Skip to content

Commit

Permalink
OSCI-582
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Stepanov <[email protected]>
  • Loading branch information
Andrei-Stepanov committed Apr 5, 2024
1 parent b466781 commit 7e01b56
Show file tree
Hide file tree
Showing 2 changed files with 458 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/schema/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
GreenwaveDecisionType,
getGreenwaveDecisionContext,
} from './greenwave_types';
import { mkStagesAndStates } from './stages_states';

const log = debug('osci:schema/artifacts');
const cfg = getcfg();
Expand Down Expand Up @@ -358,7 +359,7 @@ const ArtifactChildrenHit = new GraphQLObjectType({
hit_info: {
type: GraphQLJSON,
description: 'info about db-document',
},
}
},
});

Expand All @@ -370,6 +371,10 @@ const ArtifactChildren = new GraphQLObjectType({
type: GraphQLJSON,
description: 'information about opensearch-query',
},
stagesSummary: {
type: GraphQLJSON,
description: 'summary for stages, works only for onlyActual parameter',
}
},
});

Expand Down Expand Up @@ -514,7 +519,9 @@ export const artifactChildren: GraphQLFieldConfig<any, any> = {
reducedTotal,
);
_.set(hits_info, "total.value", reducedTotal);
return { hits: recentChildrenForEachThreadId, hits_info };
// Calculate summary
const stagesSummary = mkStagesAndStates(recentChildrenForEachThreadId as any);
return { hits: recentChildrenForEachThreadId, hits_info, stagesSummary };
},
};

Expand Down
Loading

0 comments on commit 7e01b56

Please sign in to comment.