Skip to content

Commit 1ff6e8b

Browse files
authored
Merge pull request #3440 from ProgrammeVitam/bug_15558
CP V8.0 - Bug #14713 & #15558 - [Search App] key to translate.
2 parents 158021b + d8ee01e commit 1ff6e8b

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,17 @@
3434
* The fact that you are presently reading this means that you have had
3535
* knowledge of the CeCILL-C license and that you accept its terms.
3636
*/
37-
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
37+
import { Component, EventEmitter, Input, Output } from '@angular/core';
3838
import { CriteriaSearchCriteria, CriteriaValue, SearchCriteriaTypeEnum, SearchCriteriaValue } from 'vitamui-library';
3939
import { TranslateService } from '@ngx-translate/core';
4040
@Component({
4141
selector: 'app-criteria-search',
4242
templateUrl: './criteria-search.component.html',
4343
styleUrls: ['./criteria-search.component.scss'],
4444
})
45-
export class CriteriaSearchComponent implements OnInit {
45+
export class CriteriaSearchComponent {
4646
constructor(private translateService: TranslateService) {}
4747

48-
ngOnInit() {
49-
if (this.criteriaVal) {
50-
this.criteriaVal.keyTranslated = true;
51-
}
52-
}
53-
5448
@Input()
5549
criteriaKey: string;
5650

@@ -64,6 +58,10 @@ export class CriteriaSearchComponent implements OnInit {
6458
}
6559
}
6660

61+
get criteriaVal(): CriteriaSearchCriteria {
62+
return this._criteriaVal;
63+
}
64+
6765
@Output() criteriaRemoveEvent: EventEmitter<any> = new EventEmitter();
6866

6967
removeCriteria(keyElt: string, valueElt?: CriteriaValue) {

ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/criteria-search/criteria-search.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ export class CriteriaSearchComponent {
9191
getCriteriaLabel(key: string, criteriaValue: SearchCriteriaValue): string {
9292
if (criteriaValue.valueTranslated) {
9393
return this.translateService.instant(
94-
`ARCHIVE_SEARCH.SEARCH_CRITERIA_FILTER.${this.getCategoryName(this.criteriaVal.category)}.${criteriaValue.label}`,
94+
`COLLECT.SEARCH_CRITERIA_FILTER.${this.getCategoryName(this.criteriaVal.category)}.${criteriaValue.label}`,
9595
);
9696
}
9797
if (key === 'ALL_ARCHIVE_UNIT_TYPES') {
98-
return this.translateService.instant(`ARCHIVE_SEARCH.SEARCH_CRITERIA_FILTER.FIELDS.${criteriaValue?.value?.id}`);
98+
return this.translateService.instant(`COLLECT.SEARCH_CRITERIA_FILTER.FIELDS.${criteriaValue?.value?.id}`);
9999
}
100100
if (key === 'ORPHANS_NODE') {
101101
return this.translateService.instant('COLLECT.FILING_SCHEMA.ORPHANS_NODE');

0 commit comments

Comments
 (0)