Skip to content
Snippets Groups Projects
Verified Commit c7b61404 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #8218 modif basket list component

parent 428e8d4c
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
{{basket.basket_name}}<br/><small color="primary">({{lang.redirectedTo}} {{basket.redirectedUser}})</small> {{basket.basket_name}}<br/><small color="primary">({{lang.redirectedTo}} {{basket.redirectedUser}})</small>
</p> </p>
</a> </a>
<a mat-list-item *ngIf="!basket.redirected" routerLink="/basketList/{{regroupedBasket.groupSerialId}}/baskets/{{basket.basket_id}}" style="cursor:pointer;" [ngStyle]="{'opacity': basket.resourceNumber==0 ? '0.5' : '1'}"> <a mat-list-item *ngIf="!basket.redirected" (click)="closePanelLeft();" routerLink="/basketList/{{regroupedBasket.groupSerialId}}/baskets/{{basket.basket_id}}" style="cursor:pointer;" [ngStyle]="{'opacity': basket.resourceNumber==0 ? '0.5' : '1'}">
<mat-icon [ngStyle]="{'color': basket.color}" *ngIf="!mobileMode" mat-list-icon class="fa fa-inbox"></mat-icon> <mat-icon [ngStyle]="{'color': basket.color}" *ngIf="!mobileMode" mat-list-icon class="fa fa-inbox"></mat-icon>
<span *ngIf="basket.resourceNumber==0" class="badge" style="min-width:auto;">{{basket.resourceNumber}}</span> <span *ngIf="basket.resourceNumber==0" class="badge" style="min-width:auto;">{{basket.resourceNumber}}</span>
<span *ngIf="basket.resourceNumber!=0" bgcolor="warn" class="badge" style="min-width:auto;">{{basket.resourceNumber}}</span> <span *ngIf="basket.resourceNumber!=0" bgcolor="warn" class="badge" style="min-width:auto;">{{basket.resourceNumber}}</span>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
autoFocus="false" style="overflow-x:hidden;" [ngStyle]="{'width': mobileMode ? '80%' : '400px'}"> autoFocus="false" style="overflow-x:hidden;" [ngStyle]="{'width': mobileMode ? '80%' : '400px'}">
<menu-shortcut></menu-shortcut> <menu-shortcut></menu-shortcut>
<menu-nav></menu-nav> <menu-nav></menu-nav>
<basket-home *ngIf="homeData" [homeData]="homeData"></basket-home> <basket-home *ngIf="homeData" [homeData]="homeData" [snavL]="snav"></basket-home>
<mat-divider></mat-divider> <mat-divider></mat-divider>
</mat-sidenav> </mat-sidenav>
<mat-sidenav-content> <mat-sidenav-content>
...@@ -20,7 +20,11 @@ ...@@ -20,7 +20,11 @@
style="width:100%;table-layout: fixed;"> style="width:100%;table-layout: fixed;">
<!-- Number Column --> <!-- Number Column -->
<ng-container matColumnDef="res_id"> <ng-container matColumnDef="res_id">
<td mat-cell *matCellDef="let row" style="text-align:center;width:10%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> <td mat-cell *matCellDef="let row" [ngStyle]="{'width': mobileMode ? '30%' : '10%'}" style="text-align:center;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;vertical-align: top;">
<div *ngIf="row.closing_date == null && mobileMode" id="{{row.res_id}}_creation_date" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"
title='{{row.creation_date | date : "le dd/MM/y à HH:mm"}}'>
<i class="fa fa-calendar" title="date d'enregistrement"></i> {{row.creation_date | timeAgo}}
</div>
<div style="overflow: hidden;text-overflow: ellipsis;"> <div style="overflow: hidden;text-overflow: ellipsis;">
<mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="{{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}} {{row.status_icon}} {{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}}-2x" title="{{row.status_label}}"></mat-icon> <mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="{{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}} {{row.status_icon}} {{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}}-2x" title="{{row.status_label}}"></mat-icon>
</div> </div>
...@@ -31,11 +35,18 @@ ...@@ -31,11 +35,18 @@
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="subject"> <ng-container matColumnDef="subject">
<td mat-cell *matCellDef="let row" style="width:50%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> <td mat-cell *matCellDef="let row" style="width:50%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;vertical-align: top;">
<div *ngIf="row.closing_date == null && mobileMode" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;text-align: right;">
<i class="fa fa-stopwatch" title="date limite de traitement"></i>&nbsp;
<span [innerHTML]="row.process_limit_date | timeLimit" title='{{row.process_limit_date | date : "le dd/MM/y à HH:mm"}}'></span>
</div>
<div style="overflow: hidden;text-overflow: ellipsis;" title="{{row.subject}}"> <div style="overflow: hidden;text-overflow: ellipsis;" title="{{row.subject}}">
<span class="label" [ngStyle]="{'background': row.priority_color}">{{row.priority_label}}</span>&nbsp; <span *ngIf="!mobileMode" class="label" [ngStyle]="{'background': row.priority_color}">{{row.priority_label}}</span>&nbsp;
<span>{{row.subject}}</span> <span>{{row.subject}}</span>
</div> </div>
<div *ngIf="mobileMode" style="padding-top: 5px;color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;text-align: right;">
{{row.dest_user}}
</div>
<!--<div> <!--<div>
<button mat-stroked-button color="primary" style="margin:5px;line-height: 20px;width: 150px;overflow: hidden;text-overflow: ellipsis;">réponse du zpfezk zekf opezf</button> <button mat-stroked-button color="primary" style="margin:5px;line-height: 20px;width: 150px;overflow: hidden;text-overflow: ellipsis;">réponse du zpfezk zekf opezf</button>
<button mat-stroked-button color="primary" style="margin:5px;line-height: 20px;width: 150px;overflow: hidden;text-overflow: ellipsis;">réponse du zpfezk zekf opezf</button> <button mat-stroked-button color="primary" style="margin:5px;line-height: 20px;width: 150px;overflow: hidden;text-overflow: ellipsis;">réponse du zpfezk zekf opezf</button>
...@@ -47,7 +58,7 @@ ...@@ -47,7 +58,7 @@
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="contact_society"> <ng-container matColumnDef="contact_society">
<td mat-cell *matCellDef="let row" style="width:25%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> <td mat-cell *matCellDef="let row" style="width:25%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;vertical-align: top;">
<div style="overflow: hidden;text-overflow: ellipsis;"> <div style="overflow: hidden;text-overflow: ellipsis;">
<i class="fa fa-address-card" color="primary"></i>&nbsp; <i class="fa fa-address-card" color="primary"></i>&nbsp;
<span *ngIf="row.contact_lastname==''">{{row.contact_society}}</span> <span *ngIf="row.contact_lastname==''">{{row.contact_society}}</span>
...@@ -63,7 +74,7 @@ ...@@ -63,7 +74,7 @@
</ng-container> </ng-container>
<ng-container matColumnDef="creation_date"> <ng-container matColumnDef="creation_date">
<td mat-cell *matCellDef="let row" style="text-align: right;width:15%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> <td mat-cell *matCellDef="let row" style="text-align: right;width:15%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;vertical-align: top;">
<div *ngIf="row.closing_date == null" id="{{row.res_id}}_creation_date" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;" <div *ngIf="row.closing_date == null" id="{{row.res_id}}_creation_date" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"
title='{{row.creation_date | date : "le dd/MM/y à HH:mm"}}'> title='{{row.creation_date | date : "le dd/MM/y à HH:mm"}}'>
<i class="fa fa-calendar" title="date d'enregistrement"></i> {{row.creation_date | timeAgo}} <i class="fa fa-calendar" title="date d'enregistrement"></i> {{row.creation_date | timeAgo}}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
autoFocus="false" style="overflow-x:hidden;" [ngStyle]="{'width': mobileMode ? '80%' : '400px'}"> autoFocus="false" style="overflow-x:hidden;" [ngStyle]="{'width': mobileMode ? '80%' : '400px'}">
<menu-shortcut></menu-shortcut> <menu-shortcut></menu-shortcut>
<menu-nav></menu-nav> <menu-nav></menu-nav>
<basket-home *ngIf="homeData" [homeData]="homeData"></basket-home> <basket-home *ngIf="homeData" [homeData]="homeData" [snavL]="snav"></basket-home>
<mat-divider></mat-divider> <mat-divider></mat-divider>
</mat-sidenav> </mat-sidenav>
<mat-sidenav-content> <mat-sidenav-content>
...@@ -25,7 +25,11 @@ ...@@ -25,7 +25,11 @@
<mat-tab label="Mes derniers courriers"> <mat-tab label="Mes derniers courriers">
<table mat-table [dataSource]="dataSource" matSort matSortActive="res_id" matSortDisableClear matSortDirection="asc" style="width:100%;table-layout: fixed;"> <table mat-table [dataSource]="dataSource" matSort matSortActive="res_id" matSortDisableClear matSortDirection="asc" style="width:100%;table-layout: fixed;">
<ng-container matColumnDef="res_id"> <ng-container matColumnDef="res_id">
<td mat-cell *matCellDef="let row" style="text-align:center;width:15%;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;"> <td mat-cell *matCellDef="let row" [ngStyle]="{'width': mobileMode ? '30%' : '10%'}" style="text-align:center;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;padding: 5px;vertical-align: top;">
<div *ngIf="row.closing_date == null && mobileMode" id="{{row.res_id}}_creation_date" style="color: rgba(0,0,0,0.4);font-size: 90%;overflow: hidden;text-overflow: ellipsis;"
title='{{row.creation_date | date : "le dd/MM/y à HH:mm"}}'>
<i class="fa fa-calendar" title="date d'enregistrement"></i> {{row.creation_date | timeAgo}}
</div>
<div style="overflow: hidden;text-overflow: ellipsis;"> <div style="overflow: hidden;text-overflow: ellipsis;">
<mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="{{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}} {{row.status_icon}} {{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}}-2x" title="{{row.status_label}}"></mat-icon> <mat-icon [ngStyle]="{'color': row.priority_color}" color="primary" class="{{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}} {{row.status_icon}} {{row.status_icon.charAt(0)}}{{row.status_icon.charAt(1)}}-2x" title="{{row.status_label}}"></mat-icon>
</div> </div>
...@@ -41,6 +45,11 @@ ...@@ -41,6 +45,11 @@
<span class="label" [ngStyle]="{'background': row.priority_color}">{{row.priority_label}}</span>&nbsp; <span class="label" [ngStyle]="{'background': row.priority_color}">{{row.priority_label}}</span>&nbsp;
<span>{{row.subject}}</span> <span>{{row.subject}}</span>
</div> </div>
<div *ngIf="mobileMode" style="text-align: right">
<button mat-icon-button (click)="$event.stopPropagation();goTo(row);">
<mat-icon color="primary" class="fa fa-eye fa-2x"></mat-icon>
</button>
</div>
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="contact_society"> <ng-container matColumnDef="contact_society">
......
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { LANG } from '../translate.component'; import { LANG } from '../translate.component';
import { MatSidenav } from '@angular/material';
declare function $j(selector: any) : any; declare function $j(selector: any) : any;
declare var angularGlobals : any; declare var angularGlobals : any;
...@@ -17,6 +18,7 @@ export class BasketHomeComponent implements OnInit { ...@@ -17,6 +18,7 @@ export class BasketHomeComponent implements OnInit {
mobileMode : boolean = false; mobileMode : boolean = false;
@Input() homeData: any; @Input() homeData: any;
@Input() snavL: MatSidenav;
constructor(public http: HttpClient) { constructor(public http: HttpClient) {
this.mobileMode = angularGlobals.mobileMode; this.mobileMode = angularGlobals.mobileMode;
...@@ -33,4 +35,10 @@ export class BasketHomeComponent implements OnInit { ...@@ -33,4 +35,10 @@ export class BasketHomeComponent implements OnInit {
goToRedirect(basketId:any,owner:any) { goToRedirect(basketId:any,owner:any) {
window.location.href="index.php?page=view_baskets&module=basket&baskets="+basketId+"_"+owner+"&groupId="; window.location.href="index.php?page=view_baskets&module=basket&baskets="+basketId+"_"+owner+"&groupId=";
} }
closePanelLeft() {
if(this.mobileMode) {
this.snavL.close();
}
}
} }
...@@ -58,6 +58,10 @@ export class BasketListComponent implements OnInit { ...@@ -58,6 +58,10 @@ export class BasketListComponent implements OnInit {
this.loading = false; this.loading = false;
if (this.mobileMode) {
this.displayedColumnsBasket = ['res_id', 'subject'];
}
this.http.get(this.coreUrl + "rest/home") this.http.get(this.coreUrl + "rest/home")
.subscribe((data: any) => { .subscribe((data: any) => {
this.homeData = data; this.homeData = data;
......
...@@ -52,6 +52,10 @@ export class HomeComponent extends AutoCompletePlugin implements OnInit { ...@@ -52,6 +52,10 @@ export class HomeComponent extends AutoCompletePlugin implements OnInit {
} }
ngOnInit(): void { ngOnInit(): void {
if (this.mobileMode) {
this.displayedColumns = ['res_id', 'subject'];
}
window['MainHeaderComponent'].refreshTitle(this.lang.home); window['MainHeaderComponent'].refreshTitle(this.lang.home);
window['MainHeaderComponent'].setSnav(this.snav); window['MainHeaderComponent'].setSnav(this.snav);
window['MainHeaderComponent'].setSnavRight(null); window['MainHeaderComponent'].setSnavRight(null);
...@@ -75,10 +79,8 @@ export class HomeComponent extends AutoCompletePlugin implements OnInit { ...@@ -75,10 +79,8 @@ export class HomeComponent extends AutoCompletePlugin implements OnInit {
goTo(row:any){ goTo(row:any){
if (this.docUrl == this.coreUrl+'rest/res/'+row.res_id+'/content' && this.sidenavRight.opened) { if (this.docUrl == this.coreUrl+'rest/res/'+row.res_id+'/content' && this.sidenavRight.opened) {
this.displayedColumns = ['res_id', 'subject', 'creation_date'];
this.sidenavRight.close(); this.sidenavRight.close();
} else { } else {
this.displayedColumns = ['res_id', 'subject', 'creation_date'];
this.docUrl = this.coreUrl+'rest/res/'+row.res_id+'/content'; this.docUrl = this.coreUrl+'rest/res/'+row.res_id+'/content';
this.innerHtml = this.sanitizer.bypassSecurityTrustHtml( this.innerHtml = this.sanitizer.bypassSecurityTrustHtml(
"<object style='height:100%;width:100%;' data='" + this.docUrl + "' type='application/pdf' class='embed-responsive-item'>" + "<object style='height:100%;width:100%;' data='" + this.docUrl + "' type='application/pdf' class='embed-responsive-item'>" +
...@@ -86,7 +88,6 @@ export class HomeComponent extends AutoCompletePlugin implements OnInit { ...@@ -86,7 +88,6 @@ export class HomeComponent extends AutoCompletePlugin implements OnInit {
"</object>"); "</object>");
this.sidenavRight.open(); this.sidenavRight.open();
} }
//window.open(this.coreUrl+'rest/res/'+row.res_id+'/content');
} }
goToDetail(row:any){ goToDetail(row:any){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment