Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(UI): load apps on scroll #2063

Merged
merged 11 commits into from
Oct 25, 2024
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
Loading