Verified Commit afc1e0bf authored by Alex ORLUC's avatar Alex ORLUC

FIX #11641 TIME 1:30 fix refresh folder after aucotomplete + autoclose basket…

FIX #11641 TIME 1:30 fix refresh folder after aucotomplete + autoclose basket panel in folder list + fix icon size header and left panel
parent 9a8eac8a
<mat-divider *ngIf="homeData.regroupedBaskets.length > 0 || homeData.assignedBaskets.length > 0">
</mat-divider>
<mat-expansion-panel class="basketList" expanded *ngIf="homeData.regroupedBaskets.length > 0 || homeData.assignedBaskets.length > 0">
<mat-expansion-panel class="basketList" [expanded]="appService.getStateBasketMenu()" *ngIf="homeData.regroupedBaskets.length > 0 || homeData.assignedBaskets.length > 0">
<mat-expansion-panel-header>
<mat-panel-title>
<i class="fa fa-inbox"></i>&nbsp;{{lang.myBaskets}}
<i class="fa fa-inbox panelIconMenu"></i>&nbsp;{{lang.myBaskets}}
</mat-panel-title>
</mat-expansion-panel-header>
<mat-form-field floatLabel="never" appearance="outline" class="basketsFilter" style="padding-left:20px;padding-right:20px;font-size: 11px;">
......
......@@ -57,3 +57,7 @@
padding-bottom: 5px;
}
}
.panelIconMenu {
font-size: 22px;
}
\ No newline at end of file
......@@ -22,6 +22,7 @@ export class BasketHomeComponent implements OnInit {
basketId: ''
};
@Input() snavL: MatSidenav;
@Input('opened') opened: boolean;
@Output('refreshEvent') refreshEvent = new EventEmitter<string>();
constructor(
......
......@@ -84,7 +84,10 @@ export class FolderDocumentListComponent implements OnInit {
allResInBasket: number[] = [];
selectedDiffusionTab: number = 0;
folderInfo: any = {
id: 0
id: 0,
'label': '',
'ownerDisplayName': '',
'entitiesSharing': []
};
private destroy$ = new Subject<boolean>();
......@@ -115,6 +118,7 @@ export class FolderDocumentListComponent implements OnInit {
}
ngOnInit(): void {
this.appService.openBasketMenu(false);
this.loading = false;
this.http.get("../../rest/home")
......
<div class="folderTools">
<div class="filter">
<plugin-autocomplete [size]="'small'" [labelPlaceholder]="lang.searchFolder" [routeDatas]="['/rest/autocomplete/folders']" [targetSearchKey]="'idToDisplay'" (triggerEvent)="goTo($event)"></plugin-autocomplete>
<plugin-autocomplete [size]="'small'" [labelPlaceholder]="lang.searchFolder"
[routeDatas]="['/rest/autocomplete/folders']" [targetSearchKey]="'idToDisplay'"
(triggerEvent)="goTo($event)"></plugin-autocomplete>
</div>
<div>
<button mat-icon-button color="accent" title="{{lang.addRootFolder}}" (click)="toggleInput()">
......@@ -13,36 +15,46 @@
<form>
<mat-form-field floatLabel="never" style="width: 100%;">
<input matInput id="itemValue" #itemValue placeholder="{{lang.addRootFolder}}">
<button type="submit" matSuffix mat-icon-button (click)="createRoot(itemValue.value);createRootNode = !createRootNode" [disabled]="itemValue.value === ''">
<button type="submit" matSuffix mat-icon-button
(click)="createRoot(itemValue.value);createRootNode = !createRootNode"
[disabled]="itemValue.value === ''">
<mat-icon class="fa fa-check" color="accent" [title]="lang.add"></mat-icon>
</button>
</mat-form-field>
</form>
</mat-list-item>
</mat-list>
<mat-nav-list>
</mat-list>
<mat-nav-list>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<!-- This is the tree node template for leaf nodes -->
<mat-tree-node cdkDropList [id]="'folder-list-'+node.id" cdkDropListConnectedTo="['document-list','folder-list']" (cdkDropListDropped)="drop($event, node)" (cdkDropListEntered)="dragEnter(node)" (cdkDropListExited)="node.drag=false" [@hideShow] *matTreeNodeDef="let node"
matTreeNodePadding matTreeNodePaddingIndent="20px">
<mat-tree-node cdkDropList [id]="'folder-list-'+node.id"
cdkDropListConnectedTo="['document-list','folder-list']" (cdkDropListDropped)="drop($event, node)"
(cdkDropListEntered)="dragEnter(node)" (cdkDropListExited)="node.drag=false" [@hideShow]
*matTreeNodeDef="let node" matTreeNodePadding matTreeNodePaddingIndent="20px">
<!-- use a disabled button to provide padding for tree leaf -->
<button class="expandButton" mat-icon-button disabled></button>
<a mat-list-item disableRipple class="folderTreeItem" [class.selectedFolder]="node.selected" (mouseenter)="showAction(node)" (mouseleave)="hideAction(node)" (click)="selectFolder(node)">
<a mat-list-item disableRipple class="folderTreeItem" [class.selectedFolder]="node.selected"
(mouseenter)="showAction(node)" (mouseleave)="hideAction(node)" (click)="selectFolder(node)">
<span style="width: 90%;overflow: hidden;text-overflow: ellipsis;">
<span class="treeLabel" [title]="node.label" [class.drag]="node.drag">
<i class="fa fa-users private" *ngIf="node.public" title="{{lang.sharedFolder}}"></i> {{node.label}}
<i class="fa fa-users private" *ngIf="node.public" title="{{lang.sharedFolder}}"></i>
{{node.label}}
</span>
</span>
<button mat-icon-button [matMenuTriggerFor]="menu" (click)="$event.stopPropagation();showAction(node);checkRights(node);" [disabled]="!node.showAction" style="position: absolute;right:0px;">
<button mat-icon-button [matMenuTriggerFor]="menu"
(click)="$event.stopPropagation();showAction(node);checkRights(node);" [disabled]="!node.showAction"
style="position: absolute;right:0px;">
<mat-icon *ngIf="node.showAction" class="folderAction fa fa-ellipsis-v"></mat-icon>
<span *ngIf="!node.showAction" class="countResources" [class.empty]="node.countResources === 0">
{{node.countResources}}
</span>
</button>
<mat-menu #menu="matMenu">
<button mat-menu-item [disabled]="createItemNode || !node.canAdd" (click)="addNewItem(node)">{{lang.addSubFolder}}</button>
<button mat-menu-item [disabled]="createItemNode || !node.canAdd"
(click)="addNewItem(node)">{{lang.addSubFolder}}</button>
<button mat-menu-item (click)="deleteNode(node)" [disabled]="!node.edition">{{lang.delete}}</button>
<button mat-menu-item (click)="openFolderAdmin(node)" [disabled]="!node.edition">{{lang.update}}</button>
<button mat-menu-item (click)="openFolderAdmin(node)"
[disabled]="!node.edition">{{lang.update}}</button>
</mat-menu>
</a>
</mat-tree-node>
......@@ -50,41 +62,50 @@
<form>
<mat-form-field floatLabel="never" style="width: 100%;padding-left: 10px;padding-right: 10px;">
<input matInput id="itemValue" #itemValue placeholder="{{lang.addFolder}}...">
<button type="submit" matSuffix mat-icon-button (click)="saveNode(node, itemValue.value)" [disabled]="itemValue.value === ''">
<button type="submit" matSuffix mat-icon-button (click)="saveNode(node, itemValue.value)"
[disabled]="itemValue.value === ''">
<mat-icon class="fa fa-check" color="accent" [title]="lang.add"></mat-icon>
</button>
</mat-form-field>
</form>
</mat-tree-node>
<!-- This is the tree node template for expandable nodes -->
<mat-tree-node cdkDropList [id]="'folder-list-'+node.id" cdkDropListConnectedTo="list-1" (cdkDropListDropped)="drop($event, node)" (cdkDropListEntered)="dragEnter(node)" (cdkDropListExited)="node.drag=false" [@hideShow] *matTreeNodeDef="let node;when: hasChild"
<mat-tree-node cdkDropList [id]="'folder-list-'+node.id" cdkDropListConnectedTo="list-1"
(cdkDropListDropped)="drop($event, node)" (cdkDropListEntered)="dragEnter(node)"
(cdkDropListExited)="node.drag=false" [@hideShow] *matTreeNodeDef="let node;when: hasChild"
matTreeNodePadding matTreeNodePaddingIndent="20px">
<button class="expandButton" mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror fa {{treeControl.isExpanded(node) ? 'fa-chevron-down' : 'fa-chevron-right'}}">
<mat-icon
class="mat-icon-rtl-mirror fa {{treeControl.isExpanded(node) ? 'fa-chevron-down' : 'fa-chevron-right'}}">
</mat-icon>
</button>
<a mat-list-item disableRipple class="folderTreeItem" [class.selectedFolder]="node.selected" (mouseleave)="hideAction(node)" (mouseenter)="showAction(node)" (click)="selectFolder(node)">
<a mat-list-item disableRipple class="folderTreeItem" [class.selectedFolder]="node.selected"
(mouseleave)="hideAction(node)" (mouseenter)="showAction(node)" (click)="selectFolder(node)">
<span style="width: 90%;overflow: hidden;text-overflow: ellipsis;">
<span class="treeLabel" [title]="node.label" [class.drag]="node.drag">
<i class="fa fa-users private" *ngIf="node.public" title="{{lang.sharedFolder}}"></i> {{node.label}}
<i class="fa fa-users private" *ngIf="node.public" title="{{lang.sharedFolder}}"></i>
{{node.label}}
</span>
</span>
<button mat-icon-button [matMenuTriggerFor]="menu" (click)="$event.stopPropagation();checkRights(node);" [disabled]="!node.showAction" style="position: absolute;right:0px;">
<button mat-icon-button [matMenuTriggerFor]="menu" (click)="$event.stopPropagation();checkRights(node);"
[disabled]="!node.showAction" style="position: absolute;right:0px;">
<mat-icon *ngIf="node.showAction" class="folderAction fa fa-ellipsis-v"></mat-icon>
<span *ngIf="!node.showAction" class="countResources" [class.empty]="node.countResources === 0">
{{node.countResources}}
</span>
</button>
<mat-menu #menu="matMenu">
<button mat-menu-item [disabled]="createItemNode || !node.canAdd" (click)="addNewItem(node)">{{lang.addSubFolder}}</button>
<button mat-menu-item [disabled]="createItemNode || !node.canAdd"
(click)="addNewItem(node)">{{lang.addSubFolder}}</button>
<button mat-menu-item (click)="deleteNode(node)" [disabled]="!node.edition">{{lang.delete}}</button>
<button mat-menu-item (click)="openFolderAdmin(node)" [disabled]="!node.edition">{{lang.update}}</button>
<button mat-menu-item (click)="openFolderAdmin(node)"
[disabled]="!node.edition">{{lang.update}}</button>
</mat-menu>
</a>
</mat-tree-node>
</mat-tree>
</mat-nav-list>
<!--<mat-nav-list>
</mat-nav-list>
<!--<mat-nav-list>
<mat-list-item role="listitem" disableRipple (click)="toggleInput()" class="more">
<mat-icon class="fa {{createRootNode ? 'fa-chevron-up' : 'fa-chevron-down'}}"></mat-icon>&nbsp;{{createRootNode ? lang.less : lang.more}}
</mat-list-item>
......
......@@ -447,6 +447,8 @@ export class FolderTreeComponent implements OnInit {
}
goTo(folder: any) {
this.seletedId = folder.id;
this.getFolders();
this.router.navigate(["/folders/" + folder.id]);
}
}
<mat-expansion-panel class="folderList" expanded>
<mat-expansion-panel-header>
<mat-panel-title>
<i class="fa fa-folder"></i>&nbsp;{{lang.folders}}
<i class="fa fa-folder panelIconMenu"></i>&nbsp;{{lang.folders}}
</mat-panel-title>
</mat-expansion-panel-header>
<folder-tree #folderTree [selectedId]="id" (refreshDocList)="refreshDocList()"></folder-tree>
......
......@@ -25,3 +25,7 @@
font-weight: bold;
}
}
.panelIconMenu {
font-size: 22px;
}
\ No newline at end of file
......@@ -2,5 +2,5 @@
<button *ngIf="!snavLeft.opened" mat-icon-button (click)="snavLeft.open()" style="font-size:20px;">
<mat-icon class="fa fa-stream"></mat-icon>
</button>
<i *ngIf="headerService.headerMessageIcon !== ''" class="{{headerService.headerMessageIcon}}"></i> {{headerService.headerMessage}} <span class="admin-toolbar-title-small">{{headerService.subHeaderMessage}}</span>
<i *ngIf="headerService.headerMessageIcon !== ''" class="{{headerService.headerMessageIcon}} headerIcon"></i> {{headerService.headerMessage}} <span class="admin-toolbar-title-small">{{headerService.subHeaderMessage}}</span>
</div>
\ No newline at end of file
......@@ -5,3 +5,7 @@
margin-top: -10px;
}
}
.headerIcon {
font-size: 22px;
}
\ No newline at end of file
......@@ -9,6 +9,9 @@ export class AppService {
currentUser: any;
isBasketMenuOpen: boolean = true;
isFolderMenuOpen: boolean = true;
constructor(changeDetectorRef: ChangeDetectorRef, media: MediaMatcher) {
this.mobileQuery = media.matchMedia('(max-width: 768px)');
this._mobileQueryListener = () => changeDetectorRef.detectChanges();
......@@ -30,4 +33,20 @@ export class AppService {
ngOnDestroy(): void {
this.mobileQuery.removeListener(this._mobileQueryListener);
}
openBasketMenu(state: boolean) {
return this.isBasketMenuOpen = state;
}
openFolderMenu(state: boolean) {
return this.isFolderMenuOpen = state;
}
getStateBasketMenu() {
return this.isBasketMenuOpen;
}
getStateFolderMenu() {
return this.isFolderMenuOpen;
}
}
Markdown is supported
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