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

fix(topology): update for new GraphQL schema #1224

20 changes: 8 additions & 12 deletions src/app/Archives/AllTargetsArchivedRecordingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC<AllTargetsArchivedRecor
return {
target,
targetAsObs: of(target),
archiveCount: node.target.recordings.archived.aggregate.count,
archiveCount: node.target.archivedRecordings.aggregate.count,
};
}),
);
Expand All @@ -150,11 +150,9 @@ export const AllTargetsArchivedRecordingsTable: React.FC<AllTargetsArchivedRecor
target {
connectUrl
alias
recordings {
archived {
aggregate {
count
}
archivedRecordings {
aggregate {
count
}
}
}
Expand All @@ -179,11 +177,9 @@ export const AllTargetsArchivedRecordingsTable: React.FC<AllTargetsArchivedRecor
query ArchiveCountForTarget($connectUrl: String) {
targetNodes(filter: { name: $connectUrl }) {
target {
recordings {
archived {
aggregate {
count
}
archivedRecordings {
aggregate {
count
}
}
}
Expand All @@ -198,7 +194,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC<AllTargetsArchivedRecor
{
target: target,
targetAsObs: of(target),
archiveCount: v.data.targetNodes[0].target.recordings.archived.aggregate.count,
archiveCount: v.data.targetNodes[0].target.archivedRecordings.aggregate.count,
},
];
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/CreateRecording/CustomRecordingForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export const CustomRecordingForm: React.FC = () => {
events: eventSpecifierString,
duration: continuous ? undefined : duration * (durationUnit / 1000),
archiveOnStop: archiveOnStop && !continuous,
restart: restart,
replace: restart ? 'ALWAYS' : 'NEVER',
advancedOptions: {
toDisk: toDisk,
maxAge: toDisk ? (continuous ? maxAge * maxAgeUnit : undefined) : undefined,
Expand Down
2 changes: 2 additions & 0 deletions src/app/CreateRecording/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { ValidatedOptions } from '@patternfly/react-core';

export type EventTemplateIdentifier = Pick<EventTemplate, 'name' | 'type'>;

export type RecordingReplace = 'ALWAYS' | 'NEVER' | 'STOPPED';

interface _FormBaseData {
name: string;
template?: EventTemplateIdentifier;
Expand Down
60 changes: 31 additions & 29 deletions src/app/Dashboard/AutomatedAnalysis/AutomatedAnalysisCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,19 @@ export const AutomatedAnalysisCard: DashboardCardFC<AutomatedAnalysisCardProps>
query ActiveRecordingsForAutomatedAnalysis($connectUrl: String) {
targetNodes(filter: { name: $connectUrl }) {
target {
recordings {
active (filter: {
name: "${automatedAnalysisRecordingName}",
labels: ["origin=${automatedAnalysisRecordingName}"],
}) {
data {
state
name
downloadUrl
reportUrl
metadata {
labels {
key
value
}
activeRecordings(filter: {
name: "${automatedAnalysisRecordingName}",
labels: ["origin=${automatedAnalysisRecordingName}"],
}) {
data {
state
name
downloadUrl
reportUrl
metadata {
labels {
key
value
}
}
}
Expand All @@ -213,21 +211,25 @@ export const AutomatedAnalysisCard: DashboardCardFC<AutomatedAnalysisCardProps>
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
return context.api.graphql<any>(
`query ArchivedRecordingsForAutomatedAnalysis($connectUrl: String) {
archivedRecordings(filter: { sourceTarget: $connectUrl }) {
data {
name
downloadUrl
reportUrl
metadata {
labels {
key
value
targetNodes(filter: { name: $connectUrl }) {
target {
archivedRecordings {
data {
name
downloadUrl
reportUrl
metadata {
labels {
key
value
}
}
size
archivedTime
}
}
}
size
archivedTime
}
}
}`,
{ connectUrl },
);
Expand Down Expand Up @@ -311,7 +313,7 @@ export const AutomatedAnalysisCard: DashboardCardFC<AutomatedAnalysisCardProps>
queryArchivedRecordings(connectUrl)
.pipe(
first(),
map((v) => v.data.archivedRecordings.data as ArchivedRecording[]),
map((v) => v.data.targetNodes[0].target.archivedRecordings.data as ArchivedRecording[]),
)
.subscribe({
next: (recordings) => {
Expand Down Expand Up @@ -366,7 +368,7 @@ export const AutomatedAnalysisCard: DashboardCardFC<AutomatedAnalysisCardProps>
}
}
}),
map((v) => v.data.targetNodes[0].target.recordings.active.data[0] as Recording),
map((v) => v.data.targetNodes[0].target.activeRecordings.data[0] as Recording),
tap((recording) => {
if (recording === null || recording === undefined) {
throw new Error(NO_RECORDINGS_MESSAGE);
Expand Down
6 changes: 3 additions & 3 deletions src/app/RecordingMetadata/BulkEditLabels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ export const BulkEditLabels: React.FC<BulkEditLabelsProps> = ({
context.api.graphql<any>(
`query ArchivedRecordingsForTarget($connectUrl: String) {
targetNodes(filter: { name: $connectUrl }) {
recordings {
archived {
target {
archivedRecordings {
data {
name
downloadUrl
Expand All @@ -205,7 +205,7 @@ export const BulkEditLabels: React.FC<BulkEditLabelsProps> = ({
{ connectUrl: target.connectUrl },
),
),
map((v) => v.data.targetNodes[0].recordings.archived.data as ArchivedRecording[]),
map((v) => v.data.targetNodes[0].target.archivedRecordings.data as ArchivedRecording[]),
first(),
);
}
Expand Down
26 changes: 15 additions & 11 deletions src/app/Recordings/ArchivedRecordingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,22 @@ export const ArchivedRecordingsTable: React.FC<ArchivedRecordingsTableProps> = (
return context.api.graphql<any>(
`
query ArchivedRecordingsForTarget($connectUrl: String) {
archivedRecordings(filter: { sourceTarget: $connectUrl }) {
data {
name
downloadUrl
reportUrl
metadata {
labels {
key
value
targetNodes(filter: { name: $connectUrl }) {
target {
archivedRecordings {
data {
name
downloadUrl
reportUrl
metadata {
labels {
key
value
}
}
size
}
}
size
}
}
}`,
Expand Down Expand Up @@ -256,7 +260,7 @@ export const ArchivedRecordingsTable: React.FC<ArchivedRecordingsTableProps> = (
filter((target) => !!target),
first(),
concatMap((target: Target) => queryTargetRecordings(target.connectUrl)),
map((v) => v.data.archivedRecordings.data as ArchivedRecording[]),
map((v) => v.data.targetNodes[0].target.archivedRecordings.data as ArchivedRecording[]),
)
.subscribe({
next: handleRecordings,
Expand Down
Loading
Loading