diff --git a/frontend/src/app/GN2CommonModule/form/dynamic-form/dynamic-form.component.html b/frontend/src/app/GN2CommonModule/form/dynamic-form/dynamic-form.component.html index 77eb38208b..766f63b878 100644 --- a/frontend/src/app/GN2CommonModule/form/dynamic-form/dynamic-form.component.html +++ b/frontend/src/app/GN2CommonModule/form/dynamic-form/dynamic-form.component.html @@ -232,6 +232,7 @@ [sizeMax]="appConfig.MEDIAS.MEDIAS_SIZE_MAX" [default]="formDefComp.default || {}" [details]="formDefComp.details" + [hideDetailsFields]="formDefComp.hide_details_fields" > diff --git a/frontend/src/app/GN2CommonModule/form/media/media-form-definition.ts b/frontend/src/app/GN2CommonModule/form/media/media-form-definition.ts index a2792fda25..08963f1cfd 100644 --- a/frontend/src/app/GN2CommonModule/form/media/media-form-definition.ts +++ b/frontend/src/app/GN2CommonModule/form/media/media-form-definition.ts @@ -45,7 +45,7 @@ export const mediaFormDefinitionsDict = { attribut_label: 'Avancé', definition: "Afficher plus d'options pour le formulaire", value: true, - hidden: ({ meta }) => !(meta.details && meta.details.length) + hidden: ({ meta }) => !(meta.details && meta.details.length) || meta.hideDetailsFields }, id_nomenclature_media_type: { attribut_label: 'Type de média', diff --git a/frontend/src/app/GN2CommonModule/form/media/media.component.ts b/frontend/src/app/GN2CommonModule/form/media/media.component.ts index 57cd6b46a3..2e35ed0a42 100644 --- a/frontend/src/app/GN2CommonModule/form/media/media.component.ts +++ b/frontend/src/app/GN2CommonModule/form/media/media.component.ts @@ -42,6 +42,9 @@ export class MediaComponent implements OnInit { @Input() details = []; + /* fix #1083 Cacher les champs présents dans details */ + @Input() hideDetailsFields : boolean = false; + constructor( private _formBuilder: FormBuilder, public ms: MediaService, @@ -54,7 +57,8 @@ export class MediaComponent implements OnInit { mediaFormDefinitionsDict, { nomenclatures: this.ms.metaNomenclatures(), - details: this.details + details: this.details, + hideDetailsFields: this.hideDetailsFields } ); diff --git a/frontend/src/app/GN2CommonModule/form/media/medias.component.html b/frontend/src/app/GN2CommonModule/form/media/medias.component.html index 654320f5e7..b893ac9f8d 100644 --- a/frontend/src/app/GN2CommonModule/form/media/medias.component.html +++ b/frontend/src/app/GN2CommonModule/form/media/medias.component.html @@ -74,6 +74,7 @@ [sizeMax]="sizeMax" [default]="default" [details]="details" + [hideDetailsFields]="hideDetailsFields" > diff --git a/frontend/src/app/GN2CommonModule/form/media/medias.component.ts b/frontend/src/app/GN2CommonModule/form/media/medias.component.ts index fbd51e942d..64304c83ca 100644 --- a/frontend/src/app/GN2CommonModule/form/media/medias.component.ts +++ b/frontend/src/app/GN2CommonModule/form/media/medias.component.ts @@ -31,6 +31,9 @@ export class MediasComponent implements OnInit { @Input() disabled = false; @Input() disabledTxt: string; + /* fix #1083 Cacher les champs présents dans details */ + @Input() hideDetailsFields : boolean = false; + public bInitialized: boolean; constructor(public ms: MediaService) {}