mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +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
@@ -1,14 +1,30 @@
|
||||
<ng-container *ngIf="selection$ | async as selection">
|
||||
<button
|
||||
mat-menu-item
|
||||
data-automation-id="share-action-button"
|
||||
(click)="editSharedNode(selection)"
|
||||
>
|
||||
<mat-icon>link</mat-icon>
|
||||
<ng-container *ngIf="isShared(selection); else not_shared">
|
||||
<span>{{ 'APP.ACTIONS.SHARE_EDIT' | translate }}</span>
|
||||
</ng-container>
|
||||
</button>
|
||||
<ng-container *ngIf="!data.iconButton">
|
||||
<button
|
||||
mat-menu-item
|
||||
data-automation-id="share-action-button"
|
||||
(click)="editSharedNode(selection)"
|
||||
>
|
||||
<mat-icon>link</mat-icon>
|
||||
<ng-container *ngIf="isShared(selection); else not_shared">
|
||||
<span>{{ 'APP.ACTIONS.SHARE_EDIT' | translate }}</span>
|
||||
</ng-container>
|
||||
</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-template #not_shared>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* 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 { Store } from '@ngrx/store';
|
||||
import { SelectionState } from '@alfresco/adf-extensions';
|
||||
@@ -38,6 +38,8 @@ import {
|
||||
templateUrl: './toggle-shared.component.html'
|
||||
})
|
||||
export class ToggleSharedComponent implements OnInit {
|
||||
@Input() data: any;
|
||||
|
||||
selection$: Observable<SelectionState>;
|
||||
|
||||
constructor(private store: Store<AppStore>) {}
|
||||
|
||||
@@ -214,9 +214,7 @@ export class ContentManagementService {
|
||||
})
|
||||
.afterClosed()
|
||||
.subscribe(deletedSharedLink => {
|
||||
this.store.dispatch(
|
||||
new SetSelectedNodesAction([deletedSharedLink || node])
|
||||
);
|
||||
this.store.dispatch(new SetSelectedNodesAction([node]));
|
||||
if (deletedSharedLink) {
|
||||
this.linksUnshared.next(deletedSharedLink);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user