diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.css b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.css index 2fe298def05f1e0a3c35ff154e36010efebf072a..979a72ff0235996f49ab9b1cfad4eb54787936a3 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.css +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.css @@ -1,20 +1,20 @@ .button-content { - border-radius: 7px; - padding-left: 10px; - padding-right: 10px; - max-width: 400px; - font-weight: bold; - height: 60px; + border-radius: 7px; + padding-left: 10px; + padding-right: 10px; + max-width: 400px; + font-weight: bold; + height: 60px; } .no-results-center { - text-align: center; + text-align: center; } .scroll { - overflow-y: scroll; - height: 600px; - width: 600px; + overflow-y: scroll; + height: 600px; + width: 600px; } .scroll::-webkit-scrollbar { @@ -32,12 +32,13 @@ } .pad { - padding: 0; - margin: auto; - height: 600px; + padding: 0; + margin: auto; + height: 600px; } + .rectangle { -background: #EEEEEE; + background: #EEEEEE; } .actif-filters { @@ -48,67 +49,72 @@ background: #EEEEEE; font-weight: bold; } -.sauvegarde-text { - padding-left: 20px; - padding-bottom: 25px; - font-size: 21px; - font-weight: bold; -} +.sauvegarde-text { + padding-left: 20px; + padding-bottom: 25px; + font-size: 21px; + font-weight: bold; +} -.input-text { - width: 85%; - padding-left: 5%; - padding-top: 25px; +.input-text { + width: 85%; + padding-left: 5%; + padding-top: 25px; } .btn-ok { - padding-top: 186px; - padding-left: 40px; + padding-top: 214px; + padding-left: 40px; } -.input-width{ - width: 450px; + +.input-width { + width: 450px; } + .btn-close-it-no-results { - padding-left: 480px; - padding-top: 0px; + padding-left: 480px; + padding-top: 0; } .btn-close-it { - padding-left: 500px; - padding-top: 0px; + padding-left: 470px; + padding-top: 10px; } .btn-close-it-input { - padding-left: 530px; - padding-top: 0px; + padding-left: 470px; + padding-top: 10px; } .pad5 { - padding-bottom: 10px; + padding-bottom: 10px; } + .pad35 { - padding-left: 20px; - font-size: 15px; - font-weight: bold; -} -.border-results{ - left: 0%; - right: 0%; - top: 0%; - bottom: 0%; - background: #FFFFFF; - border: 1px solid #BDBDBD; - box-sizing: border-box; - border-radius: 10px; - margin-top: 17px; + padding-left: 20px; + font-size: 15px; + font-weight: bold; +} + +.border-results { + left: 0; + right: 0; + top: 0; + bottom: 0; + background: #FFFFFF; + border: 1px solid #BDBDBD; + box-sizing: border-box; + border-radius: 10px; + margin-top: 17px; } + .scroll-results { - height: 285px; - width: 107%; - padding-left: 25px; - overflow-y: scroll; - scrollbar-color: var(--vitamui-primary-light) #F7EBFA; - scrollbar-width: thin; + height: 285px; + width: 107%; + padding-left: 25px; + overflow-y: scroll; + scrollbar-color: var(--vitamui-primary-light) #F7EBFA; + scrollbar-width: thin; } .scroll-results::-webkit-scrollbar { @@ -126,15 +132,15 @@ background: #EEEEEE; } .btn-create { - padding: 5px 0px 0px 140px; + padding: 5px 0 0 140px; } -.pink-color{ - background: #F6F3FB; +.pink-color { + background: #F6F3FB; } .boutton:focus { - outline: none; + outline: none; } .ko-icon { @@ -143,36 +149,37 @@ background: #EEEEEE; } .warning { - padding-top: 5px; + padding-top: 5px; } .save-icon { - color: #9D9D9D; - font-size: 35px; + color: #9D9D9D; + font-size: 35px; } .pad-bottom { - padding-bottom: 10px; - padding-left: 5%; + padding-bottom: 10px; + padding-left: 5%; } + .triangle { - position: relative; - color: white; - max-width: 10%; - top: 134px; - border: 28px solid #eeeeee; - border-top-color: transparent; - border-right-color: transparent; - border-bottom-color: transparent; - border-left-color: #eeeeee; + position: relative; + color: white; + max-width: 10%; + top: 134px; + border: 28px solid #eeeeee; + border-top-color: transparent; + border-right-color: transparent; + border-bottom-color: transparent; + border-left-color: #eeeeee; } .scroll-filters { - height: 470px; - overflow-y: scroll; - overflow-x: hidden; - scrollbar-color: var(--vitamui-primary-light) #F7EBFA; - scrollbar-width: thin; + height: 470px; + overflow-y: scroll; + overflow-x: hidden; + scrollbar-color: var(--vitamui-primary-light) #F7EBFA; + scrollbar-width: thin; } .scroll-filters::-webkit-scrollbar { @@ -188,84 +195,92 @@ background: #EEEEEE; border-radius: 20px; border: 3px solid #F7EBFA; } + .results-message { - font-weight: bold; - padding-left: 5px; - font-style: normal; - font-size: 16px; - line-height: 22px; + font-weight: bold; + padding-left: 5px; + font-style: normal; + font-size: 16px; + line-height: 22px; } .results-nb-filters { - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 22px; - color: #616161; + font-style: normal; + font-weight: normal; + font-size: 14px; + line-height: 22px; + color: #616161; } + .div-update { - padding-left: 38px; + padding-left: 38px; } -.confirm-update { - padding-left: 35px; - padding-top: 10px; +.confirm-update { + padding-left: 35px; + padding-top: 10px; } -.cancel-update { - padding-left: 70px; +.cancel-update { + padding-left: 70px; } .pad-actions { - padding-left: 30px; + padding-left: 30px; } -.pad-results{ - padding-top: 12px; - padding-bottom: 12px; +.pad-results { + padding-top: 12px; + padding-bottom: 12px; } + .hover-div:hover { - background: rgb(236 234 241); - border-radius: 10px; + background: rgb(236 234 241); + border-radius: 10px; } + .btn-result-update:hover { - background: rgb(236 234 241); + background: rgb(236 234 241); } + .btn-no-result { - font-size: 20px; - padding-top: 13px; - color: var(--vitamui-grey-700); + font-size: 20px; + padding-top: 13px; + color: var(--vitamui-grey-700); } + .criteria-list-width { - width: 730px; + width: 730px; } .confirm-width { - width: 730px; + width: 730px; } + .warning-message { - font-family: Mulish; - font-style: normal; - font-weight: normal; - font-size: 13px; - line-height: 16px; - letter-spacing: -0.2px; - color: #000000; -} - -.no-scroll-results{ - height: 283px; - width: 107%; - padding-left: 25px; - overflow-y: hidden; -} + font-family: Mulish; + font-style: normal; + font-weight: normal; + font-size: 13px; + line-height: 16px; + letter-spacing: -0.2px; + color: #000000; +} + +.no-scroll-results { + height: 283px; + width: 107%; + padding-left: 25px; + overflow-y: hidden; +} .scroll-div { - height: 470px; - overflow-y: hidden; - overflow-x: hidden; + height: 470px; + overflow-y: hidden; + overflow-x: hidden; } + .width-save-form { - width: 610px; + width: 610px; -} \ No newline at end of file +} diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.scss b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.scss index 9d2b0bf22665c6a6779fa3338938bb9e242c1408..975dd95c23e46a4a12d13fbd1d5f40fb85ec688d 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.scss +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.scss @@ -1,7 +1,5 @@ .permissionTable { - overflow-y: scroll; - overflow-x: hidden; - max-height: 24vw; + overflow: hidden; display: block; } @@ -10,15 +8,19 @@ } .smallServiceCol { - min-width: 200px; max-width: 200px; + min-width: 200px; + max-width: 200px; } .smallToggleCol { - min-width: 75px; max-width: 75px; + min-width: 75px; + max-width: 75px; } .serviceCol { - min-width: 400px; max-width: 400px; + min-width: 400px; + max-width: 400px; } .toggleCol { - min-width: 100px; max-width: 100px; + min-width: 100px; + max-width: 100px; } diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.html b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.html index aa0c58e8480dcd4d6e968277187b787f3ed358a7..60dbde038ce3a0a749bddba4d3e602b304db1fbe 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.html +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.html @@ -1,8 +1,5 @@ <form [formGroup]="form" class="side-form" (ngSubmit)="onSubmit()"> - - <div *ngIf="form.value.fullAccess"> - Tous les accès sont autorisés. - </div> + <div *ngIf="form.value.fullAccess">Tous les accès sont autorisés.</div> <div *ngIf="!form.value.fullAccess"> <app-security-profile-edit-permission formControlName="permissions" [small]="true"></app-security-profile-edit-permission> diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.scss b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.scss index add4272f5a3fd453036857c766217ac6e3579b91..1d92621c00af1c232816f0cfe2301cca3167acce 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.scss +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.scss @@ -5,5 +5,6 @@ .bottom { margin-top: auto; + padding-bottom: 30px; } } diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts index 567721dd9257981a4375143351df2521f388f086..b683321c5a305f82e477e09dbd1ccd1fb7522aba 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts @@ -1,17 +1,16 @@ -import {Component, EventEmitter, Input, Output} from '@angular/core'; -import {FormBuilder, FormControl, FormGroup} from '@angular/forms'; -import {SecurityProfile} from 'projects/vitamui-library/src/public-api'; -import {Observable, of} from 'rxjs'; -import {catchError, filter, map, switchMap} from 'rxjs/operators'; -import {diff, Option} from 'ui-frontend-common'; -import {extend, isEmpty} from 'underscore'; - -import {SecurityProfileService} from '../../security-profile.service'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { SecurityProfile } from 'projects/vitamui-library/src/public-api'; +import { Observable, of } from 'rxjs'; +import { catchError, filter, map, switchMap } from 'rxjs/operators'; +import { diff, Option } from 'ui-frontend-common'; +import { extend, isEmpty } from 'underscore'; +import { SecurityProfileService } from '../../security-profile.service'; @Component({ selector: 'app-security-profile-permissions-tab', templateUrl: './security-profile-permissions-tab.component.html', - styleUrls: ['./security-profile-permissions-tab.component.scss'] + styleUrls: ['./security-profile-permissions-tab.component.scss'], }) export class SecurityProfilePermissionsTabComponent { @Output() updated: EventEmitter<boolean> = new EventEmitter<boolean>(); @@ -27,17 +26,17 @@ export class SecurityProfilePermissionsTabComponent { // FIXME: Get list from common var ? rules: Option[] = [ - {key: 'StorageRule', label: 'Durée d\'utilité courante', info: ''}, - {key: 'ReuseRule', label: 'Durée de réutilisation', info: ''}, - {key: 'ClassificationRule', label: 'Durée de classification', info: ''}, - {key: 'DisseminationRule', label: 'Délai de diffusion', info: ''}, - {key: 'AdministrationRule', label: 'Durée d\'utilité administrative', info: ''}, - {key: 'AppraisalRule', label: 'Délai de communicabilité', info: ''} + { key: 'StorageRule', label: `Durée d'utilité courante`, info: '' }, + { key: 'ReuseRule', label: 'Durée de réutilisation', info: '' }, + { key: 'ClassificationRule', label: 'Durée de classification', info: '' }, + { key: 'DisseminationRule', label: 'Délai de diffusion', info: '' }, + { key: 'AdministrationRule', label: `Durée d'utilité administrative`, info: '' }, + { key: 'AppraisalRule', label: 'Délai de communicabilité', info: '' }, ]; previousValue = (): SecurityProfile => { return this._SecurityProfile; - } + }; @Input() // tslint:disable-next-line:no-shadowed-variable @@ -53,10 +52,10 @@ export class SecurityProfilePermissionsTabComponent { @Input() set readOnly(readOnly: boolean) { if (readOnly && this.form.enabled) { - this.form.disable({emitEvent: false}); + this.form.disable({ emitEvent: false }); } else if (this.form.disabled) { - this.form.enable({emitEvent: false}); - this.form.get('identifier').disable({emitEvent: false}); + this.form.enable({ emitEvent: false }); + this.form.get('identifier').disable({ emitEvent: false }); } } @@ -67,7 +66,7 @@ export class SecurityProfilePermissionsTabComponent { ) { this.form = this.formBuilder.group({ fullAccess: [null], - permissions: [null] + permissions: [null], }); this.ruleFilter.valueChanges.subscribe((val) => { @@ -80,16 +79,18 @@ export class SecurityProfilePermissionsTabComponent { unchanged(): boolean { let unchanged = true; - if (this.form.getRawValue().permissions.length !== this.previousValue().permissions.length) { - unchanged = false; - } else { - const previousPermissions = this.previousValue().permissions; - // tslint:disable-next-line:no-shadowed-variable - const diff = this.form.getRawValue().permissions.filter((permission: string) => { - return previousPermissions.indexOf(permission) === -1; - }); - if (diff.length > 0) { + if (this.form.getRawValue().permissions != undefined) { + if (this.form.getRawValue().permissions.length !== this.previousValue().permissions.length) { unchanged = false; + } else { + const previousPermissions = this.previousValue().permissions; + // tslint:disable-next-line:no-shadowed-variable + const diff = this.form.getRawValue().permissions.filter((permission: string) => { + return previousPermissions.indexOf(permission) === -1; + }); + if (diff.length > 0) { + unchanged = false; + } } } @@ -104,10 +105,11 @@ export class SecurityProfilePermissionsTabComponent { prepareSubmit(): Observable<SecurityProfile> { return of(diff(this.form.getRawValue(), this.previousValue())).pipe( filter((formData) => !isEmpty(formData)), - map((formData) => extend({id: this.previousValue().id, identifier: this.previousValue().identifier}, formData)), - switchMap( - (formData: { id: string, [key: string]: any } - ) => this.SecurityProfileService.patch(formData).pipe(catchError(() => of(null))))); + map((formData) => extend({ id: this.previousValue().id, identifier: this.previousValue().identifier }, formData)), + switchMap((formData: { id: string; [key: string]: any }) => + this.SecurityProfileService.patch(formData).pipe(catchError(() => of(null))) + ) + ); } onSubmit() { @@ -115,20 +117,21 @@ export class SecurityProfilePermissionsTabComponent { if (this.isInvalid()) { return; } - this.prepareSubmit().subscribe(() => { - this.SecurityProfileService.get(this.SecurityProfile.identifier).subscribe( - response => { + this.prepareSubmit().subscribe( + () => { + this.SecurityProfileService.get(this.SecurityProfile.identifier).subscribe((response) => { this.submited = false; this.SecurityProfile = response; - } - ); - }, () => { - this.submited = false; - }); + }); + }, + () => { + this.submited = false; + } + ); } // tslint:disable-next-line:no-shadowed-variable resetForm(SecurityProfile: SecurityProfile) { - this.form.reset(SecurityProfile, {emitEvent: false}); + this.form.reset(SecurityProfile, { emitEvent: false }); } } diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts index b5fee5dee1956ff5425c0cb1de5b22f4735f57f7..4c0220ed8ec74a7dc22cdb080a68fdf95dfaec8c 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts @@ -1,33 +1,35 @@ -import {Component, OnInit, ViewChild} from '@angular/core'; -import {MatDialog} from '@angular/material/dialog'; -import {ActivatedRoute} from '@angular/router'; - -import {SecurityProfile} from 'projects/vitamui-library/src/lib/models/security-profile'; -import {ApplicationService, GlobalEventService, SidenavPage} from 'ui-frontend-common'; -import {SecurityProfileCreateComponent} from './security-profile-create/security-profile-create.component'; -import {SecurityProfileListComponent} from './security-profile-list/security-profile-list.component'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; +import { ActivatedRoute } from '@angular/router'; +import { SecurityProfile } from 'projects/vitamui-library/src/lib/models/security-profile'; +import { ApplicationService, GlobalEventService, SidenavPage } from 'ui-frontend-common'; +import { SecurityProfileCreateComponent } from './security-profile-create/security-profile-create.component'; +import { SecurityProfileListComponent } from './security-profile-list/security-profile-list.component'; @Component({ selector: 'app-security-profile', templateUrl: './security-profile.component.html', - styleUrls: ['./security-profile.component.scss'] + styleUrls: ['./security-profile.component.scss'], }) export class SecurityProfileComponent extends SidenavPage<SecurityProfile> implements OnInit { - search = ''; isSlaveMode: boolean; - @ViewChild(SecurityProfileListComponent, {static: true}) contextListComponent: SecurityProfileListComponent; + @ViewChild(SecurityProfileListComponent, { static: true }) contextListComponent: SecurityProfileListComponent; - constructor(public dialog: MatDialog, route: ActivatedRoute, globalEventService: GlobalEventService, - private applicationService: ApplicationService) { + constructor( + public dialog: MatDialog, + route: ActivatedRoute, + globalEventService: GlobalEventService, + private applicationService: ApplicationService + ) { super(route, globalEventService); } openCreateSecurityProfileDialog() { const dialogRef = this.dialog.open(SecurityProfileCreateComponent, { panelClass: 'vitamui-modal', - disableClose: true + disableClose: true, }); dialogRef.componentInstance.isSlaveMode = this.isSlaveMode; dialogRef.afterClosed().subscribe((result) => { @@ -64,5 +66,4 @@ export class SecurityProfileComponent extends SidenavPage<SecurityProfile> imple showSecurityProfile(item: SecurityProfile) { this.openPanel(item); } - }