Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/94_console_31' into 3.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
nardil committed Jul 24, 2019
2 parents e06777f + 019de58 commit 0a05b11
Show file tree
Hide file tree
Showing 17 changed files with 115 additions and 18 deletions.
2 changes: 1 addition & 1 deletion wars/web-console/src/main/angular/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"ng": "ng",
"lock modules": "npm shrinkwrap",
"proxy-start": "ng serve --proxy-config proxy.config.json",
"proxy-start-ip-wifi": "ng serve --proxy-config proxy.config.json --host 192.168.2.120",
"proxy-start-ip-wifi": "ng serve --proxy-config proxy.config.json --host 192.168.2.133",
"build": "ng build --prod --aot false --output-hashing=none",
"test": "ng test",
"lint": "ng lint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ export class ApplicazioniViewComponent implements IModalDialog, OnInit, AfterVie

if(this.json.domini && this.json.domini.length != 0) {
this.json.domini.forEach((item, index) => {
_dettaglio.domini.push(new Dato({ label: (index != 0)?'':Voce.DOMINI, value: item.ragioneSociale }));
_dettaglio.domini.push(new Dato({ label: (index != 0)?'':Voce.ENTI_CREDITORI, value: item.ragioneSociale }));
});
} else {
_dettaglio.domini.push(new Dato({ label: Voce.DOMINI, value: Voce.NESSUNO }));
_dettaglio.domini.push(new Dato({ label: Voce.ENTI_CREDITORI, value: Voce.NESSUNO }));
}
if(this.json.tipiPendenza && this.json.tipiPendenza.length != 0) {
this.json.tipiPendenza.forEach((item, index) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<p class="color-gray pt-2 mt-3 mb-2">{{voce.AUTORIZZAZIONI}}</p>
<div class="w-100 my-4">
<mat-form-field class="w-100" color="accent" [formGroup]="fGroup">
<mat-select [placeholder]="voce.DOMINI" formControlName="dominio_ctrl" multiple [compareWith]="dominioCmpFn">
<mat-select [placeholder]="voce.ENTI_CREDITORI" formControlName="dominio_ctrl" multiple [compareWith]="dominioCmpFn">
<mat-option *ngFor="let item of domini" [value]="item">{{item.ragioneSociale}}</mat-option>
</mat-select>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="col-12 col-lg-2"></div>
<div class="col-12 col-lg-8">
<mat-form-field class="w-100" color="accent" [formGroup]="fGroup" *ngIf="_jsonFormInput">
<mat-select placeholder="Dominio" formControlName="idDominio_ctrl" multiple required>
<mat-select [placeholder]="_voce.ENTE_CREDITORE" formControlName="idDominio_ctrl" multiple required>
<mat-option *ngFor="let item of json.values" [value]="item">{{item.label}}</mat-option>
</mat-select>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export class DominioViewComponent implements IFormComponent, OnInit, AfterViewIn
@Input() fGroup: FormGroup;
@Input() json: any;

protected _voce = Voce;

protected SVG: string = 'data:image/svg+xml;base64,';
protected _jsonFormInput: boolean = false;
protected _name: string = '';
Expand Down Expand Up @@ -298,6 +300,7 @@ export class DominioViewComponent implements IFormComponent, OnInit, AfterViewIn
import { Inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
import { Dato } from '../../../../../../classes/view/dato';
import { Voce } from '../../../../../../services/voce.service';

@Component({
selector: 'link-alert-dialog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<p class="color-gray pt-4 mb-2">{{voce.AUTORIZZAZIONI}}</p>
<div class="w-100">
<mat-form-field class="w-100" color="accent" [formGroup]="fGroup">
<mat-select [placeholder]="voce.DOMINI" formControlName="dominio_ctrl" multiple [compareWith]="dominioCmpFn">
<mat-select [placeholder]="voce.ENTI_CREDITORI" formControlName="dominio_ctrl" multiple [compareWith]="dominioCmpFn">
<mat-option *ngFor="let item of domini" [value]="item">{{item.ragioneSociale}}</mat-option>
</mat-select>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<div class="col-12 col-lg-8">
<mat-card class="shadow no-border-radius mb-4">
<mat-form-field class="w-100" color="accent" [formGroup]="fGroup">
<mat-select placeholder="Dominio" formControlName="domini_ctrl"
(selectionChange)="_dominiChangeSelection($event)" required>
<mat-select [placeholder]="_voce.ENTE_CREDITORE" formControlName="domini_ctrl"
(selectionChange)="_dominiChangeSelection($event)" [compareWith]="dominioCmpFn" required>
<mat-option *ngFor="let item of _domini" [value]="item">{{item.ragioneSociale}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field class="w-100" color="accent" [formGroup]="fGroup">
<mat-select placeholder="Tipo pendenza" formControlName="tipiPendenzaDominio_ctrl"
(selectionChange)="_tipiPendenzaDominioChangeSelection($event)" required>
(selectionChange)="_tipiPendenzaDominioChangeSelection($event)" [compareWith]="tipoPendenzaDominioCmpFn" required>
<mat-option *ngFor="let item of _tipiPendenzaDominio" [value]="item">{{item.descrizione}}</mat-option>
</mat-select>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { ModalBehavior } from '../../../../../../classes/modal-behavior';
import { GovpayService } from '../../../../../../services/govpay.service';
import { GeneratorsEntryPointList } from '../../../../../../classes/generators-entry-point-list';
import { Voce } from '../../../../../../services/voce.service';

@Component({
selector: 'link-scheda-pendenza-view',
Expand All @@ -19,6 +20,8 @@ export class SchedaPendenzaViewComponent implements IModalDialog, IFormComponent
@Input() fGroup: FormGroup;
@Input() json: any;

protected _voce = Voce;

protected _domini: any[];
protected _tipiPendenzaDominio: any[];

Expand Down Expand Up @@ -61,12 +64,25 @@ export class SchedaPendenzaViewComponent implements IModalDialog, IFormComponent
}
}

protected dominioCmpFn(d1: any, d2: any): boolean {
return (d1 && d2)?(d1.idDominio === d2.idDominio):(d1 === d2);
}

protected tipoPendenzaDominioCmpFn(p1: any, p2: any): boolean {
return (p1 && p2)?(p1.idTipoPendenza === p2.idTipoPendenza):(p1 === p2);
}

protected _loadDomini() {
const _service = UtilService.URL_DOMINI;
this.gps.getDataService(_service).subscribe(
(response) => {
this.gps.updateSpinner(false);
this._domini = (response && response.body)?response.body['risultati']:[];
if(this._domini.length == 1) {
const _fdom = this._domini[0];
this.fGroup.controls['domini_ctrl'].setValue(_fdom);
this._dominiChangeSelection({ value: _fdom });
}
},
(error) => {
this.gps.updateSpinner(false);
Expand All @@ -88,6 +104,11 @@ export class SchedaPendenzaViewComponent implements IModalDialog, IFormComponent
this.gps.updateSpinner(false);
this.fGroup.controls['tipiPendenzaDominio_ctrl'].enable();
this._tipiPendenzaDominio = (response && response.body)?response.body['risultati']:[];
if(this._tipiPendenzaDominio.length == 1) {
const _ftpdom = this._tipiPendenzaDominio[0];
this.fGroup.controls['tipiPendenzaDominio_ctrl'].setValue(_ftpdom);
this._tipiPendenzaDominioChangeSelection({ value: _ftpdom });
}
},
(error) => {
this.gps.updateSpinner(false);
Expand Down Expand Up @@ -145,6 +166,9 @@ export class SchedaPendenzaViewComponent implements IModalDialog, IFormComponent

protected _createJsForm() {
const componentType = GeneratorsEntryPointList.getComponentByName(this._componentRefType);
this._formOptions['defautWidgetOptions'] = {
validationMessages: Voce.VALIDATION_IT_MESSAGES
};
this._mapByComponentType(componentType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class DominiViewComponent implements IModalDialog, OnInit, AfterViewInit
_mb.editMode = true;
_mb.info = {
viewModel: this.json,
dialogTitle: 'Modifica dominio',
dialogTitle: Voce.MODIFICA_ENTE_CREDITORE,
templateName: UtilService.DOMINIO
};
_mb.async_callback = this.save.bind(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ export class OperatoriViewComponent implements IModalDialog, OnInit {

if(this.json.domini && this.json.domini.length != 0) {
this.json.domini.forEach((item, index) => {
_dettaglio.domini.push(new Dato({ label: (index != 0)?'':Voce.DOMINI, value: item.ragioneSociale }));
_dettaglio.domini.push(new Dato({ label: (index != 0)?'':Voce.ENTI_CREDITORI, value: item.ragioneSociale }));
});
} else {
_dettaglio.domini.push(new Dato({ label: Voce.DOMINI, value: Voce.NESSUNO }));
_dettaglio.domini.push(new Dato({ label: Voce.ENTI_CREDITORI, value: Voce.NESSUNO }));
}
if(this.json.tipiPendenza && this.json.tipiPendenza.length != 0) {
this.json.tipiPendenza.forEach((item, index) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class SideListComponent implements OnInit, OnDestroy, IExport {
break;
case UtilService.URL_DOMINI:
_mb.info = {
dialogTitle: 'Nuovo dominio',
dialogTitle: Voce.NUOVO_ENTE_CREDITORE,
templateName: UtilService.DOMINIO
};
_component = this.ls.componentRefByName(UtilService.DOMINI);
Expand Down Expand Up @@ -432,7 +432,7 @@ export class SideListComponent implements OnInit, OnDestroy, IExport {
tmpValue.push(item.ragioneSocialeDominio?item.ragioneSocialeDominio:item.idDominio);
tmpValue.push(item.ragioneSocialePsp?item.ragioneSocialePsp:item.idPsp);
_st = Dato.arraysToDato(
[ Voce.DATA, Voce.DOMINIO, Voce.PSP ],
[ Voce.DATA, Voce.ENTE_CREDITORE, Voce.PSP ],
tmpValue,
', '
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class ProfiloComponent implements OnInit {
if(profilo.domini) {
this.info.domini = profilo.domini.map((item, index) => {
if(index === 0) {
return new Dato({ label: 'Domini', value: item.ragioneSociale });
return new Dato({ label: Voce.ENTI_CREDITORI, value: item.ragioneSociale });
}
return new Dato({ value: item.ragioneSociale });
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Subscription } from 'rxjs/Subscription';

import * as moment from 'moment';
import { HttpClient } from '@angular/common/http';
import { Voce } from './voce.service';

declare let GovPayConfig: any;

Expand Down Expand Up @@ -345,7 +346,7 @@ export class UtilService {
public static TXT_REGISTRO_INTERMEDIARI: string = 'Intermediari';
public static TXT_RPPS: string = 'Richieste di pagamento';
public static TXT_APPLICAZIONI: string = 'Applicazioni';
public static TXT_DOMINI: string = 'Domini';
public static TXT_DOMINI: string = Voce.ENTI_CREDITORI;
public static TXT_TIPI_PENDENZA: string = 'Tipi pendenza';
public static TXT_ENTRATE: string = 'Entrate';
public static TXT_RUOLI: string = 'Ruoli';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class Voce {
public static ELABORAZIONE: string = 'Elaborazione';
public static EMAIL: string = 'Email';
public static ENTE_CREDITORE: string = 'Ente creditore';
public static ENTI_CREDITORI: string = 'Enti creditori';
public static EROGATORE: string = 'Erogatore';
public static ESITO: string = 'Esito';

Expand Down Expand Up @@ -112,6 +113,8 @@ export class Voce {

public static MODULO: string = 'Modulo interno che ha emesso l\'evento';
public static MODELLO_PAGAMENTO: string = 'Modello pagamento';
public static MODIFICA_DOMINIO: string = 'Modifica dominio';
public static MODIFICA_ENTE_CREDITORE: string = 'Modifica Ente creditore';
public static MY_BANK: string = 'My Bank';

public static NAZIONE: string = 'Nazione';
Expand All @@ -122,6 +125,8 @@ export class Voce {
public static NESSUNA: string = 'Nessuna';
public static NESSUNO: string = 'Nessuno';
public static NON_CONFIGURATO: string = 'Non configurato';
public static NUOVO_DOMINIO: string = 'Nuovo dominio';
public static NUOVO_ENTE_CREDITORE: string = 'Nuovo Ente creditore';

public static OPERATORE_MITTENTE: string = 'Operatore mittente';
public static OPERAZIONI: string = 'Operazioni';
Expand Down Expand Up @@ -192,4 +197,67 @@ export class Voce {

public static WEB: string = 'Sito web';


//Validation Error Messages
public static VALIDATION_IT_MESSAGES: any = {
// Italian error messages
required: 'Campo obbligatorio.',
minLength: 'Numero minimo di caratteri richiesti: {{minimumLength}} (valore corrente: {{currentLength}})',
maxLength: 'Numero massimo di caratteri: {{maximumLength}} (valore corrente: {{currentLength}})',
pattern: 'Schema non corrispondente: {{requiredPattern}}',
format: function (error) {
switch (error.requiredFormat) {
case 'date':
return 'Formato data non corrispondente';
case 'time':
return 'Formato orario non corrispondente';
case 'date-time':
return 'Formato data/ora non corrispondente';
case 'email':
return 'Indirizzo email nonvalido, es. "name@example.com"';
case 'hostname':
return 'Hostname non valido, es. "example.com"';
case 'ipv4':
return 'Indirizzo IPv4 non valido, es. "127.0.0.1"';
case 'ipv6':
return 'Indirizzo IPv6 non valido, es. "1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0"';
// Add examples for 'uri', 'uri-reference', and 'uri-template'
// case 'uri': case 'uri-reference': case 'uri-template':
case 'url':
return 'Url non valido, es. "http://www.example.com/page.html"';
case 'uuid':
return 'UUID non valido, es. "12345678-9ABC-DEF0-1234-56789ABCDEF0"';
case 'color':
return 'Colore no valido, es. "#FFFFFF" or "rgb(255, 255, 255)"';
case 'json-pointer':
return 'Puntatore JSON non valido, es. "/pointer/to/something"';
case 'relative-json-pointer':
return 'Puntatore JSON relativo non valido, es. "2/pointer/to/something"';
case 'regex':
return 'Espressione regolare no valida, es. "(1-)?\\d{3}-\\d{3}-\\d{4}"';
default:
return 'Valore non correttamente formattato ' + error.requiredFormat;
}
},
minimum: 'Valore minimo {{minimumValue}} o maggiore',
exclusiveMinimum: 'Valore minimo richiesto almeno {{exclusiveMinimumValue}}',
maximum: 'Valore massimo {{maximumValue}} o inferiore',
exclusiveMaximum: 'Valore massimo richiesto al più {{exclusiveMaximumValue}}',
multipleOf: function (error) {
if ((1 / error.multipleOfValue) % 10 === 0) {
const decimals = Math.log10(1 / error.multipleOfValue);
return `Numero decimali richiesti ${decimals} o meno.`;
} else {
return `Deve essere un multiplo di ${error.multipleOfValue}.`;
}
},
minProperties: 'Proprietà richieste: {{minimumProperties}} o più (proprietà correnti: {{currentProperties}})',
maxProperties: 'Proprietà richieste: {{maximumProperties}} o meno (proprietà correnti: {{currentProperties}})',
minItems: 'Elementi richiesti: {{minimumItems}} o più (elementi correnti: {{currentItems}})',
maxItems: 'Elementi richiesti: {{maximumItems}} or meno (elementi correnti: {{currentItems}})',
uniqueItems: 'Ogni elemento deve essere unico',
// Note: No default error messages for 'type', 'const', 'enum', or 'dependencies'
};


}
1 change: 1 addition & 0 deletions wars/web-console/src/main/angular/console/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
import 'core-js/es7/array';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
Expand Down
2 changes: 1 addition & 1 deletion wars/web-console/src/main/webapp/main.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wars/web-console/src/main/webapp/polyfills.bundle.js

Large diffs are not rendered by default.

0 comments on commit 0a05b11

Please sign in to comment.