Merge branch 'master' into VM/RED-9788-2

This commit is contained in:
Valentin Mihai 2024-08-09 10:29:16 +03:00
commit f0535eb47f
6 changed files with 33 additions and 7 deletions

View File

@ -24,10 +24,16 @@
<div class="iqser-input-group required">
<label translate="add-edit-component-mapping.form.file"></label>
<iqser-upload-file (fileChanged)="fileChanged($event)" [file]="activeFile" [accept]="'.csv'" />
<iqser-upload-file (fileChanged)="changeFile($event)" [file]="activeFile" [accept]="'.csv'" />
</div>
<div class="row">
<div
class="row"
[class.disabled-file-options]="disabledFileOptions"
[matTooltip]="'add-edit-component-mapping.disabled-file-options' | translate"
[matTooltipDisabled]="!disabledFileOptions"
[matTooltipPosition]="'above'"
>
<div class="iqser-input-group required w-150">
<label translate="add-edit-component-mapping.form.delimiter"></label>
<input

View File

@ -18,4 +18,14 @@
font-size: 15px;
}
}
&.disabled-file-options {
opacity: 0.5;
pointer-events: auto;
max-width: 300px;
.iqser-input-group {
pointer-events: none;
}
}
}

View File

@ -11,6 +11,7 @@ import { MatSelect, MatSelectTrigger } from '@angular/material/select';
import { fileAttributeEncodingTypesTranslations } from '@translations/file-attribute-encoding-types-translations';
import { firstValueFrom } from 'rxjs';
import { ComponentMappingsService } from '@services/entity-services/component-mappings.service';
import { MatTooltip } from '@angular/material/tooltip';
interface DialogData {
dossierTemplateId: string;
@ -42,6 +43,7 @@ interface DialogResult {
MatSelect,
IconButtonComponent,
UploadFileComponent,
MatTooltip,
],
})
export class AddEditComponentMappingDialogComponent
@ -50,6 +52,7 @@ export class AddEditComponentMappingDialogComponent
{
protected readonly encodingTypeOptions = Object.keys(FileAttributeEncodingTypes);
protected readonly translations = fileAttributeEncodingTypesTranslations;
#fileChanged = false;
activeFile: File;
form!: UntypedFormGroup;
@ -73,7 +76,8 @@ export class AddEditComponentMappingDialogComponent
}
}
fileChanged(file: File) {
changeFile(file: File) {
this.#fileChanged = true;
this.form.get('file').setValue(file);
this.form.get('fileName').setValue(file?.name);
}
@ -91,4 +95,8 @@ export class AddEditComponentMappingDialogComponent
delimiter: [this.data?.mapping?.delimiter ?? ',', Validators.required],
});
}
get disabledFileOptions() {
return this.initialFormValue?.file && !this.#fileChanged;
}
}

View File

@ -100,6 +100,7 @@
"dialog": {
"title": "{type, select, add{Add New} edit{Edit} other{}} Component Mapping"
},
"disabled-file-options": "",
"form": {
"delimiter": "",
"delimiter-placeholder": "",

View File

@ -1550,13 +1550,13 @@
"jump-to-next": "Springe zu Nächster",
"jump-to-previous": "Springe zu Vorheriger",
"label": "Arbeitsvorrat",
"no-annotations": "There are no annotations for the selected component.",
"no-annotations": "There are no annotations on the selected page or for the selected component.",
"page-is": "Diese Seite ist",
"reset": "reset",
"select": "Auswählen",
"select-all": "Alle",
"select-none": "Keine",
"show-skipped": "",
"show-skipped": "Show skipped in document",
"the-filters": "the filters",
"wrong-filters": "The selected filter combination is not possible. Please adjust or"
},

View File

@ -100,6 +100,7 @@
"dialog": {
"title": "{type, select, add{Add new} edit{Edit} other{}} component mapping"
},
"disabled-file-options": "Re-upload mapping file to change",
"form": {
"delimiter": "CSV delimiter",
"delimiter-placeholder": "CSV delimiter",
@ -1550,13 +1551,13 @@
"jump-to-next": "Jump to next",
"jump-to-previous": "Jump to previous",
"label": "Workload",
"no-annotations": "There are no annotations for the selected component.",
"no-annotations": "There are no annotations on the selected page or for the selected component.",
"page-is": "This page is",
"reset": "reset",
"select": "Select",
"select-all": "All",
"select-none": "None",
"show-skipped": "",
"show-skipped": "Show skipped in document",
"the-filters": "the filters",
"wrong-filters": "The selected filter combination is not possible. Please adjust or"
},