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(about): add missing buildInfo in mocked health response #1345

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/Recordings/Filters/DatetimeFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface DateTimeRange {
to?: Date;
}

export const filterRecordingByDatetime = (recordings?: ActiveRecording[], filters?: DateTimeRange[]) => {
export const filterRecordingByDatetime = (recordings: ActiveRecording[], filters?: DateTimeRange[]) => {
if (!recordings?.length || !filters?.length) {
return recordings;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/Recordings/Filters/DurationFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { DURATION_INPUT_MAXLENGTH } from './const';

export const CONTINUOUS_INDICATOR = 'continuous';

export const filterRecordingByDuration = (recordings?: ActiveRecording[], filters?: DurationRange[]) => {
export const filterRecordingByDuration = (recordings: ActiveRecording[], filters?: DurationRange[]) => {
if (!recordings?.length || !filters?.length) {
return recordings;
}
Expand Down
10 changes: 10 additions & 0 deletions src/mirage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ export const startMirage = ({ environment = 'development' } = {}) => {
this.logging = environment === 'development';

this.get('health', () => ({
build: {
git: {
hash: '775aee4cdd61f5b8d91aa38f4601933c9750d54e',
},
},
cryostatVersion: `${build.version.replace(/(-\w+)*$/g, '')}-0-preview`,
dashboardAvailable: false,
dashboardConfigured: false,
Expand Down Expand Up @@ -97,6 +102,11 @@ export const startMirage = ({ environment = 'development' } = {}) => {
() => new Response(400, {}, 'Resource downloads are not supported in this demo'),
);
this.post('api/v2/targets', (schema, request) => {
const params = request.queryParams;
if (params['dryrun']) {
return new Response(200);
}

const attrs = request.requestBody as any;
const target = schema.create(Resource.TARGET, {
jvmId: `${Date.now().toString(16)}`,
Expand Down
Loading