Skip to content

Commit

Permalink
translation of rolesandpermissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Omar-Nabil authored and alberto-art3ch committed Jun 28, 2024
1 parent e216c4b commit 80241c9
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -30,15 +30,15 @@
<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%">
{{ rolePermissionService.name }}
</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%">
Expand All @@ -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>
Expand Down Expand Up @@ -110,8 +110,8 @@ <h3>

<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>

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/assets/translations/cs-CS.json
Original file line number Diff line number Diff line change
Expand Up @@ -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í",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/translations/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/translations/es-MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/translations/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 80241c9

Please sign in to comment.