diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html index 7cdfd12d203179e510b86d653d420d94171db385..250f76fea1aaa33f2ad7c69b6a06c3f3049a24f0 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html @@ -37,7 +37,8 @@ [childrenListToExclude]="headerTabChildrenToExclude" [shouldLoad]="isTabClicked(1)" [collectionName]="collectionNames[1]" - [puaMode]="puaMode"> + [puaMode]="puaMode" + [activeTabIndex]="activeTabIndex"> </pastis-file-tree> </ng-template> @@ -56,7 +57,8 @@ [childrenListToExclude]="rulesTabChildrenToExclude" [shouldLoad]="isTabClicked(2)" [collectionName]="collectionNames[2]" - [puaMode]="puaMode"> + [puaMode]="puaMode" + [activeTabIndex]="activeTabIndex"> </pastis-file-tree> </ng-template> @@ -74,7 +76,8 @@ [childrenListToExclude]="treeTabChildrenToExclude" [shouldLoad]="isTabClicked(3)" [collectionName]="collectionNames[3]" - [puaMode]="puaMode"> + [puaMode]="puaMode" + [activeTabIndex]="activeTabIndex"> </pastis-file-tree> </ng-template> </div> @@ -92,7 +95,8 @@ [childrenListToExclude]="objectTabChildrenToExclude" [shouldLoad]="isTabClicked(4)" [collectionName]="collectionNames[4]" - [puaMode]="puaMode"> + [puaMode]="puaMode" + [activeTabIndex]="activeTabIndex"> </pastis-file-tree> </ng-template> diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.html b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.html index 118729f5b1e6ad3e52494d21a620fe9da19bb741..0f6a0d116afa4e5d711b1abe5fe42c6031404443 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.html +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.html @@ -4,6 +4,11 @@ <!-- Nested tree node--> <mat-nested-tree-node *matTreeNodeDef="let node;when:hasNestedChild"> + <div *ngIf="node.name === rootElementName && ((activeTabIndex === 3 && !puaMode) || (activeTabIndex === 1 && puaMode)) " class="pastis-btn-container-add-ua"> + <button class="btn primary" (click)= addArchiveUnit(node) > + AJOUTER UNE UA + </button> + </div> <ng-container *ngIf="!isAttribute(node) && shouldBeOnTab(node) && node" > <mat-list-item (mouseover)="hover=node.children.length" (click)="updateMedataTable(node);nestedTreeControl.expand(node)" @@ -46,7 +51,7 @@ tooltip="Ajouter une UA" tooltip-class="pastis-tooltip-class"> <!--Button plus--> - <button class="pastis-btn-add-ua" (click)= "addArchiveUnit(node)"> + <button class="pastis-btn-add-ua" *ngIf="!puaMode" (click)= "addArchiveUnit(node)"> <i class="vitamui-icon vitamui-icon-add" style="color: var(--vitamui-primary);"></i> <span class="pastis-btn-add-ua-text">Ajouter une ua</span> </button> diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.scss b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.scss index 9ceb0cbe9048f11fd2deb6a732ccd474f4c1a9aa..0d8363421de4f2b147567f6dacac88245d148598 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.scss +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.scss @@ -207,3 +207,14 @@ min-width: 100%; background-color: #F6F3FB; } +.pastis-btn-container-add-ua{ + background-color: #F6F3FB; + height: 70px; + margin-left: 40px; +} + +.primary { + @extend .primary; + background-color: var(--vitamui-primary) !important; + box-shadow: none !important; +} diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts index 69929bcb7fe9b3393a6a6cf914388d715ea93a06..26965d6dc9c229a7e06fb26cf161c30230f46086 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts @@ -79,6 +79,8 @@ export class FileTreeComponent { collectionName: string @Input() puaMode: boolean; + @Input() + activeTabIndex: number; nodeToSend: FileNode; data: FileNode;