From d4f9c160833ca049a92800a63786a7ed4a5d0ccc Mon Sep 17 00:00:00 2001 From: Alex ORLUC <alex.orluc@maarch.org> Date: Wed, 5 Feb 2020 17:27:04 +0100 Subject: [PATCH] FEAT #12361 TIME 0:15 fix var lang + fix some bugs --- .../address-ban-autocomplete.component.html | 2 +- .../address-ban-autocomplete.component.ts | 14 ++------------ .../app/viewer/document-viewer.component.html | 2 +- .../app/viewer/document-viewer.component.ts | 9 +++++++-- src/frontend/lang/lang-en.ts | 1 + src/frontend/lang/lang-fr.ts | 1 + src/frontend/lang/lang-nl.ts | 1 + 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/frontend/app/contact/ban-autocomplete/address-ban-autocomplete.component.html b/src/frontend/app/contact/ban-autocomplete/address-ban-autocomplete.component.html index 965a5030484..d5e4ba591c6 100644 --- a/src/frontend/app/contact/ban-autocomplete/address-ban-autocomplete.component.html +++ b/src/frontend/app/contact/ban-autocomplete/address-ban-autocomplete.component.html @@ -29,7 +29,7 @@ </mat-chip> </mat-chip-list> <div class="noResult" *ngIf="controlAutocomplete.value.length === 0"> - {{lang.noSelectedFolder}} + {{lang.noSelectedAddress}} </div> </div> </form> \ No newline at end of file diff --git a/src/frontend/app/contact/ban-autocomplete/address-ban-autocomplete.component.ts b/src/frontend/app/contact/ban-autocomplete/address-ban-autocomplete.component.ts index a0dc2be59ce..d54de4b0734 100644 --- a/src/frontend/app/contact/ban-autocomplete/address-ban-autocomplete.component.ts +++ b/src/frontend/app/contact/ban-autocomplete/address-ban-autocomplete.component.ts @@ -2,14 +2,10 @@ import { Component, OnInit, Input, ViewChild, ElementRef } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { LANG } from '../../translate.component'; import { NotificationService } from '../../notification.service'; -import { HeaderService } from '../../../service/header.service'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { AppService } from '../../../service/app.service'; -import { SortPipe } from '../../../plugins/sorting.pipe'; import { FormControl } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { debounceTime, filter, distinctUntilChanged, tap, switchMap, exhaustMap, catchError } from 'rxjs/operators'; -import { LatinisePipe } from 'ngx-pipes'; @Component({ selector: 'app-address-ban-input', @@ -17,8 +13,7 @@ import { LatinisePipe } from 'ngx-pipes'; styleUrls: [ 'address-ban-autocomplete.component.scss', '../../indexation/indexing-form/indexing-form.component.scss' - ], - providers: [NotificationService, AppService, SortPipe] + ] }) export class AddressBanAutocompleteComponent implements OnInit { @@ -52,9 +47,6 @@ export class AddressBanAutocompleteComponent implements OnInit { public http: HttpClient, private notify: NotificationService, public dialog: MatDialog, - private headerService: HeaderService, - public appService: AppService, - private latinisePipe: LatinisePipe ) { } @@ -118,8 +110,7 @@ export class AddressBanAutocompleteComponent implements OnInit { longitude: ev.option.value.lon, latitude: ev.option.value.lat } - console.log(ev.option.value); - + this.setFormValue(objAddress); this.myControl.setValue(''); @@ -134,7 +125,6 @@ export class AddressBanAutocompleteComponent implements OnInit { setFormValue(item: any) { this.valuesToDisplay[item['id']] = `${item.addressNumber} ${item.addressStreet}, ${item.addressTown} (${item.addressPostcode})`; this.controlAutocomplete.setValue([item]); - console.log(this.valuesToDisplay); } resetAutocomplete() { diff --git a/src/frontend/app/viewer/document-viewer.component.html b/src/frontend/app/viewer/document-viewer.component.html index b7f2d6a6509..8ead8d9a001 100644 --- a/src/frontend/app/viewer/document-viewer.component.html +++ b/src/frontend/app/viewer/document-viewer.component.html @@ -68,7 +68,7 @@ </button> </mat-menu> <ng-container *ngIf="mode === 'mainDocument' && !functions.empty(file.subinfos)"> - <button *ngIf="file.subinfos.mainDocVersions.length > 0" mat-button + <button *ngIf="file.subinfos.mainDocVersions.length > 1" mat-button [matBadge]="file.subinfos.mainDocVersions.length" [matMenuTriggerFor]="menuVersionsDoc"> {{lang.versions}} </button> diff --git a/src/frontend/app/viewer/document-viewer.component.ts b/src/frontend/app/viewer/document-viewer.component.ts index 5ce92e104c8..5203a008413 100644 --- a/src/frontend/app/viewer/document-viewer.component.ts +++ b/src/frontend/app/viewer/document-viewer.component.ts @@ -7,7 +7,7 @@ import { AppService } from '../../service/app.service'; import { tap, catchError, filter, map, exhaustMap } from 'rxjs/operators'; import { of, Subject } from 'rxjs'; import { ConfirmComponent } from '../../plugins/modal/confirm.component'; -import { MatDialogRef, MatDialog, MatSidenav, fadeInItems } from '@angular/material'; +import { MatDialogRef, MatDialog, MatSidenav } from '@angular/material'; import { AlertComponent } from '../../plugins/modal/alert.component'; import { SortPipe } from '../../plugins/sorting.pipe'; import { PluginSelectSearchComponent } from '../../plugins/select-search/select-search.component'; @@ -44,7 +44,12 @@ export class DocumentViewerComponent implements OnInit { type: '', contentMode: 'base64', content: null, - src: null + src: null, + subinfos : { + mainDocVersions: [], + signedDocVersions: false, + commentedDocVersions: false, + } }; allowedExtensions: any[] = []; diff --git a/src/frontend/lang/lang-en.ts b/src/frontend/lang/lang-en.ts index 55e402b7cbd..4fca720fc35 100755 --- a/src/frontend/lang/lang-en.ts +++ b/src/frontend/lang/lang-en.ts @@ -1480,4 +1480,5 @@ export const LANG_EN = { "documentSignedMsg": "The document has been signed, you can't edit this document", "banAutocompleteInput": "Autocomplete BAN input", "noMailContact" : "No (external) contact linked to this mail", + "noSelectedAddress": "No selected address", }; diff --git a/src/frontend/lang/lang-fr.ts b/src/frontend/lang/lang-fr.ts index 749079c7b17..09d8bc99850 100755 --- a/src/frontend/lang/lang-fr.ts +++ b/src/frontend/lang/lang-fr.ts @@ -1519,4 +1519,5 @@ export const LANG_FR = { "documentSignedMsg": "Le document a été signé, vous ne pouvez pas editer ce document", "banAutocompleteInput": "Champ autocomplete BAN", "noMailContact" : "Aucun contact (externe) attaché pour ce courrier", + "noSelectedAddress": "Aucune adresse associée", }; diff --git a/src/frontend/lang/lang-nl.ts b/src/frontend/lang/lang-nl.ts index 8ded968084f..c9d9c0456aa 100755 --- a/src/frontend/lang/lang-nl.ts +++ b/src/frontend/lang/lang-nl.ts @@ -1505,4 +1505,5 @@ export const LANG_NL = { "documentSignedMsg": "The document has been signed, you can't edit this document", //_TO_TRANSLATE "banAutocompleteInput": "Autocomplete BAN input", //_TO_TRANSLATE "noMailContact" : "No (external) contact linked to this mail", //_TO_TRANSLATE + "noSelectedAddress": "No selected address", //_TO_TRANSLATE }; -- GitLab