Commit 325a1ffa authored by achinta's avatar achinta

fix: atuh issue

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