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

FEAT #14947 TIME 0:45 fix redirect basket css + disable current user for redirection

parent 86186b1d
No related branches found
No related tags found
No related merge requests found
...@@ -95,7 +95,8 @@ ...@@ -95,7 +95,8 @@
{{this.ruleText}}</div> {{this.ruleText}}</div>
<div class="col-sm-6" style="padding-left:0px;padding-right: 0px;"> <div class="col-sm-6" style="padding-left:0px;padding-right: 0px;">
<mat-form-field style="padding:10px;"> <mat-form-field style="padding:10px;">
<input matInput #inputPasswd placeholder="{{'lang.typeNewPassword' | translate}}" <input matInput #inputPasswd
placeholder="{{'lang.typeNewPassword' | translate}}"
formControlName="newPasswordCtrl" required formControlName="newPasswordCtrl" required
[type]="hidePassword ? 'password' : 'text'"> [type]="hidePassword ? 'password' : 'text'">
<mat-icon matSuffix (click)="hidePassword = !hidePassword" <mat-icon matSuffix (click)="hidePassword = !hidePassword"
...@@ -110,8 +111,9 @@ ...@@ -110,8 +111,9 @@
</div> </div>
<div class="col-sm-6" style="padding-left:0px;padding-right:0px;"> <div class="col-sm-6" style="padding-left:0px;padding-right:0px;">
<mat-form-field style="padding:10px;"> <mat-form-field style="padding:10px;">
<input matInput #inputPasswd2 placeholder="{{'lang.retypeNewPassword' | translate}}" <input matInput #inputPasswd2
required [type]="hidePassword ? 'password' : 'text'" placeholder="{{'lang.retypeNewPassword' | translate}}" required
[type]="hidePassword ? 'password' : 'text'"
formControlName="retypePasswordCtrl"> formControlName="retypePasswordCtrl">
<mat-icon matSuffix (click)="hidePassword = !hidePassword" <mat-icon matSuffix (click)="hidePassword = !hidePassword"
class="fa fa-2x" class="fa fa-2x"
...@@ -157,11 +159,14 @@ ...@@ -157,11 +159,14 @@
</div> </div>
<div class="input-group"> <div class="input-group">
<mat-form-field> <mat-form-field>
<input matInput *ngIf="creationMode" type="text" title="{{'lang.id' | translate}}" <input matInput *ngIf="creationMode" type="text"
name="user_id" [(ngModel)]="user.userId" placeholder="{{'lang.id' | translate}}" title="{{'lang.id' | translate}}" name="user_id"
pattern="^[\w.@-]*$" required (keyup)="setLowerUserId()" maxlength="128"> [(ngModel)]="user.userId" placeholder="{{'lang.id' | translate}}"
<input matInput *ngIf="!creationMode" type="text" title="{{'lang.id' | translate}}" pattern="^[\w.@-]*$" required (keyup)="setLowerUserId()"
value="{{user.user_id}}" placeholder="{{'lang.id' | translate}}" disabled> maxlength="128">
<input matInput *ngIf="!creationMode" type="text"
title="{{'lang.id' | translate}}" value="{{user.user_id}}"
placeholder="{{'lang.id' | translate}}" disabled>
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
...@@ -170,21 +175,24 @@ ...@@ -170,21 +175,24 @@
<div class="col-sm-5" style="font-weight:bold;"> <div class="col-sm-5" style="font-weight:bold;">
<mat-form-field> <mat-form-field>
<input matInput type="text" id="lastname" name="lastname" maxlength="255" <input matInput type="text" id="lastname" name="lastname" maxlength="255"
title="{{'lang.lastname' | translate}}" placeholder="{{'lang.lastname' | translate}}" title="{{'lang.lastname' | translate}}"
placeholder="{{'lang.lastname' | translate}}"
[(ngModel)]="user.lastname" required> [(ngModel)]="user.lastname" required>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="col-sm-5" style="font-weight:bold;"> <div class="col-sm-5" style="font-weight:bold;">
<mat-form-field> <mat-form-field>
<input matInput type="text" id="firstname" name="firstname" maxlength="255" <input matInput type="text" id="firstname" name="firstname" maxlength="255"
title="{{'lang.firstname' | translate}}" placeholder="{{'lang.firstname' | translate}}" title="{{'lang.firstname' | translate}}"
placeholder="{{'lang.firstname' | translate}}"
[(ngModel)]="user.firstname" required> [(ngModel)]="user.firstname" required>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="col-sm-2" style="font-style:italic;"> <div class="col-sm-2" style="font-style:italic;">
<mat-form-field> <mat-form-field>
<input matInput type="text" id="initials" name="initials" maxlength="32" <input matInput type="text" id="initials" name="initials" maxlength="32"
title="{{'lang.initials' | translate}}" placeholder="{{'lang.initials' | translate}}" title="{{'lang.initials' | translate}}"
placeholder="{{'lang.initials' | translate}}"
[(ngModel)]="user.initials"> [(ngModel)]="user.initials">
</mat-form-field> </mat-form-field>
</div> </div>
...@@ -193,7 +201,8 @@ ...@@ -193,7 +201,8 @@
<div class="col-sm-12"> <div class="col-sm-12">
<mat-form-field> <mat-form-field>
<input matInput type="tel" id="phone" name="phone" maxlength="32" <input matInput type="tel" id="phone" name="phone" maxlength="32"
title="{{'lang.phoneNumber' | translate}}" placeholder="{{'lang.phoneNumber' | translate}}" title="{{'lang.phoneNumber' | translate}}"
placeholder="{{'lang.phoneNumber' | translate}}"
[(ngModel)]="user.phone" pattern="\+?((|\ |\.|\(|\)|\-)?(\d)*)*\d$" [(ngModel)]="user.phone" pattern="\+?((|\ |\.|\(|\)|\-)?(\d)*)*\d$"
[disabled]="(creationMode && !canManagePersonalDatas) || (!creationMode && (!canManagePersonalDatas || !canViewPersonalDatas))"> [disabled]="(creationMode && !canManagePersonalDatas) || (!creationMode && (!canManagePersonalDatas || !canViewPersonalDatas))">
</mat-form-field> </mat-form-field>
...@@ -202,8 +211,10 @@ ...@@ -202,8 +211,10 @@
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<mat-form-field> <mat-form-field>
<input matInput type="email" id="mail" name="mail" title="{{'lang.email' | translate}}" <input matInput type="email" id="mail" name="mail"
placeholder="{{'lang.email' | translate}}" [(ngModel)]="user.mail" maxlength="255" title="{{'lang.email' | translate}}"
placeholder="{{'lang.email' | translate}}" [(ngModel)]="user.mail"
maxlength="255"
pattern="(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)" required> pattern="(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)" required>
</mat-form-field> </mat-form-field>
</div> </div>
...@@ -219,7 +230,8 @@ ...@@ -219,7 +230,8 @@
<mat-form-field> <mat-form-field>
<mat-label>{{'lang.accountType' | translate}}</mat-label> <mat-label>{{'lang.accountType' | translate}}</mat-label>
<mat-select [(ngModel)]="user.mode" id="accountType" name="accountType" <mat-select [(ngModel)]="user.mode" id="accountType" name="accountType"
required [disabled]="headerService.user.mode === 'standard' && ['root_visible','root_invisible'].indexOf(user.mode) > -1"> required
[disabled]="headerService.user.mode === 'standard' && ['root_visible','root_invisible'].indexOf(user.mode) > -1">
<ng-container *ngFor="let mode of adminModes | sortBy : 'label'"> <ng-container *ngFor="let mode of adminModes | sortBy : 'label'">
<mat-option [value]="mode.id" <mat-option [value]="mode.id"
[disabled]="headerService.user.mode === 'standard' && ['root_visible','root_invisible'].indexOf(mode.id) > -1" [disabled]="headerService.user.mode === 'standard' && ['root_visible','root_invisible'].indexOf(mode.id) > -1"
...@@ -233,8 +245,11 @@ ...@@ -233,8 +245,11 @@
<div *ngIf="user.mode === 'rest'"> <div *ngIf="user.mode === 'rest'">
<mat-form-field> <mat-form-field>
<mat-label>{{'lang.authorizedRoutes' | translate}}</mat-label> <mat-label>{{'lang.authorizedRoutes' | translate}}</mat-label>
<textarea matInput name="authorizedApi" [(ngModel)]="user.authorizedApi" placeholder="Ex : PUT/attachments/{id}"></textarea> <textarea matInput name="authorizedApi" [(ngModel)]="user.authorizedApi"
<mat-hint>{{'lang.authorizedRoutesInformations' | translate}} <a href="https://docs.maarch.org/gitbook/html/MaarchCourrier/{{appVersion}}/guat/guat_architecture/API_REST/home.html" target="_blank">{{'lang.here' | translate}}</a></mat-hint> placeholder="Ex : PUT/attachments/{id}"></textarea>
<mat-hint>{{'lang.authorizedRoutesInformations' | translate}} <a
href="https://docs.maarch.org/gitbook/html/MaarchCourrier/{{appVersion}}/guat/guat_architecture/API_REST/home.html"
target="_blank">{{'lang.here' | translate}}</a></mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
...@@ -260,7 +275,9 @@ ...@@ -260,7 +275,9 @@
</mat-nav-list> </mat-nav-list>
</mat-tab> </mat-tab>
<mat-tab *ngIf="!creationMode" label="{{'lang.entities' | translate}}"> <mat-tab *ngIf="!creationMode" label="{{'lang.entities' | translate}}">
<app-maarch-flat-tree #maarchTree (afterSelectNode)="addEntity($event)" [selectionPropagation]="false" [openState]="'all'" (afterDeselectNode)="deleteEntity($event)"></app-maarch-flat-tree> <app-maarch-flat-tree #maarchTree (afterSelectNode)="addEntity($event)"
[selectionPropagation]="false" [openState]="'all'"
(afterDeselectNode)="deleteEntity($event)"></app-maarch-flat-tree>
</mat-tab> </mat-tab>
<mat-tab *ngIf="!creationMode" label="{{'lang.baskets' | translate}}"> <mat-tab *ngIf="!creationMode" label="{{'lang.baskets' | translate}}">
<div class="col-sm-6" style="overflow:hidden;"> <div class="col-sm-6" style="overflow:hidden;">
...@@ -269,7 +286,8 @@ ...@@ -269,7 +286,8 @@
<mat-icon mat-list-icon color="primary"> <mat-icon mat-list-icon color="primary">
<mat-checkbox color="primary" <mat-checkbox color="primary"
(change)="$event ? masterToggleBaskets($event) : null" (change)="$event ? masterToggleBaskets($event) : null"
[checked]="selectionBaskets.hasValue()" matTooltip="{{'lang.selectAll' | translate}}"> [checked]="selectionBaskets.hasValue()"
matTooltip="{{'lang.selectAll' | translate}}">
</mat-checkbox> </mat-checkbox>
</mat-icon> </mat-icon>
<p mat-line *ngIf="!selectionBaskets.hasValue()" <p mat-line *ngIf="!selectionBaskets.hasValue()"
...@@ -282,11 +300,13 @@ ...@@ -282,11 +300,13 @@
<mat-icon class="fa fa-reply"></mat-icon> <mat-icon class="fa fa-reply"></mat-icon>
<mat-divider [vertical]="true" class="vertical-divider"></mat-divider> <mat-divider [vertical]="true" class="vertical-divider"></mat-divider>
</button> </button>
<button color="warn" mat-icon-button matTooltip="{{'lang.disableBasket' | translate}}" <button color="warn" mat-icon-button
matTooltip="{{'lang.disableBasket' | translate}}"
(click)="toggleBasket(false)"> (click)="toggleBasket(false)">
<mat-icon class="fa fa-ban"></mat-icon> <mat-icon class="fa fa-ban"></mat-icon>
</button> </button>
<button color="accent" mat-icon-button matTooltip="{{'lang.enableBasket' | translate}}" <button color="accent" mat-icon-button
matTooltip="{{'lang.enableBasket' | translate}}"
(click)="toggleBasket(true)"> (click)="toggleBasket(true)">
<mat-icon class="fa fa-check"></mat-icon> <mat-icon class="fa fa-check"></mat-icon>
</button> </button>
...@@ -295,6 +315,8 @@ ...@@ -295,6 +315,8 @@
[routeDatas]="['/rest/autocomplete/users']" [routeDatas]="['/rest/autocomplete/users']"
[targetSearchKey]="'idToDisplay'" [targetSearchKey]="'idToDisplay'"
[subInfoKey]="'descriptionToDisplay'" [subInfoKey]="'descriptionToDisplay'"
[disableItems]="[user.id]"
[styles]="['no-margin']"
(triggerEvent)="addBasketRedirection($event)" appearance="outline"> (triggerEvent)="addBasketRedirection($event)" appearance="outline">
</plugin-autocomplete> </plugin-autocomplete>
</mat-menu> </mat-menu>
...@@ -399,8 +421,10 @@ ...@@ -399,8 +421,10 @@
</mat-tab-group> </mat-tab-group>
</div> </div>
</mat-tab> </mat-tab>
<mat-tab *ngIf="!creationMode" label="{{'lang.signatures' | translate}}" [disabled]="!canViewPersonalDatas"> <mat-tab *ngIf="!creationMode" label="{{'lang.signatures' | translate}}"
<div *ngIf="canManagePersonalDatas" dnd-droppable matTooltip="{{'lang.uploadSignFileInfo' | translate}}" [disabled]="!canViewPersonalDatas">
<div *ngIf="canManagePersonalDatas" dnd-droppable
matTooltip="{{'lang.uploadSignFileInfo' | translate}}"
(click)="clickOnUploader('uploadSignFile')" [class.dndFileHighlighted]="highlightMe" (click)="clickOnUploader('uploadSignFile')" [class.dndFileHighlighted]="highlightMe"
(dragover)="highlightMe=true" (dragleave)="highlightMe=false" (dragover)="highlightMe=true" (dragleave)="highlightMe=false"
(onDropSuccess)="test($event);highlightMe=false;" class="dndFile"> (onDropSuccess)="test($event);highlightMe=false;" class="dndFile">
...@@ -414,7 +438,8 @@ ...@@ -414,7 +438,8 @@
<mat-card-content style="text-align:center;"> <mat-card-content style="text-align:center;">
<mat-form-field floatLabel="never"> <mat-form-field floatLabel="never">
<input matInput type="text" [(ngModel)]="signature.signature_label" <input matInput type="text" [(ngModel)]="signature.signature_label"
name="selectedSignatureLabel" placeholder="{{'lang.label' | translate}}" name="selectedSignatureLabel"
placeholder="{{'lang.label' | translate}}"
(change)="updateSignature(i)" (change)="updateSignature(i)"
[disabled]="!canManagePersonalDatas"> [disabled]="!canManagePersonalDatas">
<button mat-button matSuffix mat-icon-button <button mat-button matSuffix mat-icon-button
...@@ -493,7 +518,8 @@ ...@@ -493,7 +518,8 @@
{{element.event_date | date : "dd/MM/y HH:mm"}}</mat-cell> {{element.event_date | date : "dd/MM/y HH:mm"}}</mat-cell>
</ng-container> </ng-container>
<ng-container matColumnDef="record_id"> <ng-container matColumnDef="record_id">
<mat-header-cell *matHeaderCellDef style="flex:1;">{{'lang.technicalId' | translate}} <mat-header-cell *matHeaderCellDef style="flex:1;">
{{'lang.technicalId' | translate}}
</mat-header-cell> </mat-header-cell>
<mat-cell *matCellDef="let element" style="flex:1;">{{element.record_id}} <mat-cell *matCellDef="let element" style="flex:1;">{{element.record_id}}
</mat-cell> </mat-cell>
...@@ -545,7 +571,8 @@ ...@@ -545,7 +571,8 @@
<p mat-line> <p mat-line>
<mat-form-field style="font-size:10px;"> <mat-form-field style="font-size:10px;">
<input matInput type="text" id="role" name="role" title="{{'lang.role' | translate}}" <input matInput type="text" id="role" name="role" title="{{'lang.role' | translate}}"
placeholder="{{'lang.role' | translate}}" [(ngModel)]="userGroup.role" (change)="updateGroup(userGroup)"> placeholder="{{'lang.role' | translate}}" [(ngModel)]="userGroup.role"
(change)="updateGroup(userGroup)">
<mat-hint matTooltip="{{'lang.perimeter' | translate}}">{{userGroup.maarch_comment}}</mat-hint> <mat-hint matTooltip="{{'lang.perimeter' | translate}}">{{userGroup.maarch_comment}}</mat-hint>
</mat-form-field> </mat-form-field>
</p> </p>
...@@ -559,7 +586,8 @@ ...@@ -559,7 +586,8 @@
style="position:relative;"> style="position:relative;">
<button mat-icon-button <button mat-icon-button
style="cursor:pointer;position: absolute;right: -20px;top: -20px;font-size:10px;" style="cursor:pointer;position: absolute;right: -20px;top: -20px;font-size:10px;"
(click)="updatePrimaryEntity(userEntity)" matTooltip="{{'lang.entityTooglePrimary' | translate}}"> (click)="updatePrimaryEntity(userEntity)"
matTooltip="{{'lang.entityTooglePrimary' | translate}}">
<mat-icon class="fa fa-arrow-up"></mat-icon> <mat-icon class="fa fa-arrow-up"></mat-icon>
</button> </button>
</mat-icon> </mat-icon>
...@@ -580,4 +608,4 @@ ...@@ -580,4 +608,4 @@
</mat-list> </mat-list>
</mat-sidenav> </mat-sidenav>
</mat-sidenav-container> </mat-sidenav-container>
\ No newline at end of file
This diff is collapsed.
<form> <form>
<input *ngIf="controlAutocomplete !== undefined" type="hidden" [formControl]="controlAutocomplete"> <input *ngIf="controlAutocomplete !== undefined" type="hidden" [formControl]="controlAutocomplete">
<mat-form-field [class.smallInput]="size === 'small'" [appearance]="appearance" floatLabel="never"> <mat-form-field class="maarch-autocomplete" [class.no-margin]="styles.indexOf('no-margin') > -1" [class.smallInput]="size === 'small'" [appearance]="appearance" floatLabel="never" (click)="$event.stopPropagation();">
<mat-label *ngIf="singleMode">{{placeholder}}</mat-label> <mat-label *ngIf="singleMode">{{placeholder}}</mat-label>
<mat-icon *ngIf="size !== 'small' && (myControl.enabled && !singleMode)" color="primary" class="fa fa-search" <mat-icon *ngIf="size !== 'small' && (myControl.enabled && !singleMode)" color="primary" class="fa fa-search"
matPrefix></mat-icon> matPrefix></mat-icon>
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<button type="button" *ngIf="myControl.disabled" matSuffix mat-icon-button color="warn" (click)="unsetValue()"> <button type="button" *ngIf="myControl.disabled" matSuffix mat-icon-button color="warn" (click)="unsetValue()">
<mat-icon class="fa fa-times" color="warn" [title]="'lang.delete' | translate"></mat-icon> <mat-icon class="fa fa-times" color="warn" [title]="'lang.delete' | translate"></mat-icon>
</button> </button>
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectOpt($event)"> <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectOpt($event)" [displayWith]="displayFnWrapper()" >
<ng-container *ngIf="options.length > 0 && !loading"> <ng-container *ngIf="options.length > 0 && !loading">
<mat-option *ngFor="let option of filteredOptions | async | sortBy: key" [value]="option"> <mat-option *ngFor="let option of filteredOptions | async | sortBy: key"[value]="option" [disabled]="disableItems.indexOf(option['serialId']) > -1">
<mat-icon *ngIf="type[option['type']]" class="autcompleteIcon fas {{type[option['type']]}}" <mat-icon *ngIf="type[option['type']]" class="autcompleteIcon fas {{type[option['type']]}}"
color="primary"> color="primary">
</mat-icon>&nbsp;<span </mat-icon>&nbsp;<span
......
...@@ -12,6 +12,13 @@ ...@@ -12,6 +12,13 @@
top: 0px !important; top: 0px !important;
} }
.no-margin {
::ng-deep.mat-form-field-wrapper {
margin: 0px;
padding: 0px;
}
}
.mat-option { .mat-option {
::ng-deep.mat-option-text { ::ng-deep.mat-option-text {
align-items: center; align-items: center;
...@@ -24,6 +31,10 @@ ...@@ -24,6 +31,10 @@
} }
} }
.mat-option-disabled {
opacity: 0.3 !important;
}
.autcompleteIcon { .autcompleteIcon {
width: 20px; width: 20px;
display: flex; display: flex;
......
...@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; ...@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Input, EventEmitter, Output, ViewChild, ElementRef } from '@angular/core'; import { Input, EventEmitter, Output, ViewChild, ElementRef } from '@angular/core';
import { Observable, of, forkJoin } from 'rxjs'; import { Observable, of, forkJoin } from 'rxjs';
import { map, startWith, debounceTime, filter, distinctUntilChanged, switchMap, tap, exhaustMap, catchError } from 'rxjs/operators'; import { map, startWith, debounceTime, filter, switchMap, tap, exhaustMap, catchError } from 'rxjs/operators';
import { LatinisePipe } from 'ngx-pipes'; import { LatinisePipe } from 'ngx-pipes';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
...@@ -58,7 +58,7 @@ export class PluginAutocomplete implements OnInit { ...@@ -58,7 +58,7 @@ export class PluginAutocomplete implements OnInit {
/** /**
* Route datas used in async autocomplete. Incompatible with @datas * Route datas used in async autocomplete. Incompatible with @datas
*/ */
@Input('routeDatas') routeDatas: string[]; @Input() routeDatas: string[];
/** /**
* Placeholder used in input * Placeholder used in input
...@@ -90,6 +90,16 @@ export class PluginAutocomplete implements OnInit { ...@@ -90,6 +90,16 @@ export class PluginAutocomplete implements OnInit {
*/ */
@Input() manageDatas: string; @Input() manageDatas: string;
/**
* Identifier of disabled items
*/
@Input() disableItems: any = [];
/**
* List of classes uses
*/
@Input() styles: any = [];
/** /**
* Catch external event after select an element in autocomplete * Catch external event after select an element in autocomplete
*/ */
...@@ -288,4 +298,13 @@ export class PluginAutocomplete implements OnInit { ...@@ -288,4 +298,13 @@ export class PluginAutocomplete implements OnInit {
resetValue() { resetValue() {
return this.myControl.setValue(''); return this.myControl.setValue('');
} }
}
\ No newline at end of file displayFn(option: any): string {
return option ? option[this.key] : option;
}
// workaround to use var in scope componenent
displayFnWrapper() {
return (offer: any) => this.displayFn(offer);
}
}
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