Skip to content

Commit

Permalink
[Security Solution] [Cases] rename case dir/plugin/context/i18n to ca…
Browse files Browse the repository at this point in the history
…ses (#94149)
  • Loading branch information
stephmilovic authored Mar 10, 2021
1 parent 426d495 commit 2bb2329
Show file tree
Hide file tree
Showing 340 changed files with 1,256 additions and 1,248 deletions.
16 changes: 8 additions & 8 deletions api_docs/case.json → api_docs/cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@
"children": [
{
"tags": [],
"id": "def-server.CaseRequestContext.getCaseClient",
"id": "def-server.CaseRequestContext.getCasesClient",
"type": "Function",
"label": "getCaseClient",
"label": "getCasesClient",
"description": [],
"source": {
"path": "x-pack/plugins/case/server/types.ts",
"path": "x-pack/plugins/cases/server/types.ts",
"lineNumber": 14
},
"signature": [
"() => ",
{
"pluginId": "case",
"pluginId": "cases",
"scope": "server",
"docId": "kibCasePluginApi",
"section": "def-server.CaseClient",
"text": "CaseClient"
"section": "def-server.CasesClient",
"text": "CasesClient"
}
]
}
],
"source": {
"path": "x-pack/plugins/case/server/types.ts",
"path": "x-pack/plugins/cases/server/types.ts",
"lineNumber": 13
},
"initialIsOpen": false
Expand All @@ -60,4 +60,4 @@
"misc": [],
"objects": []
}
}
}
2 changes: 1 addition & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ Failure to have auth enabled in Kibana will make for a broken UI. UI-based error
|"Never look back. The past is done. The future is a blank canvas." ― Suzy Kassem, Rise Up and Salute the Sun
|{kib-repo}blob/{branch}/x-pack/plugins/case/README.md[case]
|{kib-repo}blob/{branch}/x-pack/plugins/cases/README.md[cases]
|Experimental Feature
Expand Down
2 changes: 1 addition & 1 deletion src/dev/cli_dev_mode/get_server_watch_paths.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ it('produces the right watch and ignore list', () => {
<absolute path>/x-pack/plugins/apm/e2e,
<absolute path>/x-pack/plugins/apm/scripts,
<absolute path>/x-pack/plugins/canvas/canvas_plugin_src,
<absolute path>/x-pack/plugins/case/server/scripts,
<absolute path>/x-pack/plugins/cases/server/scripts,
<absolute path>/x-pack/plugins/lists/scripts,
<absolute path>/x-pack/plugins/lists/server/scripts,
<absolute path>/x-pack/plugins/security_solution/scripts,
Expand Down
2 changes: 1 addition & 1 deletion src/dev/cli_dev_mode/get_server_watch_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function getServerWatchPaths({ pluginPaths, pluginScanDirs }: Options) {
fromRoot('x-pack/plugins/apm/e2e'),
fromRoot('x-pack/plugins/apm/scripts'),
fromRoot('x-pack/plugins/canvas/canvas_plugin_src'), // prevents server from restarting twice for Canvas plugin changes,
fromRoot('x-pack/plugins/case/server/scripts'),
fromRoot('x-pack/plugins/cases/server/scripts'),
fromRoot('x-pack/plugins/lists/scripts'),
fromRoot('x-pack/plugins/lists/server/scripts'),
fromRoot('x-pack/plugins/security_solution/scripts'),
Expand Down
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"xpack.apm": "plugins/apm",
"xpack.beatsManagement": "plugins/beats_management",
"xpack.canvas": "plugins/canvas",
"xpack.case": "plugins/case",
"xpack.cases": "plugins/cases",
"xpack.cloud": "plugins/cloud",
"xpack.dashboard": "plugins/dashboard_enhanced",
"xpack.discover": "plugins/discover_enhanced",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { i18n } from '@kbn/i18n';

export const NAME = i18n.translate('xpack.actions.builtin.case.jiraTitle', {
export const NAME = i18n.translate('xpack.actions.builtin.cases.jiraTitle', {
defaultMessage: 'Jira',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { i18n } from '@kbn/i18n';

export const NAME = i18n.translate('xpack.actions.builtin.case.resilientTitle', {
export const NAME = i18n.translate('xpack.actions.builtin.cases.resilientTitle', {
defaultMessage: 'IBM Resilient',
});

Expand Down
20 changes: 0 additions & 20 deletions x-pack/plugins/case/server/client/index.ts

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const CasePostRequestNoTypeRt = rt.type({
/**
* This type is used for validating a create case request. It requires that the type field be defined.
*/
export const CaseClientPostRequestRt = rt.type({
export const CasesClientPostRequestRt = rt.type({
...CasePostRequestNoTypeRt.props,
[caseTypeField]: CaseTypeRt,
});
Expand All @@ -92,7 +92,7 @@ export const CaseClientPostRequestRt = rt.type({
* This type is not used for validation when decoding a request because intersection does not have props defined which
* required for the excess function. Instead we use this as the type used by the UI. This allows the type field to be
* optional and the server will handle setting it to a default value before validating that the request
* has all the necessary fields. CaseClientPostRequestRt is used for validation.
* has all the necessary fields. CasesClientPostRequestRt is used for validation.
*/
export const CasePostRequestRt = rt.intersection([
rt.partial({ type: CaseTypeRt }),
Expand Down Expand Up @@ -178,7 +178,7 @@ export type CaseAttributes = rt.TypeOf<typeof CaseAttributesRt>;
* that the type field be defined. The CasePostRequest should be used in most places (the UI etc). This type is really
* only necessary for validation.
*/
export type CaseClientPostRequest = rt.TypeOf<typeof CaseClientPostRequestRt>;
export type CasesClientPostRequest = rt.TypeOf<typeof CasesClientPostRequestRt>;
export type CasePostRequest = rt.TypeOf<typeof CasePostRequestRt>;
export type CaseResponse = rt.TypeOf<typeof CaseResponseRt>;
export type CasesResponse = rt.TypeOf<typeof CasesResponseRt>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as rt from 'io-ts';
import { UserRT } from '../user';

/* To the next developer, if you add/removed fields here
* make sure to check this file (x-pack/plugins/case/server/services/user_actions/helpers.ts) too
* make sure to check this file (x-pack/plugins/cases/server/services/user_actions/helpers.ts) too
*/
const UserActionFieldTypeRt = rt.union([
rt.literal('comment'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import * as rt from 'io-ts';

// New fields should also be added at: x-pack/plugins/case/server/connectors/case/schema.ts
// New fields should also be added at: x-pack/plugins/cases/server/connectors/case/schema.ts
export const JiraFieldsRT = rt.type({
issueType: rt.union([rt.string, rt.null]),
priority: rt.union([rt.string, rt.null]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import * as rt from 'io-ts';

// New fields should also be added at: x-pack/plugins/case/server/connectors/case/schema.ts
// New fields should also be added at: x-pack/plugins/cases/server/connectors/case/schema.ts
export const ResilientFieldsRT = rt.type({
incidentTypes: rt.union([rt.array(rt.string), rt.null]),
severityCode: rt.union([rt.string, rt.null]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import * as rt from 'io-ts';

// New fields should also be added at: x-pack/plugins/case/server/connectors/case/schema.ts
// New fields should also be added at: x-pack/plugins/cases/server/connectors/case/schema.ts
export const ServiceNowITSMFieldsRT = rt.type({
impact: rt.union([rt.string, rt.null]),
severity: rt.union([rt.string, rt.null]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import * as rt from 'io-ts';

// New fields should also be added at: x-pack/plugins/case/server/connectors/case/schema.ts
// New fields should also be added at: x-pack/plugins/cases/server/connectors/case/schema.ts
export const ServiceNowSIRFieldsRT = rt.type({
category: rt.union([rt.string, rt.null]),
destIp: rt.union([rt.boolean, rt.null]),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { DEFAULT_MAX_SIGNALS } from '../../security_solution/common/constants';

export const APP_ID = 'case';
export const APP_ID = 'cases';

/**
* Case routes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/x-pack/plugins/case'],
roots: ['<rootDir>/x-pack/plugins/cases'],
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configPath": ["xpack", "case"],
"id": "case",
"configPath": ["xpack", "cases"],
"id": "cases",
"kibanaVersion": "kibana",
"requiredPlugins": ["actions", "securitySolution"],
"optionalPlugins": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"author": "Elastic",
"name": "case",
"name": "cases",
"version": "8.0.0",
"private": true,
"license": "Elastic-License",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { ElasticsearchClient, Logger } from 'kibana/server';
import { AlertInfo } from '../../common';
import { AlertServiceContract } from '../../services';
import { CaseClientGetAlertsResponse } from './types';
import { CasesClientGetAlertsResponse } from './types';

interface GetParams {
alertsService: AlertServiceContract;
Expand All @@ -22,7 +22,7 @@ export const get = async ({
alertsInfo,
scopedClusterClient,
logger,
}: GetParams): Promise<CaseClientGetAlertsResponse> => {
}: GetParams): Promise<CasesClientGetAlertsResponse> => {
if (alertsInfo.length === 0) {
return [];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ interface Alert {
};
}

export type CaseClientGetAlertsResponse = Alert[];
export type CasesClientGetAlertsResponse = Alert[];
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@

import { CaseStatuses } from '../../../common/api';
import { createMockSavedObjectsRepository } from '../../routes/api/__fixtures__';
import { createCaseClientWithMockSavedObjectsClient } from '../mocks';
import { createCasesClientWithMockSavedObjectsClient } from '../mocks';

describe('updateAlertsStatus', () => {
it('updates the status of the alert correctly', async () => {
const savedObjectsClient = createMockSavedObjectsRepository();

const caseClient = await createCaseClientWithMockSavedObjectsClient({ savedObjectsClient });
await caseClient.client.updateAlertsStatus({
const casesClient = await createCasesClientWithMockSavedObjectsClient({ savedObjectsClient });
await casesClient.client.updateAlertsStatus({
alerts: [{ id: 'alert-id-1', index: '.siem-signals', status: CaseStatuses.closed }],
});

expect(caseClient.services.alertsService.updateAlertsStatus).toHaveBeenCalledWith({
expect(casesClient.services.alertsService.updateAlertsStatus).toHaveBeenCalledWith({
logger: expect.anything(),
scopedClusterClient: expect.anything(),
alerts: [{ id: 'alert-id-1', index: '.siem-signals', status: CaseStatuses.closed }],
Expand Down
Loading

0 comments on commit 2bb2329

Please sign in to comment.