Skip to content
Snippets Groups Projects
Commit 4e82e271 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #17005 TIME 0:05 make the message optional

parent 664f6206
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<ion-content> <ion-content>
<ion-list-header> <ion-list-header>
<ion-label color="secondary"> <ion-label color="secondary">
{{ 'lang.loginMessage' | translate}} <ng-container>*</ng-container> {{ 'lang.loginMessage' | translate}}
</ion-label> </ion-label>
</ion-list-header> </ion-list-header>
<ion-item lines="none"> <ion-item lines="none">
......
...@@ -59,19 +59,15 @@ export class CustomizationComponent implements OnInit { ...@@ -59,19 +59,15 @@ export class CustomizationComponent implements OnInit {
onSubmit() { onSubmit() {
this.loginMessage = tinymce.get('login_message').getContent(); this.loginMessage = tinymce.get('login_message').getContent();
if (this.functions.empty(this.loginMessage)) { this.http.put('../rest/customization', {id: this.authService.user.id , loginMessage: this.loginMessage}).pipe(
this.notificationService.error(this.translate.instant('lang.requiredField')); tap(() => {
} else { this.notificationService.success(this.translate.instant('lang.messageSaved'));
this.http.put('../rest/customization', {id: this.authService.user.id , loginMessage: this.loginMessage}).pipe( }),
tap(() => { catchError((err: any) => {
this.notificationService.success(this.translate.instant('lang.messageSaved')); this.notificationService.handleErrors(err);
}), return of(false);
catchError((err: any) => { })
this.notificationService.handleErrors(err); ).subscribe();
return of(false);
})
).subscribe();
}
} }
initMce() { initMce() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<mat-icon svgIcon="maarchLogo" class="maarchLogo"></mat-icon> <mat-icon svgIcon="maarchLogo" class="maarchLogo"></mat-icon>
<ion-card style="width: 400px;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);"> <ion-card style="width: 400px;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);">
<ion-card-header> <ion-card-header *ngIf="!functions.empty(authService.loginMessage)">
<ion-card-subtitle class="loginMessage"> <ion-card-subtitle class="loginMessage">
<div [innerHTML]="authService.loginMessage | safeHtml"></div> <div [innerHTML]="authService.loginMessage | safeHtml"></div>
</ion-card-subtitle> </ion-card-subtitle>
......
...@@ -11,6 +11,7 @@ import { tap, catchError } from 'rxjs/operators'; ...@@ -11,6 +11,7 @@ import { tap, catchError } from 'rxjs/operators';
import { of } from 'rxjs'; import { of } from 'rxjs';
import { LoadingController, MenuController } from '@ionic/angular'; import { LoadingController, MenuController } from '@ionic/angular';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { FunctionsService } from '../service/functions.service';
@Component({ @Component({
templateUrl: 'login.component.html', templateUrl: 'login.component.html',
...@@ -37,6 +38,7 @@ export class LoginComponent implements OnInit, AfterViewInit { ...@@ -37,6 +38,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
public loadingController: LoadingController, public loadingController: LoadingController,
private translate: TranslateService, private translate: TranslateService,
private menu: MenuController, private menu: MenuController,
public functions: FunctionsService
) { } ) { }
async ngOnInit() { async ngOnInit() {
...@@ -49,7 +51,7 @@ export class LoginComponent implements OnInit, AfterViewInit { ...@@ -49,7 +51,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
this.environment = environment; this.environment = environment;
this.signaturesService.reset(); this.signaturesService.reset();
await this.loadCommitInformation(); await this.loadCommitInformation();
} }
ionViewWillEnter() { ionViewWillEnter() {
......
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