Skip to content

Commit

Permalink
Bugfix 3.5.x
Browse files Browse the repository at this point in the history
- Aggiornamento gestione logo ente creditore
  • Loading branch information
simo-git committed Oct 21, 2021
1 parent d9826a3 commit fe652e4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<input matInput [placeholder]="_voce.WEB_SITE" formControlName="web_ctrl" autocomplete="off">
</mat-form-field>
<div class="row">
<div class="col-12 col-sm-6" [formGroup]="fGroup">
<div class="col-12 col-sm-6 mb-3 mb-sm-0" [formGroup]="fGroup">
<mat-slide-toggle formControlName="abilita_ctrl" color="accent">{{_voce.ABILITATO}}</mat-slide-toggle>
</div>
<div class="col-12 col-sm-6" [formGroup]="fGroup">
Expand Down Expand Up @@ -110,7 +110,7 @@
<input #iBrowse hidden placeholder="Logo" type="file" formControlName="logo_ctrl" autocomplete="off">
<div class="d-inline action" *ngIf="!_base64File" (click)="_select()">Sfoglia...</div>
<div class="d-block b64-group" *ngIf="_base64File">
<img class="d-block w-50" [src]="_base64File"/>
<img class="card-logo-dominio" [src]="_base64File"/>
<mat-icon class="action b64-icon" (click)="_resetSelection()">delete</mat-icon>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ export class DominioViewComponent implements IFormComponent, OnInit, AfterViewIn
if(_hasColor && _results && _results.length != 0 && _map_results && _map_results.length != 0) {
this._askForConversion({ original: _result, xsvg: _xsvg, results: _results, map: _map_results });
} else {
this._base64File = this._sanitizer.bypassSecurityTrustUrl(_result);
this._base64File = this._sanitizer.bypassSecurityTrustUrl((_result.indexOf('base64,')!==-1?_result:UtilService.RootByTOA() + _result));
}
} else {
this._base64File = this._sanitizer.bypassSecurityTrustUrl(_result);
this._base64File = this._sanitizer.bypassSecurityTrustUrl((_result.indexOf('base64,')!==-1?_result:UtilService.RootByTOA() + _result));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<link-key-value-view class="d-block link-key-value-fill-mat-card" *ngFor="let item of informazioniExtra" [info]="item"></link-key-value-view>
</div>
</mat-card>
<mat-card class="shadow no-border-radius mb-4" *ngIf="!logoError">
<img class="d-block w-50 link-key-value-fill-mat-card px-3 py-3" [src]="logo" (error)="_onError($event)"/>
<mat-card class="shadow no-border-radius mb-4" *ngIf="!logoError && logo">
<img class="d-block card-logo-dominio link-key-value-fill-mat-card px-3 py-3" [src]="logo" (error)="_onError($event)"/>
</mat-card>
<link-filter-card (over-icon-click)="_iconCardClick(_UNITA, $event)" (add-icon-click)="_addEdit(_UNITA)" [card-title]="'Unità operative'"
[data-list]="unita_operative" [show-actions]="_PLUS_CREDIT" [show-over-icons]="_PLUS_CREDIT" [next-page]="_paginatorOptions.unita.next"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export class DominiViewComponent implements IModalDialog, OnInit, AfterViewInit
}

this.logoError = false;
this.logo = json.logo?this._sanitizer.bypassSecurityTrustUrl(json.logo):this.NO_LOGO;
this.logo = json.logo?this._sanitizer.bypassSecurityTrustUrl(UtilService.RootByTOA()+json.logo):this.NO_LOGO;

this.informazioni = _dettaglio.info.slice(0);
this.informazioniPA = _dettaglio.infoPA.slice(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1508,15 +1508,19 @@ export class UtilService {
}

desaturateColor(_color: string): string {
let col = this.hexToRgb(_color);
let sat = 0;
let gray = col.r * 0.3086 + col.g * 0.6094 + col.b * 0.0820;
try {
let col = this.hexToRgb(_color);
let sat = 0;
let gray = col.r * 0.3086 + col.g * 0.6094 + col.b * 0.0820;

col.r = Math.round(col.r * sat + gray * (1-sat));
col.g = Math.round(col.g * sat + gray * (1-sat));
col.b = Math.round(col.b * sat + gray * (1-sat));
col.r = Math.round(col.r * sat + gray * (1-sat));
col.g = Math.round(col.g * sat + gray * (1-sat));
col.b = Math.round(col.b * sat + gray * (1-sat));

return this.rgbToHex(col.r,col.g,col.b);
return this.rgbToHex(col.r,col.g,col.b);
} catch (e) {
return _color;
}
}

static b64toBlob(b64Data: any, contentType: string = '', sliceSize: number = 512) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ link-incassi-view .pagamenti-riconciliati link-key-value-view .row {
margin: -1rem 0;
}

img.card-logo-dominio {
max-width: 84px;
width: 84px;
height: auto;
}

// Overridden styles
// mat-dialog, mat-card
Expand Down

0 comments on commit fe652e4

Please sign in to comment.