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

[MNT-23433] configure position for close button on Viewer #9143

Merged
merged 15 commits into from
Jan 2, 2024

Conversation

AnukritiGL
Copy link
Contributor

@AnukritiGL AnukritiGL commented Dec 7, 2023

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)
The button to close the preview is located on the left side while the other control buttons are on the right.

What is the new behaviour?
The button to close the preview is now configurable, customer can set the position of close button either left or right.

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:
https://alfresco.atlassian.net/browse/MNT-23433

Dependent PR link : Alfresco/alfresco-content-app#3535

@AnukritiGL AnukritiGL force-pushed the MNT-23433-preview-buttons-positions-configuration branch 2 times, most recently from 3be17a8 to 5c55a26 Compare December 12, 2023 14:13
@@ -61,7 +61,8 @@ See the [Custom layout](#custom-layout) section for full details of all availabl
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| allowFullScreen | `boolean` | true | Toggles the 'Full Screen' feature. |
| allowGoBack | `boolean` | true | Allows `back` navigation |
| allowGoBack | `boolean` | true | Allows `back` navigation. |
| closeButtonPosition | `string` | `left` | Set close button position right/left. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of string should be CloseButtonPosition type

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@AnukritiGL AnukritiGL force-pushed the MNT-23433-preview-buttons-positions-configuration branch from f01ea91 to 151cc4a Compare December 26, 2023 08:12
@AnukritiGL AnukritiGL force-pushed the MNT-23433-preview-buttons-positions-configuration branch from 8c79fc8 to 3daf9bc Compare January 2, 2024 09:25
| allowGoBack | `boolean` | true | Allows `back` navigation |
| allowGoBack | `boolean` | true | Allows `back` navigation. |
| closeButtonPosition | `CloseButtonPosition` | `left` | Set close button position right/left. |
| hideInfoButton | `boolean` | `false` | Toggles Info button. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| hideInfoButton | `boolean` | `false` | Toggles Info button. |
| hideInfoButton | `boolean` | false | Toggles Info button. |

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(element.querySelector('[data-automation-id="adf-toolbar-back"]')).toBeDefined();
expect(element.querySelector('[data-automation-id="adf-toolbar-back"]')).not.toBeNull();
expect(element.querySelector('[data-automation-id="adf-toolbar-left-back"]')).toBeDefined();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of those statements is obsolete, first you check if the element is defined and then if it's not a null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed obsolete statements

@@ -23,9 +23,9 @@
</button>
</ng-container>

<button *ngIf="allowGoBack"
<button *ngIf="allowGoBack && closeButtonPosition === 'left'"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be CloseButtonPosition.Left instead of left

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -120,6 +120,19 @@
</mat-menu>
</ng-container>

<ng-container *ngIf="allowGoBack && closeButtonPosition === 'right'">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for right

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(element.querySelector('[data-automation-id="adf-toolbar-back"]')).toBeDefined();
expect(element.querySelector('[data-automation-id="adf-toolbar-back"]')).not.toBeNull();
expect(element.querySelector('[data-automation-id="adf-toolbar-left-back"]')).toBeDefined();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for obsolete check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed obsolete statements

@AnukritiGL AnukritiGL requested a review from MichalKinas January 2, 2024 12:39
Copy link

sonarqubecloud bot commented Jan 2, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.9% Duplication on New Code

See analysis details on SonarCloud

@AnukritiGL AnukritiGL merged commit e65b543 into develop Jan 2, 2024
33 checks passed
@AnukritiGL AnukritiGL deleted the MNT-23433-preview-buttons-positions-configuration branch January 2, 2024 14:25
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.

5 participants