Skip to content

Commit

Permalink
feat: allow to specify policy creation in short form syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitf committed Dec 2, 2021
1 parent d60de97 commit a451c2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/dashboard-frontend/src/services/helpers/location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export function buildFactoryLoaderLocation(url?: string): Location {
devfilePath = extractUrlParam(fullUrl, 'df');
}

// creation policy
const policiesCreate = extractUrlParam(fullUrl, 'policies.create');
const encodedUrl = encodeURIComponent(fullUrl.toString());

// if editor specified, add it as a new parameter
Expand All @@ -62,6 +64,9 @@ export function buildFactoryLoaderLocation(url?: string): Location {
if (devfilePath) {
pathAndQuery = `${pathAndQuery}&override.devfileFilename=${devfilePath}`;
}
if (policiesCreate) {
pathAndQuery = `${pathAndQuery}&policies.create=${policiesCreate}`;
}
}
return _buildLocationObject(pathAndQuery);
}
Expand Down

0 comments on commit a451c2b

Please sign in to comment.