mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-2621] Shared link - when dialog is closed focus is not returned to trigger (#1255)
* use custom component action * adjust component. to render icon and menu action * pass action data * update selection after dialog closes * update mocks
This commit is contained in:
committed by
Adina Parpalita
parent
236d80106d
commit
f526db9657
@@ -422,6 +422,9 @@
|
|||||||
"id": "app.toolbar.share",
|
"id": "app.toolbar.share",
|
||||||
"type": "custom",
|
"type": "custom",
|
||||||
"order": 600,
|
"order": 600,
|
||||||
|
"data": {
|
||||||
|
"iconButton": true
|
||||||
|
},
|
||||||
"component": "app.shared-link.toggleSharedLink",
|
"component": "app.shared-link.toggleSharedLink",
|
||||||
"rules": {
|
"rules": {
|
||||||
"visible": "app.selection.file.canShare"
|
"visible": "app.selection.file.canShare"
|
||||||
@@ -517,6 +520,9 @@
|
|||||||
"id": "item3",
|
"id": "item3",
|
||||||
"type": "custom",
|
"type": "custom",
|
||||||
"order": 400,
|
"order": 400,
|
||||||
|
"data": {
|
||||||
|
"iconButton": false
|
||||||
|
},
|
||||||
"component": "app.shared-link.toggleSharedLink",
|
"component": "app.shared-link.toggleSharedLink",
|
||||||
"rules": {
|
"rules": {
|
||||||
"visible": "app.selection.file.canShare"
|
"visible": "app.selection.file.canShare"
|
||||||
@@ -538,6 +544,9 @@
|
|||||||
"id": "item3",
|
"id": "item3",
|
||||||
"type": "custom",
|
"type": "custom",
|
||||||
"order": 400,
|
"order": 400,
|
||||||
|
"data": {
|
||||||
|
"iconButton": false
|
||||||
|
},
|
||||||
"component": "app.shared-link.toggleSharedLink",
|
"component": "app.shared-link.toggleSharedLink",
|
||||||
"rules": {
|
"rules": {
|
||||||
"visible": "app.selection.file.canShare"
|
"visible": "app.selection.file.canShare"
|
||||||
@@ -586,6 +595,9 @@
|
|||||||
"id": "app.context.menu.share",
|
"id": "app.context.menu.share",
|
||||||
"type": "custom",
|
"type": "custom",
|
||||||
"order": 400,
|
"order": 400,
|
||||||
|
"data": {
|
||||||
|
"iconButton": false
|
||||||
|
},
|
||||||
"component": "app.shared-link.toggleSharedLink",
|
"component": "app.shared-link.toggleSharedLink",
|
||||||
"rules": {
|
"rules": {
|
||||||
"visible": "app.selection.file.canShare"
|
"visible": "app.selection.file.canShare"
|
||||||
@@ -805,6 +817,9 @@
|
|||||||
"id": "app.viewer.share",
|
"id": "app.viewer.share",
|
||||||
"type": "custom",
|
"type": "custom",
|
||||||
"order": 300,
|
"order": 300,
|
||||||
|
"data": {
|
||||||
|
"iconButton": true
|
||||||
|
},
|
||||||
"component": "app.shared-link.toggleSharedLink",
|
"component": "app.shared-link.toggleSharedLink",
|
||||||
"rules": {
|
"rules": {
|
||||||
"visible": "app.selection.file.canShare"
|
"visible": "app.selection.file.canShare"
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<ng-container *ngIf="selection$ | async as selection">
|
<ng-container *ngIf="selection$ | async as selection">
|
||||||
|
<ng-container *ngIf="!data.iconButton">
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
data-automation-id="share-action-button"
|
data-automation-id="share-action-button"
|
||||||
@@ -9,6 +10,21 @@
|
|||||||
<span>{{ 'APP.ACTIONS.SHARE_EDIT' | translate }}</span>
|
<span>{{ 'APP.ACTIONS.SHARE_EDIT' | translate }}</span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</button>
|
</button>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container *ngIf="data.iconButton">
|
||||||
|
<button
|
||||||
|
mat-icon-button
|
||||||
|
data-automation-id="share-action-button"
|
||||||
|
(click)="editSharedNode(selection)"
|
||||||
|
[attr.title]="
|
||||||
|
(isShared(selection) ? 'APP.ACTIONS.SHARE_EDIT' : 'APP.ACTIONS.SHARE')
|
||||||
|
| translate
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<mat-icon>link</mat-icon>
|
||||||
|
</button>
|
||||||
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-template #not_shared>
|
<ng-template #not_shared>
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit, Input } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { SelectionState } from '@alfresco/adf-extensions';
|
import { SelectionState } from '@alfresco/adf-extensions';
|
||||||
@@ -38,6 +38,8 @@ import {
|
|||||||
templateUrl: './toggle-shared.component.html'
|
templateUrl: './toggle-shared.component.html'
|
||||||
})
|
})
|
||||||
export class ToggleSharedComponent implements OnInit {
|
export class ToggleSharedComponent implements OnInit {
|
||||||
|
@Input() data: any;
|
||||||
|
|
||||||
selection$: Observable<SelectionState>;
|
selection$: Observable<SelectionState>;
|
||||||
|
|
||||||
constructor(private store: Store<AppStore>) {}
|
constructor(private store: Store<AppStore>) {}
|
||||||
|
@@ -214,9 +214,7 @@ export class ContentManagementService {
|
|||||||
})
|
})
|
||||||
.afterClosed()
|
.afterClosed()
|
||||||
.subscribe(deletedSharedLink => {
|
.subscribe(deletedSharedLink => {
|
||||||
this.store.dispatch(
|
this.store.dispatch(new SetSelectedNodesAction([node]));
|
||||||
new SetSelectedNodesAction([deletedSharedLink || node])
|
|
||||||
);
|
|
||||||
if (deletedSharedLink) {
|
if (deletedSharedLink) {
|
||||||
this.linksUnshared.next(deletedSharedLink);
|
this.linksUnshared.next(deletedSharedLink);
|
||||||
}
|
}
|
||||||
|
@@ -197,26 +197,14 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "app.toolbar.share",
|
"id": "app.toolbar.share",
|
||||||
|
"type": "custom",
|
||||||
"order": 100,
|
"order": 100,
|
||||||
"title": "APP.ACTIONS.SHARE",
|
"data": {
|
||||||
"icon": "link",
|
"iconButton": true
|
||||||
"actions": {
|
|
||||||
"click": "SHARE_NODE"
|
|
||||||
},
|
},
|
||||||
|
"component": "app.shared-link.toggleSharedLink",
|
||||||
"rules": {
|
"rules": {
|
||||||
"visible": "app.selection.file.canShare"
|
"visible": "canToggleSharedLink"
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "app.toolbar.share.edit",
|
|
||||||
"order": 101,
|
|
||||||
"title": "APP.ACTIONS.SHARE_EDIT",
|
|
||||||
"icon": "link",
|
|
||||||
"actions": {
|
|
||||||
"click": "SHARE_NODE"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"visible": "app.selection.file.isShared"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -486,6 +474,9 @@
|
|||||||
"id": "app.context.menu.share",
|
"id": "app.context.menu.share",
|
||||||
"type": "custom",
|
"type": "custom",
|
||||||
"order": 100,
|
"order": 100,
|
||||||
|
"data": {
|
||||||
|
"iconButton": false
|
||||||
|
},
|
||||||
"component": "app.shared-link.toggleSharedLink",
|
"component": "app.shared-link.toggleSharedLink",
|
||||||
"rules": {
|
"rules": {
|
||||||
"visible": "canToggleSharedLink"
|
"visible": "canToggleSharedLink"
|
||||||
@@ -747,26 +738,14 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "app.viewer.share",
|
"id": "app.viewer.share",
|
||||||
|
"type": "custom",
|
||||||
"order": 200,
|
"order": 200,
|
||||||
"title": "APP.ACTIONS.SHARE",
|
"data": {
|
||||||
"icon": "link",
|
"iconButton": true
|
||||||
"actions": {
|
|
||||||
"click": "SHARE_NODE"
|
|
||||||
},
|
},
|
||||||
|
"component": "app.shared-link.toggleSharedLink",
|
||||||
"rules": {
|
"rules": {
|
||||||
"visible": "app.selection.file.canShare"
|
"visible": "canToggleSharedLink"
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "app.viewer.share.edit",
|
|
||||||
"order": 250,
|
|
||||||
"title": "APP.ACTIONS.SHARE_EDIT",
|
|
||||||
"icon": "link",
|
|
||||||
"actions": {
|
|
||||||
"click": "SHARE_NODE"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"visible": "app.selection.file.isShared"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user