-
Notifications
You must be signed in to change notification settings - Fork 268
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
[MNT-23433] configure position for close button on Viewer #9143
Conversation
lib/content-services/src/lib/viewer/components/alfresco-viewer.component.ts
Outdated
Show resolved
Hide resolved
lib/content-services/src/lib/viewer/components/alfresco-viewer.component.ts
Outdated
Show resolved
Hide resolved
3be17a8
to
5c55a26
Compare
lib/content-services/src/lib/viewer/components/alfresco-viewer.component.ts
Outdated
Show resolved
Hide resolved
lib/content-services/src/lib/viewer/components/alfresco-viewer.component.ts
Outdated
Show resolved
Hide resolved
@@ -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. | |
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.
instead of string should be CloseButtonPosition type
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.
Done
f01ea91
to
151cc4a
Compare
8c79fc8
to
3daf9bc
Compare
| 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. | |
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.
| hideInfoButton | `boolean` | `false` | Toggles Info button. | | |
| hideInfoButton | `boolean` | false | Toggles Info button. | |
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.
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(); |
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.
One of those statements is obsolete, first you check if the element is defined and then if it's not a null
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.
Removed obsolete statements
@@ -23,9 +23,9 @@ | |||
</button> | |||
</ng-container> | |||
|
|||
<button *ngIf="allowGoBack" | |||
<button *ngIf="allowGoBack && closeButtonPosition === 'left'" |
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.
Should be CloseButtonPosition.Left
instead of left
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.
done
@@ -120,6 +120,19 @@ | |||
</mat-menu> | |||
</ng-container> | |||
|
|||
<ng-container *ngIf="allowGoBack && closeButtonPosition === 'right'"> |
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.
Same here for right
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.
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(); |
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.
Same here for obsolete check
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.
Removed obsolete statements
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
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)
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")
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