entitytoentitymappingtranslation
This commit is contained in:
committed by
Jose Alberto Hernandez
parent
02bf1249b1
commit
83f9a0e499
@@ -33,13 +33,13 @@
|
||||
<mat-card>
|
||||
|
||||
<form [formGroup]="filterPreferenceForm" (ngSubmit)="showFilteredData()">
|
||||
<mat-card-title> {{firstMappingEntity}} {{'labels.text.access to' | translate}} {{secondMappingEntity}} </mat-card-title>
|
||||
<mat-card-title> {{firstMappingEntity| translateKey:'inputs'}} {{'labels.text.access to' | translate}} {{secondMappingEntity | translateKey:'text'}} </mat-card-title>
|
||||
<mat-card-content>
|
||||
|
||||
<div fxLayout="row" fxLayoutAlign="space-evenly center">
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>{{firstMappingEntity}}</mat-label>
|
||||
<mat-label>{{firstMappingEntity | translateKey:'inputs'}}</mat-label>
|
||||
<mat-select required formControlName="mappingFirstParamId">
|
||||
<mat-option [value]="0">
|
||||
{{'labels.inputs.All' | translate}}
|
||||
@@ -49,12 +49,12 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="filterPreferenceForm.controls.mappingFirstParamId.hasError('required')">
|
||||
{{firstMappingEntity}} {{ "labels.commons.is" | translate}} <strong>{{ "labels.commons.required" | translate}}</strong>
|
||||
{{firstMappingEntity | translateKey:'inputs'}} {{ "labels.commons.is" | translate}} <strong>{{ "labels.commons.required" | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>{{secondMappingEntity}}</mat-label>
|
||||
<mat-label>{{secondMappingEntity | translateKey:'text'}}</mat-label>
|
||||
<mat-select required formControlName="mappingSecondParamId">
|
||||
<mat-option [value]="0">
|
||||
{{'labels.inputs.All' | translate}}
|
||||
@@ -64,7 +64,7 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="filterPreferenceForm.controls.mappingSecondParamId.hasError('required')">
|
||||
{{secondMappingEntity}} {{ "labels.commons.is" | translate}} <strong>{{ "labels.commons.required" | translate}}</strong>
|
||||
{{secondMappingEntity | translateKey:'text'}} {{ "labels.commons.is" | translate}} <strong>{{ "labels.commons.required" | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
@@ -82,12 +82,12 @@
|
||||
<div>
|
||||
<table mat-table [dataSource]="entityMappingsListData">
|
||||
<ng-container matColumnDef="fromentity">
|
||||
<th mat-header-cell *matHeaderCellDef> {{firstMappingEntity}} </th>
|
||||
<th mat-header-cell *matHeaderCellDef> {{firstMappingEntity | translateKey:'inputs'}} </th>
|
||||
<td mat-cell *matCellDef="let listdata"> {{ listdata.fromEntity }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="toentity">
|
||||
<th mat-header-cell *matHeaderCellDef> {{secondMappingEntity}} </th>
|
||||
<th mat-header-cell *matHeaderCellDef> {{secondMappingEntity | translateKey:'text'}} </th>
|
||||
<td mat-cell *matCellDef="let listdata"> {{ listdata.toEntity }} </td>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@@ -7,17 +7,18 @@ import { MatTableDataSource } from '@angular/material/table';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { SystemService } from 'app/system/system.service';
|
||||
import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { SystemService } from 'app/system/system.service';
|
||||
|
||||
/** Custom Components */
|
||||
import { DeleteDialogComponent } from '../../shared/delete-dialog/delete-dialog.component';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
|
||||
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
||||
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
|
||||
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
|
||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
import { DeleteDialogComponent } from '../../shared/delete-dialog/delete-dialog.component';
|
||||
|
||||
/**
|
||||
* Entity to Entity Mapping Component
|
||||
@@ -78,13 +79,15 @@ export class EntityToEntityMappingComponent implements OnInit {
|
||||
/**
|
||||
* Retrieves the codes data from `resolve`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {TranslateService} translateService Translate Service.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private systemService: SystemService,
|
||||
private dateUtils: Dates,
|
||||
private dialog: MatDialog,
|
||||
private settingsService: SettingsService) {
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private systemService: SystemService,
|
||||
private dateUtils: Dates,
|
||||
private dialog: MatDialog,
|
||||
private settingsService: SettingsService,
|
||||
private translateService: TranslateService) {
|
||||
this.route.data.subscribe((data: { entityMappings: any }) => {
|
||||
this.entityMappings = data.entityMappings;
|
||||
});
|
||||
@@ -215,31 +218,31 @@ export class EntityToEntityMappingComponent implements OnInit {
|
||||
const formfields: FormfieldBase[] = [
|
||||
new SelectBase({
|
||||
controlName: 'fromId',
|
||||
label: this.firstMappingEntity,
|
||||
label: this.translateService.instant(`labels.inputs.${this.firstMappingEntity}`),
|
||||
options: { label: 'name', value: 'id', data: this.firstEntityData },
|
||||
required: true
|
||||
}),
|
||||
new SelectBase({
|
||||
controlName: 'toId',
|
||||
label: this.secondMappingEntity,
|
||||
label: this.translateService.instant(`labels.text.${this.secondMappingEntity}`),
|
||||
options: { label: 'name', value: 'id', data: this.secondEntityData },
|
||||
required: true
|
||||
}),
|
||||
new DatepickerBase({
|
||||
controlName: 'startDate',
|
||||
label: 'Start Date',
|
||||
label: this.translateService.instant('labels.inputs.Start Date'),
|
||||
type: 'date',
|
||||
required: false
|
||||
}),
|
||||
new DatepickerBase({
|
||||
controlName: 'endDate',
|
||||
label: 'End Date',
|
||||
label: this.translateService.instant('labels.inputs.End Date'),
|
||||
type: 'date',
|
||||
required: false
|
||||
})
|
||||
];
|
||||
const data = {
|
||||
title: 'Add Entity to Entity Mapping',
|
||||
title: this.translateService.instant('labels.buttons.Add') +' '+this.translateService.instant('labels.heading.Entity to Entity Mapping'),
|
||||
layout: { addButtonText: 'Confirm' },
|
||||
formfields: formfields
|
||||
};
|
||||
@@ -266,31 +269,31 @@ export class EntityToEntityMappingComponent implements OnInit {
|
||||
const formfields: FormfieldBase[] = [
|
||||
new SelectBase({
|
||||
controlName: 'fromId',
|
||||
label: this.firstMappingEntity,
|
||||
label: this.translateService.instant(`labels.inputs.${this.firstMappingEntity}`),
|
||||
options: { label: 'name', value: 'id', data: this.firstEntityData },
|
||||
required: true
|
||||
}),
|
||||
new SelectBase({
|
||||
controlName: 'toId',
|
||||
label: this.secondMappingEntity,
|
||||
label: this.translateService.instant(`labels.text.${this.secondMappingEntity}`),
|
||||
options: { label: 'name', value: 'id', data: this.secondEntityData },
|
||||
required: true
|
||||
}),
|
||||
new DatepickerBase({
|
||||
controlName: 'startDate',
|
||||
label: 'Start Date',
|
||||
label: this.translateService.instant('labels.inputs.Start Date'),
|
||||
type: 'date',
|
||||
required: false
|
||||
}),
|
||||
new DatepickerBase({
|
||||
controlName: 'endDate',
|
||||
label: 'End Date',
|
||||
label: this.translateService.instant('labels.inputs.End Date'),
|
||||
type: 'date',
|
||||
required: false
|
||||
})
|
||||
];
|
||||
const data = {
|
||||
title: 'Edit Entity to Entity Mapping',
|
||||
title: this.translateService.instant('labels.buttons.Edit') +' '+this.translateService.instant('labels.heading.Entity to Entity Mapping'),
|
||||
layout: { addButtonText: 'Confirm' },
|
||||
formfields: formfields
|
||||
};
|
||||
@@ -358,7 +361,7 @@ export class EntityToEntityMappingComponent implements OnInit {
|
||||
*/
|
||||
delete(id: number) {
|
||||
const deleteNoteDialogRef = this.dialog.open(DeleteDialogComponent, {
|
||||
data: { deleteContext: `Mapping id: ${id}` }
|
||||
data: { deleteContext: this.translateService.instant('labels.inputs.Mapping id') + ' ' + id }
|
||||
});
|
||||
deleteNoteDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.delete) {
|
||||
|
||||
Reference in New Issue
Block a user