translation of rolesandpermissions
This commit is contained in:
committed by
Jose Alberto Hernandez
parent
e216c4b0d5
commit
80241c964e
@@ -9,18 +9,18 @@
|
||||
<div fxLayout="column">
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Name</mat-label>
|
||||
<mat-label>{{ 'labels.inputs.Name' | translate }}</mat-label>
|
||||
<input matInput required formControlName="name">
|
||||
<mat-error *ngIf="roleForm.controls.name.hasError('required')">
|
||||
Role Name is <strong>required</strong>
|
||||
{{ 'labels.inputs.Role Name' | translate }} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Description</mat-label>
|
||||
<mat-label>{{ 'labels.inputs.Description' | translate }}</mat-label>
|
||||
<textarea matInput required formControlName="description"></textarea>
|
||||
<mat-error *ngIf="roleForm.controls.description.hasError('required')">
|
||||
Role Description is <strong>required</strong>
|
||||
{{ 'labels.inputs.Role Description' | translate }} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!roleForm.valid">Submit</button>
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">{{'labels.buttons.Cancel' | translate}}</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!roleForm.valid">{{'labels.buttons.Submit' | translate}}</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
<div fxLayout="column">
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Role Name</mat-label>
|
||||
<mat-label>{{ 'labels.inputs.Role Name' | translate }}</mat-label>
|
||||
<input matInput disabled formControlName="name">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Role Description</mat-label>
|
||||
<mat-label>{{ 'labels.inputs.Role Description' | translate }}</mat-label>
|
||||
<input matInput required formControlName="description">
|
||||
<mat-error *ngIf="roleForm.controls.description.hasError('required')">
|
||||
Description is <strong>required</strong>
|
||||
{{ 'labels.inputs.Description' | translate }} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../../']">Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!roleForm.valid || roleForm.pristine">Submit</button>
|
||||
<button type="button" mat-raised-button [routerLink]="['../../']">{{'labels.buttons.Cancel' | translate}}</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!roleForm.valid || roleForm.pristine">{{'labels.buttons.Submit' | translate}}</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div #buttonAddRole class="in-block">
|
||||
<button mat-raised-button color="primary">
|
||||
<fa-icon icon="plus" class="m-r-10"></fa-icon>
|
||||
Add Role
|
||||
{{'labels.buttons.Add Role' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -21,29 +21,29 @@
|
||||
<table mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Name' | translate}} </th>
|
||||
<td mat-cell *matCellDef="let role"> {{ role.name }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="description">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Description </th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'labels.inputs.Description' | translate }} </th>
|
||||
<td mat-cell *matCellDef="let role"> {{ role.description }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="disabled">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Status </th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'labels.inputs.Status' | translate }} </th>
|
||||
<td mat-cell *matCellDef="let role">
|
||||
<div [className]="role.disabled === true ? 'false' : 'true'">
|
||||
<fa-icon matTooltip="{{ role.disabled === true ? 'Disabled' : 'Enabled' }}" matTooltipPosition="right" icon="circle" size="lg"></fa-icon>
|
||||
<fa-icon [matTooltip]="role.disabled === true ? (('labels.inputs.Disabled' | translate)) : (('labels.inputs.Enabled' | translate))" matTooltipPosition="right" icon="circle" size="lg"></fa-icon>
|
||||
</div>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef>Actions</th>
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let role;" >
|
||||
<button *ngIf="role.name !== 'Super user'" mat-icon-button color="primary" (click)="routeEdit($event)" [routerLink]="[role.id, 'edit']">
|
||||
<fa-icon icon="edit"> Edit </fa-icon>
|
||||
<fa-icon icon="edit"> {{'labels.buttons.Edit' | translate }} </fa-icon>
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
@@ -60,29 +60,29 @@
|
||||
</div>
|
||||
|
||||
<ng-template #templateButtonAddRole let-popover="popover">
|
||||
<h2>Add Role</h2>
|
||||
<p class="mw300">To create a new role.</p>
|
||||
<h2>{{'labels.buttons.Add Role' | translate}}</h2>
|
||||
<p class="mw300">{{'labels.text.To create a new role' | translate}}.</p>
|
||||
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();previousStep();">Back</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter, filter, 'bottom', true);">Next</button>
|
||||
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{'labels.buttons.Close' | translate }}</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();previousStep();">{{'labels.buttons.Back' | translate}}</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter, filter, 'bottom', true);">{{'labels.buttons.Next' | translate }}</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #templateFilter let-popover="popover">
|
||||
<h4>Search bar to filter roles.</h4>
|
||||
<h4>{{'labels.heading.Search bar to filter roles' | translate }}.</h4>
|
||||
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateButtonAddRole, buttonAddRole, 'bottom', true)">Back</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateTableRolesandPermissions, tableRolesandPermissions, 'top', true)">Next</button>
|
||||
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{'labels.buttons.Close' | translate }}</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateButtonAddRole, buttonAddRole, 'bottom', true)">{{'labels.buttons.Back' | translate}}</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateTableRolesandPermissions, tableRolesandPermissions, 'top', true)">{{'labels.buttons.Next' | translate }}</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #templateTableRolesandPermissions let-popover="popover">
|
||||
<h4 class="mw300">List of roles defined within the organization. or more details click: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/67895364/Manage+Roles+and+Permissions" target="_blank">Manage Roles and Permission</a></h4>
|
||||
<h4 class="mw300">{{'labels.heading.List of roles defined within the organization' | translate}}: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/67895364/Manage+Roles+and+Permissions" target="_blank">{{'labels.inputs.Manage Roles and Permission' | translate}}</a></h4>
|
||||
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter, filter, 'bottom', true);">Back</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">Next</button>
|
||||
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{'labels.buttons.Close' | translate }}</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter, filter, 'bottom', true);">{{'labels.buttons.Back' | translate}}</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">{{'labels.buttons.Next' | translate }}</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
|
||||
<button mat-raised-button color="primary" (click)="editRoles(); backupCheckValues();" [disabled]="rolePermissionService.name === 'Super user'">
|
||||
<fa-icon icon="edit" class="m-r-10"></fa-icon>
|
||||
Edit Role
|
||||
{{ 'labels.text.Edit Role' | translate }}
|
||||
</button>
|
||||
|
||||
<button *ngIf="!isRoleEnable(rolePermissionService.disabled)" mat-raised-button color="danger" (click)="disableRolesConfirmation()" [disabled]="rolePermissionService.name === 'Super user'">
|
||||
<fa-icon icon="lock" class="m-r-10"></fa-icon>
|
||||
Disable Role
|
||||
{{ 'labels.buttons.Disable' | translate }} {{ 'labels.inputs.Role' | translate }}
|
||||
</button>
|
||||
|
||||
<button *ngIf="isRoleEnable(rolePermissionService.disabled)" mat-raised-button color="primary" (click)="enableRolesConfirmation()" [disabled]="rolePermissionService.name === 'Super user'">
|
||||
<fa-icon icon="lock-open" class="m-r-10"></fa-icon>
|
||||
Enable Role
|
||||
{{ 'labels.buttons.Enable' | translate }} {{ 'labels.inputs.Role' | translate }}
|
||||
</button>
|
||||
|
||||
<button mat-raised-button color="warn" (click)="deleteRole()" [disabled]="rolePermissionService.name === 'Super user'">
|
||||
<fa-icon icon="trash" class="m-r-10"></fa-icon>
|
||||
Delete Role
|
||||
{{'labels.buttons.Delete' | translate }} {{ 'labels.inputs.Role' | translate }}
|
||||
</button>
|
||||
|
||||
</div>
|
||||
@@ -30,7 +30,7 @@
|
||||
<div fxLayout="row wrap" class="content">
|
||||
|
||||
<div fxFlex="40%" fxFlex.lt-md="50%" class="header">
|
||||
<b>Name:</b>
|
||||
<b>{{'labels.inputs.Name' | translate}}:</b>
|
||||
</div>
|
||||
|
||||
<div fxFlex="60%" fxFlex.lt-md="50%">
|
||||
@@ -38,7 +38,7 @@
|
||||
</div>
|
||||
|
||||
<div fxFlex="40%" fxFlex.lt-md="50%" class="header">
|
||||
<b>Description:</b>
|
||||
<b>{{ 'labels.inputs.Role Description' | translate }}:</b>
|
||||
</div>
|
||||
|
||||
<div fxFlex="60%" fxFlex.lt-md="50%">
|
||||
@@ -62,13 +62,13 @@
|
||||
<div fxLayout="row" class="permissionSelected">
|
||||
<div fxFlex="75">
|
||||
<h3>
|
||||
Permissions: <strong>{{ formatName(previousGrouping) }}</strong>
|
||||
{{'labels.buttons.Permissions' | translate }}: <strong>{{ formatName(previousGrouping) }}</strong>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div fxFlex= "25" fxLayout="row" fxLayout.xs="column" fxLayoutAlign="end" fxLayoutGap="5px" *ngIf="!isDisabled" class="selectDeselect">
|
||||
<button mat-raised-button color="primary" (click)="selectAll()">Select All</button>
|
||||
<button mat-raised-button color="default" (click)="deselectAll()">Deselect All</button>
|
||||
<button mat-raised-button color="primary" (click)="selectAll()">{{'labels.buttons.Select All' | translate }}</button>
|
||||
<button mat-raised-button color="default" (click)="deselectAll()">{{'labels.buttons.Deselect All' | translate }}</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -110,8 +110,8 @@
|
||||
|
||||
<div fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px" *ngIf="!isDisabled">
|
||||
<mat-card-actions>
|
||||
<button type="button" mat-raised-button (click)="cancel(); restoreCheckboxes();">Cancel</button>
|
||||
<button mat-raised-button color="primary" (click)="submit()">Submit</button>
|
||||
<button type="button" mat-raised-button (click)="cancel(); restoreCheckboxes();">{{'labels.buttons.Cancel' | translate}}</button>
|
||||
<button mat-raised-button color="primary" (click)="submit()">{{'labels.buttons.Submit' | translate}}</button>
|
||||
</mat-card-actions>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { SystemService } from '../../system.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as _ from 'lodash';
|
||||
import { SystemService } from '../../system.service';
|
||||
|
||||
/** Custom Components */
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component';
|
||||
import { DisableDialogComponent } from '../../../shared/disable-dialog/disable-dialog.component';
|
||||
import { EnableDialogComponent } from '../../../shared/enable-dialog/enable-dialog.component';
|
||||
@@ -59,11 +60,13 @@ export class ViewRoleComponent implements OnInit {
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
* @param {MatDialog} dialog Shared Dialog Boxes.
|
||||
* @param {TranslateService} translateService Translate Service.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private systemService: SystemService,
|
||||
private router: Router,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private translateService:TranslateService,
|
||||
public dialog: MatDialog) {
|
||||
this.route.data.subscribe((data: { roledetails: any }) => {
|
||||
this.rolePermissionService = data.roledetails;
|
||||
@@ -246,7 +249,7 @@ export class ViewRoleComponent implements OnInit {
|
||||
*/
|
||||
deleteRole() {
|
||||
const deleteRoleDialogRef = this.dialog.open(DeleteDialogComponent, {
|
||||
data: { deleteContext: `role ${this.roleId}` }
|
||||
data: { deleteContext: this.translateService.instant('labels.inputs.Role') + ' ' + this.roleId }
|
||||
});
|
||||
deleteRoleDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.delete) {
|
||||
@@ -265,7 +268,7 @@ export class ViewRoleComponent implements OnInit {
|
||||
*/
|
||||
enableRolesConfirmation() {
|
||||
const enableRoleDialogRef = this.dialog.open(EnableDialogComponent, {
|
||||
data: { enableContext: `role ${this.roleId}` }
|
||||
data: { enableContext: this.translateService.instant('labels.inputs.Role') + ' ' + this.roleId }
|
||||
});
|
||||
enableRoleDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.enable) {
|
||||
@@ -284,7 +287,7 @@ export class ViewRoleComponent implements OnInit {
|
||||
*/
|
||||
disableRolesConfirmation() {
|
||||
const deleteRoleDialogRef = this.dialog.open(DisableDialogComponent, {
|
||||
data: { disableContext: `role ${this.roleId}` }
|
||||
data: { disableContext: this.translateService.instant('labels.inputs.Role') + ' ' + this.roleId }
|
||||
});
|
||||
deleteRoleDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.disable) {
|
||||
|
||||
Reference in New Issue
Block a user