Commit 4e82e271 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #17005 TIME 0:05 make the message optional

parent 664f6206
......@@ -11,7 +11,7 @@
<ion-content>
<ion-list-header>
<ion-label color="secondary">
{{ 'lang.loginMessage' | translate}} <ng-container>*</ng-container>
{{ 'lang.loginMessage' | translate}}
</ion-label>
</ion-list-header>
<ion-item lines="none">
......
......@@ -59,19 +59,15 @@ export class CustomizationComponent implements OnInit {
onSubmit() {
this.loginMessage = tinymce.get('login_message').getContent();
if (this.functions.empty(this.loginMessage)) {
this.notificationService.error(this.translate.instant('lang.requiredField'));
} else {
this.http.put('../rest/customization', {id: this.authService.user.id , loginMessage: this.loginMessage}).pipe(
tap(() => {
this.notificationService.success(this.translate.instant('lang.messageSaved'));
}),
catchError((err: any) => {
this.notificationService.handleErrors(err);
return of(false);
})
).subscribe();
}
this.http.put('../rest/customization', {id: this.authService.user.id , loginMessage: this.loginMessage}).pipe(
tap(() => {
this.notificationService.success(this.translate.instant('lang.messageSaved'));
}),
catchError((err: any) => {
this.notificationService.handleErrors(err);
return of(false);
})
).subscribe();
}
initMce() {
......
......@@ -2,7 +2,7 @@
<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-header>
<ion-card-header *ngIf="!functions.empty(authService.loginMessage)">
<ion-card-subtitle class="loginMessage">
<div [innerHTML]="authService.loginMessage | safeHtml"></div>
</ion-card-subtitle>
......
......@@ -11,6 +11,7 @@ import { tap, catchError } from 'rxjs/operators';
import { of } from 'rxjs';
import { LoadingController, MenuController } from '@ionic/angular';
import { TranslateService } from '@ngx-translate/core';
import { FunctionsService } from '../service/functions.service';
@Component({
templateUrl: 'login.component.html',
......@@ -37,6 +38,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
public loadingController: LoadingController,
private translate: TranslateService,
private menu: MenuController,
public functions: FunctionsService
) { }
async ngOnInit() {
......@@ -49,7 +51,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
this.environment = environment;
this.signaturesService.reset();
await this.loadCommitInformation();
await this.loadCommitInformation();
}
ionViewWillEnter() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment