Skip to content

Commit

Permalink
fix additional new case id references
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelolo24 committed Oct 14, 2024
1 parent c9c185b commit 13cb7a7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions x-pack/plugins/cases/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export { CaseSeverity } from './types/domain';
export {
APP_ID,
FEATURE_ID,
FEATURE_ID_V2,
CASES_URL,
SECURITY_SOLUTION_OWNER,
OBSERVABILITY_OWNER,
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/cases/public/client/helpers/can_use_cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import type { ApplicationStart } from '@kbn/core/public';
import {
FEATURE_ID,
FEATURE_ID_V2,
GENERAL_CASES_OWNER,
OBSERVABILITY_OWNER,
SECURITY_SOLUTION_OWNER,
Expand Down Expand Up @@ -81,7 +81,7 @@ export const canUseCases =

const getFeatureID = (owner: CasesOwners) => {
if (owner === GENERAL_CASES_OWNER) {
return FEATURE_ID;
return FEATURE_ID_V2;
}

return `${owner}CasesV2`;
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/cases/public/common/lib/kibana/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { NavigateToAppOptions } from '@kbn/core/public';
import { getUICapabilities } from '../../../client/helpers/capabilities';
import { convertToCamelCase } from '../../../api/utils';
import {
FEATURE_ID,
FEATURE_ID_V2,
DEFAULT_DATE_FORMAT,
DEFAULT_DATE_FORMAT_TZ,
} from '../../../../common/constants';
Expand Down Expand Up @@ -178,7 +178,7 @@ interface UseApplicationCapabilities {

export const useApplicationCapabilities = (): UseApplicationCapabilities => {
const capabilities = useKibana().services?.application?.capabilities;
const casesCapabilities = capabilities[FEATURE_ID];
const casesCapabilities = capabilities[FEATURE_ID_V2];
const permissions = getUICapabilities(casesCapabilities);

return useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { APP_ID, FEATURE_ID } from '../../../common/constants';
import { APP_ID, FEATURE_ID_V2 } from '../../../common/constants';
import { useKibana } from '../../common/lib/kibana';
import type { CasesPermissions } from '../../containers/types';
import { allCasePermissions } from '../../utils/permissions';
Expand All @@ -25,7 +25,7 @@ export const useAvailableCasesOwners = (

return Object.entries(kibanaCapabilities).reduce(
(availableOwners: string[], [featureId, kibanaCapability]) => {
if (!featureId.endsWith('Cases')) {
if (!featureId.endsWith('CasesV2')) {
return availableOwners;
}
for (const cap of capabilities) {
Expand All @@ -42,7 +42,7 @@ export const useAvailableCasesOwners = (
};

const getOwnerFromFeatureID = (featureID: string) => {
if (featureID === FEATURE_ID) {
if (featureID === FEATURE_ID_V2) {
return APP_ID;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
ALERT_STATUS,
} from '@kbn/rule-data-utils';
import type { FieldFormatsRegistry } from '@kbn/field-formats-plugin/common';
import { APP_ID as CASE_APP_ID, FEATURE_ID as CASE_GENERAL_ID } from '@kbn/cases-plugin/common';
import { APP_ID as CASE_APP_ID, FEATURE_ID_V2 as CASE_GENERAL_ID } from '@kbn/cases-plugin/common';
import { MANAGEMENT_APP_ID } from '@kbn/deeplinks-management/constants';
import { getAlertFlyout } from './use_alerts_flyout';
import {
Expand Down

0 comments on commit 13cb7a7

Please sign in to comment.