-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Riconciliazioni: nuova visualizzazione dei "Pagamenti riconciliati"
- Loading branch information
1 parent
e98e35e
commit 91aba83
Showing
12 changed files
with
351 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
wars/web-console/src/main/angular/console/src/app/classes/view/dato-ex.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
export class DatoEx { | ||
|
||
label: string = ''; | ||
value: any = null; | ||
type: string = ''; | ||
|
||
constructor (_data?: any) { | ||
if(_data) { | ||
for (let key in _data) { | ||
if(this.hasOwnProperty(key)) { | ||
this[key] = _data[key]; | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* datoToString | ||
* @param {string} separator: default ': ' | ||
* @returns {string} | ||
*/ | ||
datoToString(separator: string = ': '): string { | ||
return this.label + separator + this.value; | ||
} | ||
|
||
/** | ||
* arraysToString | ||
* @param {string[]} labels | ||
* @param {string[]} values | ||
* @param {string} separator: default ' ' | ||
* @returns {string} | ||
*/ | ||
public static arraysToString(labels: string[], values: string[], separator: string = ' '): string { | ||
let sst = []; | ||
labels.forEach((s, i) => { | ||
sst.push(s + ': ' + values[i]); | ||
}); | ||
|
||
return sst.join(separator); | ||
} | ||
|
||
/** | ||
* concatStrings | ||
* @param {string[]} labels | ||
* @param {string} separator: default ' ' | ||
* @returns {string} | ||
*/ | ||
public static concatStrings(labels: string[], separator: string = ' '): string { | ||
let sst = []; | ||
labels.forEach((s) => { | ||
if(s) { | ||
sst.push(s); | ||
} | ||
}); | ||
|
||
return sst.join(separator); | ||
} | ||
|
||
/** | ||
* Array of strings to Dato object (label only) | ||
* @param {string[]} labels | ||
* @param {string[]} values | ||
* @param {string} separator | ||
* @returns {Dato} | ||
* @private | ||
*/ | ||
public static arraysToDato(labels: string[], values: string[], separator: string = ' '): DatoEx { | ||
let sst = []; | ||
labels.forEach((s, i) => { | ||
sst.push(s+': '+ values[i]); | ||
}); | ||
|
||
return new DatoEx({ label: sst.join(separator), value: '' }); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
wars/web-console/src/main/angular/console/src/app/classes/view/new-standard-collapse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Standard } from './standard'; | ||
|
||
export class NewStandardCollapse extends Standard { | ||
|
||
motivo: string = null; | ||
elenco: any[] = null; | ||
|
||
item: any = null; | ||
|
||
constructor (_data?: any) { | ||
|
||
super(_data); | ||
|
||
if(_data) { | ||
for (let key in _data) { | ||
if(this.hasOwnProperty(key)) { | ||
(_data[key] !== null && _data[key] !== undefined)?this[key] = _data[key]:null; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...gular/console/src/app/elements/item-view/views/key-json-view/key-json-view.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="container"> | ||
<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"> | ||
<div class="col-12 col-sm-8 quote" *ngSwitchCase="'quote'"> | ||
<table class="table table-bordered table-sm"> | ||
<thead> | ||
<tr> | ||
<th class="text-truncate" *ngFor="let key of quoteKeys">{{ quoteLabel[key] }}</th> | ||
</tr> | ||
</thead> | ||
<tr *ngFor="let item of info.value" > | ||
<td *ngFor="let key of quoteKeys">{{ item[key] }}</td> | ||
</tr> | ||
</table> | ||
</div> | ||
<div class="col-12 col-sm-8" *ngSwitchDefault> | ||
<!-- <mat-expansion-panel class="mat-elevation-z0 px-0 py-0"> | ||
<mat-expansion-panel-header><mat-panel-title><mat-icon>visibility</mat-icon></mat-panel-title></mat-expansion-panel-header> --> | ||
<div class="contenuto-json border"><div><pre>{{ info.value | json }}</pre></div></div> | ||
<!-- </mat-expansion-panel> --> | ||
</div> | ||
</ng-container> | ||
</div> | ||
</div> |
26 changes: 26 additions & 0 deletions
26
...gular/console/src/app/elements/item-view/views/key-json-view/key-json-view.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
:host ::ng-deep { | ||
|
||
.table-sm { | ||
font-size: 14px; | ||
} | ||
|
||
.contenuto-json { | ||
height: 250px; | ||
overflow: auto; | ||
padding: 5px; | ||
} | ||
|
||
.mat-expansion-panel-header { | ||
padding: 0; | ||
height: 18px !important; | ||
} | ||
|
||
.mat-expansion-panel-body { | ||
padding: 0 0 16px; | ||
margin-top: 16px; | ||
} | ||
|
||
.mat-expansion-panel-header:not([aria-disabled='true']):hover { | ||
background-color: transparent !important; | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
...angular/console/src/app/elements/item-view/views/key-json-view/key-json-view.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; | ||
import { DatoEx } from '../../../../classes/view/dato-ex'; | ||
|
||
@Component({ | ||
selector: 'link-key-json-view', | ||
templateUrl: './key-json-view.component.html', | ||
styleUrls: ['./key-json-view.component.scss'] | ||
}) | ||
export class KeyJsonViewComponent implements OnInit, OnChanges { | ||
|
||
@Input('info') info: DatoEx = new DatoEx(); | ||
|
||
quoteKeys: any[] = []; | ||
|
||
// quoteOrder = ['capitolo', 'annoEsercizio', 'importo', 'titolo', 'accertamento', 'tipologia', 'categoria', 'articolo']; | ||
quoteOrder = ['titolo', 'tipologia', 'categoria', 'capitolo', 'articolo', 'accertamento', 'annoEsercizio', 'importo']; | ||
quoteLabel = { | ||
capitolo: 'Capitolo', | ||
annoEsercizio: 'Anno esercizio', | ||
importo: 'Importo', | ||
titolo: 'Titolo', | ||
accertamento: 'Accertamento', | ||
tipologia: 'Tipologia', | ||
categoria: 'Categoria', | ||
articolo: 'Articolo', | ||
proprietaCustom: 'Proprieta custom' | ||
}; | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
ngOnChanges(changes: SimpleChanges) { | ||
if (changes.info && changes.info.currentValue) { | ||
this.prepareData(); | ||
} | ||
} | ||
|
||
prepareData() { | ||
if ((this.info.type == 'quote') && this.info.value && this.info.value[0]) { | ||
this.quoteKeys = Object.keys(this.info.value[0]); | ||
const sorted = this.quoteKeys.sort((a, b) => this.quoteOrder.indexOf(a) - this.quoteOrder.indexOf(b)); | ||
this.quoteKeys = sorted; | ||
} | ||
} | ||
|
||
// protected _setLabelStyle() { | ||
// let _trunc: boolean = true; | ||
// if(this.info && this.info.value && this.info.value.indexOf(' ') != -1) { | ||
// _trunc = false; | ||
// } | ||
// return { | ||
// 'text-truncate': _trunc, | ||
// 'color-gray': true, | ||
// 'my-0': true | ||
// } | ||
// } | ||
|
||
// protected _tooltip(): string { | ||
// if(this.info) { | ||
// return this.info.label+': '+this.info.value; | ||
// } | ||
// return null; | ||
// } | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...ents/item-view/views/new-standard-collapse-view/new-standard-collapse-view.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="d-block"> | ||
<link-standard-view [info]="info" [dataRef]="dataRef" (click)="_collapse()" class="pointer"></link-standard-view> | ||
<p class="mt-4" *ngIf="_expanded && info.motivo">{{info.motivo}}</p> | ||
<div class="content-collapse mt-4" *ngIf="_expanded" @slideDownUp> | ||
<ng-container *ngFor="let item of _elenco"> | ||
<link-key-value-view class="d-block link-key-value-fill-mat-card" [info]="item" *ngIf="item.type == 'string'"></link-key-value-view> | ||
<link-key-json-view class="d-block link-key-value-fill-mat-card" [info]="item" *ngIf="item.type != 'string'"></link-key-json-view> | ||
</ng-container> | ||
</div> | ||
</div> |
18 changes: 18 additions & 0 deletions
18
...ents/item-view/views/new-standard-collapse-view/new-standard-collapse-view.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@import '~@angular/material/theming'; | ||
@import '../../../../../styles/variables.scss'; | ||
|
||
p { | ||
margin: 0; | ||
} | ||
|
||
.pointer { | ||
cursor: pointer; | ||
} | ||
|
||
.content-collapse { | ||
background-color: #ffffff; | ||
margin-left: -20px; | ||
margin-right: -20px; | ||
padding-left: 20px; | ||
padding-right: 20px; | ||
} |
Oops, something went wrong.