forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution][Serverless] Open Security project features modal …
…in Cloud UI (elastic#170212) ## Summary Use `open=securityProjectFeatures` query param in the Serverless _Get Started_ page link, to open the project features (tier) modal directly. https://github.com/elastic/kibana/assets/17747913/f00c2092-047d-43ad-a5eb-7996718bd0ca
- Loading branch information
Showing
4 changed files
with
49 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
x-pack/plugins/security_solution_serverless/public/navigation/links/util.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { getProjectFeaturesUrl } from './util'; | ||
import type { CloudStart } from '@kbn/cloud-plugin/public'; | ||
|
||
const cloud = { | ||
serverless: { | ||
projectId: '1234', | ||
}, | ||
projectsUrl: 'https://cloud.elastic.co/projects', | ||
} as CloudStart; | ||
|
||
describe('util', () => { | ||
describe('getProductFeaturesUrl', () => { | ||
it('should return undefined if the projectId is not present', () => { | ||
expect(getProjectFeaturesUrl({ ...cloud, serverless: { projectId: undefined } })).toBe( | ||
undefined | ||
); | ||
}); | ||
|
||
it('should return undefined if the projectsUrl is not present', () => { | ||
expect(getProjectFeaturesUrl({ ...cloud, projectsUrl: undefined })).toBe(undefined); | ||
}); | ||
|
||
it('should return the correct url', () => { | ||
expect(getProjectFeaturesUrl(cloud)).toBe( | ||
`${cloud.projectsUrl}/security/${cloud.serverless?.projectId}?open=securityProjectFeatures` | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters