add translation for manage-data-tables inside system module

This commit is contained in:
Omar-Nabil
2024-06-05 16:33:14 -06:00
committed by Jose Alberto Hernandez
parent 9a0124d358
commit 1fdaf44645
20 changed files with 221 additions and 93 deletions
@@ -1,4 +1,4 @@
<h1 mat-dialog-title>{{ data.columnName ? "Edit" : "Add" }} Column</h1>
<h1 mat-dialog-title>{{ data.columnName ? ('labels.buttons.Edit' | translate) : ('labels.buttons.Add' | translate) }} {{'labels.inputs.Column' | translate }}</h1>
<mat-dialog-content>
@@ -7,29 +7,29 @@
<div fxLayout="column">
<mat-form-field>
<mat-label>Column Name</mat-label>
<mat-label>{{'labels.inputs.Column Name' | translate }}</mat-label>
<input matInput required formControlName="name">
<mat-error *ngIf="columnForm.controls.name.hasError('required')">
Column Name is <strong>required</strong>
{{'labels.inputs.Column Name' | translate }} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>Column Type</mat-label>
<mat-label>{{'labels.inputs.Column Type' | translate }}</mat-label>
<mat-select required formControlName="type">
<mat-option *ngFor="let columnType of columnTypeData" [value]="columnType.value">
{{ columnType.displayValue }}
{{ columnType.displayValue | translateKey:'inputs' }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="columnForm.value.type === 'String'">
<mat-label>Column Length</mat-label>
<mat-label> {{'labels.inputs.Column Length' | translate }}</mat-label>
<input matInput required type="number" formControlName="length">
</mat-form-field>
<mat-form-field *ngIf="columnForm.value.type === 'Dropdown'">
<mat-label>Column Code</mat-label>
<mat-label> {{'labels.inputs.Column Code' | translate }}</mat-label>
<mat-select required formControlName="code">
<mat-option *ngFor="let columnCode of data.columnCodes" [value]="columnCode.name">
{{ columnCode.name }}
@@ -38,15 +38,15 @@
</mat-form-field>
<div>
<mat-checkbox labelPosition="after" formControlName="mandatory">Mandatory</mat-checkbox>
<mat-checkbox labelPosition="after" formControlName="mandatory">{{'labels.text.Mandatory' | translate}}</mat-checkbox>
</div>
<div>
<mat-checkbox labelPosition="after" formControlName="unique">Unique</mat-checkbox>
<mat-checkbox labelPosition="after" formControlName="unique">{{'labels.inputs.Unique' | translate}}</mat-checkbox>
</div>
<div>
<mat-checkbox labelPosition="after" formControlName="indexed">Indexed</mat-checkbox>
<mat-checkbox labelPosition="after" formControlName="indexed">{{'labels.inputs.Indexed' | translate}}</mat-checkbox>
</div>
</div>
@@ -56,7 +56,7 @@
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button mat-dialog-close>Cancel</button>
<button mat-button mat-dialog-close>{{'labels.buttons.Cancel' | translate }}</button>
<button mat-raised-button color="primary" [disabled]="!columnForm.valid || columnForm.pristine"
(click)="submit()">Submit</button>
(click)="submit()">{{'labels.buttons.Submit' | translate }}</button>
</mat-dialog-actions>
@@ -9,45 +9,45 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="40%">
<mat-label>Data Table Name</mat-label>
<mat-label>{{'labels.inputs.Data Table Name' | translate}}</mat-label>
<input matInput required formControlName="datatableName">
<mat-error *ngIf="dataTableForm.controls.datatableName.hasError('required')">
Data Table Name is <strong>required</strong>
{{'labels.inputs.Data Table Name' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="20%">
<mat-label>Entity Type</mat-label>
<mat-label>{{'labels.inputs.Entity Type' | translate}}</mat-label>
<mat-select required formControlName="apptableName">
<mat-option *ngFor="let appTable of appTableData" [value]="appTable.value">
{{ appTable.displayValue }}
{{ appTable.displayValue | translateKey:'inputs'}}
</mat-option>
</mat-select>
<mat-error *ngIf="dataTableForm.controls.apptableName.hasError('required')">
Application Table Name is <strong>required</strong>
{{'labels.inputs.Application Table Name' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="20%" *ngIf="showEntitySubType">
<mat-label>Entity SubType</mat-label>
<mat-label>{{'labels.inputs.Entity SubType' | translate}}</mat-label>
<mat-select formControlName="entitySubType">
<mat-option *ngFor="let entitySubType of entitySubTypeData" [value]="entitySubType.value">
{{ entitySubType.displayValue }}
{{ entitySubType.displayValue | translateKey:'inputs' }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="20%" *ngIf="showSavingsSubType">
<mat-label>Savings SubType</mat-label>
<mat-label>{{ 'labels.inputs.Savings SubType' | translate }}</mat-label>
<mat-select formControlName="entitySubType">
<mat-option *ngFor="let savingsSubType of savingsSubTypeData" [value]="savingsSubType.value">
{{ savingsSubType.displayValue }}
{{ savingsSubType.displayValue | translateKey:'inputs'}}
</mat-option>
</mat-select>
</mat-form-field>
<div fxFlex="14%" class="multi-row-wrapper">
<mat-checkbox labelPosition="before" formControlName="multiRow" class="multi-row">Multi Row</mat-checkbox>
<mat-checkbox labelPosition="before" formControlName="multiRow" class="multi-row">{{'labels.inputs.Multi Row' | translate }}</mat-checkbox>
</div>
</div>
@@ -55,11 +55,11 @@
<div fxLayout="row wrap" fxLayoutGap="60%" fxLayout.lt-md="column">
<p fxFlex="20%" class="mat-title">Columns</p>
<p fxFlex="20%" class="mat-title">{{'labels.inputs.Columns' | translate}}</p>
<button mat-raised-button fxFlex="20%" type="button" color="primary" (click)="addColumn()">
<fa-icon icon="plus" class="m-r-10"></fa-icon>
Add Column
{{'labels.buttons.Add' | translate}} {{'labels.inputs.Columns' | translate}}
</button>
</div>
@@ -69,7 +69,7 @@
<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 column"> {{ column.columnName }}
<fa-icon *ngIf="column.isColumnPrimaryKey" icon="check-circle" size="lg" class="column-mandatory"
matTooltip="Primary Key" matTooltipPosition="right"></fa-icon>
@@ -77,22 +77,22 @@
</ng-container>
<ng-container matColumnDef="type">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Type </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Type' | translate}} </th>
<td mat-cell *matCellDef="let column"> {{ column.columnDisplayType }} </td>
</ng-container>
<ng-container matColumnDef="length">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Length </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Length' | translate}} </th>
<td mat-cell *matCellDef="let column"> {{ column.columnLength }} </td>
</ng-container>
<ng-container matColumnDef="code">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Code </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'labels.inputs.Code' | translate }} </th>
<td mat-cell *matCellDef="let column"> {{ column.columnCode }} </td>
</ng-container>
<ng-container matColumnDef="mandatory">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Mandatory </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.text.Mandatory' | translate}} </th>
<td mat-cell *matCellDef="let column" class="left">
<fa-icon *ngIf="!column.isColumnNullable" icon="check-circle" size="lg" class="column-mandatory"
matTooltip="Yes" matTooltipPosition="right"></fa-icon>
@@ -102,7 +102,7 @@
</ng-container>
<ng-container matColumnDef="unique">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Unique </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.inputs.Unique' | translate}} </th>
<td mat-cell *matCellDef="let column">
<fa-icon *ngIf="column.isColumnUnique" icon="check-circle" size="lg" class="column-mandatory"
matTooltip="Yes" matTooltipPosition="right"></fa-icon>
@@ -112,7 +112,7 @@
</ng-container>
<ng-container matColumnDef="indexed">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Indexed </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.inputs.Indexed' | translate}} </th>
<td mat-cell *matCellDef="let column">
<fa-icon *ngIf="column.isColumnIndexed" icon="check-circle" size="lg" class="column-mandatory"
matTooltip="Yes" matTooltipPosition="right"></fa-icon>
@@ -122,7 +122,7 @@
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Actions </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'labels.inputs.Actions' | translate }} </th>
<td mat-cell *matCellDef="let column" fxLayoutGap="15%">
<button type="button" color="primary" mat-icon-button (click)="editColumn(column)">
<fa-icon icon="edit" size="lg"></fa-icon>
@@ -143,9 +143,9 @@
</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 type="button" mat-raised-button [routerLink]="['../']">{{'labels.buttons.Cancel' | translate }}</button>
<button mat-raised-button color="primary"
[disabled]="!dataTableForm.valid || columnData.length === 0">Submit</button>
[disabled]="!dataTableForm.valid || columnData.length === 0">{{'labels.buttons.Submit' | translate }}</button>
</mat-card-actions>
</form>
@@ -155,12 +155,12 @@
</div>
<ng-template #templateDataTableFormRef let-popover="popover">
<h2>Create Datatable</h2>
<p class="mw400">Click to start filling the details. * mark fields are neccessary. For more details click: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/52592760/Manage+Data+Tables" target="_blank">Manage Datatables</a></p>
<h2>{{'labels.buttons.Create Datatable' | translate }}</h2>
<p class="mw400">{{'labels.text.Filling Details' | translate }} <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/52592760/Manage+Data+Tables" target="_blank">Manage Datatables</a></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();">Create Datatable</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStep()">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();">{{'labels.buttons.Create Datatable' | 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();nextStep()">{{'labels.buttons.Next' | translate }}</button>
</div>
</ng-template>
@@ -1,25 +1,26 @@
/** Angular Imports */
import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
import { AfterViewInit, Component, ElementRef, OnInit, TemplateRef, ViewChild } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { ActivatedRoute, Router } from '@angular/router';
/** Custom Services */
import { SystemService } from '../../system.service';
import { PopoverService } from '../../../configuration-wizard/popover/popover.service';
import { ConfigurationWizardService } from '../../../configuration-wizard/configuration-wizard.service';
import { PopoverService } from '../../../configuration-wizard/popover/popover.service';
import { SystemService } from '../../system.service';
/** Data Imports */
import { appTableData, entitySubTypeData, savingsSubTypeData } from '../app-table-data';
/** Custom Components */
import { ColumnDialogComponent } from '../column-dialog/column-dialog.component';
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
import { ColumnDialogComponent } from '../column-dialog/column-dialog.component';
/** Custom Dialog Component */
import { TranslateService } from '@ngx-translate/core';
import { ContinueSetupDialogComponent } from '../../../configuration-wizard/continue-setup-dialog/continue-setup-dialog.component';
import { DatatableColumn } from '../datatable-column.model';
@@ -78,6 +79,7 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
* @param {MatDialog} dialog Dialog Reference.
* @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
* @param {PopoverService} popoverService PopoverService.
* @param {TranslateService} translateService Translate Service.
*/
constructor(private formBuilder: UntypedFormBuilder,
private systemService: SystemService,
@@ -85,7 +87,8 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
private router: Router,
private dialog: MatDialog,
private configurationWizardService: ConfigurationWizardService,
private popoverService: PopoverService) {
private popoverService: PopoverService,
private translateService: TranslateService) {
this.route.data.subscribe((data: { columnCodes: any }) => {
this.dataForDialog.columnCodes = data.columnCodes;
});
@@ -199,7 +202,7 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
*/
deleteColumn(column: any) {
const deleteColumnDialogRef = this.dialog.open(DeleteDialogComponent, {
data: { deleteContext: `column ${column.name}` }
data: { deleteContext: this.translateService.instant('labels.inputs.Column') + ' ' + column.name}
});
deleteColumnDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
@@ -9,27 +9,27 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="40%">
<mat-label>Data Table Name</mat-label>
<mat-label>{{'labels.inputs.Data Table Name' | translate}}</mat-label>
<input matInput required formControlName="datatableName">
</mat-form-field>
<mat-form-field fxFlex="20%">
<mat-label>Application Table Name</mat-label>
<mat-label>{{'labels.inputs.Application Table Name' | translate}}</mat-label>
<mat-select required formControlName="apptableName">
<mat-option *ngFor="let appTable of appTableData" [value]="appTable.value">
{{ appTable.displayValue }}
{{ appTable.displayValue | translateKey:'inputs'}}
</mat-option>
</mat-select>
<mat-error *ngIf="dataTableForm.controls.apptableName.hasError('required')">
Application Table Name is <strong>required</strong>
{{'labels.inputs.Application Table Name' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="20%" *ngIf="showEntitySubType">
<mat-label>Entity SubType</mat-label>
<mat-label>{{'labels.inputs.Entity SubType' | translate}}</mat-label>
<mat-select formControlName="entitySubType">
<mat-option *ngFor="let entitySubType of entitySubTypeData" [value]="entitySubType.value">
{{ entitySubType.displayValue }}
{{ entitySubType.displayValue | translateKey:'inputs'}}
</mat-option>
</mat-select>
</mat-form-field>
@@ -39,11 +39,11 @@
<div fxLayout="row wrap" fxLayoutGap="60%" fxLayout.lt-md="column">
<p fxFlex="20%" class="mat-title">Columns</p>
<p fxFlex="20%" class="mat-title">{{'labels.inputs.Columns' | translate}}</p>
<button mat-raised-button fxFlex="20%" type="button" color="primary" (click)="addColumn()">
<fa-icon icon="plus" class="m-r-10"></fa-icon>
Add Column
{{'labels.buttons.Add' | translate}} {{'labels.inputs.Columns' | translate}}
</button>
</div>
@@ -53,27 +53,27 @@
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Name </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{ 'labels.inputs.Name' | translate}} </th>
<td mat-cell *matCellDef="let column"> {{ column.columnName }}</td>
</ng-container>
<ng-container matColumnDef="type">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Type </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.inputs.Type' | translate}} </th>
<td mat-cell *matCellDef="let column"> {{ column.columnDisplayType }} </td>
</ng-container>
<ng-container matColumnDef="length">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Length </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.inputs.Length' | translate}} </th>
<td mat-cell *matCellDef="let column"> {{ column.columnLength }} </td>
</ng-container>
<ng-container matColumnDef="code">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Code </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{ 'labels.inputs.Code' | translate }} </th>
<td mat-cell *matCellDef="let column"> {{ column.columnCode }} </td>
</ng-container>
<ng-container matColumnDef="mandatory">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Mandatory </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.text.Mandatory' | translate}} </th>
<td mat-cell *matCellDef="let column">
<fa-icon *ngIf="!column.isColumnNullable" icon="check-circle" size="lg" class="column-mandatory"
matTooltip="Yes" matTooltipPosition="right"></fa-icon>
@@ -83,7 +83,7 @@
</ng-container>
<ng-container matColumnDef="unique">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Unique </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.inputs.Unique' | translate}} </th>
<td mat-cell *matCellDef="let column">
<fa-icon *ngIf="column.isColumnUnique" icon="check-circle" size="lg" class="column-mandatory"
matTooltip="Yes" matTooltipPosition="right"></fa-icon>
@@ -93,7 +93,7 @@
</ng-container>
<ng-container matColumnDef="indexed">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Indexed </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.inputs.Indexed' | translate}} </th>
<td mat-cell *matCellDef="let column">
<fa-icon *ngIf="column.isColumnIndexed" icon="check-circle" size="lg" class="column-mandatory"
matTooltip="Yes" matTooltipPosition="right"></fa-icon>
@@ -103,7 +103,7 @@
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Actions </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{ 'labels.inputs.Actions' | translate }} </th>
<td mat-cell *matCellDef="let column" fxLayoutGap="15%" class="center">
<button type="button" color="primary" mat-icon-button (click)="editColumn(column)" *ngIf="!column.system">
<fa-icon icon="edit" size="lg"></fa-icon>
@@ -124,9 +124,9 @@
</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 type="button" mat-raised-button [routerLink]="['../']">{{'labels.buttons.Cancel' | translate }}</button>
<button mat-raised-button color="primary" [disabled]="!isFormEdited"
*mifosxHasPermission="'UPDATE_DATATABLE'">Submit</button>
*mifosxHasPermission="'UPDATE_DATATABLE'">{{'labels.buttons.Submit' | translate }}</button>
</mat-card-actions>
</form>
@@ -1,11 +1,11 @@
/** Angular Imports */
import { Component, OnInit, ViewChild } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { ActivatedRoute, Router } from '@angular/router';
/** Custom Services */
import { SystemService } from '../../system.service';
@@ -14,8 +14,9 @@ import { SystemService } from '../../system.service';
import { appTableData, entitySubTypeData } from '../app-table-data';
/** Custom Components */
import { ColumnDialogComponent } from '../column-dialog/column-dialog.component';
import { TranslateService } from '@ngx-translate/core';
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
import { ColumnDialogComponent } from '../column-dialog/column-dialog.component';
import { DatatableColumn } from '../datatable-column.model';
/**
@@ -84,7 +85,8 @@ export class EditDataTableComponent implements OnInit {
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router,
private dialog: MatDialog) {
private dialog: MatDialog,
private translateService: TranslateService) {
this.route.data.subscribe((data: { dataTable: any, columnCodes: any }) => {
this.dataTableData = data.dataTable;
this.dataTableData.columnHeaderData.forEach((item: any) => {
@@ -282,7 +284,7 @@ export class EditDataTableComponent implements OnInit {
*/
deleteColumn(column: any) {
const deleteColumnDialogRef = this.dialog.open(DeleteDialogComponent, {
data: { deleteContext: `column ${column.columnName}` }
data: { deleteContext: this.translateService.instant('labels.inputs.Column') + ' ' + column.columnName}
});
deleteColumnDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
@@ -2,7 +2,7 @@
<div #createDatatableRef class="in-block">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_DATATABLE'">
<fa-icon icon="plus" class="m-r-10"></fa-icon>
Create Data Table
{{'labels.buttons.Create Data Table' | translate}}
</button>
</div>
</div>
@@ -21,17 +21,17 @@
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="registeredTableName">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Data Table Name </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Data Table Name' | translate}} </th>
<td mat-cell *matCellDef="let dataTable"> {{ dataTable.registeredTableName }} </td>
</ng-container>
<ng-container matColumnDef="applicationTableName">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Associated With </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Associated With' | translate}} </th>
<td mat-cell *matCellDef="let dataTable"> {{ dataTable.applicationTableName }} </td>
</ng-container>
<ng-container matColumnDef="entitySubType">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Sub Type </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Sub Type' | translate}} </th>
<td mat-cell *matCellDef="let dataTable"> {{ dataTable.entitySubType }} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
@@ -46,8 +46,8 @@
</div>
<ng-template #templateCreateDatatableRef let-popover="popover">
<h2>Create Data Table</h2>
<p class="mw300">This will launch a page that will allow you to create a new data table.</p>
<h2>{{'labels.buttons.Create Data Table' | translate}}</h2>
<p class="mw300">{{'labels.text.Launch a page that create new data table' | 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>
@@ -56,7 +56,7 @@
</ng-template>
<ng-template #templateFilter let-popover="popover">
<h4>Search bar to filter datatables.</h4>
<h4>{{'labels.heading.Search bar to filter datatables' | 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(templateCreateDatatableRef,createDatatableRef,'bottom', true);">Back</button>
@@ -65,10 +65,10 @@
</ng-template>
<ng-template #templateDatatablesList let-popover="popover">
<h4>List of all currently available data tables.</h4>
<h4>{{'labels.heading.List of all currently available data tables' | 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(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>
@@ -2,12 +2,12 @@
<button mat-raised-button color="primary" [routerLink]="['edit']" *mifosxHasPermission="'UPDATE_DATATABLE'">
<fa-icon icon="edit" class="m-r-10"></fa-icon>
Edit
{{'labels.buttons.Edit' | translate }}
</button>
<button mat-raised-button color="warn" (click)="delete()" *mifosxHasPermission="'DELETE_DATATABLE'">
<fa-icon icon="trash" class="m-r-10"></fa-icon>
Delete
{{'labels.buttons.Delete' | translate }}
</button>
</div>
@@ -20,7 +20,7 @@
<div fxLayout="row wrap" fxLayout.lt-md="column" fxLayoutGap="12px">
<div class="mat-body-strong">
Associated With
{{'labels.inputs.Associated With' | translate}}
</div>
<div>
{{ dataTableData.applicationTableName }}
@@ -39,27 +39,27 @@
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="columnName">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Field Name </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.inputs.Field Name' | translate}} </th>
<td mat-cell *matCellDef="let dataTableColumn"> {{ dataTableColumn.columnName }}</td>
</ng-container>
<ng-container matColumnDef="columnDisplayType">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Type </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.inputs.Type' | translate}} </th>
<td mat-cell *matCellDef="let dataTable"> {{ dataTable.columnDisplayType }} </td>
</ng-container>
<ng-container matColumnDef="columnLength">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Length </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.inputs.Length' | translate}} </th>
<td mat-cell *matCellDef="let dataTable"> {{ dataTable.columnLength }} </td>
</ng-container>
<ng-container matColumnDef="columnCode">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Code </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{ 'labels.inputs.Code' | translate }} </th>
<td mat-cell *matCellDef="let dataTable"> {{ dataTable.columnCode }} </td>
</ng-container>
<ng-container matColumnDef="isColumnNullable">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Mandatory </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.text.Mandatory' | translate}} </th>
<td mat-cell *matCellDef="let dataTable">
<fa-icon *ngIf="!dataTable.isColumnNullable" icon="check-circle" size="lg" class="column-mandatory"
matTooltip="Yes" matTooltipPosition="right"></fa-icon>
@@ -69,7 +69,7 @@
</ng-container>
<ng-container matColumnDef="isColumnUnique">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Unique </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.inputs.Unique' | translate}} </th>
<td mat-cell *matCellDef="let dataTable">
<fa-icon *ngIf="dataTable.isColumnUnique" icon="check-circle" size="lg" class="column-mandatory"
matTooltip="Yes" matTooltipPosition="right"></fa-icon>
@@ -79,7 +79,7 @@
</ng-container>
<ng-container matColumnDef="isColumnIndexed">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> Indexed </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="center"> {{'labels.inputs.Indexed' | translate}} </th>
<td mat-cell *matCellDef="let dataTable">
<fa-icon *ngIf="dataTable.isColumnIndexed" icon="check-circle" size="lg" class="column-mandatory"
matTooltip="Yes" matTooltipPosition="right"></fa-icon>
@@ -1,15 +1,16 @@
/** Angular Imports */
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { ActivatedRoute, Router } from '@angular/router';
/** Custom Services */
import { SystemService } from '../../system.service';
/** Custom Components */
import { TranslateService } from '@ngx-translate/core';
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
/**
@@ -42,11 +43,13 @@ export class ViewDataTableComponent implements OnInit {
* @param {SystemService} systemService System Service.
* @param {Router} router Router for navigation.
* @param {MatDialog} dialog Dialog reference.
* @param {TranslateService} translateService Translate Service.
*/
constructor(private route: ActivatedRoute,
private systemService: SystemService,
private router: Router,
private dialog: MatDialog) {
private dialog: MatDialog,
private translateService: TranslateService) {
this.route.data.subscribe((data: { dataTable: any }) => {
this.dataTableData = data.dataTable;
this.columnsData = this.dataTableData.columnHeaderData;
@@ -76,7 +79,7 @@ export class ViewDataTableComponent implements OnInit {
*/
delete() {
const deleteDataTableDialogRef = this.dialog.open(DeleteDialogComponent, {
data: { deleteContext: `data table ${this.dataTableData.registeredTableName}` }
data: { deleteContext: this.translateService.instant('labels.inputs.Data Table') + ' ' + this.dataTableData.registeredTableName}
});
deleteDataTableDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {