@fluxhub/fluxhub-lib 1.0.209 → 1.0.211

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,7 @@ import { TranslateModule } from '@ngx-translate/core';
32
32
  import { DragulaService, DragulaModule } from 'ng2-dragula';
33
33
  import { MatDialogRef, MatDialog, DateAdapter, MAT_DATE_LOCALE, MatAutocompleteModule, MatButtonModule, MatButtonToggleModule, MatPaginatorModule, MatCardModule, MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatGridListModule, MatIconModule, MatInputModule, MatListModule, MatMenuModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, MatSelectModule, MatSidenavModule, MatSliderModule, MatSortModule, MatSlideToggleModule, MatSnackBarModule, MatTableModule, MatTabsModule, MatToolbarModule, MatTooltipModule, MatFormFieldModule, MatExpansionModule, MatStepperModule, MatDialogModule, MatNativeDateModule } from '@angular/material';
34
34
  import { ActivatedRoute, Router } from '@angular/router';
35
- import { Injectable, forwardRef, Component, Input, ViewChild, Output, EventEmitter, ElementRef, Directive, Inject, PLATFORM_ID, Pipe, ViewContainerRef, NgModule, defineInjectable, inject, HostListener } from '@angular/core';
35
+ import { Injectable, forwardRef, Component, Input, ViewChild, Output, EventEmitter, ElementRef, Directive, Inject, PLATFORM_ID, Pipe, ViewContainerRef, defineInjectable, inject, NgModule, HostListener } from '@angular/core';
36
36
  import { Http } from '@angular/http';
37
37
  import { SlimLoadingBarService } from 'ng2-slim-loading-bar';
38
38
  import { ToastrService } from 'ngx-toastr';
@@ -2642,6 +2642,7 @@ class FHUploadComponent {
2642
2642
  this.limit_string = 'Il file di <size>MB supera il limite di 500MB';
2643
2643
  this.allegato_inserito = 'ALLEGATO INSERITO';
2644
2644
  this.inserire_descrizione = 'Descrizione Obbligatoria';
2645
+ this.lista_allegati = [];
2645
2646
  this.change = new EventEmitter();
2646
2647
  this.upload_ended = new EventEmitter();
2647
2648
  this.loading = false;
@@ -2652,7 +2653,6 @@ class FHUploadComponent {
2652
2653
  this.file_name = '';
2653
2654
  this.label = '';
2654
2655
  this.username = '';
2655
- this.progress_p = 0;
2656
2656
  this.b_edit_loaded = false;
2657
2657
  this.tipo = '';
2658
2658
  this.b_ini = false;
@@ -2680,6 +2680,7 @@ class FHUploadComponent {
2680
2680
  * @return {?}
2681
2681
  */
2682
2682
  ngOnInit() {
2683
+ console.log('INIT');
2683
2684
  /** @type {?} */
2684
2685
  var uo = {};
2685
2686
  uo.headers = [{ name: 'Authorization', value: 'Bearer ' + localStorage.getItem(this.app_s.COMPANY_KEY + "token") }];
@@ -2696,8 +2697,9 @@ class FHUploadComponent {
2696
2697
  this.uploader.onErrorItem = (a, b, c, d) => {
2697
2698
  this.toastr.error(b);
2698
2699
  };
2699
- this.uploader.onAfterAddingFile = () => {
2700
- this.ch();
2700
+ this.uploader.onAfterAddingFile = (fileItem) => {
2701
+ console.log('onAfterAddingFile');
2702
+ this.ch(fileItem);
2701
2703
  };
2702
2704
  this.uploader.onProgressItem = (fileItem, progress) => {
2703
2705
  // console.log(fileItem);
@@ -2726,13 +2728,22 @@ class FHUploadComponent {
2726
2728
  window.open(this.app_s.COMPANY_SITE_ROOT + '/uploads/' + this.App + '/' + this.K + '/' + this.file_name);
2727
2729
  }
2728
2730
  /**
2731
+ * @param {?} fileItem
2729
2732
  * @return {?}
2730
2733
  */
2731
- ch() {
2734
+ ch(fileItem) {
2732
2735
  if (this.descri_obb && this.descrizione == '') {
2733
2736
  this.toastr.error(this.inserire_descrizione);
2734
2737
  return;
2735
2738
  }
2739
+ console.log('this.lista_allegati ', this.lista_allegati);
2740
+ console.log('fileItem ', fileItem);
2741
+ for (let i = 0; i < this.lista_allegati.length; i++) {
2742
+ if (this.lista_allegati[i].Filename.toLowerCase() == fileItem.file.name.toLowerCase()) {
2743
+ this.toastr.error('File già presente (cancellarlo per aggiornarlo)');
2744
+ return;
2745
+ }
2746
+ }
2736
2747
  this.uploader.onBuildItemForm = (item, form) => {
2737
2748
  form.append('App', this.App);
2738
2749
  form.append('K', this.K);
@@ -2806,6 +2817,7 @@ FHUploadComponent.decorators = [
2806
2817
  { type: Component, args: [{
2807
2818
  selector: 'FHUpload',
2808
2819
  template: `
2820
+ aaaazzz
2809
2821
  <div *ngIf="loading" fxLayout="row">
2810
2822
  WAIT
2811
2823
  </div>
@@ -2846,6 +2858,7 @@ FHUploadComponent.propDecorators = {
2846
2858
  limit_string: [{ type: Input }],
2847
2859
  allegato_inserito: [{ type: Input }],
2848
2860
  inserire_descrizione: [{ type: Input }],
2861
+ lista_allegati: [{ type: Input }],
2849
2862
  change: [{ type: Output }],
2850
2863
  upload_ended: [{ type: Output }]
2851
2864
  };
@@ -3240,6 +3253,7 @@ class FHUploadPanelComponent {
3240
3253
  this.enabled = true;
3241
3254
  this.label = '';
3242
3255
  this.sovrascrivi_path = '';
3256
+ this.access_control = false;
3243
3257
  this.change = new EventEmitter();
3244
3258
  this.App = '';
3245
3259
  this.K = '';
@@ -3304,6 +3318,7 @@ class FHUploadPanelComponent {
3304
3318
  * @return {?}
3305
3319
  */
3306
3320
  ngOnInit() {
3321
+ console.log('INIT1');
3307
3322
  this.upc.single = false;
3308
3323
  this.b_mobile = this._appservice.getState().pageFullscreen;
3309
3324
  this
@@ -3351,6 +3366,7 @@ class FHUploadPanelComponent {
3351
3366
  if ('3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|ASCX|ASF|ASH|ASHX|ASMX|ASP|ASPX|ASX|AU|AUP|AVI|AXD|AZE|BAK|BASH|BAT|BIN|BLANK|BMP|BOWERRC|BPG|BROWSER|BZ2|C|CAB|CAD|CAF|CAL|CD|CER|CFG|CFM|CFML|CGI|CLASS|CMD|CODEKIT|COFFEE|COFFEELINTIGNORE|COM|COMPILE|CONF|CONFIG|CPP|CPTX|CR2|CRDOWNLOAD|CRT|CRYPT|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VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH'.indexOf(arrf[arrf.length - 1].toLocaleUpperCase()) != -1)
3352
3367
  iconf = arrf[arrf.length - 1].toLocaleLowerCase();
3353
3368
  this.arr_g[i].icon = iconf + '.svg';
3369
+ this.arr_g[i].can_delete = !this.access_control || this.arr_g[i].idp == this._appservice.user;
3354
3370
  }
3355
3371
  }
3356
3372
  });
@@ -3365,7 +3381,7 @@ FHUploadPanelComponent.decorators = [
3365
3381
 
3366
3382
  <div fxLayout="column">
3367
3383
  <div [hidden]="!enabled">
3368
- <FHUpload [single]="b_False" (change)="ref_allegato()" #upc></FHUpload>
3384
+ <FHUpload [single]="b_False" [lista_allegati]="arr_g" (change)="ref_allegato()" #upc></FHUpload>
3369
3385
  <br></div>
3370
3386
 
3371
3387
  <table width="98%" class="fh_table">
@@ -3375,6 +3391,7 @@ FHUploadPanelComponent.decorators = [
3375
3391
  <th style="width:50%">Nome</th>
3376
3392
  <th style="width:60px;text-align:center">Dim.</th>
3377
3393
  <th style="width:50%">Descrizione</th>
3394
+ <th style="width:30%">Utente</th>
3378
3395
  <th style="width:240px;text-align:center">Data</th>
3379
3396
  <th style="width:40px" class="actions"></th>
3380
3397
  <th *ngIf="enabled" style="width:40px" class="actions"></th>
@@ -3392,6 +3409,7 @@ FHUploadPanelComponent.decorators = [
3392
3409
  <td *ngIf="!b_mobile">{{app.Filename}}</td>
3393
3410
  <td *ngIf="!b_mobile" style="text-align:center">{{app.Filesize}}</td>
3394
3411
  <td *ngIf="!b_mobile">{{app.descrizione}}</td>
3412
+ <td *ngIf="!b_mobile">{{app.nc}}</td>
3395
3413
  <td *ngIf="!b_mobile" style="text-align:center">{{app.dt_ins | date: 'dd/MM/yyyy HH:mm:ss'}}</td>
3396
3414
  <td *ngIf="!b_mobile" style="text-align:center">
3397
3415
  <button mat-icon-button matTooltip="Download File" (click)="download_all(app)">
@@ -3400,9 +3418,15 @@ FHUploadPanelComponent.decorators = [
3400
3418
  </td>
3401
3419
 
3402
3420
  <td *ngIf="enabled" style="text-align:center">
3403
- <a mat-icon-button matTooltip="Elimina File" *ngIf="enabled" (click)="delete(app)">
3421
+ <a mat-icon-button matTooltip="Elimina File" *ngIf="app.can_delete" (click)="delete(app)">
3404
3422
  <mat-icon>delete</mat-icon>
3405
- </a></td>
3423
+ </a>
3424
+
3425
+ <a mat-icon-button [matTooltip]="'Cancellazione consentita solo a: '+app.nc" *ngIf="!app.can_delete" [disabled]="true" >
3426
+ <mat-icon>delete</mat-icon>
3427
+ </a>
3428
+
3429
+ </td>
3406
3430
 
3407
3431
  </tr>
3408
3432
  </table>
@@ -3431,6 +3455,7 @@ FHUploadPanelComponent.propDecorators = {
3431
3455
  enabled: [{ type: Input }],
3432
3456
  label: [{ type: Input }],
3433
3457
  sovrascrivi_path: [{ type: Input }],
3458
+ access_control: [{ type: Input }],
3434
3459
  change: [{ type: Output }],
3435
3460
  upc: [{ type: ViewChild, args: ['upc',] }]
3436
3461
  };
@@ -10430,6 +10455,7 @@ class win_uploads {
10430
10455
  this.app_s = app_s;
10431
10456
  this.enabled = true;
10432
10457
  this.change = new EventEmitter();
10458
+ this.access_control = true;
10433
10459
  this.App = '';
10434
10460
  this.K = '';
10435
10461
  this.b_edit_loaded = false;
@@ -10512,9 +10538,18 @@ class win_uploads {
10512
10538
  });
10513
10539
  }
10514
10540
  /**
10541
+ * @param {?} fileItem
10515
10542
  * @return {?}
10516
10543
  */
10517
- ch() {
10544
+ ch(fileItem) {
10545
+ console.log('this.arr_g ', this.arr_g);
10546
+ console.log('fileItem ', fileItem);
10547
+ for (let i = 0; i < this.arr_g.length; i++) {
10548
+ if (this.arr_g[i].Filename.toLowerCase() == fileItem.file.name.toLowerCase()) {
10549
+ this.toastr.error('File già presente (cancellarlo per aggiornarlo)');
10550
+ return;
10551
+ }
10552
+ }
10518
10553
  this.uploader.onBuildItemForm = (item, form) => {
10519
10554
  form.append('App', this.App);
10520
10555
  form.append('K', this.K);
@@ -10560,6 +10595,7 @@ class win_uploads {
10560
10595
  if ('3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|ASCX|ASF|ASH|ASHX|ASMX|ASP|ASPX|ASX|AU|AUP|AVI|AXD|AZE|BAK|BASH|BAT|BIN|BLANK|BMP|BOWERRC|BPG|BROWSER|BZ2|C|CAB|CAD|CAF|CAL|CD|CER|CFG|CFM|CFML|CGI|CLASS|CMD|CODEKIT|COFFEE|COFFEELINTIGNORE|COM|COMPILE|CONF|CONFIG|CPP|CPTX|CR2|CRDOWNLOAD|CRT|CRYPT|CS|CSH|CSON|CSPROJ|CSS|CSV|CUE|DAT|DB|DBF|DEB|DGN|DIST|DIZ|DLL|DMG|DNG|DOC|DOCB|DOCM|DOCX|DOT|DOTM|DOTX|DOWNLOAD|DPJ|DS_STORE|DTD|DWG|DXF|EDITORCONFIG|EL|ENC|EOT|EPS|EPUB|ESLINTIGNORE|EXE|F4V|FAX|FB2|FLA|FLAC|FLV|FOLDER|GADGET|GDP|GEM|GIF|GITATTRIBUTES|GITIGNORE|GO|GPG|GZ|H|HANDLEBARS|HBS|HEIC|HS|HSL|HTM|HTML|IBOOKS|ICNS|ICO|ICS|IDX|IFF|IFO|IMAGE|IMG|IN|INDD|INF|INI|ISO|J2|JAR|JAVA|JPE|JPEG|JPG|JS|JSON|JSP|JSX|KEY|KF8|KMK|KSH|KUP|LESS|LEX|LICX|LISP|LIT|LNK|LOCK|LOG|LUA|M|M2V|M3U|M3U8|M4|M4A|M4R|M4V|MAP|MASTER|MC|MD|MDB|MDF|ME|MI|MID|MIDI|MK|MKV|MM|MO|MOBI|MOD|MOV|MP2|MP3|MP4|MPA|MPD|MPE|MPEG|MPG|MPGA|MPP|MPT|MSI|MSU|NEF|NES|NFO|NIX|NPMIGNORE|ODB|ODS|ODT|OGG|OGV|OST|OTF|OTT|OVA|OVF|P12|P7B|PAGES|PART|PCD|PDB|PDF|PEM|PFX|PGP|PH|PHAR|PHP|PKG|PL|PLIST|PM|PNG|PO|POM|POT|POTX|PPS|PPSX|PPT|PPTM|PPTX|PROP|PS|PS1|PSD|PSP|PST|PUB|PY|PYC|QT|RA|RAM|RAR|RAW|RB|RDF|RESX|RETRY|RM|ROM|RPM|RSA|RSS|RTF|RU|RUB|SASS|SCSS|SDF|SED|SH|SITEMAP|SKIN|SLDM|SLDX|SLN|SOL|SQL|SQLITE|STEP|STL|SVG|SWD|SWF|SWIFT|SYS|TAR|TCSH|TEX|TFIGNORE|TGA|TGZ|TIF|TIFF|TMP|TORRENT|TS|TSV|TTF|TWIG|TXT|UDF|VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH'.indexOf(arrf[arrf.length - 1].toLocaleUpperCase()) != -1)
10561
10596
  iconf = arrf[arrf.length - 1].toLocaleLowerCase();
10562
10597
  this.arr_g[i].icon = iconf + '.svg';
10598
+ this.arr_g[i].can_delete = !this.access_control || this.arr_g[i].idp == this.app_s.user;
10563
10599
  }
10564
10600
  }
10565
10601
  });
@@ -10571,6 +10607,10 @@ class win_uploads {
10571
10607
  this.App = this.app_s.getState().wkf_doc_info.uiid_app;
10572
10608
  this.K = this.app_s.getState().wkf_doc_info.uiid_doc;
10573
10609
  this.single = false;
10610
+ this.uploader.onAfterAddingFile = (fileItem) => {
10611
+ console.log('onAfterAddingFile');
10612
+ this.ch(fileItem);
10613
+ };
10574
10614
  this.init(this.App, this.K);
10575
10615
  this.ref_allegato();
10576
10616
  }
@@ -10604,7 +10644,7 @@ win_uploads.decorators = [
10604
10644
  <input matInput type="text" name="descrizione" [(ngModel)]="descrizione" placeholder="{{label}}">
10605
10645
 
10606
10646
 
10607
- <input type="file" ng2FileSelect [uploader]="uploader" multiple (change)="ch()"/>
10647
+ <input type="file" ng2FileSelect [uploader]="uploader" multiple />
10608
10648
  <!--<button mat-raised-button *ngIf="b_edit_loaded" (click)="download_all()">{{label_b}}</button>-->
10609
10649
  </div>
10610
10650
  <br>
@@ -10619,6 +10659,8 @@ win_uploads.decorators = [
10619
10659
  <th style="width:50%">Nome</th>
10620
10660
  <th style="width:60px;text-align:center">Dim.</th>
10621
10661
  <th style="width:50%">Descrizione</th>
10662
+
10663
+ <th style="width:30%">Utente</th>
10622
10664
  <th style="width:240px;text-align:center">Data</th>
10623
10665
  <th style="width:40px" class="actions"></th>
10624
10666
  <th *ngIf="enabled" style="width:40px" class="actions"></th>
@@ -10633,6 +10675,7 @@ win_uploads.decorators = [
10633
10675
  <td>{{app.Filename}}</td>
10634
10676
  <td style="text-align:center">{{app.Filesize}}</td>
10635
10677
  <td>{{app.descrizione}}</td>
10678
+ <td>{{app.nc}}</td>
10636
10679
  <td style="text-align:center">{{app.dt_ins | date: 'dd/MM/yyyy HH:mm:ss'}}</td>
10637
10680
  <td style="text-align:center">
10638
10681
  <button mat-icon-button matTooltip="Download File" (click)="download_all(app)">
@@ -10640,9 +10683,17 @@ win_uploads.decorators = [
10640
10683
  </button>
10641
10684
  </td>
10642
10685
 
10643
- <td style="text-align:center"><a mat-icon-button *ngIf="enabled" (click)="delete(app)">
10644
- <mat-icon>delete</mat-icon>
10645
- </a></td>
10686
+
10687
+ <td *ngIf="enabled" style="text-align:center">
10688
+ <a mat-icon-button matTooltip="Elimina File" *ngIf="app.can_delete" (click)="delete(app)">
10689
+ <mat-icon>delete</mat-icon>
10690
+ </a>
10691
+
10692
+ <a mat-icon-button [matTooltip]="'Cancellazione consentita solo a: '+app.nc" *ngIf="!app.can_delete" [disabled]="true" >
10693
+ <mat-icon>delete</mat-icon>
10694
+ </a>
10695
+
10696
+ </td>
10646
10697
  </tr>
10647
10698
  </table>
10648
10699
 
@@ -10672,6 +10723,7 @@ win_uploads.propDecorators = {
10672
10723
  enabled: [{ type: Input }],
10673
10724
  change: [{ type: Output }],
10674
10725
  upc: [{ type: ViewChild, args: ['upc',] }],
10726
+ access_control: [{ type: Input }],
10675
10727
  single: [{ type: Input }]
10676
10728
  };
10677
10729