[SecuritySolution] disable edit and create from rules breadcrumb (#105412)

* disable edit and create from rules breadcrumb

* remove href for create /rule breadcrumb

* fix lint error
This commit is contained in:
Angela Chuang 2021-07-14 09:36:56 +01:00 committed by GitHub
parent 604b424212
commit b2a6a9d308
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 13 deletions

View file

@ -323,8 +323,7 @@ describe('Navigation Breadcrumbs', () => {
},
{
text: 'Create',
href:
"securitySolution/rules/create?sourcerer=()&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-05-16T23:10:43.696Z',fromStr:now-24h,kind:relative,to:'2019-05-17T23:10:43.697Z',toStr:now)),timeline:(linkTo:!(global),timerange:(from:'2019-05-16T23:10:43.696Z',fromStr:now-24h,kind:relative,to:'2019-05-17T23:10:43.697Z',toStr:now)))",
href: '',
},
]);
});
@ -382,7 +381,7 @@ describe('Navigation Breadcrumbs', () => {
},
{
text: 'Edit',
href: `securitySolution/rules/id/${mockDetailName}/edit?sourcerer=()&timerange=(global:(linkTo:!(timeline),timerange:(from:'2019-05-16T23:10:43.696Z',fromStr:now-24h,kind:relative,to:'2019-05-17T23:10:43.697Z',toStr:now)),timeline:(linkTo:!(global),timerange:(from:'2019-05-16T23:10:43.696Z',fromStr:now-24h,kind:relative,to:'2019-05-17T23:10:43.697Z',toStr:now)))`,
href: '',
},
]);
});

View file

@ -11,8 +11,6 @@ import { ChromeBreadcrumb } from '../../../../../../../../src/core/public';
import {
getRulesUrl,
getRuleDetailsUrl,
getCreateRuleUrl,
getEditRuleUrl,
} from '../../../../common/components/link_to/redirect_to_detection_engine';
import * as i18nRules from './translations';
import { RouteSpyState } from '../../../../common/utils/route/types';
@ -79,10 +77,7 @@ export const getBreadcrumbs = (
...breadcrumb,
{
text: i18nRules.ADD_PAGE_TITLE,
href: getUrlForApp(APP_ID, {
deepLinkId: SecurityPageName.rules,
path: getCreateRuleUrl(!isEmpty(search[0]) ? search[0] : ''),
}),
href: '',
},
];
}
@ -92,10 +87,7 @@ export const getBreadcrumbs = (
...breadcrumb,
{
text: i18nRules.EDIT_PAGE_TITLE,
href: getUrlForApp(APP_ID, {
deepLinkId: SecurityPageName.rules,
path: getEditRuleUrl(params.detailName, !isEmpty(search[0]) ? search[0] : ''),
}),
href: '',
},
];
}