Commit 562d49db authored by Baptiste Toulemonde's avatar Baptiste Toulemonde
Browse files

issues #34 #35

parent afbfd3f4
......@@ -25,7 +25,7 @@
<!--Toggle button allow additional properties-->
<div *ngIf="this.profileService.profileMode==='PUA' && this.isStandalone" class="panel-buttons" matTooltip="{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.ADDITIONAL_PROPERTIES_TOOLTIP' |
translate}}">
<allow-additional-properties [checked]="additionalProperties" (stateToggleButton)="changeStatusAditionalProperties($event)">
<allow-additional-properties [checked]="clickedNode.additionalProperties" (stateToggleButton)="changeStatusAditionalProperties($event)">
</allow-additional-properties>
</div>
<!--Button save-->
......@@ -306,9 +306,11 @@
</mat-form-field>
<ng-template #blockInput>
<vitamui-common-editable-input (ngModelChange)="addEnumsControl($event)" [ngModel]="editedEnumControl">
</vitamui-common-editable-input>
</vitamui-common-editable-input>
</ng-template>
</div>
<div class="col-8" *ngIf="isEmptyEnumeration(enumerationsSedaControl) && isDataType()"><p class="pastis-indication">{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.FORMAT_ENUMERATION_AUTORISES' |
translate}}: <span *ngFor="let regex of availableRegex">{{ regex.label }}, </span></p></div>
</div>
<div *ngIf="enumsControlSeleted?.length > 0" class="pastis-container-selected-items mt-5">
<div *ngFor="let item of enumsControlSeleted ;let i =index" style="display: inline-flex">
......
......@@ -226,6 +226,15 @@ table {
));
}
.pastis-indication {
font-size: 16px;
font-family: 'Mulish', sans-serif;
color: #212121 ;
font-weight: 400;
vertical-align: middle;
}
.pastis-btn-add-tag {
width: 210px;
float: left;
......
......@@ -223,7 +223,6 @@ export class FileTreeMetadataComponent {
cardinalite: string[];
commentaire: string;
enumeration: string[];
additionalProperties: boolean;
additionalPropertiesMetadonnee: boolean;
constructor(private fileService: FileService, private fileMetadataService: FileTreeMetadataService,
......@@ -257,7 +256,7 @@ export class FileTreeMetadataComponent {
this.popupControlOkLabel = 'AJOUTER LES CONTROLES';
}
this.additionalProperties = false;
this.additionalPropertiesMetadonnee = false;
this.docPath = this.isStandalone ? 'assets/doc/Standalone - Documentation APP - PASTIS.pdf' : 'assets/doc/VITAM UI - Documentation APP - PASTIS.pdf';
this.languagePopup = false;
......@@ -271,7 +270,6 @@ export class FileTreeMetadataComponent {
);
this._fileServiceSubscriptionNodeChange = this.fileService.nodeChange.subscribe(node => {
this.clickedNode = node;
this.additionalProperties = node.additionalProperties;
// BreadCrumb for navigation through metadatas
if (node && node !== undefined) {
const breadCrumbNodeLabel: string = node.name;
......@@ -605,6 +603,8 @@ export class FileTreeMetadataComponent {
this.editedEnumControl = [];
this.enumsControlSeleted = [];
this.openControls = true;
const type: string = this.sedaService.findSedaChildByName(fileNode.name, this.selectedSedaNode).Type;
this.setAvailableRegex(type);
fileNode.puaData.enum.forEach(e => {
this.editedEnumControl.push(e);
this.enumsControlSeleted.push(e);
......@@ -670,6 +670,11 @@ export class FileTreeMetadataComponent {
}
}
isDataType(): boolean {
const type: string = this.sedaService.findSedaChildByName(this.clickedControl.name, this.selectedSedaNode).Type;
return (type === DateFormatType.date || type === DateFormatType.dateTime || type === DateFormatType.dateType);
}
setControlsVues(elements: string[], sedaName: string) {
if ((this.isStandalone && elements.includes('Enumération'))
|| elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.ENUMERATIONS_LABEL'))) {
......@@ -677,6 +682,8 @@ export class FileTreeMetadataComponent {
this.enumerationsSedaControl = this.sedaService.findSedaChildByName(sedaName, this.selectedSedaNode).Enumeration;
this.editedEnumControl = this.enumerationsSedaControl;
this.enumsControlSeleted = this.enumerationsSedaControl;
const type: string = this.sedaService.findSedaChildByName(sedaName, this.selectedSedaNode).Type;
this.setAvailableRegex(type);
}
if ((this.isStandalone && elements.includes('Expression régulière'))
|| elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.EXPRESSION_REGULIERE_LABEL'))) {
......
......@@ -172,7 +172,7 @@
"POPUP_VALIDER": "Validate",
"POPUP_ANNULER": "Cancel",
"ENREGISTRER_PROFIL_TOOLTIP": "Export profile",
"TELECHARGER_MANUEL_TOOLTIP": "Setting",
"TELECHARGER_MANUEL_TOOLTIP": "Settings and resources",
"NOM_METADONNEE": "Metadata name",
"VALEUR_FIXE": "Fixed value",
"CARDINALITE": "Cardinality",
......@@ -181,6 +181,7 @@
"CONTROLE_METADONNEE": "Metadata control",
"EDITION_CONTROLE": "Edit controls",
"ENUMERATION_CONTROLE": "\"Enumeration\" type control",
"FORMAT_ENUMERATION_AUTORISES": "Allowed date format(s) for this metadata ",
"INFO_EXPRESSION": "Set regular expression for metadata value",
"INFO_ENNUMERATION": "Mention allowed values",
"FORMATAGE_PREDEFINI": "Use predefined formatting",
......
......@@ -172,7 +172,7 @@
"POPUP_VALIDER": "Valider",
"POPUP_ANNULER": "Annuler",
"ENREGISTRER_PROFIL_TOOLTIP": "Exporter le profil",
"TELECHARGER_MANUEL_TOOLTIP": "Paramètres",
"TELECHARGER_MANUEL_TOOLTIP": "Paramètres et ressources",
"NOM_METADONNEE": "Nom de la métadonnée",
"VALEUR_FIXE": "Valeur fixe",
"CARDINALITE": "Cardinalité",
......@@ -181,6 +181,7 @@
"CONTROLE_METADONNEE": "Contrôle de métadonnée",
"EDITION_CONTROLE": "Modifier les contrôles",
"ENUMERATION_CONTROLE": "Contrôle de type \"Enumération\"",
"FORMAT_ENUMERATION_AUTORISES": "Format(s) de date autorisé(s) pour cette métadonnée",
"FORMATAGE_PREDEFINI": "Utiliser un formatage prédéfini",
"SAISIR_EXPRESSION": "Saisir une expression régulière",
"EXPRESSION_CONTROLE": "Contrôle de type \"Expression régulière\"",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment