[ADF-2484] moved translation into the context menu action (#3092)

This commit is contained in:
Vito
2018-03-19 15:57:37 +00:00
committed by Eugenio Romano
parent 1c2a959a23
commit 8ead17685a
4 changed files with 16 additions and 12 deletions

View File

@@ -247,12 +247,12 @@
<!-- common actions --> <!-- common actions -->
<content-action <content-action
icon="get_app" icon="get_app"
title="{{'DOCUMENT_LIST.ACTIONS.DOWNLOAD' | translate}}" title="DOCUMENT_LIST.ACTIONS.DOWNLOAD"
handler="download"> handler="download">
</content-action> </content-action>
<content-action <content-action
icon="content_copy" icon="content_copy"
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.COPY' | translate}}" title="DOCUMENT_LIST.ACTIONS.FOLDER.COPY"
permission="copy" permission="copy"
[disableWithNoPermission]="true" [disableWithNoPermission]="true"
(error)="onContentActionError($event)" (error)="onContentActionError($event)"
@@ -261,7 +261,7 @@
</content-action> </content-action>
<content-action <content-action
icon="redo" icon="redo"
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.MOVE' | translate}}" title="DOCUMENT_LIST.ACTIONS.FOLDER.MOVE"
permission="update" permission="update"
[disableWithNoPermission]="true" [disableWithNoPermission]="true"
(error)="onContentActionError($event)" (error)="onContentActionError($event)"
@@ -272,28 +272,28 @@
icon="delete" icon="delete"
permission="delete" permission="delete"
[disableWithNoPermission]="true" [disableWithNoPermission]="true"
title="{{'DOCUMENT_LIST.ACTIONS.FOLDER.DELETE' | translate}}" title="DOCUMENT_LIST.ACTIONS.FOLDER.DELETE"
(permissionEvent)="handlePermissionError($event)" (permissionEvent)="handlePermissionError($event)"
(success)="onDeleteActionSuccess($event)" (success)="onDeleteActionSuccess($event)"
handler="delete"> handler="delete">
</content-action> </content-action>
<content-action <content-action
icon="info" icon="info"
title="{{'DOCUMENT_LIST.ACTIONS.METADATA' | translate}}" title="DOCUMENT_LIST.ACTIONS.METADATA"
(execute)="onManageMetadata($event)"> (execute)="onManageMetadata($event)">
</content-action> </content-action>
<!-- document actions --> <!-- document actions -->
<content-action <content-action
icon="storage" icon="storage"
target="document" target="document"
title="{{'DOCUMENT_LIST.ACTIONS.VERSIONS' | translate}}" title="DOCUMENT_LIST.ACTIONS.VERSIONS"
(execute)="onManageVersions($event)"> (execute)="onManageVersions($event)">
</content-action> </content-action>
<content-action <content-action
*ngIf="authenticationService.isBpmLoggedIn()" *ngIf="authenticationService.isBpmLoggedIn()"
icon="play_arrow" icon="play_arrow"
target="document" target="document"
title="{{'DOCUMENT_LIST.ACTIONS.DOCUMENT.PROCESS_ACTION' | translate}}" title="DOCUMENT_LIST.ACTIONS.DOCUMENT.PROCESS_ACTION"
(execute)="startProcesAction($event)"> (execute)="startProcesAction($event)">
</content-action> </content-action>
</content-actions> </content-actions>
@@ -344,7 +344,7 @@
</div> </div>
</div> </div>
<context-menu-holder></context-menu-holder> <adf-context-menu-holder></adf-context-menu-holder>
<div *ngIf="processId"> <div *ngIf="processId">
<adf-start-process <adf-start-process

View File

@@ -80,7 +80,7 @@ export class MyView {
| Name | Type | Default value | Description | | Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- | | ---- | ---- | ------------- | ----------- |
| title | `string` | `'Action'` | The title of the action as shown in the menu. | | title | `string` | `'Action'` | The title of the action as shown in the menu. If the title is a translation key the translation will be automatically showed. |
| icon | `string` | | The name of the icon to display next to the menu command (can be left blank). | | icon | `string` | | The name of the icon to display next to the menu command (can be left blank). |
| handler | `string` | | System actions. Can be "delete", "download", "copy" or "move". | | handler | `string` | | System actions. Can be "delete", "download", "copy" or "move". |
| target | `string` | [ContentActionTarget.All](https://github.com/Alfresco/alfresco-ng2-components/blob/development/lib/content-services/document-list/models/content-action.model.ts) | Type of item that the action applies to. Can be one of the values provided by the enum : **All**, **Folder**, **Document** | | target | `string` | [ContentActionTarget.All](https://github.com/Alfresco/alfresco-ng2-components/blob/development/lib/content-services/document-list/models/content-action.model.ts) | Type of item that the action applies to. Can be one of the values provided by the enum : **All**, **Folder**, **Document** |

View File

@@ -21,7 +21,9 @@ import { Component, HostListener, Input, OnDestroy, OnInit, Renderer2, ViewChild
import { MatMenuTrigger } from '@angular/material'; import { MatMenuTrigger } from '@angular/material';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs/Subscription';
import { ContextMenuService } from './context-menu.service'; import { ContextMenuService } from './context-menu.service';
/**
* @deprecated: context-menu-holder is deprecated, use adf-context-menu-holder instead.
*/
@Component({ @Component({
selector: 'adf-context-menu-holder, context-menu-holder', selector: 'adf-context-menu-holder, context-menu-holder',
template: ` template: `
@@ -35,7 +37,7 @@ import { ContextMenuService } from './context-menu.service';
<mat-icon *ngIf="showIcons && link.model?.icon"> <mat-icon *ngIf="showIcons && link.model?.icon">
{{ link.model?.icon }} {{ link.model?.icon }}
</mat-icon> </mat-icon>
{{link.title || link.model?.title}} {{ (link.title || link.model?.title) | translate}}
</button> </button>
</mat-menu> </mat-menu>
` `

View File

@@ -18,6 +18,7 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { MaterialModule } from '../material.module'; import { MaterialModule } from '../material.module';
import { TranslateModule } from '@ngx-translate/core';
import { ContextMenuHolderComponent } from './context-menu-holder.component'; import { ContextMenuHolderComponent } from './context-menu-holder.component';
import { ContextMenuDirective } from './context-menu.directive'; import { ContextMenuDirective } from './context-menu.directive';
@@ -26,7 +27,8 @@ import { ContextMenuService } from './context-menu.service';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
MaterialModule MaterialModule,
TranslateModule
], ],
declarations: [ declarations: [
ContextMenuHolderComponent, ContextMenuHolderComponent,