-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AAE-15221 Allow multiple roles when fetching deployed applications #10503
AAE-15221 Allow multiple roles when fetching deployed applications #10503
Conversation
2450c72
to
7b8d4cd
Compare
Quality Gate passedIssues Measures |
if (status === '') { | ||
return of([]); | ||
} | ||
const path = this.getApplicationUrl(); | ||
const pathParams = {}; | ||
const queryParams = { status, roles: role, sort: 'name' }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for arrays, does it need to be formatted somehow, i.e. comma-separated list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Angular's HttpParams class is designed to accept an array.
* @returns The list of deployed apps | ||
*/ | ||
getDeployedApplicationsByStatus(status: string, role?: string): Observable<ApplicationInstanceModel[]> { | ||
return this.hasDeployedApps() ? of(this.deployedApps) : this.getApplicationsByStatus(status, role); | ||
getDeployedApplicationsByStatus(status: string, roles?: string | string[]): Observable<ApplicationInstanceModel[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm reading it right, roles can be either a string or a string array, or is this casting a string as a string array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roles can be either a string or a string array.
Are there tests that need to be created or updated for this change? |
The existing tests were not actually testing the optional |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behaviour? (You can also link to an open issue here)
AAE-15221
What is the new behaviour?
Allow multiple roles in query param for
GET /v1/applications
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information:
This partial fix is consumed in https://github.com/Alfresco/hxp-frontend-apps/pull/10275.