Commit aa1c0742 authored by Baptiste Toulemonde's avatar Baptiste Toulemonde
Browse files

fix retour 1803 + css edition nom ua

parent 21782a2f
......@@ -107,13 +107,14 @@
[dpDayPicker]="config"
[maxlength]="120"
[ngModel]="element.valeurFixe"
class="valeur-fixe-pastis">
class="valeur-fixe-pastis"
[disabled]="this.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">
placeholder="Choisissez une valeur" [disabled]="this.profileService.profileMode === 'PUA'">
<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}}
......@@ -124,8 +125,8 @@
<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">
</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>
......@@ -410,7 +411,7 @@
{{'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 secondary ml-5" style="text-transform: uppercase;" (click)="onDeleteControls()">
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>
......
......@@ -440,6 +440,10 @@ dp-day-calendar .dp-day-calendar-container {
}
}
button.delete {
border: 1px solid
}
.pastis-vitamui-container-editable-commentaire{
width: 203px;
height:50px;
......
......@@ -158,8 +158,7 @@ export class FileTreeMetadataComponent {
{ label: 'AAAA-MM-JJ', value: '[0-9]{4}-[0-9]{2}-[0-9]{2}' },
{ label: 'AAAA-MM-JJTHH:MM:SS', value: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}' },
{ label: 'AAAA', value: '[0-9]{4}' },
{ label: 'AAAA-MM', value: '[0-9]{4}-[0-9]{2}' },
{ label: 'Adresse mail', value: '[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}' }
{ label: 'AAAA-MM', value: '[0-9]{4}-[0-9]{2}' }
];
availableRegex: Array<{ label: string, value: string }>;
......@@ -658,11 +657,11 @@ export class FileTreeMetadataComponent {
this.availableRegex = this.formatagePredefini.filter(e => e.label === 'AAAA-MM-JJTHH:MM:SS');
break;
case DateFormatType.dateType:
this.availableRegex = this.formatagePredefini.slice(0, -1);
this.availableRegex = this.formatagePredefini;
break;
default:
this.availableRegex = this.formatagePredefini
.filter(e => e.label === 'AAAA-MM-JJ' || e.label === 'AAAA' || e.label === 'Adresse mail');
.filter(e => e.label === 'AAAA-MM-JJ' || e.label === 'AAAA');
break;
}
this.regex = this.formatagePredefini[0].value;
......@@ -849,9 +848,9 @@ export class FileTreeMetadataComponent {
return this.sedaService.isDuplicated(nomDuChamp, this.selectedSedaNode);
}
isElementEdit(node: MetadataHeaders) : boolean {
if(this.profileService.profileMode==='PUA') return false;
if (node.nomDuChampEdit){
isElementEdit(node: MetadataHeaders): boolean {
if (this.profileService.profileMode === 'PUA') { return false; }
if (node.nomDuChampEdit) {
return true;
}
return false;
......
<mat-tree #treeSelector
*ngIf="fileTreeService.nestedTreeControl && fileTreeService.nestedDataSource"
[dataSource]="fileTreeService.nestedDataSource" [treeControl]="fileTreeService.nestedTreeControl"
class="pastis-tree">
<mat-tree #treeSelector *ngIf="fileTreeService.nestedTreeControl && fileTreeService.nestedDataSource"
[dataSource]="fileTreeService.nestedDataSource" [treeControl]="fileTreeService.nestedTreeControl" class="pastis-tree">
<!-- Nested tree node-->
<mat-nested-tree-node *matTreeNodeDef="let node;when:hasNestedChild">
<div *ngIf="node.name === rootElementName && (activeTabIndex === 2 && this.profileService.profileMode === 'PA') "
class="pastis-btn-container-add-ua">
class="pastis-btn-container-add-ua">
<button (click)=addArchiveUnit(node) class="btn primary">
{{'PROFILE.EDIT_PROFILE.FILE_TREE.AJOUTER_UA' | translate}}
</button>
</div>
<ng-container *ngIf="!isAttribute(node) && shouldBeOnTab(node) && node">
<mat-list-item
(click)="updateMedataTable(node);fileTreeService.nestedTreeControl.expand(node)"
<mat-list-item (click)="updateMedataTable(node);fileTreeService.nestedTreeControl.expand(node)"
(mouseover)="hover=node.children.length"
[ngClass]="{'list-item':!selectedItem(node),'list-item-select':selectedItem(node)}"
>
[ngClass]="{'list-item':!selectedItem(node),'list-item-select':selectedItem(node)}">
<!--Root node name-->
<span *ngIf="node.name === rootElementName && this.profileService.profileMode === 'PA'"
class="pastis-tree-node-root-name">
<span [ngStyle]="{'margin-left': calculateNodePosition(node) + 'px'}">
{{rootElementShowName}}
</span>
<mat-divider class="pastis-divider"></mat-divider>
class="pastis-tree-node-root-name">
<span [ngStyle]="{'margin-left': calculateNodePosition(node) + 'px'}">
{{rootElementShowName}}
</span>
<mat-divider class="pastis-divider"></mat-divider>
</span>
<!--Root children without children-->
<span (click)="updateMedataTable(node);$event.stopPropagation()"
*ngIf="!node.children.length && node.name !== rootElementName
<span (click)="updateMedataTable(node);$event.stopPropagation()" *ngIf="!node.children.length && node.name !== rootElementName
&& isPartOfCollection(node) && shouldBeOnTab(node) && !isAttribute(node)"
[ngStyle]="{'margin-left': calculateNodePosition(node) + 'px'}"
class="pastis-tree-node-name">
[ngStyle]="{'margin-left': calculateNodePosition(node) + 'px'}" class="pastis-tree-node-name">
<span class="text text-medium">{{onResolveName(node)}}</span>
<mat-divider class="pastis-divider"></mat-divider>
</span>
<!--Root children with children-->
<span *ngIf="node.children.length && node.name !== rootElementName
&& isPartOfCollection(node) && shouldBeOnTab(node) && !isAttribute(node)">
<div (click)="expendChildren(node);$event.stopPropagation()"
[ngStyle]="{'margin-left': calculateNodePosition(node) + 'px' , 'width': '350px' }">
<span *ngIf="isElementComplexAndHasChildren(node)"
[ngClass]="{'pastis-chevron-icon': !fileTreeService.nestedTreeControl.isExpanded(node),'pastis-chevron-icon-selected':fileTreeService.nestedTreeControl.isExpanded(node)}">
<mat-icon>{{fileTreeService.nestedTreeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}</mat-icon>
<div (click)="expendChildren(node);$event.stopPropagation()"
[ngStyle]="{'margin-left': calculateNodePosition(node) + 'px' , 'width': '360px' }">
<span *ngIf="isElementComplexAndHasChildren(node)"
[ngClass]="{'pastis-chevron-icon': !fileTreeService.nestedTreeControl.isExpanded(node),'pastis-chevron-icon-selected':fileTreeService.nestedTreeControl.isExpanded(node)}">
<mat-icon>{{fileTreeService.nestedTreeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</span>
<button [id]="'child' + node.id" [ngStyle]="{'display': 'none' }" mat-icon-button matTreeNodeToggle>
</button>
<span class="pastis-tree-node-name">
<span [ngClass]="{'text-medium-normal':!selectedItem(node),'text-medium-primary':selectedItem(node)}"
class="text text-medium" *ngIf="node.nonEditFileNode || node.name==='ArchiveUnit'; else elseBlock">
<modify-text-button *ngIf="this.profileService.profileMode ==='PA'"
(textEdit)="changeFileNode($event, node)" [node]="node"></modify-text-button>
{{this.profileService.profileMode ==='PUA' ? onResolveName(node) : ''}}
</span>
<button [id]="'child' + node.id" [ngStyle]="{'display': 'none' }" mat-icon-button
matTreeNodeToggle>
</button>
<span class="pastis-tree-node-name">
<span [ngClass]="{'text-medium-normal':!selectedItem(node),'text-medium-primary':selectedItem(node)}"
class="text text-medium" *ngIf="node.nonEditFileNode || node.name==='ArchiveUnit'; else elseBlock">
<modify-text-button *ngIf="this.profileService.profileMode==='PA'" (textEdit)="changeFileNode($event, node)" [node]="node"></modify-text-button>
{{this.profileService.profileMode==='PUA' ? onResolveName(node) : ''}}
</span>
<ng-template #elseBlock>{{onResolveName(node)}}</ng-template>
<span *ngIf="node.nonEditFileNode || node.name === 'ArchiveUnit'"
matTooltip="Ajouter une UA"
matTooltipClass="pastis-tooltip-class"
style="float: right;">
<ng-template #elseBlock>{{onResolveName(node)}}</ng-template>
<span *ngIf="node.nonEditFileNode || node.name === 'ArchiveUnit'" matTooltip="Ajouter une UA"
matTooltipClass="pastis-tooltip-class" style="float: right;">
<!--Button plus-->
<button (click)="addArchiveUnit(node)" *ngIf="this.profileService.profileMode === 'PA'"
class="pastis-btn-add-ua">
<i class="vitamui-icon vitamui-icon-add" style="color: var(--vitamui-primary);"></i>
<span
class="pastis-btn-add-ua-text">{{'PROFILE.EDIT_PROFILE.FILE_TREE.AJOUTER_UA_ICON' | translate}}</span>
</button>
</span>
<!--Button plus-->
<button (click)="addArchiveUnit(node)" *ngIf="this.profileService.profileMode === 'PA'"
class="pastis-btn-add-ua">
<i class="vitamui-icon vitamui-icon-add" style="color: var(--vitamui-primary);"></i>
<span class="pastis-btn-add-ua-text">{{'PROFILE.EDIT_PROFILE.FILE_TREE.AJOUTER_UA_ICON' |
translate}}</span>
</button>
</span>
</div>
<mat-divider class="pastis-divider"></mat-divider>
</span>
</span>
</div>
<mat-divider class="pastis-divider"></mat-divider>
</span>
</mat-list-item>
<ul [hidden]="!fileTreeService.nestedTreeControl.isExpanded(node)" class="pastis-tree-ul">
......@@ -83,4 +77,4 @@
</mat-nested-tree-node>
</mat-tree>
</mat-tree>
\ No newline at end of file
.ok{
z-index: 999;
flex-flow: row;
}
.pastis-button {
......@@ -17,6 +17,7 @@
.pastis-input-edit {
padding: 10px;
border-radius: 10% ;
border: var(--buttons-border);
border: 1px solid var(--buttons-border);
border-radius: 5px;
box-shadow: 0px 0px 2px rgba(33, 33, 33, 0.2), 0px 1px 4px rgba(33, 33, 33, 0.05);
}
\ No newline at end of file
<div class="ok row mb-2">
<div class="col-6 mr-5" *ngIf="editmode ; else elseBlock">
<input class="pastis-input-edit" [(ngModel)]="editText" type="text" />
</div>
<div class="col-2">
<button class="pastis-button" *ngIf="!editmode" (click)="edit()">edit</button>
<button class="pastis-button" *ngIf="editmode" (click)="save()">save</button>
</div>
<div class="col-2">
<button class="pastis-button" *ngIf="editmode" (click)="cancel()">cancel</button>
</div>
</div>
<span *ngIf="editmode ; else elseBlock">
<input (click)="$event.stopPropagation()" class="pastis-input-edit" [(ngModel)]="editText" type="text" />
</span>
<span class="ml-1">
<button class="pastis-button" (click)="$event.stopPropagation()" *ngIf="!editmode" (click)="edit()">edit</button>
<button class="pastis-button" (click)="$event.stopPropagation()" *ngIf="editmode" (click)="save()">save</button>
</span>
<span class="ml-1">
<button class="pastis-button" (click)="$event.stopPropagation()" *ngIf="editmode" (click)="cancel()">cancel</button>
</span>
<ng-template #elseBlock> <div class="col-6">{{ node.editName ? node.editName : node.name}}</div></ng-template>
\ No newline at end of file
<ng-template #elseBlock> <span class="mr-3">{{ node.editName ? node.editName : node.name }}</span> </ng-template>
\ No newline at end of file
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