Skip to content

Commit

Permalink
make thresholdRule config optional
Browse files Browse the repository at this point in the history
  • Loading branch information
benakansara committed Dec 6, 2023
1 parent 8393941 commit b37116e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jest.spyOn(pluginContext, 'usePluginContext').mockImplementation(() => ({
uptime: { enabled: false },
observability: { enabled: false },
},
thresholdRule: { enabled: false },
},
aiAssistant: {
enabled: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const withCore = makeDecorator({
},
} as unknown as Partial<CoreStart>);

const config = {
const config: ConfigSchema = {
unsafe: {
alertDetails: {
logs: { enabled: false },
Expand All @@ -87,7 +87,7 @@ const withCore = makeDecorator({
observability: { enabled: false },
},
},
} as ConfigSchema;
};

return (
<MemoryRouter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jest.spyOn(pluginContext, 'usePluginContext').mockImplementation(() => ({
uptime: { enabled: false },
observability: { enabled: false },
},
thresholdRule: { enabled: false },
},
},
observabilityRuleTypeRegistry: createObservabilityRuleTypeRegistryMock(),
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/observability/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export interface ConfigSchema {
enabled: boolean;
};
};
thresholdRule: {
thresholdRule?: {
enabled: boolean;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function KibanaReactStorybookDecorator(Story: ComponentType) {
} as unknown as AppMountParameters;
const observabilityRuleTypeRegistry = createObservabilityRuleTypeRegistryMock();

const config = {
const config: ConfigSchema = {
unsafe: {
alertDetails: {
logs: { enabled: false },
Expand All @@ -34,7 +34,7 @@ export function KibanaReactStorybookDecorator(Story: ComponentType) {
observability: { enabled: false },
},
},
} as ConfigSchema;
};

const mockTheme: CoreTheme = {
darkMode: false,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/observability/public/utils/test_helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const defaultConfig: ConfigSchema = {
observability: { enabled: false },
},
},
} as ConfigSchema;
};

const queryClient = new QueryClient({
defaultOptions: {
Expand Down

0 comments on commit b37116e

Please sign in to comment.