diff --git a/src/frontend/app/installer/customization/customization.component.html b/src/frontend/app/installer/customization/customization.component.html index 6edc4fef9a6e4f5709a80eb5d0f7a1e0673e42b0..8123b741f3074fda72c1c360bb4d73607b1f8473 100644 --- a/src/frontend/app/installer/customization/customization.component.html +++ b/src/frontend/app/installer/customization/customization.component.html @@ -12,7 +12,7 @@ <ng-container *ngIf="stepFormGroup.controls['customId'].errors?.customExist"> {{lang.customAlreadyExist}} </ng-container> - <ng-container *ngIf="stepFormGroup.controls['customId'].errors?.pattern"> + <ng-container *ngIf="stepFormGroup.controls['customId'].errors?.pattern"> {{lang.onlySpecialCharAllowed |Â scan : ['"_", "-"']}} </ng-container> </mat-error> @@ -22,36 +22,45 @@ <input matInput formControlName="appName"> </mat-form-field> <div>{{lang.loginMsg}} : </div> - <textarea style="padding-top: 10px;" name="loginMessage" id="loginMessage" formControlName="loginMessage"></textarea> + <textarea style="padding-top: 10px;" name="loginMessage" id="loginMessage" + formControlName="loginMessage"></textarea> <br /> <br /> <div>{{lang.homeMsg}} : </div> - <textarea style="padding-top: 10px;" name="homeMessage" id="homeMessage" formControlName="homeMessage"></textarea> + <textarea style="padding-top: 10px;" name="homeMessage" id="homeMessage" + formControlName="homeMessage"></textarea> <br /> <br /> </div> <div class="col-md-6"> <div>{{lang.chooseLogo}} : </div> <div> - <mat-card style="width: 350px;background-size: 100%;cursor: pointer;" matRipple> - <img [src]="logoURL()" (click)="uploadLogo.click()" style="width: 100%;"/> - <input type="file" name="files[]" #uploadLogo (change)="uploadTrigger($event, 'logo')" accept="image/svg+xml" style="display: none;"> + <mat-card style="width: 350px;background-size: 100%;cursor: pointer;" [matRipple]="!stepFormGroup.controls['uploadedLogo'].disabled"> + <img [src]="logoURL()" (click)="clickLogoButton(uploadLogo)" style="width: 100%;" /> + <input type="file" name="files[]" #uploadLogo (change)="uploadTrigger($event, 'logo')" + accept="image/svg+xml" style="display: none;"> </mat-card> </div> <br /> <div>{{lang.chooseLoginBg}} : </div> <div class="backgroundList"> - <mat-card (click)="stepFormGroup.controls['bodyLoginBackground'].setValue('bodylogin.jpg')" style="opacity: 0.3;" class="backgroundItem" - [class.selected]="stepFormGroup.controls['bodyLoginBackground'].value === 'bodylogin.jpg'" + <mat-card (click)="selectBg('assets/bodylogin.jpg')" style="opacity: 0.3;" class="backgroundItem" + [class.disabled]="stepFormGroup.controls['bodyLoginBackground'].disabled" + [class.selected]="stepFormGroup.controls['bodyLoginBackground'].value === 'assets/bodylogin.jpg'" style="background:url(assets/bodylogin.jpg);background-size: cover;"> </mat-card> - <mat-card *ngFor="let background of backgroundList" (click)="stepFormGroup.controls['bodyLoginBackground'].setValue(background.url)" + <mat-card *ngFor="let background of backgroundList" + (click)="selectBg(background.url)" style="opacity: 0.3;" class="backgroundItem" [class.selected]="background.url === stepFormGroup.controls['bodyLoginBackground'].value" + [class.disabled]="stepFormGroup.controls['bodyLoginBackground'].disabled" [style.background]="'url('+background.url+')'"> </mat-card> - <mat-card style="opacity: 0.3;display: flex;align-items: center;justify-content: center;" class="backgroundItem" [class.readonly]="readonlyState" (click)="uploadFile.click()"> - <input type="file" name="files[]" #uploadFile (change)="uploadTrigger($event, 'bg')" accept="image/jpeg" style="display: none;"> + <mat-card *ngIf="!stepFormGroup.controls['bodyLoginBackground'].disabled" + style="opacity: 0.3;display: flex;align-items: center;justify-content: center;" + class="backgroundItem" (click)="uploadFile.click()"> + <input type="file" name="files[]" #uploadFile (change)="uploadTrigger($event, 'bg')" + accept="image/jpeg" style="display: none;"> <i class="fa fa-plus" style="font-size: 30px;color: #666;"></i> </mat-card> </div> diff --git a/src/frontend/app/installer/customization/customization.component.scss b/src/frontend/app/installer/customization/customization.component.scss index a88c2ec22b15b1c72cd77076fe124e8e4c3e8cd3..fcc93d2c38ee590e5f5fbd71f22e713ef2571006 100644 --- a/src/frontend/app/installer/customization/customization.component.scss +++ b/src/frontend/app/installer/customization/customization.component.scss @@ -34,7 +34,11 @@ background-size: cover !important; } -.backgroundItem:hover { +.disabled { + cursor: default !important; +} + +.backgroundItem:not(.disabled):hover { transition: all 0.3s; opacity: 1 !important; } \ No newline at end of file diff --git a/src/frontend/app/installer/customization/customization.component.ts b/src/frontend/app/installer/customization/customization.component.ts index 32e3356df72e2f1f6a95b9d50da946732fafb566..7a7d2482dd4bc44871d43aeaeed1c9a06f22b626 100644 --- a/src/frontend/app/installer/customization/customization.component.ts +++ b/src/frontend/app/installer/customization/customization.component.ts @@ -72,11 +72,19 @@ export class CustomizationComponent implements OnInit { if (this.installerService.isStepAlreadyLaunched('createCustom') && this.installerService.isStepAlreadyLaunched('customization')) { this.stepFormGroup.disable(); this.readonlyState = true; + tinymce.remove(); this.initMce(true); } else if (this.installerService.isStepAlreadyLaunched('createCustom')) { this.stepFormGroup.controls['customId'].disable(); this.stepFormGroup.controls['appName'].disable(); + this.stepFormGroup.controls['firstCtrl'].disable(); + } else if (this.installerService.isStepAlreadyLaunched('customization')) { + this.stepFormGroup.controls['loginMessage'].disable(); + this.stepFormGroup.controls['homeMessage'].disable(); + this.stepFormGroup.controls['bodyLoginBackground'].disable(); + this.stepFormGroup.controls['uploadedLogo'].disable(); this.readonlyState = true; + tinymce.remove(); this.initMce(true); } else { this.readonlyState = false; @@ -108,12 +116,15 @@ export class CustomizationComponent implements OnInit { } isValidStep() { - return this.stepFormGroup === undefined ? false : this.stepFormGroup.valid || (this.installerService.isStepAlreadyLaunched('createCustom') && this.installerService.isStepAlreadyLaunched('customization')); + if (this.installerService.isStepAlreadyLaunched('createCustom') && this.installerService.isStepAlreadyLaunched('customization')) { + return true; + } else { + return this.stepFormGroup === undefined ? false : this.stepFormGroup.valid; + } } - getFormGroup() { - return this.stepFormGroup; + return this.installerService.isStepAlreadyLaunched('createCustom') && this.installerService.isStepAlreadyLaunched('customization') ? true : this.stepFormGroup; } initMce(readonly = false) { @@ -175,7 +186,7 @@ export class CustomizationComponent implements OnInit { } uploadTrigger(fileInput: any, mode: string) { - if (fileInput.target.files && fileInput.target.files[0] && !this.readonlyState) { + if (fileInput.target.files && fileInput.target.files[0]) { const allowedExtension = mode !== 'logo' ? ['image/jpg', 'image/jpeg'] : ['image/svg+xml']; if (allowedExtension.indexOf(fileInput.target.files[0].type) !== -1) { const reader = new FileReader(); @@ -201,4 +212,16 @@ export class CustomizationComponent implements OnInit { logoURL() { return this.sanitizer.bypassSecurityTrustUrl(this.stepFormGroup.controls['uploadedLogo'].value); } + + selectBg(content: string) { + if (!this.stepFormGroup.controls['bodyLoginBackground'].disabled) { + this.stepFormGroup.controls['bodyLoginBackground'].setValue(content); + } + } + + clickLogoButton(uploadLogo: any) { + if (!this.stepFormGroup.controls['uploadedLogo'].disabled) { + uploadLogo.click(); + } + } } diff --git a/src/frontend/app/installer/database/database.component.html b/src/frontend/app/installer/database/database.component.html index a02d60c8a602402b977ed6c500755a4d1fb444ab..ca9aef6366126a5634d736f58940a1c2aa84bdc6 100644 --- a/src/frontend/app/installer/database/database.component.html +++ b/src/frontend/app/installer/database/database.component.html @@ -39,7 +39,7 @@ </mat-select> </mat-form-field> <div style="text-align:center;"> - <button mat-raised-button type="button" color="primary" (click)="checkConnection()" [disabled]="isEmptyConnInfo()"> + <button mat-raised-button type="button" color="primary" (click)="checkConnection()" [disabled]="isEmptyConnInfo() || stepFormGroup.controls['dbHostCtrl'].disabled"> {{lang.checkInformations}} </button> </div> diff --git a/src/frontend/app/installer/database/database.component.ts b/src/frontend/app/installer/database/database.component.ts index 64428bcc4fa5cc6ef27068f768d1d30df1863c15..89371fd988d49b513b2a1f174cf401cccf617ffe 100644 --- a/src/frontend/app/installer/database/database.component.ts +++ b/src/frontend/app/installer/database/database.component.ts @@ -120,7 +120,11 @@ export class DatabaseComponent implements OnInit { } isValidStep() { - return this.stepFormGroup === undefined ? false : this.stepFormGroup.valid || this.installerService.isStepAlreadyLaunched('database'); + if (this.installerService.isStepAlreadyLaunched('database')) { + return true; + } else { + return this.stepFormGroup === undefined ? false : this.stepFormGroup.valid; + } } isEmptyConnInfo() { @@ -132,7 +136,7 @@ export class DatabaseComponent implements OnInit { } getFormGroup() { - return this.stepFormGroup; + return this.installerService.isStepAlreadyLaunched('database') ? true : this.stepFormGroup; } getInfoToInstall(): StepAction[] { diff --git a/src/frontend/app/installer/docservers/docservers.component.ts b/src/frontend/app/installer/docservers/docservers.component.ts index fbed25724f9bf2bbf71e01d8cbf6e2d3ff2f258f..f563049b6f97255b4e5062bc7f8c38261d3a8d13 100644 --- a/src/frontend/app/installer/docservers/docservers.component.ts +++ b/src/frontend/app/installer/docservers/docservers.component.ts @@ -38,7 +38,11 @@ export class DocserversComponent implements OnInit { isValidStep() { - return this.stepFormGroup === undefined ? false : this.stepFormGroup.valid || this.installerService.isStepAlreadyLaunched('docserver'); + if (this.installerService.isStepAlreadyLaunched('docserver')) { + return true; + } else { + return this.stepFormGroup === undefined ? false : this.stepFormGroup.valid; + } } initStep() { @@ -48,7 +52,7 @@ export class DocserversComponent implements OnInit { } getFormGroup() { - return this.stepFormGroup; + return this.installerService.isStepAlreadyLaunched('docserver') ? true : this.stepFormGroup; } checkAvailability() { diff --git a/src/frontend/app/installer/installer.component.html b/src/frontend/app/installer/installer.component.html index 183b774ef3074534e38a5f7deeecd1db3af8cbd2..261298f259dd215230b9c4789836cac3a9c4900e 100644 --- a/src/frontend/app/installer/installer.component.html +++ b/src/frontend/app/installer/installer.component.html @@ -83,12 +83,12 @@ <button mat-fab matStepperPrevious class="previousStepButton" color="primary"> <mat-icon class="fa fa-arrow-left"></mat-icon> </button> - <button mat-fab matStepperNext class="nextStepButton" color="primary" [disabled]="!appUseradmin.isValidStep()"> - <mat-icon class="fa fa-arrow-right"></mat-icon> + <button mat-fab class="nextStepButton" color="accent" [disabled]="!appUseradmin.isValidStep()" (click)="endInstall()"> + <mat-icon class="fas fa-check-double"></mat-icon> </button> </div> </mat-step> - <mat-step [stepControl]="appMailserver.getFormGroup()" optional> + <!--<mat-step [stepControl]="appMailserver.getFormGroup()" optional> <ng-template matStepLabel>{{lang.stepMailServer}}</ng-template> <div class="stepContainer"> <div class="stepContent"> @@ -97,11 +97,9 @@ <button mat-fab matStepperPrevious class="previousStepButton" color="primary"> <mat-icon class="fa fa-arrow-left"></mat-icon> </button> - <button mat-fab class="nextStepButton" color="accent" [disabled]="!appMailserver.isValidStep()" (click)="endInstall()"> - <mat-icon class="fas fa-check-double"></mat-icon> - </button> + </div> - </mat-step> + </mat-step>--> <ng-template matStepperIcon="edit"> <mat-icon class="fa fa-check stepIcon"></mat-icon> </ng-template> diff --git a/src/frontend/app/installer/mailserver/mailserver.component.ts b/src/frontend/app/installer/mailserver/mailserver.component.ts index 47e97f0385851b3369afa8dcb3720813de39d8c3..a93722cb321f1ccb5a32b59b8fcdef6d4336052a 100644 --- a/src/frontend/app/installer/mailserver/mailserver.component.ts +++ b/src/frontend/app/installer/mailserver/mailserver.component.ts @@ -190,7 +190,6 @@ export class MailserverComponent implements OnInit { } getInfoToInstall(): StepAction[] { - this.notify.error('TO DO : WAIT BACK route : ../rest/installer/mailserver'); return []; /* return [{ idStep : 'mailserver', diff --git a/src/frontend/app/installer/useradmin/useradmin.component.ts b/src/frontend/app/installer/useradmin/useradmin.component.ts index c691195fa9e55935ed7797d8b518da4e5d7872f2..496aeb09360628e1c43baa6e25ae7928b7f67bc9 100644 --- a/src/frontend/app/installer/useradmin/useradmin.component.ts +++ b/src/frontend/app/installer/useradmin/useradmin.component.ts @@ -73,7 +73,7 @@ export class UseradminComponent implements OnInit { } getFormGroup() { - return this.stepFormGroup; + return this.installerService.isStepAlreadyLaunched('userAdmin') ? true : this.stepFormGroup; } getInfoToInstall(): StepAction[] {