Skip to content
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

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

DavidOlson-Hyland
Copy link
Contributor

@DavidOlson-Hyland DavidOlson-Hyland commented Dec 17, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

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")

  • Yes
  • No

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.

@CLAassistant
Copy link

CLAassistant commented Dec 17, 2024

CLA assistant check
All committers have signed the CLA.

@DavidOlson-Hyland DavidOlson-Hyland force-pushed the fix/AAE-15221-app-get-multiple-roles branch from 2450c72 to 7b8d4cd Compare January 7, 2025 14:33
Copy link

sonarqubecloud bot commented Jan 7, 2025

if (status === '') {
return of([]);
}
const path = this.getApplicationUrl();
const pathParams = {};
const queryParams = { status, roles: role, sort: 'name' };
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@DavidOlson-Hyland DavidOlson-Hyland merged commit 65b9916 into develop Jan 8, 2025
18 checks passed
@DavidOlson-Hyland DavidOlson-Hyland deleted the fix/AAE-15221-app-get-multiple-roles branch January 8, 2025 14:51
* @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[]> {
Copy link

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?

Copy link
Contributor Author

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.

@csandham
Copy link

csandham commented Jan 8, 2025

Are there tests that need to be created or updated for this change?

@DavidOlson-Hyland
Copy link
Contributor Author

DavidOlson-Hyland commented Jan 8, 2025

The existing tests were not actually testing the optional roles parameter. They are only testing what is returned for a 'fake' status based on what is defined in the app.config. As the roles param is merely being passed through unchanged, adding a test around it seemed unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants