Skip to content

Commit

Permalink
feat(UI): load apps on scroll (#2063)
Browse files Browse the repository at this point in the history
Ref: SRX-ZYK5HN
  • Loading branch information
miguel-crespo-fdc authored Oct 25, 2024
1 parent 9118990 commit 3aeb3db
Show file tree
Hide file tree
Showing 16 changed files with 1,194 additions and 966 deletions.
4 changes: 4 additions & 0 deletions services/cd-service/pkg/service/overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
"os"
"sort"
"sync"
Expand All @@ -57,6 +58,9 @@ func (o *OverviewServiceServer) GetAppDetails(
ctx context.Context,
in *api.GetAppDetailsRequest) (*api.GetAppDetailsResponse, error) {

span, ctx := tracer.StartSpanFromContext(ctx, "GetAppDetails")
defer span.Finish()

var appName = in.AppName
var response = &api.GetAppDetailsResponse{
Application: &api.Application{
Expand Down
13 changes: 12 additions & 1 deletion services/frontend-service/src/ui/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { PageRoutes } from './PageRoutes';
import '../../assets/app-v2.scss';
import * as React from 'react';
import {
AppDetailsResponse,
AppDetailsState,
EnableRolloutStatus,
FlushRolloutStatus,
PanicOverview,
Expand Down Expand Up @@ -100,7 +102,16 @@ export const App: React.FC = () => {
UpdateOverview.set(result);
UpdateOverview.set({ loaded: true });
PanicOverview.set({ error: '' });
updateAppDetails.set({});

const newDetails: { [p: string]: AppDetailsResponse } = {};
result.lightweightApps?.forEach(
(elem) =>
(newDetails[elem.name] = {
appDetailState: AppDetailsState.NOTREQUESTED,
details: undefined,
})
);
updateAppDetails.set(newDetails);
},
(error) => {
PanicOverview.set({ error: JSON.stringify({ msg: 'error in streamoverview', error }) });
Expand Down
Loading

0 comments on commit 3aeb3db

Please sign in to comment.