Merge remote-tracking branch 'origin/master' into RED-9747

This commit is contained in:
Dan Percic 2024-08-08 13:57:34 +02:00
commit 0af6e45868
11 changed files with 40 additions and 25 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

@ -12,7 +12,7 @@ import { FileWorkloadComponent } from '../table-item/file-workload/file-workload
import { ProcessingIndicatorComponent } from '@shared/components/processing-indicator/processing-indicator.component';
import { FileActionsComponent } from '../../../shared-dossiers/components/file-actions/file-actions.component';
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
import { ActiveListingEntityService } from '@services/active-listing-entity.service';
import { ActiveListingEntityService } from '@common-ui/listing/services/active-listing-entity.service';
@Component({
selector: 'redaction-workflow-item',

View File

@ -10,7 +10,7 @@ import { TranslateModule } from '@ngx-translate/core';
import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
import { firstValueFrom } from 'rxjs';
import { ComponentLogService } from '@services/files/component-log.service';
import { ActiveListingEntityService } from '@services/active-listing-entity.service';
import { ActiveListingEntityService } from '@common-ui/listing/services/active-listing-entity.service';
@Component({
selector: 'redaction-file-download-btn',

View File

@ -1,13 +0,0 @@
import { Injectable, signal } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class ActiveListingEntityService {
readonly #activeEntity = signal<string>('');
readonly activeEntity = this.#activeEntity.asReadonly();
updateEntity(entity: string = '') {
this.#activeEntity.set(entity);
}
}

View File

@ -100,6 +100,7 @@
"dialog": {
"title": "{type, select, add{Neues Komponenten-Mapping erstellen} edit{Komponenten-Mapping bearbeiten} other{}}"
},
"disabled-file-options": "",
"form": {
"delimiter": "",
"delimiter-placeholder": "",

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

@ -100,6 +100,7 @@
"dialog": {
"title": "{type, select, add{Add new} edit{Edit} other{}} component mapping"
},
"disabled-file-options": "",
"form": {
"delimiter": "CSV delimiter",
"delimiter-placeholder": "CSV delimiter",
@ -535,9 +536,9 @@
"title": "{length} {length, plural, one{component} other{components}}"
},
"component-download": {
"json": "Download as JSON",
"report": "",
"xml": "Download as XML"
"json": "Components as JSON",
"report": "Report",
"xml": "Components as XML"
},
"component-management": {
"actions": {
@ -1032,7 +1033,7 @@
"reanalyse": {
"action": "Datei analysieren"
},
"report-download": "",
"report-download": "Report download",
"start-auto-analysis": "Enable auto-analysis",
"stop-auto-analysis": "Stop auto-analysis",
"table-col-names": {

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",
@ -535,9 +536,9 @@
"title": "{length} {length, plural, one{component} other{components}}"
},
"component-download": {
"json": "Download as JSON",
"json": "Components as JSON",
"report": "Report",
"xml": "Download as XML"
"xml": "Components as XML"
},
"component-management": {
"actions": {

@ -1 +1 @@
Subproject commit 66277814c5e2d224f78dad5e28c94ac4d084409b
Subproject commit f079b6c157a0336fb4c521d692309517317df565