Skip to content

Commit

Permalink
fix(graphql): adjustments for Dashboard Automated Analysis with new A…
Browse files Browse the repository at this point in the history
…PI schema
  • Loading branch information
andrewazores committed Mar 1, 2024
1 parent a37abbb commit 01229ed
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
34 changes: 21 additions & 13 deletions src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,23 @@ export const AutomatedAnalysisCard: DashboardCardFC<AutomatedAnalysisCardProps>
`
query ActiveRecordingsForAutomatedAnalysis($connectUrl: String) {
targetNodes(filter: { name: $connectUrl }) {
recordings {
active (filter: {
name: "${automatedAnalysisRecordingName}",
labels: ["origin=${automatedAnalysisRecordingName}"],
}) {
data {
state
name
downloadUrl
reportUrl
metadata {
labels
target {
recordings {
active (filter: {
name: "${automatedAnalysisRecordingName}",
labels: ["origin=${automatedAnalysisRecordingName}"],
}) {
data {
state
name
downloadUrl
reportUrl
metadata {
labels {
key
value
}
}
}
}
}
Expand All @@ -214,7 +219,10 @@ export const AutomatedAnalysisCard: DashboardCardFC<AutomatedAnalysisCardProps>
downloadUrl
reportUrl
metadata {
labels
labels {
key
value
}
}
size
archivedTime
Expand Down
10 changes: 9 additions & 1 deletion src/app/Shared/Services/Api.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,16 @@ export class ApiService {
if (archiveOnStop != undefined) {
form.append('archiveOnStop', String(archiveOnStop));
}
const transformedMetadata = {
labels: {},
annotations: {
cryostat: {},
platform: {},
},
};
metadata?.labels.forEach((label) => (transformedMetadata.labels[label.key] = label.value));
if (metadata) {
form.append('metadata', JSON.stringify(metadata));
form.append('metadata', JSON.stringify(transformedMetadata));
}
if (restart != undefined) {
form.append('restart', String(restart));
Expand Down

0 comments on commit 01229ed

Please sign in to comment.