Skip to content

Commit

Permalink
[Security Solution][Serverless] Fix project features url (elastic#181608
Browse files Browse the repository at this point in the history
)

## Summary

Fixes the double slash (`//`) in the URL to manage the serverless
project features from the Get Started page:

before:

`https://console.qa.cld.elstc.co/projects//security/:id`

<img width="1207" alt="before"
src="https://github.com/elastic/kibana/assets/17747913/10dc4a4f-99b4-4ce8-abc8-858fa1e95236">

After:

`https://console.qa.cld.elstc.co/projects/security/:id`

<img width="1207" alt="after"
src="https://github.com/elastic/kibana/assets/17747913/936bcffb-4530-4a9d-90db-b4a5c4f9f1cd">

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
semd and kibanamachine authored Apr 25, 2024
1 parent b64b72a commit 7c447ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const cloud = {
serverless: {
projectId: '1234',
},
projectsUrl: 'https://cloud.elastic.co/projects',
projectsUrl: 'https://cloud.elastic.co/projects/',
} as CloudStart;

describe('util', () => {
Expand All @@ -29,7 +29,7 @@ describe('util', () => {

it('should return the correct url', () => {
expect(getProjectFeaturesUrl(cloud)).toBe(
`${cloud.projectsUrl}/security/${cloud.serverless?.projectId}?open=securityProjectFeatures`
`${cloud.projectsUrl}security/${cloud.serverless?.projectId}?open=securityProjectFeatures`
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const getProjectFeaturesUrl = (cloud: CloudStart): string | undefined =>
if (!projectsBaseUrl || !projectId) {
return undefined;
}
return `${projectsBaseUrl}/${SECURITY_PROJECT_TYPE}/${projectId}?open=securityProjectFeatures`;
return `${projectsBaseUrl}${SECURITY_PROJECT_TYPE}/${projectId}?open=securityProjectFeatures`;
};

export const getCloudUrl: GetCloudUrl = (cloudUrlKey, cloud) => {
Expand Down

0 comments on commit 7c447ad

Please sign in to comment.