forked from opendatahub-io/odh-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #328 from opendatahub-io/v2.22.0-fixes
V2.22.0 fixes
- Loading branch information
Showing
10 changed files
with
267 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
frontend/src/__mocks__/mockDWUsageByOwnerPrometheusResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { WorkloadMetricIndexedByOwner, WorkloadMetricPromQueryResponse } from '~/api'; | ||
import { WorkloadOwnerType } from '~/k8sTypes'; | ||
import { mockPrometheusQueryVectorResponse } from './mockPrometheusQueryVectorResponse'; | ||
|
||
export const mockDWUsageByOwnerPrometheusResponse = ( | ||
usageByOwner: WorkloadMetricIndexedByOwner, | ||
): WorkloadMetricPromQueryResponse => | ||
mockPrometheusQueryVectorResponse({ | ||
result: Object.values(WorkloadOwnerType).flatMap((ownerKind) => | ||
Object.keys(usageByOwner[ownerKind]).map((ownerName) => ({ | ||
// eslint-disable-next-line camelcase | ||
metric: { owner_kind: ownerKind, owner_name: ownerName }, | ||
value: [0, String(usageByOwner[ownerKind][ownerName])], | ||
})), | ||
), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.