Skip to content

Commit

Permalink
Riconciliazioni: ora è possibile, da "app-config", scegliere gli attr…
Browse files Browse the repository at this point in the history
…ibuti da nascondere di "quote" e se mostrare i campi vuoti.
  • Loading branch information
atatarelli committed Dec 10, 2021
1 parent 43b151f commit bba62f3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="container">
<div class="container" *ngIf="showValue()">
<div class="row lh-130 regular-16 mb-2 break-all">
<div class="col-12 col-sm-4 color-gray lh-130 mb-2 mb-sm-0">{{info.label?info.label + ':':info.label}}</div>
<ng-container [ngSwitch]="info.type">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class KeyJsonViewComponent implements OnInit, OnChanges {

// Default
_quoteOrder = ['titolo', 'tipologia', 'categoria', 'capitolo', 'articolo', 'accertamento', 'annoEsercizio', 'importo'];
_quoteHidden = ['proprietaCustom'];
_quoteLabel = {
capitolo: 'Capitolo',
annoEsercizio: 'Anno esercizio',
Expand All @@ -27,11 +28,14 @@ export class KeyJsonViewComponent implements OnInit, OnChanges {
articolo: 'Articolo',
proprietaCustom: 'Proprieta custom'
};
_showEmpty = false;

constructor() {
if (GovRiconciliazioniConfig && GovRiconciliazioniConfig.quoteOrder && GovRiconciliazioniConfig.quoteLabel) {
this._quoteOrder = GovRiconciliazioniConfig.quoteOrder;
this._quoteLabel = GovRiconciliazioniConfig.quoteLabel;
if (GovRiconciliazioniConfig) {
this._quoteOrder = GovRiconciliazioniConfig.quoteOrder || this._quoteOrder;
this._quoteHidden = GovRiconciliazioniConfig.quoteHidden || this._quoteHidden;
this._quoteLabel = GovRiconciliazioniConfig.quoteLabel || this._quoteLabel;
this._showEmpty = (GovRiconciliazioniConfig.showEmpty) ? GovRiconciliazioniConfig.showEmpty : this._showEmpty;
}
}

Expand All @@ -47,11 +51,22 @@ export class KeyJsonViewComponent implements OnInit, OnChanges {
prepareData() {
if ((this.info.type == 'quote') && this.info.value && this.info.value[0]) {
this.quoteKeys = Object.keys(this.info.value[0]);
this.quoteKeys = this.quoteKeys.filter(function (n) {
return (this._quoteHidden.indexOf(n) == -1);
}.bind(this));
const sorted = this.quoteKeys.sort((a, b) => this._quoteOrder.indexOf(a) - this._quoteOrder.indexOf(b));
this.quoteKeys = sorted;
}
}

showValue() {
let show = true;
if (!this._showEmpty) {
show = Boolean(this.info.value);
}
return (show);
}

// protected _setLabelStyle() {
// let _trunc: boolean = true;
// if(this.info && this.info.value && this.info.value.indexOf(' ') != -1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
articolo: 'Articolo',
proprietaCustom: 'Proprieta custom'
},
quoteHidden: ['proprietaCustom'],
showEmpty: false,
quoteExport: ['titolo', 'tipologia', 'categoria', 'capitolo', 'articolo', 'accertamento', 'annoEsercizio', 'importo'],
quoteCount: 10,
exportLabel: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ button[mat-button] {
margin: 0;
}

link-incassi-view .pagamenti-riconciliati link-key-value-view .row {
link-incassi-view .pagamenti-riconciliati link-key-value-view .row,
link-incassi-view .pagamenti-riconciliati link-key-json-view .row {
font-size: 14px;
}

Expand Down

0 comments on commit bba62f3

Please sign in to comment.