mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
accessibility (#1689)
This commit is contained in:
@@ -17,10 +17,8 @@
|
|||||||
mat-icon-button
|
mat-icon-button
|
||||||
data-automation-id="share-action-button"
|
data-automation-id="share-action-button"
|
||||||
(click)="editSharedNode(selection)"
|
(click)="editSharedNode(selection)"
|
||||||
[attr.title]="
|
[attr.aria-label]="getLabel(selection) | translate"
|
||||||
(isShared(selection) ? 'APP.ACTIONS.SHARE_EDIT' : 'APP.ACTIONS.SHARE')
|
[attr.title]="getLabel(selection) | translate"
|
||||||
| translate
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<mat-icon>link</mat-icon>
|
<mat-icon>link</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
@@ -72,4 +72,19 @@ describe('ToggleSharedComponent', () => {
|
|||||||
component.editSharedNode({ first: { entry } });
|
component.editSharedNode({ first: { entry } });
|
||||||
expect(storeMock.dispatch).toHaveBeenCalled();
|
expect(storeMock.dispatch).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should get action label for unshared file', () => {
|
||||||
|
component.ngOnInit();
|
||||||
|
const label = component.getLabel({ first: { entry } });
|
||||||
|
|
||||||
|
expect(label).toBe('APP.ACTIONS.SHARE');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should get action label for shared file', () => {
|
||||||
|
entry.properties['qshare:sharedId'] = 'some-id';
|
||||||
|
component.ngOnInit();
|
||||||
|
const label = component.getLabel({ first: { entry } });
|
||||||
|
|
||||||
|
expect(label).toBe('APP.ACTIONS.SHARE_EDIT');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -56,4 +56,8 @@ export class ToggleSharedComponent implements OnInit {
|
|||||||
editSharedNode(selection: SelectionState) {
|
editSharedNode(selection: SelectionState) {
|
||||||
this.store.dispatch(new ShareNodeAction(selection.first));
|
this.store.dispatch(new ShareNodeAction(selection.first));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getLabel(selection: SelectionState): string {
|
||||||
|
return this.isShared(selection) ? 'APP.ACTIONS.SHARE_EDIT' : 'APP.ACTIONS.SHARE';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user