translation of rolesandpermissions

This commit is contained in:
Omar-Nabil
2024-06-27 21:52:56 -06:00
committed by Jose Alberto Hernandez
parent e216c4b0d5
commit 80241c964e
17 changed files with 75 additions and 48 deletions
@@ -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) {
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "Smazat otázku",
"Delete Selected": "Smazat vybrané",
"Delete Signature": "Smazat podpis",
"Deselect All": "Odznačit vše",
"Disable": "Zakázat",
"Dividends": "Dividendy",
"Download": "Stažení",
@@ -482,6 +483,7 @@
"Setup Organization": "Nastavení organizace",
"Setup Products": "Nastavení produktů",
"Setup System": "Systém nastavení",
"Select All": "Vybrat vše",
"Show more": "Zobrazit více",
"Show less": "Ukaž méně",
"Staff": "Personál",
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "Frage löschen",
"Delete Selected": "Ausgewählte löschen",
"Delete Signature": "Signatur löschen",
"Deselect All": "Alle abwählen",
"Disable": "Deaktivieren",
"Dividends": "Dividenden",
"Download": "Herunterladen",
@@ -482,6 +483,7 @@
"Setup Organization": "Organisation einrichten",
"Setup Products": "Setup-Produkte",
"Setup System": "Setup-System",
"Select All": "Wählen Sie Alle",
"Show more": "Zeig mehr",
"Show less": "Zeige weniger",
"Staff": "Personal",
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "Delete Question",
"Delete Selected": "Delete Selected",
"Delete Signature": "Delete Signature",
"Deselect All": "Deselect All",
"Disable": "Disable",
"Dividends": "Dividends",
"Download": "Download",
@@ -482,6 +483,7 @@
"Setup Organization": "Setup Organization",
"Setup Products": "Setup Products",
"Setup System": "Setup System",
"Select All": "Select All",
"Show less": "Show less",
"Show more": "Show more",
"Staff": "Staff",
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "Eliminar pregunta",
"Delete Selected": "Eliminar seleccionado",
"Delete Signature": "Eliminar firma",
"Deselect All": "Deseleccionar todo",
"Disable": "Desactivar",
"Dividends": "Dividendos",
"Download": "Descargar",
@@ -482,6 +483,7 @@
"Setup Organization": "Configuración de Organización",
"Setup Products": "Configuración de Productos",
"Setup System": "Configuración de Sistema",
"Select All": "Seleccionar todo",
"Show more": "Mostrar más",
"Show less": "Muestra menos",
"Staff": "Asesor",
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "Supprimer la question",
"Delete Selected": "Supprimer sélectionnée",
"Delete Signature": "Supprimer la signature",
"Deselect All": "Tout déselectionner",
"Disable": "Désactiver",
"Dividends": "Dividendes",
"Download": "Télécharger",
@@ -482,6 +483,7 @@
"Setup Organization": "Organisation de configuration",
"Setup Products": "Produits d'installation",
"Setup System": "Système de configuration",
"Select All": "Tout sélectionner",
"Show more": "Montre plus",
"Show less": "Montrer moins",
"Staff": "Personnel",
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "Elimina domanda",
"Delete Selected": "Elimina selezionato",
"Delete Signature": "Elimina firma",
"Deselect All": "Deselezionare tutto",
"Disable": "disattivare",
"Dividends": "Dividendi",
"Download": "Scaricamento",
@@ -482,6 +483,7 @@
"Setup Organization": "Configurazione dell'organizzazione",
"Setup Products": "Imposta prodotti",
"Setup System": "Sistema di installazione",
"Select All": "Seleziona tutto",
"Show more": "Mostra di più",
"Show less": "Mostra meno",
"Staff": "Personale",
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "질문 삭제",
"Delete Selected": "선택된 것을 지워 라",
"Delete Signature": "서명 삭제",
"Deselect All": "모두 선택 취소",
"Disable": "장애를 입히다",
"Dividends": "배당금",
"Download": "다운로드",
@@ -482,6 +483,7 @@
"Setup Organization": "조직 설정",
"Setup Products": "설치 제품",
"Setup System": "설정 시스템",
"Select All": "모두 선택",
"Show more": "자세히보기",
"Show less": "간략히 보기",
"Staff": "직원",
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "Ištrinti klausimą",
"Delete Selected": "Išštrinti pasirinktus",
"Delete Signature": "Ištrinti parašą",
"Deselect All": "Atzymeti visus pasirinkimus",
"Disable": "Išjungti",
"Dividends": "Dividendai",
"Download": "parsisiųsti",
@@ -482,6 +483,7 @@
"Setup Organization": "Nustatykite organizaciją",
"Setup Products": "Sąrankos produktai",
"Setup System": "Sistemos sąranka",
"Select All": "Pasirinkti viską",
"Show more": "Rodyti daugiau",
"Show less": "Rodyti mažiau",
"Staff": "Personalas",
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "Dzēst jautājumu",
"Delete Selected": "Dzēst atlasītos",
"Delete Signature": "Dzēst parakstu",
"Deselect All": "Atsijāt visu",
"Disable": "Atspējot",
"Dividends": "Dividendes",
"Download": "Lejupielādēt",
@@ -482,6 +483,7 @@
"Setup Organization": "Organizācijas iestatīšana",
"Setup Products": "Iestatīšanas produkti",
"Setup System": "Uzstādīšanas sistēma",
"Select All": "Izvēlēties visus",
"Show more": "Parādīt vairāk",
"Show less": "Rādīt mazāk",
"Staff": "Personāls",
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "प्रश्न मेटाउनुहोस्",
"Delete Selected": "चयन गरिएको मेटाउनुहोस्",
"Delete Signature": "हस्ताक्षर मेटाउनुहोस्",
"Deselect All": "सबै अचयन गर्नुहोस्",
"Disable": "असक्षम गर्नुहोस्",
"Dividends": "लाभांश",
"Download": "डाउनलोड गर्नुहोस्",
@@ -482,6 +483,7 @@
"Setup Organization": "स्थापना संगठन",
"Setup Products": "उत्पादनहरू सेटअप गर्नुहोस्",
"Setup System": "सेटअप प्रणाली",
"Select All": "सबै छान्नु",
"Show more": "थप देखाउनुहोस्",
"Show less": "कम देखाउनुहोस्",
"Staff": "कर्मचारी",
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "Excluir pergunta",
"Delete Selected": "Excluir selecionado",
"Delete Signature": "Excluir assinatura",
"Deselect All": "Desmarcar todos",
"Disable": "Desativar",
"Dividends": "Dividendos",
"Download": "Download",
@@ -482,6 +483,7 @@
"Setup Organization": "Configurar organização",
"Setup Products": "Configurar produtos",
"Setup System": "Sistema de configuração",
"Select All": "Selecionar tudo",
"Show more": "Mostre mais",
"Show less": "Mostre menos",
"Staff": "Funcionários",
+2
View File
@@ -394,6 +394,7 @@
"Delete Question": "Futa Swali",
"Delete Selected": "Futa Uliochaguliwa",
"Delete Signature": "Futa Sahihi",
"Deselect All": "Usichague zote",
"Disable": "Zima",
"Dividends": "Gawio",
"Download": "Pakua",
@@ -482,6 +483,7 @@
"Setup Organization": "Shirika la Kuanzisha",
"Setup Products": "Weka Bidhaa",
"Setup System": "Kuanzisha Mfumo",
"Select All": "Chagua Zote",
"Show more": "Onyesha zaidi",
"Show less": "Onyesha kidogo",
"Staff": "Wafanyakazi",