Commit 325a1ffa authored by achinta's avatar achinta

fix: atuh issue

parent f7b8595a
......@@ -32,7 +32,6 @@ export class AppComponent implements OnInit {
this.router.events.pipe(
filter(event => event instanceof NavigationEnd)
).subscribe((event: any) => {
// console.log('Route changed:', event.url);
this.onRouteChange(event.url);
});
// Capacitor.addListener()
......@@ -48,8 +47,6 @@ export class AppComponent implements OnInit {
public onRouteChange(url: string): void {
// Custom function to execute on route change
// console.log('Triggered function on route change!', url);
this._themeService.updateSidebarState(false);
}
}
......@@ -20,7 +20,6 @@ export class BeforeLoginComponent {
public loginUrl =`/${RequestMapperService.LOGIN_URL}`;
public selectedSchool(school:string): void{
// console.log(school);
localStorage.setItem('logged_school', school);
}
}
......@@ -13,10 +13,10 @@ export const verifyRoleGuard: CanActivateFn = (
const requiredRoles: string[] = route.data['roles'] as string[];
const userRole: string = localStorage.getItem('role')||'';
console.log('requiredRoles=>',requiredRoles);
console.log('userRole=>',userRole);
// console.log('requiredRoles=>',requiredRoles);
// console.log('userRole=>',userRole);
// return true;
// FFBF00
if( userRole && isRoleValid(requiredRoles, userRole) ) return true;
else {
......
......@@ -12,7 +12,7 @@
<form class="login_form" [formGroup]="loginForm">
<h5>Welcome</h5>
<mat-radio-group aria-label="Select an option" formControlName="role">
<mat-radio-group aria-label="Select an option" formControlName="role" >
<mat-radio-button value="student">Student</mat-radio-button>
<mat-radio-button value="EDITOR">Teacher</mat-radio-button>
</mat-radio-group>
......@@ -25,7 +25,7 @@
<span class="material-symbols-outlined" matPrefix>
person
</span>
<input class="inputStyle" matInput placeholder="{{ 'Enter your number' }}" #input
<input type="number" class="inputStyle" matInput placeholder="{{ 'Enter your number' }}" #input
formControlName="phoneNo" [readonly]="otpSend" [disabled]="otpSend" />
</mat-form-field>
......
import { CommonModule, NgOptimizedImage, isPlatformBrowser } from '@angular/common';
import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core';
import { Router, RouterModule } from '@angular/router';
import { CommonModule, NgOptimizedImage } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { RouterModule } from '@angular/router';
import { RoundedButtonFullWidthComponent } from '../../component-library/rounded-button-full-width/rounded-button-full-width.component';
import { AuthTransmissionService } from '../../raintree/transmission/auth-transmission.service';
import { TransmissionMapperService } from '../../mappers/transmission-mapper.service';
import { RaintreeResponse } from '../../raintree/interface/raintree-response';
import { Auth } from '../interface/auth';
import { AuthService } from '../service/auth.service';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { AbstractControl, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { TransmissionMessageHandlerService } from '../../raintree/transmission-message-handler/transmission-message-handler';
import { UserProfile } from '../interface/user-profile';
import { ToasterService } from '../../component-library/toaster/toaster.service';
......@@ -53,11 +52,11 @@ export class LoginComponent implements OnInit {
public hidePassword: boolean = true;
public loginForm = new FormGroup({
phoneNo: new FormControl('6290861931', [
phoneNo: new FormControl('', [
Validators.required,
Validators.pattern(/^\d{10}$/)
]),
otp: new FormControl('1234', [
otp: new FormControl('', [
Validators.required,
Validators.pattern(/^\d{4}$/)
]),
......@@ -83,6 +82,14 @@ export class LoginComponent implements OnInit {
this._getUserDetails();
}
// public onChangeRole(event: MatRadioChange): void {
// if (event.value === 'EDITOR') {
// this.loginForm.get('phoneNo')?.setValue('6290861931');
// } else {
// this.loginForm.get('phoneNo')?.setValue('9830503868');
// }
// }
private _autoLogin(userInfo:any){
let loginFormPayload = {
......@@ -191,6 +198,8 @@ export class LoginComponent implements OnInit {
}
public sendOtp(): void {
if(this.loginForm.get('phoneNo')?.invalid) return;
this.otpSend = this._optService.sendOtp(Number(this.loginForm.value.phoneNo));
// console.log(otp);
// this.otpSend = !this.otpSend;
......
......@@ -19,15 +19,14 @@ export class SendOtpService {
public sendOtp(phone: number): boolean {
this._otp = Math.floor(1000 + Math.random() * 9000);
let otpUrl = RequestMapperService.OTP_URL;
this._otp = 1234;
this._otp = 5678;
const makeOtpUrl = otpUrl
.replace("[NUMBER]", String(phone))
.replace("[OTP]", String(this._otp))
console.log(makeOtpUrl);
// this._prepareToSendOtp(makeOtpUrl);
// https://103.229.250.200/smpp/sendsms?username=lmccao&password=sms@2023&to=6290861931&from=LMCCAO&text=7556%20is%20the%20OTP%20to%20create%20new%20password.%20For%20any%20assistance,%20please%20call%20033-4040-6607.%0A%0ABursar-cum-Assistant%20Secretary,%0ALa%20Martiniere%20Schools
this._toaster.success('Otp send successfully', 'Ok')
return true;
......@@ -45,11 +44,11 @@ export class SendOtpService {
() => { },
(response) => {
console.log(response);
// console.log(response);
},
(error) => {
console.log(error);
// console.log(error);
},
() => { }
......
......@@ -62,8 +62,8 @@ export class CustomTableComponent<T> {
}
public onPageChanged<T>(event: T): void {
console.log("event");
console.log(event);
// console.log("event");
// console.log(event);
}
......
......@@ -45,7 +45,7 @@ a {
color: white;
}
.card_icon_direction_boys {
background: yellow;
background: #FFBF00;
color: black;
}
}
\ No newline at end of file
......@@ -72,7 +72,7 @@ export class ManageComponent {
}
public onChangeSection(event: MatSelectChange){
console.log(event.value);
// console.log(event.value);
this._getSubject(event.value);
}
......
......@@ -3,6 +3,7 @@ import { Assignment } from '../interface/assignment';
import { AssignmentTable } from '../interface/assignment-table';
import { CustomTableColumn } from '../../../component-library/interface/custom-table-column';
import { DatePipe } from '@angular/common';
import { RoleMapperService } from '../../../mappers/role-mapper.service';
@Injectable({
providedIn: 'root'
......@@ -30,9 +31,11 @@ export class PrepareAssignmentTableDataService {
}
public prepareMatTableColumn(): CustomTableColumn[] {
let role = localStorage.getItem('role');
let includeSectionDetails = (role === RoleMapperService.TEACHER_ROLE);
let columnArray = [
// { key: 'section_details', label: 'Section' },
...(includeSectionDetails ? [{ key: 'section_details', label: 'Section' }] : []),
{ key: 'subject', label: 'Subject' },
{ key: 'last_date', label: 'Last Date' },
{ key: 'action', label: 'Action' },
......
......@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { Routine } from '../interface/routine';
import { CustomTableColumn } from '../../../component-library/interface/custom-table-column';
import { RoutineTable } from '../interface/routine-table';
import { RoleMapperService } from '../../../mappers/role-mapper.service';
@Injectable({
providedIn: 'root'
......@@ -32,10 +33,12 @@ export class PrepareRoutineTableDataService {
}
public prepareMatTableColumn(): CustomTableColumn[] {
let role = localStorage.getItem('role');
let includeSectionDetails = (role === RoleMapperService.TEACHER_ROLE);
let columnArray = [
// { key: 'class_details', label: 'Class' },
// { key: 'section_details', label: 'Section' },
...(includeSectionDetails ? [{ key: 'section_details', label: 'Section' }] : []),
{ key: 'details', label: 'Details' },
{ key: 'action', label: 'Action' },
];
......
......@@ -66,7 +66,7 @@ body {
.top_yellow_line {
width: 100%;
height: 40px;
background-color: #ffc107;
background-color: #FFBF00;
}
.mat-mdc-form-field{
......
Markdown is supported
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