Skip to content

Commit 100bccc

Browse files
committed
[Cases] Reverts the introduction of the incremental_id service (#228002)
## Summary Reverts #222874 and #226935 . The mappings and the introduction of the saved object type for the increment counter object cannot be reverted. In a future PR we will bring this feature back under a different name and reuse the increment counter object that has been introduced already. (cherry picked from commit d03ab6d) # Conflicts: # src/platform/plugins/private/kibana_usage_collection/server/collectors/management/schema.ts # src/platform/plugins/private/kibana_usage_collection/server/collectors/management/types.ts # src/platform/plugins/shared/telemetry/schema/oss_platform.json # x-pack/platform/plugins/shared/cases/public/components/all_cases/use_cases_columns.tsx # x-pack/platform/plugins/shared/cases/server/plugin.test.ts # x-pack/platform/plugins/shared/cases/server/plugin.ts
1 parent 233fbdb commit 100bccc

37 files changed

Lines changed: 74 additions & 1332 deletions

File tree

src/platform/plugins/private/kibana_usage_collection/server/collectors/management/schema.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,4 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
659659
description: 'Enable the new logs overview component.',
660660
},
661661
},
662-
'cases:incrementalIdDisplay:enabled': {
663-
type: 'boolean',
664-
_meta: {
665-
description: 'Display the incremental id of a case in the relevant pages',
666-
},
667-
},
668662
};

src/platform/plugins/private/kibana_usage_collection/server/collectors/management/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,4 @@ export interface UsageStats {
171171
'securitySolution:excludedDataTiersForRuleExecution': string[];
172172
'securitySolution:maxUnassociatedNotes': number;
173173
'observability:searchExcludedDataTiers': string[];
174-
'cases:incrementalIdDisplay:enabled': boolean;
175174
}

src/platform/plugins/shared/telemetry/schema/oss_platform.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11403,12 +11403,6 @@
1140311403
"_meta": {
1140411404
"description": "Enable the new logs overview component."
1140511405
}
11406-
},
11407-
"cases:incrementalIdDisplay:enabled": {
11408-
"type": "boolean",
11409-
"_meta": {
11410-
"description": "Display the incremental id of a case in the relevant pages"
11411-
}
1141211406
}
1141311407
}
1141411408
},

src/platform/test/plugin_functional/test_suites/core_plugins/rendering.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
228228
'xpack.cases.files.maxSize (number?)',
229229
'xpack.cases.markdownPlugins.lens (boolean?)',
230230
'xpack.cases.stack.enabled (boolean?)',
231-
'xpack.cases.incrementalId.enabled (boolean?)',
232231
'xpack.ccr.ui.enabled (boolean?)',
233232
'xpack.cloud.base_url (string?)',
234233
'xpack.cloud.cname (string?)',

x-pack/platform/plugins/shared/cases/common/constants/incremental_id.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

x-pack/platform/plugins/shared/cases/common/constants/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ export const CASE_CONFIGURE_SAVED_OBJECT = 'cases-configure' as const;
2727
export const CASE_RULES_SAVED_OBJECT = 'cases-rules' as const;
2828
export const CASE_ID_INCREMENTER_SAVED_OBJECT = 'cases-incrementing-id' as const;
2929

30-
/**
31-
* UI settings
32-
*/
33-
34-
export const CASES_UI_SETTING_ID_DISPLAY_INCREMENTAL_ID = 'cases:incrementalIdDisplay:enabled';
35-
3630
/**
3731
* If more values are added here please also add them here: x-pack/platform/test/cases_api_integration/common/plugins
3832
*/

x-pack/platform/plugins/shared/cases/common/types/api/case/v1.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ export const BulkCreateCasesResponseRt = rt.strict({
246246
export const CasesFindRequestSearchFieldsRt = rt.keyof({
247247
description: null,
248248
title: null,
249-
incremental_id: null,
250249
});
251250

252251
export const CasesFindRequestSortFieldsRt = rt.keyof({

x-pack/platform/plugins/shared/cases/common/ui/types.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ export interface CasesUiConfigType {
7272
stack: {
7373
enabled: boolean;
7474
};
75-
incrementalId: {
76-
enabled: boolean;
77-
};
7875
}
7976

8077
export const UserActionTypeAll = 'all' as const;
@@ -345,7 +342,3 @@ export interface CasesCapabilities {
345342
[CASES_REOPEN_CAPABILITY]: boolean;
346343
[ASSIGN_CASE_CAPABILITY]: boolean;
347344
}
348-
349-
export interface CasesSettings {
350-
displayIncrementalCaseId: boolean;
351-
}

x-pack/platform/plugins/shared/cases/public/common/mock/test_providers.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
2323

2424
import type { CoreStart } from '@kbn/core/public';
2525
import type { BaseFilesClient } from '@kbn/shared-ux-file-types';
26-
import type { CasesFeatures, CasesPermissions, CasesSettings } from '../../../common/ui/types';
26+
import type { CasesFeatures, CasesPermissions } from '../../../common/ui/types';
2727
import type { ReleasePhase } from '../../components/types';
2828
import { SECURITY_SOLUTION_OWNER } from '../../../common/constants';
2929
import type { CasesContextProps } from '../../components/cases_context';
@@ -47,7 +47,6 @@ interface TestProviderProps {
4747
queryClient?: QueryClient;
4848
coreStart?: CoreStart;
4949
filesClient?: BaseFilesClient;
50-
settings?: CasesSettings;
5150
}
5251

5352
window.scrollTo = jest.fn();
@@ -93,7 +92,6 @@ const TestProvidersComponent: React.FC<TestProviderProps> = ({
9392
services,
9493
queryClient,
9594
filesClient,
96-
settings,
9795
}) => {
9896
const finalCoreStart = useMemo(() => coreStart ?? coreMock.createStart(), [coreStart]);
9997
const finalServices = useMemo(
@@ -140,9 +138,6 @@ const TestProvidersComponent: React.FC<TestProviderProps> = ({
140138
permissions: permissions ?? defaultPermissions,
141139
releasePhase: releasePhase ?? 'ga',
142140
getFilesClient: getFilesClientFinal,
143-
settings: settings ?? {
144-
displayIncrementalCaseId: false,
145-
},
146141
}),
147142
[
148143
defaultExternalReferenceAttachmentTypeRegistry,
@@ -155,7 +150,6 @@ const TestProvidersComponent: React.FC<TestProviderProps> = ({
155150
permissions,
156151
persistableStateAttachmentTypeRegistry,
157152
releasePhase,
158-
settings,
159153
]
160154
);
161155

x-pack/platform/plugins/shared/cases/public/components/all_cases/all_cases_list.test.tsx

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,14 @@ describe('AllCasesListGeneric', () => {
144144
userProfiles: new Map(),
145145
currentUserProfile: undefined,
146146
selectedColumns: [],
147-
settings: {
148-
displayIncrementalCaseId: false,
149-
},
150147
};
151148

152149
const removeMsFromDate = (value: string) => moment(value).format('YYYY-MM-DDTHH:mm:ss[Z]');
153150

154151
beforeAll(() => {
155152
patchGetComputedStyle();
156153
mockKibana();
157-
const {
158-
triggersActionsUi: { actionTypeRegistry },
159-
} = useKibanaMock().services;
160-
154+
const actionTypeRegistry = useKibanaMock().services.triggersActionsUi.actionTypeRegistry;
161155
registerConnectorsToMockActionRegistry(actionTypeRegistry, connectorsMock);
162156
});
163157

@@ -189,9 +183,7 @@ describe('AllCasesListGeneric', () => {
189183

190184
it('should render AllCasesList', async () => {
191185
useLicenseMock.mockReturnValue({ isAtLeastPlatinum: () => true });
192-
renderWithTestingProviders(<AllCasesList />, {
193-
wrapperProps: { settings: { displayIncrementalCaseId: true } },
194-
});
186+
renderWithTestingProviders(<AllCasesList />);
195187

196188
const caseDetailsLinks = await screen.findAllByTestId('case-details-link');
197189

@@ -201,10 +193,6 @@ describe('AllCasesListGeneric', () => {
201193
(await screen.findAllByTestId('case-user-profile-avatar-damaged_raccoon'))[0]
202194
).toHaveTextContent('DR');
203195

204-
const incrementalIdTextElements = screen.getAllByTestId('cases-incremental-id-text');
205-
expect(incrementalIdTextElements).toHaveLength(1);
206-
expect(incrementalIdTextElements[0]).toHaveTextContent('#1');
207-
208196
expect((await screen.findAllByTestId('case-table-column-tags-coke'))[0]).toHaveAttribute(
209197
'title',
210198
useGetCasesMockState.data.cases[0].tags[0]
@@ -226,18 +214,6 @@ describe('AllCasesListGeneric', () => {
226214
expect(screen.queryByTestId('all-cases-clear-filters-link-icon')).not.toBeInTheDocument();
227215
});
228216

229-
it('should not render incremental id if setting is disabled', async () => {
230-
useLicenseMock.mockReturnValue({ isAtLeastPlatinum: () => true });
231-
renderWithTestingProviders(<AllCasesList />, {
232-
wrapperProps: { settings: { displayIncrementalCaseId: false } },
233-
});
234-
235-
await screen.findAllByTestId('case-details-link');
236-
237-
const incrementalIdTextElements = screen.queryAllByTestId('cases-incremental-id-text');
238-
expect(incrementalIdTextElements).toHaveLength(0);
239-
});
240-
241217
it("should show a tooltip with the assignee's email when hover over the assignee avatar", async () => {
242218
useLicenseMock.mockReturnValue({ isAtLeastPlatinum: () => true });
243219

@@ -539,6 +515,7 @@ describe('AllCasesListGeneric', () => {
539515
expect(useGetCasesMock).toHaveBeenLastCalledWith({
540516
filterOptions: {
541517
...DEFAULT_FILTER_OPTIONS,
518+
searchFields: ['title', 'description'],
542519
category: ['twix'],
543520
},
544521
queryParams: DEFAULT_QUERY_PARAMS,

0 commit comments

Comments
 (0)