Commit 2a809e81 authored by toulemonde's avatar toulemonde
Browse files

Merge branch 'feat/211#321' into 'fix/sprint4_150322'

Feat/211#321

See merge request !73
parents 5fa0438d 562d49db
......@@ -72,6 +72,7 @@ public class JsonFromPUA {
idCounter = 0L;
// Adding root element DescriptiveMetadata
ElementProperties root = new ElementProperties();
root.setAdditionalProperties(controlSchema.getBoolean("additionalProperties"));
root.setName("DescriptiveMetadata");
root.setId(idCounter++);
root.setLevel(0);
......
......@@ -54,10 +54,6 @@ export class AppComponent implements OnInit {
}
ngOnInit() {
if (this.isStandalone) {
document.title = 'PASTIS';
}
}
ngOnInit() {}
}
......@@ -25,13 +25,13 @@
<!--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 (stateToggleButton)="changeStatusAditionalProperties($event)">
<allow-additional-properties [checked]="clickedNode.additionalProperties" (stateToggleButton)="changeStatusAditionalProperties($event)">
</allow-additional-properties>
</div>
<!--Button save-->
<div class="panel-buttons" matTooltip="{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.ENREGISTRER_PROFIL_TOOLTIP' |
translate}}" placement="top" show-delay="0">
<pastis-user-action-save-profile [additional]="additionalProperties"></pastis-user-action-save-profile>
<pastis-user-action-save-profile ></pastis-user-action-save-profile>
</div>
<!--Button setting-->
<div class="panel-buttons" matTooltip="{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.TELECHARGER_MANUEL_TOOLTIP' |
......@@ -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;
......@@ -604,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);
......@@ -669,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'))) {
......@@ -676,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'))) {
......@@ -949,7 +957,7 @@ export class FileTreeMetadataComponent {
}
changeStatusAditionalProperties($event: boolean) {
this.additionalProperties = $event;
this.clickedNode.additionalProperties = $event;
}
......@@ -982,4 +990,6 @@ export class FileTreeMetadataComponent {
}
return false;
}
}
......@@ -161,7 +161,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
this.popupCreationCancelLabel = 'Annuler';
this.popupCreationTitleDialog = 'Choix du type de profil';
this.popupCreationSubTitleDialog = 'Création d\'un profil';
this.popupCreationOkLabel = 'TERMINER';
this.popupCreationOkLabel = 'VALIDER';
}
this.dataGeneriquePopupService.currentDonnee.subscribe(donnees => this.donnees = donnees);
this.breadcrumbDataTop = [{ label: 'PROFILE.EDIT_PROFILE.BREADCRUMB.PORTAIL', url: this.startupService.getPortalUrl(), external: true}, { label: 'PROFILE.EDIT_PROFILE.BREADCRUMB.CREER_ET_GERER_PROFIL', url: '/'}];
......
import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
@Component({
selector: 'allow-additional-properties',
......@@ -15,8 +15,8 @@ export class AllowAdditionalPropertiesComponent implements OnInit {
}
@Output() stateToggleButton = new EventEmitter<boolean>();
checked = false;
@Input()
checked: boolean;
text : string;
text1: string;
......
......@@ -35,7 +35,7 @@ same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-C license and that you accept its terms.
*/
import {Component, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core';
import {Component, EventEmitter, OnDestroy, OnInit, Output} from '@angular/core';
import {ProfileService} from '../../core/services/profile.service';
import {FileService} from '../../core/services/file.service';
import {FileNode} from '../../models/file-node';
......@@ -113,8 +113,6 @@ export class UserActionSaveProfileComponent implements OnInit, OnDestroy {
profileDescription: ProfileDescription;
fileRng: File;
@Input() additional: boolean;
@Output() close = new EventEmitter();
constructor(private profileService: ProfileService, private fileService: FileService,
......@@ -159,7 +157,6 @@ export class UserActionSaveProfileComponent implements OnInit, OnDestroy {
saveProfileToFile() {
// Retrieve the current file tree data as a JSON
this.data = this.fileService.allData.getValue();
this.data[0].additionalProperties = this.additional;
if (this.isStandalone) {
this.downloadProfiles(true);
} else {
......
......@@ -111,7 +111,7 @@
"POPUP_CREATION_CANCEL_LABEL":"CANCEL",
"POPUP_CREATION_TITLE_DIALOG": "Choice of record type",
"POPUP_CREATION_SUBTITLE_DIALOG":"Creating a record",
"POPUP_CREATION_OK_LABEL": "TERMINATE"
"POPUP_CREATION_OK_LABEL": "CONFIRM"
},
"EDIT_PROFILE": {
"NOTICE_TAB": "Notice",
......@@ -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",
......
......@@ -111,7 +111,7 @@
"POPUP_CREATION_CANCEL_LABEL":"ANNULER",
"POPUP_CREATION_TITLE_DIALOG": "Choix du type de notice",
"POPUP_CREATION_SUBTITLE_DIALOG":"Création d'une notice",
"POPUP_CREATION_OK_LABEL": "TERMINER"
"POPUP_CREATION_OK_LABEL": "VALIDER"
},
"EDIT_PROFILE": {
"NOTICE_TAB": "Notice",
......@@ -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\"",
......
......@@ -45,6 +45,7 @@ if (environment.production) {
}
if (environment.standalone) {
document.title = 'PASTIS';
document.getElementById('favicon').setAttribute('href', '../assets/favicon.ico');
}
platformBrowserDynamic().bootstrapModule(AppModule)
......
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