Commit 6987134b authored by Baptiste Toulemonde's avatar Baptiste Toulemonde
Browse files

fix control pua issues #33 #32

parent 646ea42d
......@@ -96,6 +96,8 @@ public class Notice extends IdDto {
private String path;
@JsonProperty("format")
private ProfileFormat format;
@JsonProperty("type")
private ProfileType type;
public Notice(Resource r) throws IOException {
String fileName = r.getFilename();
......@@ -114,6 +116,7 @@ public class Notice extends IdDto {
this.creationDate = new Timestamp(updateDate).toString();
this.tenant = 1;
this.version = 1;
this.type = getFileType(fileName);
this.name = getFileBaseName(fileName);
if (getFileType(fileName).equals(ProfileType.PUA)) {
InputStream inputStream = getClass().getClassLoader().getResourceAsStream("rng/" +
......
......@@ -25,13 +25,12 @@
<!--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>
<allow-additional-properties (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">
translate}}" placement="top" show-delay="0">
<pastis-user-action-save-profile [additional]="additionalProperties"></pastis-user-action-save-profile>
</div>
<!--Button setting-->
......@@ -51,8 +50,7 @@
[searchbarPlaceholder]="'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.SEARCH_PLACEHOLDER' | translate">
<!--Button add metadata-->
<button (click)="onAddNode()" *ngIf="checkElementType() && resolveButtonLabel(clickedNode) !== null"
class="btn primary ml-5"
style="text-transform: uppercase;">{{resolveButtonLabel(clickedNode)}}
class="btn primary ml-5" style="text-transform: uppercase;">{{resolveButtonLabel(clickedNode)}}
</button>
</vitamui-common-banner>
</div>
......@@ -61,8 +59,7 @@
<!--Metatada table container-->
<div class="pastis-table-container">
<table *ngIf="shouldLoadMetadataTable(); else complexElementWithouChild" [dataSource]="matDataSource"
class="list-profile-table"
mat-table>
class="list-profile-table" mat-table>
<!-- Name Column -->
<ng-container matColumnDef="nomDuChamp">
<th *matHeaderCellDef class="pastis-font-table-header pastis-col" mat-header-cell>
......@@ -81,7 +78,7 @@
</i>
<span *ngIf="isElementEdit(element) else nonEdit">{{element.nomDuChampEdit}}</span>
<ng-template #nonEdit> {{onResolveName(element.nomDuChamp)}}</ng-template>
<ng-template #nonEdit> {{onResolveName(element.nomDuChamp)}}</ng-template>
<mat-icon *ngIf="!isSedaCardinalityConform(element.cardinalite,selectedCardinalities[j])"
......@@ -104,17 +101,14 @@
<ng-container *ngSwitchCase="'date'">
<div class="pastis-vitamui-container-editable-valeur-fixe">
<vitamui-common-editable-textarea (ngModelChange)="setNodeValue(element,$event)"
[dpDayPicker]="config"
[maxlength]="120"
[ngModel]="element.valeurFixe"
class="valeur-fixe-pastis"
[disabled]="this.profileService.profileMode === 'PUA'">
[dpDayPicker]="config" [maxlength]="120" [ngModel]="element.valeurFixe" class="valeur-fixe-pastis"
[disabled]="profileService.profileMode === 'PUA'">
</vitamui-common-editable-textarea>
</div>
</ng-container>
<ng-container *ngSwitchCase="'enumeration'">
<mat-select [ngModel]="element.valeurFixe" class="mat-select-valeur-fixe"
placeholder="Choisissez une valeur" **ngIf="this.profileService.profileMode === 'PUA'">
placeholder="Choisissez une valeur" *ngIf="profileService.profileMode === 'PA'">
<mat-option [value]=""></mat-option>
<mat-option *ngFor="let val of element.enumeration; let i =index" [value]="val">
<mat-checkbox (change)="onChange(element,val);selected = i" [checked]="selected === i"> {{val}}
......@@ -125,8 +119,9 @@
<ng-container *ngIf="!checkElementType(element.nomDuChamp)">
<div *ngSwitchDefault class="pastis-vitamui-container-editable-valeur-fixe">
<vitamui-common-editable-textarea (ngModelChange)="setNodeValue(element,$event)" [maxlength]="120"
[ngModel]="element.valeurFixe" class="valeur-fixe-pastis" [disabled]="this.profileService.profileMode === 'PUA'">
</vitamui-common-editable-textarea >
[ngModel]="element.valeurFixe" class="valeur-fixe-pastis"
[disabled]="this.profileService.profileMode === 'PUA'">
</vitamui-common-editable-textarea>
</div>
</ng-container>
</ng-container>
......@@ -142,9 +137,8 @@
</th>
<td *matCellDef="let element;index as i" class="pastis-metadata-table-col-small" mat-cell>
<mat-select (ngModelChange)="setNodeChildrenCardinalities(element,$event)"
[ngModel]="selectedCardinalities[i]"
class="select-border" disableRipple="true"
panelClass="vitamui-mat-select">
[ngModel]="selectedCardinalities[i]" class="select-border" disableRipple="true"
panelClass="vitamui-mat-select">
<mat-option *ngFor="let c of element.cardinalite" [value]="c">
<span class="cardinality-text">{{c}}</span>
</mat-option>
......@@ -173,10 +167,10 @@
<th *matHeaderCellDef class="pastis-font-table-header pastis-col" mat-header-cell></th>
<td *matCellDef="let element;index as i" class="pastis-metadata-table-col-small" mat-cell>
<button (click)="onButtonClicked(element.id,$event)" *ngIf="isRowHovered(element.id)"
[center-mat-menu]="menuTrigger" [ngClass]="{'pastis-btn-metadata-options-active': isButtonClicked(element.id,matDataSource.data[rowIndex]),
'pastis-btn-metadata-options': !isButtonClicked(element.id,matDataSource.data[rowIndex]) }"
disableRipple="true" id="menuBtn"
mat-icon-button>
[center-mat-menu]="menuTrigger"
[ngClass]="{'pastis-btn-metadata-options-active': isButtonClicked(element.id,matDataSource.data[rowIndex]),
'pastis-btn-metadata-options': !isButtonClicked(element.id,matDataSource.data[rowIndex]) }" disableRipple="true"
id="menuBtn" mat-icon-button>
<mat-icon
[ngClass]="{'pastis-ico-menu-active': isButtonClicked(element.id,matDataSource.data[rowIndex]),
'pastis-ico-menu-inactive': !isButtonClicked(element.id,matDataSource.data[rowIndex])}">
......@@ -218,13 +212,13 @@
</mat-divider>
<mat-checkbox
*ngIf="isElementComplex(element.nomDuChamp) && this.profileService.profileMode==='PUA'&& isElementNameNotContentManagement(element.nomDuChamp)"
class="mat-menu-item" (change)="changeAutorisation($event, element)" [checked]="getNodeAdditionalProperties(element)">
<span class="allow_presence_text">Autoriser la presence de <br/> métadonnées non déclarées</span>
class="mat-menu-item" (change)="changeAutorisation($event, element)"
[checked]="getNodeAdditionalProperties(element)">
<span class="allow_presence_text">Autoriser la presence de <br /> métadonnées non déclarées</span>
<div class="placement-tooltip">
<i class="vitamui-icon vitamui-icon-info primary clickable"
matTooltip="Permet de modifier l’autorisation dans le manifeste de la présence de métadonnées non déclarées dans le PUA"
matTooltipClass="vitamui-tooltip"
style="font-size: 1.5em"></i>
matTooltip="Permet de modifier l’autorisation dans le manifeste de la présence de métadonnées non déclarées dans le PUA"
matTooltipClass="vitamui-tooltip" style="font-size: 1.5em"></i>
</div>
</mat-checkbox>
......@@ -237,7 +231,8 @@
</button>
<!-- Contrôle de métadonées => PUA -->
<mat-divider *ngIf="this.profileService.profileMode === 'PUA' && !isElementComplex(element.nomDuChamp) && element.id === clickedNode.id && !isAppliedControl(element.id)"
<mat-divider
*ngIf="this.profileService.profileMode === 'PUA' && !isElementComplex(element.nomDuChamp) && element.id === clickedNode.id && !isAppliedControl(element.id)"
style="border-top-color:#E0E0E0;">
</mat-divider>
<button (click)="onControlClick(element.id)"
......@@ -249,7 +244,8 @@
</button>
<!-- Edition des contres de nétadonnées -->
<mat-divider *ngIf="this.profileService.profileMode === 'PUA' && !isElementComplex(element.nomDuChamp) && element.id === clickedNode.id && isAppliedControl(element.id)"
<mat-divider
*ngIf="this.profileService.profileMode === 'PUA' && !isElementComplex(element.nomDuChamp) && element.id === clickedNode.id && isAppliedControl(element.id)"
style="border-top-color:#E0E0E0;">
</mat-divider>
<button (click)="onEditControlClick(element.id)"
......@@ -268,8 +264,7 @@
<tr *matHeaderRowDef="displayedColumns;sticky: true" class="pastis-table-row-header" mat-header-row></tr>
<tr (mouseenter)="onMouseOver(row)" (mouseleave)="onMouseLeave(row)"
*matRowDef="let row; columns: displayedColumns;"
class="pastis-table-row" mat-row></tr>
*matRowDef="let row; columns: displayedColumns;" class="pastis-table-row" mat-row></tr>
</table>
</div>
......@@ -282,9 +277,9 @@
<h2 class="pastis-dialog-config-title" matDialogTitle>
<span class="pastis-dialog-title">{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.ENUMERATION_CONTROLE' |
translate}}<mat-icon class="pastis-icon-primary "> <i
class="vitamui-icon vitamui-icon-info primary clickable" [matTooltip]="'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.INFO_ENNUMERATION' |
class="vitamui-icon vitamui-icon-info primary clickable" [matTooltip]="'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.INFO_ENNUMERATION' |
translate" matTooltipClass="vitamui-tooltip"></i>
</mat-icon>
</mat-icon>
</span>
</h2>
</div>
......@@ -296,9 +291,11 @@
<div class="ml-5 row">
<div class="col-4">
<mat-form-field class="mr-3 vitamui-mat-select" *ngIf="!isEmptyEnumeration(enumerationsSedaControl); else blockInput">
<mat-select multiple panelClass="vitamui-mat-select" name="enumsControlSeleted" (selectionChange)="addEnumsControlList($event.value)" [(ngModel)]="editedEnumControl">
<mat-option *ngFor="let element of enumerationsSedaControl" [value]="element" >
<mat-form-field class="mr-3 vitamui-mat-select"
*ngIf="!isEmptyEnumeration(enumerationsSedaControl); else blockInput">
<mat-select multiple panelClass="vitamui-mat-select" name="enumsControlSeleted"
(selectionChange)="addEnumsControlList($event.value)" [(ngModel)]="editedEnumControl">
<mat-option *ngFor="let element of enumerationsSedaControl" [value]="element">
{{element}}
</mat-option>
</mat-select>
......@@ -351,37 +348,39 @@
<div class="ml-5">
<div class="row">
<div>
<mat-radio-button value="select" class="text-text-normal pastis-radio" >
<mat-radio-button value="select" class="text-text-normal pastis-radio">
{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.FORMATAGE_PREDEFINI' |
translate}}:
</mat-radio-button>
</div>
<div>
<mat-form-field class="ml-3 vitamui-mat-select " >
<mat-select *ngIf="availableRegex.length > 1; else valueUnique"
disableRipple="true" panelClass="vitamui-mat-select" [(value)]="regex">
<div >
<mat-form-field class="ml-3 vitamui-mat-select ">
<mat-select *ngIf="availableRegex.length > 1; else valueUnique" disableRipple="true"
panelClass="vitamui-mat-select" [(value)]="regex">
<mat-option *ngFor="let predefiniElement of availableRegex" [value]="predefiniElement.value">
{{predefiniElement.label}}
</mat-option>
</mat-select>
<ng-template #valueUnique>
<mat-select
disableRipple="true" panelClass="vitamui-mat-select" [(value)]="regex" disabled>
<mat-option *ngFor="let predefiniElement of availableRegex"
[value]="availableRegex[0].value">
<ng-template #valueUnique>
<mat-select disableRipple="true" panelClass="vitamui-mat-select" [(value)]="regex" disabled>
<mat-option *ngFor="let predefiniElement of availableRegex" [value]="availableRegex[0].value">
{{predefiniElement.label}}
</mat-option>
</mat-select>
</ng-template>
<div class="select-arrow">
<i class="material-icons">keyboard_arrow_up</i>
<i class="material-icons">keyboard_arrow_down</i>
</div>
</mat-form-field>
</div>
{{predefiniElement.label}}
</mat-option>
</mat-select>
</ng-template>
<div class="select-arrow">
<i class="material-icons">keyboard_arrow_up</i>
<i class="material-icons">keyboard_arrow_down</i>
</div>
</mat-form-field>
</div>
</div>
</div>
......@@ -406,16 +405,18 @@
<div class="pastis-container-button-submit-controls">
<!--Button add metadata-->
<div class="row mt-3">
<button *ngIf=" (enumerationControl || expressionControl ) && (clickedControl.name === clickedNode.name )" [disabled]="this.enumsControlSeleted.length <= 0 && regex === null && customRegex === null"
class="btn primary ml-5" style="text-transform: uppercase;" (click)="onSubmitControls()">
{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.POPUP_CONTROL_OK_BUTTON_LABEL' | translate}}
</button>
<button *ngIf=" (enumerationControl || expressionControl ) && (clickedControl.name === clickedNode.name ) && isAppliedControl(clickedControl.id)"
class="btn delete ml-5" style="text-transform: uppercase;" (click)="onDeleteControls()">
{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.POPUP_CONTROL_DELETE_BUTTON_LABEL' | translate}}
</button>
<button *ngIf=" (enumerationControl || expressionControl ) && (clickedControl.name === clickedNode.name )"
[disabled]="this.enumsControlSeleted.length <= 0 && regex === null && customRegex === null"
class="btn primary ml-5" style="text-transform: uppercase;" (click)="onSubmitControls()">
{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.POPUP_CONTROL_OK_BUTTON_LABEL' | translate}}
</button>
<button
*ngIf=" (enumerationControl || expressionControl ) && (clickedControl.name === clickedNode.name ) && isAppliedControl(clickedControl.id)"
class="btn delete ml-5" style="text-transform: uppercase;" (click)="onDeleteControls()">
{{'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.POPUP_CONTROL_DELETE_BUTTON_LABEL' | translate}}
</button>
</div>
</div>
</div>
......@@ -429,4 +430,4 @@
</ng-template>
</mat-sidenav-content>
</mat-sidenav-container>
</mat-sidenav-container>
\ No newline at end of file
......@@ -227,10 +227,10 @@ export class FileTreeMetadataComponent {
additionalPropertiesMetadonnee: boolean;
constructor(private fileService: FileService, private fileMetadataService: FileTreeMetadataService,
private sedaService: SedaService, private fb: FormBuilder, private notificationService: NotificationService,
private router: Router, private startupService: StartupService, public profileService: ProfileService,
private fileTreeService: FileTreeService, private metadataLanguageService: PastisPopupMetadataLanguageService,
private translateService: TranslateService) {
private sedaService: SedaService, private fb: FormBuilder, private notificationService: NotificationService,
private router: Router, private startupService: StartupService, public profileService: ProfileService,
private fileTreeService: FileTreeService, private metadataLanguageService: PastisPopupMetadataLanguageService,
private translateService: TranslateService) {
this.config = {
locale: 'fr',
......@@ -595,6 +595,7 @@ export class FileTreeMetadataComponent {
}
onEditControlClick(fileNodeId: number) {
this.resetContols();
const fileNode = this.fileService.findChildById(fileNodeId, this.clickedNode);
this.clickedControl = fileNode;
if (fileNode.puaData && fileNode.puaData.enum && fileNode.puaData.enum.length > 0) {
......@@ -604,22 +605,33 @@ export class FileTreeMetadataComponent {
this.enumsControlSeleted = [];
this.openControls = true;
fileNode.puaData.enum.forEach(e => {
this.editedEnumControl.push(e)
this.enumsControlSeleted.push(e)
})
this.editedEnumControl.push(e);
this.enumsControlSeleted.push(e);
});
}
if (fileNode.puaData && fileNode.puaData.pattern) {
const actualPattern = fileNode.puaData.pattern;
this.openControls = true;
this.expressionControl = true;
this.customRegex = fileNode.puaData.pattern;
this.radioExpressionReguliere = 'select';
if (this.formatagePredefini.map( e => e.value).includes(actualPattern)) {
const sedaName = this.fileService.findChildById(fileNodeId, this.clickedNode);
const type: string = this.sedaService.findSedaChildByName(sedaName.name, this.selectedSedaNode).Type;
this.setAvailableRegex(type);
this.regex = this.availableRegex.filter(e => e.value === actualPattern).map( e => e.value)[0];
this.radioExpressionReguliere = 'select';
} else {
this.customRegex = actualPattern;
this.radioExpressionReguliere = 'input';
}
} else {
this.customRegex = '';
}
}
isAppliedControl(fileNodeId: number): boolean {
const fileNode = this.fileService.findChildById(fileNodeId, this.clickedNode);
if (fileNode.puaData && fileNode.puaData.enum) return true;
if (fileNode.puaData && fileNode.puaData.pattern) return true;
if (fileNode.puaData && fileNode.puaData.enum) { return true; }
if (fileNode.puaData && fileNode.puaData.pattern) { return true; }
return false;
}
......@@ -639,37 +651,46 @@ export class FileTreeMetadataComponent {
this.enumerationsSedaControl = [];
}
private setAvailableRegex(type: string) {
switch (type) {
case DateFormatType.date:
this.availableRegex = this.formatagePredefini.filter(e => e.label === 'AAAA-MM-JJ');
break;
case DateFormatType.dateTime:
this.availableRegex = this.formatagePredefini.filter(e => e.label === 'AAAA-MM-JJTHH:MM:SS');
break;
case DateFormatType.dateType:
this.availableRegex = this.formatagePredefini;
break;
default:
this.availableRegex = this.formatagePredefini
.filter(e => e.label === 'AAAA-MM-JJ' || e.label === 'AAAA');
break;
}
}
setControlsVues(elements: string[], sedaName: string) {
if ((this.isStandalone && elements.includes("Enumération")) || elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.ENUMERATIONS_LABEL'))) {
if ((this.isStandalone && elements.includes('Enumération'))
|| elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.ENUMERATIONS_LABEL'))) {
this.enumerationControl = true;
this.enumerationsSedaControl = this.sedaService.findSedaChildByName(sedaName, this.selectedSedaNode).Enumeration;
this.editedEnumControl = this.enumerationsSedaControl;
}
if ((this.isStandalone && elements.includes("Expression régulière")) || elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.EXPRESSION_REGULIERE_LABEL'))) {
if ((this.isStandalone && elements.includes('Expression régulière'))
|| elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.EXPRESSION_REGULIERE_LABEL'))) {
this.radioExpressionReguliere = 'select';
this.expressionControl = true;
this.customRegex = '';
const type: string = this.sedaService.findSedaChildByName(sedaName, this.selectedSedaNode).Type;
switch (type) {
case DateFormatType.date:
this.availableRegex = this.formatagePredefini.filter(e => e.label === 'AAAA-MM-JJ');
break;
case DateFormatType.dateTime:
this.availableRegex = this.formatagePredefini.filter(e => e.label === 'AAAA-MM-JJTHH:MM:SS');
break;
case DateFormatType.dateType:
this.availableRegex = this.formatagePredefini;
break;
default:
this.availableRegex = this.formatagePredefini
.filter(e => e.label === 'AAAA-MM-JJ' || e.label === 'AAAA');
break;
}
this.setAvailableRegex(type);
this.regex = this.formatagePredefini[0].value;
}
if ((this.isStandalone && elements.includes("Longueur Min/Max")) || elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.LENGTH_MIN_MAX_LABEL'))) {
if ((this.isStandalone && elements.includes('Longueur Min/Max'))
|| elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.LENGTH_MIN_MAX_LABEL'))) {
this.lengthControl = true;
}
if ((this.isStandalone && elements.includes("Valeur Min/Max")) || elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.VALUE_MIN_MAX_LABEL'))) {
if ((this.isStandalone && elements.includes('Valeur Min/Max'))
|| elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.VALUE_MIN_MAX_LABEL'))) {
this.valueControl = true;
}
......@@ -734,7 +755,7 @@ export class FileTreeMetadataComponent {
const node = this.sedaService.findSedaChildByName(nodeName, this.selectedSedaNode);
if (node && node.Children.length > 0) {
return (node.Children.find(c => c.Element == SedaElementConstants.attribute) !== undefined);
return (node.Children.find(c => c.Element === SedaElementConstants.attribute) !== undefined);
}
return false;
}
......
......@@ -77,7 +77,12 @@
<div class="vitamui-table">
<div class="vitamui-table-head">
<div class="col-2 d-flex align-items-center">
{{'PROFILE.LIST_PROFILE.TABLE.TYPE_ETAT' | translate}}
<div *ngIf="isStandalone">
{{'PROFILE.LIST_PROFILE.TABLE.TYPE' | translate}}
</div>
<div *ngIf="!isStandalone">
{{'PROFILE.LIST_PROFILE.TABLE.TYPE_ETAT' | translate}}
</div>
<vitamui-common-order-by-button [(direction)]="direction" [(orderBy)]="orderBy"
orderByKey="type">
</vitamui-common-order-by-button>
......@@ -106,10 +111,13 @@
<div *ngFor="let element of retrievedProfiles | filterByType:filterType | filterByStringName:search;"
class="vitamui-table-rows">
<div class="vitamui-row d-flex align-items-center">
<div (click)="showProfile(element)" class="col-2 clickable">
{{element.type}}<i *ngIf="element.status == 'ACTIVE'"
<div (click)="showProfile(element)" class="col-2 clickable" >
{{element.type}}
<div *ngIf="!isStandalone">
<i *ngIf="element.status == 'ACTIVE'"
class="status-badge-green ml-3"></i>
<i *ngIf="element.status == 'INACTIVE'" class="status-badge-red ml-3"></i>
</div>
</div>
<div (click)="showProfile(element)" class="col-3 clickable" style="word-wrap: break-word;">{{element.identifier}}</div>
<div (click)="showProfile(element)" class="col-3 clickable" style="word-wrap: break-word;">{{element.name}}</div>
......@@ -124,7 +132,7 @@
matTooltipPosition="above" matTooltipClass="modifierToolTip"></i>
</button>
<button (click)="changeExpand(element)" class="btn btn-circle outlin outline-primary mr-3">
<button (click)="changeExpand(element)" class="btn btn-circle outlin outline-primary mr-3" *ngIf="!isStandalone">
<i [style.fontSize.px]="25"
class="vitamui-icon vitamui-icon-more-horiz"></i>
</button>
......
......@@ -142,13 +142,15 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
constructor(private profileService: ProfileService, private noticeService: NoticeService,
private router: Router, private dialog: MatDialog,
private startupService: StartupService, private pastisConfig: PastisConfiguration, route: ActivatedRoute, globalEventService: GlobalEventService,
private dataGeneriquePopupService: DataGeneriquePopupService, private translateService: TranslateService, private toggleService : ToggleSidenavService) {
private startupService: StartupService, private pastisConfig: PastisConfiguration,
route: ActivatedRoute, globalEventService: GlobalEventService,
private dataGeneriquePopupService: DataGeneriquePopupService, private translateService: TranslateService,
private toggleService: ToggleSidenavService) {
super(route, globalEventService);
this.expanded = false;
this.pendingSub = this.toggleService.isPending.subscribe(status=>{
this.pendingSub = this.toggleService.isPending.subscribe(status => {
this.pending = status;
})
});
}
ngOnInit() {
......@@ -290,7 +292,7 @@ export class ListProfileComponent extends SidenavPage<ProfileDescription> implem
ngOnDestroy() {
this.profileService.retrievedProfiles.next([]);
this.subscriptions.forEach((subscriptions) => subscriptions.unsubscribe())
this.subscriptions.forEach((subscriptions) => subscriptions.unsubscribe());
if(this.pendingSub) this.pendingSub.unsubscribe();
}
......
......@@ -8,16 +8,16 @@
color: var(--vitamui-primary-600);
}
.pastis-button-valid {
background-color: transparent;
border-width: 0px;
color: green;
.other-icon {
padding: 6px;
}
.pastis-button-cancel {
background-color: transparent;
border-width: 0px;
color: red;
.editable-field-actions {
display: inline;
}
.editable-field-confirm {
margin-right: 2px;
}
.pastis-input-edit {
......
......@@ -5,14 +5,11 @@
</span>
<span class="ml-1">
<button class="pastis-button" (click)="$event.stopPropagation()" *ngIf="!editmode" (click)="edit()"><i class="material-icons edit-icon">edit</i></button>
<button (click)="$event.stopPropagation()" *ngIf="editmode" class="pastis-button-valid" (click)="save()" ><i class="material-icons">check</i></button>
<div class="editable-field-actions" *ngIf="editmode">
<button type="button" class="editable-field-confirm" (click)="$event.stopPropagation(); save()"><i class="material-icons other-icon">check</i></button>
<button type="button" class="editable-field-cancel" (click)="$event.stopPropagation(); cancel()"><i class="material-icons other-icon">clear</i></button>
</div>
</span>
<span class="ml-1">
<button class="pastis-button-cancel" (click)="$event.stopPropagation()" *ngIf="editmode" (click)="cancel()"><i class="material-icons">clear</i></button>
</span>
<ng-template #elseBlock> <span class="mr-3">{{ node.editName ? node.editName : node.name }}</span> </ng-template>
\ No newline at end of file
......@@ -64,12 +64,12 @@ function constantToTranslate() {
export class UserActionAddPuaControlComponent implements OnInit {
btnIsDisabled: boolean;
enumerationsLabel: string = "Enumération";
expressionReguliereLabel: string = "Expression régulière";
lengthMinMaxLabel: string = "Longueur Min/Max";
valueMinMaxLabel: string = "Valeur Min/Max";
enumerationsDefinition: string = "Signaler les valeurs autorisées";
expressionReguliereDefinition: string = "Définir une expression régulière pour la valeur de la métadonnée";
enumerationsLabel = 'Enumération';
expressionReguliereLabel = 'Expression régulière';
lengthMinMaxLabel = 'Longueur Min/Max';