Commit a5877609 authored by achinta's avatar achinta

wip: change password

parent 7b70909f
This diff is collapsed.
import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core'; import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core';
import { Router, RouterModule, RouterOutlet,NavigationEnd } from '@angular/router'; import { Router, RouterModule, RouterOutlet, NavigationEnd } from '@angular/router';
import { RequestMapperService } from './mappers/request-mapper.service'; import { RequestMapperService } from './mappers/request-mapper.service';
import { InitThemeService } from './style-guide/service/initialize-theme.service'; import { InitThemeService } from './style-guide/service/initialize-theme.service';
import { isPlatformBrowser } from '@angular/common'; import { isPlatformBrowser } from '@angular/common';
import { filter } from 'rxjs'; import { filter } from 'rxjs';
import { App } from '@capacitor/app';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
imports: [RouterOutlet, RouterModule], imports: [RouterOutlet, RouterModule],
templateUrl: './app.component.html', templateUrl: './app.component.html',
styleUrl: './app.component.scss' styleUrl: './app.component.scss'
}) })
export class AppComponent implements OnInit{ export class AppComponent implements OnInit {
public isBrowser: boolean = false; public isBrowser: boolean = false;
...@@ -34,6 +35,15 @@ export class AppComponent implements OnInit{ ...@@ -34,6 +35,15 @@ export class AppComponent implements OnInit{
// console.log('Route changed:', event.url); // console.log('Route changed:', event.url);
this.onRouteChange(event.url); this.onRouteChange(event.url);
}); });
// Capacitor.addListener()
App.addListener('backButton', ({ canGoBack }) => {
if (!canGoBack) {
App.exitApp();
} else {
window.history.back();
}
});
} }
public onRouteChange(url: string): void { public onRouteChange(url: string): void {
......
...@@ -4,10 +4,13 @@ import { provideRouter } from '@angular/router'; ...@@ -4,10 +4,13 @@ import { provideRouter } from '@angular/router';
import { routes } from './app.routes'; import { routes } from './app.routes';
import { provideHttpClient } from '@angular/common/http'; import { provideHttpClient } from '@angular/common/http';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { DatePipe } from '@angular/common';
export const appConfig: ApplicationConfig = { export const appConfig: ApplicationConfig = {
providers: [ providers: [
provideRouter(routes), provideRouter(routes),
provideHttpClient(), provideAnimationsAsync() provideHttpClient(),
provideAnimationsAsync(),
DatePipe
] ]
}; };
...@@ -84,6 +84,12 @@ export const routes: Routes = [ ...@@ -84,6 +84,12 @@ export const routes: Routes = [
import('./portal/routine/routine.routes') import('./portal/routine/routine.routes')
.then(r => r.ROUTINE_ROUTES) .then(r => r.ROUTINE_ROUTES)
}, },
{
path: RequestMapperService.PROFILE_URL,
loadChildren: () =>
import('./portal/profile/profile.routes')
.then(r => r.PROFILE_ROUTES)
},
], ],
}, },
......
...@@ -30,12 +30,16 @@ ...@@ -30,12 +30,16 @@
} }
} }
</td> </td>
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table> </table>
@if (data.length <= 0) {
<h5 class="no_record" >No records found</h5>
}
@if (count && pageSize ) { @if (count && pageSize ) {
<mat-paginator [length]="count" [pageSize]="pageSize" (page)="onPageChanged($event)"> <mat-paginator [length]="count" [pageSize]="pageSize" (page)="onPageChanged($event)">
......
...@@ -2,4 +2,8 @@ ...@@ -2,4 +2,8 @@
// .mat-mdc-header-row{ // .mat-mdc-header-row{
// } // }
// } // }
\ No newline at end of file
.no_record{
text-align: center;
}
\ No newline at end of file
...@@ -26,7 +26,7 @@ export class ToasterService { ...@@ -26,7 +26,7 @@ export class ToasterService {
this._snackBar.open(message, action,{ this._snackBar.open(message, action,{
panelClass: [custom_class], panelClass: [custom_class],
duration: 4000, duration: 2000,
verticalPosition: "top", // Allowed values are 'top' | 'bottom' verticalPosition: "top", // Allowed values are 'top' | 'bottom'
horizontalPosition: "right" // Allowed values are 'start' | 'center' | 'end' | 'left' | 'right' horizontalPosition: "right" // Allowed values are 'start' | 'center' | 'end' | 'left' | 'right'
}); });
......
...@@ -23,4 +23,8 @@ export class RequestMapperService { ...@@ -23,4 +23,8 @@ export class RequestMapperService {
public static readonly EXAM_URL: string = 'exam'; public static readonly EXAM_URL: string = 'exam';
public static readonly ROUTINE_URL: string = 'routine'; public static readonly ROUTINE_URL: string = 'routine';
// profile urls
public static readonly PROFILE_URL: string = 'profile';
public static readonly CHANGE_PASSWORD_URL: string = 'update-password';
} }
...@@ -96,7 +96,7 @@ export class AssignmentComponent implements OnInit { ...@@ -96,7 +96,7 @@ export class AssignmentComponent implements OnInit {
isUniqueValueRequiredForFieldToDisplay: false, isUniqueValueRequiredForFieldToDisplay: false,
language: "en", language: "en",
limit: 100, limit: 100,
orderBy: "ASC", orderBy: "DESC",
page: 1, page: 1,
fieldName: `${this._urlConfig.getFiledNameFilter('assignment')},${dateRangeFieldname}`, fieldName: `${this._urlConfig.getFiledNameFilter('assignment')},${dateRangeFieldname}`,
operators: `${this._urlConfig.getFieldOperatorFilter('assignment')},${dateRangeFieldOperator}`, operators: `${this._urlConfig.getFieldOperatorFilter('assignment')},${dateRangeFieldOperator}`,
...@@ -160,6 +160,6 @@ export class AssignmentComponent implements OnInit { ...@@ -160,6 +160,6 @@ export class AssignmentComponent implements OnInit {
if(this.range.value.start && this.range.value.end) if(this.range.value.start && this.range.value.end)
this._getAssignments(); this._getAssignments();
} }
} }
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="section_dropdown mat_input"> <div class="section_dropdown mat_input">
<mat-form-field class="full_width"> <mat-form-field class="full_width">
<mat-label>Select Section</mat-label> <mat-label>Select Section</mat-label>
<mat-select formControlName="section"> <mat-select formControlName="section" (selectionChange)="onChangeSection($event)" >
@for (section of sectionDropDownData; track section) { @for (section of sectionDropDownData; track section) {
<mat-option [value]="section.value">{{section.name}}</mat-option> <mat-option [value]="section.value">{{section.name}}</mat-option>
} }
......
...@@ -4,7 +4,7 @@ import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angula ...@@ -4,7 +4,7 @@ import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angula
import { MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field'; import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
import { MatSelectModule } from '@angular/material/select'; import { MatSelectChange, MatSelectModule } from '@angular/material/select';
import { FileInputComponent } from '../../../component-library/file-input/file-input.component'; import { FileInputComponent } from '../../../component-library/file-input/file-input.component';
import { SquareButtonComponent } from '../../../component-library/square-button/square-button.component'; import { SquareButtonComponent } from '../../../component-library/square-button/square-button.component';
import { Dropdown } from '../../../component-library/dropdown/interface/dropdown'; import { Dropdown } from '../../../component-library/dropdown/interface/dropdown';
...@@ -24,6 +24,7 @@ import {MatDatepickerModule} from '@angular/material/datepicker'; ...@@ -24,6 +24,7 @@ import {MatDatepickerModule} from '@angular/material/datepicker';
import {MatNativeDateModule, provideNativeDateAdapter} from '@angular/material/core'; import {MatNativeDateModule, provideNativeDateAdapter} from '@angular/material/core';
import { MatInputModule } from '@angular/material/input'; import { MatInputModule } from '@angular/material/input';
@Component({ @Component({
selector: 'app-manage', selector: 'app-manage',
imports: [ imports: [
...@@ -68,7 +69,11 @@ export class ManageComponent { ...@@ -68,7 +69,11 @@ export class ManageComponent {
ngOnInit(): void { ngOnInit(): void {
// this._getClasses(); // this._getClasses();
this._getSection(); this._getSection();
this._getSubject(); }
public onChangeSection(event: MatSelectChange){
console.log(event.value);
this._getSubject(event.value);
} }
public onFilesChanged(files: File[]): void { public onFilesChanged(files: File[]): void {
...@@ -160,7 +165,7 @@ export class ManageComponent { ...@@ -160,7 +165,7 @@ export class ManageComponent {
// ); // );
// } // }
private _getSubject() { private _getSubject(sectionId:string) {
this._classTransmission.getSubject( this._classTransmission.getSubject(
TransmissionMapperService.GET_TRANSMISSION_URL + TransmissionMapperService.GET_TRANSMISSION_URL +
this._urlConfig.generateDatasourceConfigUrl({ this._urlConfig.generateDatasourceConfigUrl({
...@@ -173,9 +178,9 @@ export class ManageComponent { ...@@ -173,9 +178,9 @@ export class ManageComponent {
limit:100, limit:100,
orderBy:"ASC", orderBy:"ASC",
page:1, page:1,
fieldName: "subject_teacher", fieldName: "subject_teacher,section",
operators: "eq", operators: "eq,eq",
fieldValues: this._auth.localStorageGetItemByKey("user_id") fieldValues: `${this._auth.localStorageGetItemByKey("user_id")},${sectionId}`
}), }),
() => { }, () => { },
(response) => { }, (response) => { },
...@@ -224,6 +229,7 @@ export class ManageComponent { ...@@ -224,6 +229,7 @@ export class ManageComponent {
}; };
} }
); );
}, },
(error) => { (error) => {
console.log(error); console.log(error);
......
import { Injectable } from '@angular/core'; import { inject, Injectable } from '@angular/core';
import { Assignment } from '../interface/assignment'; 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';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class PrepareAssignmentTableDataService { export class PrepareAssignmentTableDataService {
constructor() { } private _datePipe = inject(DatePipe);
public prepareMatTableData(data: Assignment[]): AssignmentTable[] { public prepareMatTableData(data: Assignment[]): AssignmentTable[] {
return data.map((assignment: Assignment) => { return data.map((assignment: Assignment) => {
return { return {
id: assignment.id, 'id': assignment.id,
subject: assignment.subject_subject_name?.en, 'subject': assignment.subject_subject_name?.en,
section_details: assignment.section_details?.en, 'section_details': assignment.section_details?.en,
session_name: assignment.session_session_name?.en, 'session_name': assignment.session_session_name?.en,
assigned_on: assignment.assigned_on?.en, 'assigned_on': assignment.assigned_on?.en,
last_date: assignment.last_submission_date['en'], 'last_date': `${this._datePipe.transform(assignment.last_submission_date['en'],'dd-MM-yyyy')}`,
document: assignment.docs['en'], 'document': assignment.docs['en'],
action: ['view', 'delete'] 'action': ['view', 'delete']
} }
}) })
......
...@@ -74,12 +74,26 @@ export class Menu { ...@@ -74,12 +74,26 @@ export class Menu {
children: [] children: []
}; };
public static readonly ProfileItems: Sidebar = {
id: 5,
title: 'Change Password',
icon: 'key',
// route: RequestMapperService.EXAM_URL,
route: RequestMapperService.PROFILE_URL,
selected: false,
roles: [
RoleMapperService.TEACHER_ROLE,RoleMapperService.STUDENT_ROLE
],
children: []
};
private static readonly _MenuItems: Sidebar[] = [ private static readonly _MenuItems: Sidebar[] = [
Menu._Dashboard, Menu._Dashboard,
Menu.AssignmentItems, Menu.AssignmentItems,
Menu.RoutineItems, Menu.RoutineItems,
Menu.ExamItems Menu.ExamItems,
Menu.ProfileItems
]; ];
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
<br /> <br />
<ul> <ul>
<!-- @for (sidebarParent of sideBarNavigationItems; track sidebarParent.id) { --> <!-- @for (sidebarParent of sideBarNavigationItems; track sidebarParent.id) { -->
<ng-container *ngFor="let sidebarParent of sideBarNavigationItems">
<li *ngFor="let sidebarParent of sideBarNavigationItems" (click)="sidebarParent.selected = !sidebarParent.selected"> <li (click)="sidebarParent.selected = !sidebarParent.selected">
@if(sidebarParent.children.length > 0 || @if(sidebarParent.children.length > 0 ||
sidebarParent.route==='disabled') { sidebarParent.route==='disabled') {
<span class="icon_and_text_cont" > <span class="icon_and_text_cont">
<span class="material-symbols-outlined"> <span class="material-symbols-outlined">
{{sidebarParent.icon}} {{sidebarParent.icon}}
</span> </span>
...@@ -18,49 +18,50 @@ ...@@ -18,49 +18,50 @@
</a> </a>
</span> </span>
<span class="material-symbols-outlined dd_trigger {{sidebarParent.selected?'dd_active':''}}" > <span class="material-symbols-outlined dd_trigger {{sidebarParent.selected?'dd_active':''}}">
keyboard_arrow_down keyboard_arrow_down
</span> </span>
<ul class="dd_outer_wrapper {{sidebarParent.selected?'dd_children_selected':''}}"> <ul class="dd_outer_wrapper {{sidebarParent.selected?'dd_children_selected':''}}">
<!-- @for (sidebarChildrenLevelOne of sidebarParent.children; track <!-- @for (sidebarChildrenLevelOne of sidebarParent.children; track
sidebarChildrenLevelOne.id) { --> sidebarChildrenLevelOne.id) { -->
<li *ngFor="let sidebarChildrenLevelOne of sidebarParent.children"> <li *ngFor="let sidebarChildrenLevelOne of sidebarParent.children" >
<span class="icon_and_text_cont"> <span class="icon_and_text_cont" [routerLinkActive]="['is-active']">
<span class="material-symbols-outlined"> <span class="material-symbols-outlined">
{{sidebarChildrenLevelOne.icon}} {{sidebarChildrenLevelOne.icon}}
</span>
<a [routerLink]="[sidebarChildrenLevelOne.route]" >
{{ sidebarChildrenLevelOne.title }}
</a>
</span> </span>
<a [routerLink]="[sidebarChildrenLevelOne.route]" [routerLinkActive]="['is-active']"> </li>
{{ sidebarChildrenLevelOne.title }} <!-- } -->
</a> </ul>
</span>
</li>
<!-- } -->
</ul>
} @else { } @else {
<li> <li>
<span class="icon_and_text_cont"> <span class="icon_and_text_cont" [routerLinkActive]="['is-active']">
<span class="material-symbols-outlined"> <span class="material-symbols-outlined">
{{sidebarParent.icon}} {{sidebarParent.icon}}
</span> </span>
<a [routerLink]="[ <a [routerLink]="[
sidebarParent.route === 'disabled' ? 'null' : sidebarParent.route sidebarParent.route === 'disabled' ? 'null' : sidebarParent.route
]" [routerLinkActive]="['is-active']"> ]">
{{ sidebarParent.title }} {{ sidebarParent.title }}
</a> </a>
</span> </span>
</li> </li>
} }
</li> </li>
</ng-container>
<!-- } @empty { <!-- } @empty {
<span>Empty list of Navigation</span> <span>Empty list of Navigation</span>
} --> } -->
</ul> </ul>
</div> </div>
<div class="theme_mode_changer"> <div class="theme_mode_changer">
......
...@@ -29,8 +29,15 @@ ...@@ -29,8 +29,15 @@
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
} }
.is-active{
span,a{
color: var(--accent-color);
}
}
} }
} }
.icon_and_text_cont { .icon_and_text_cont {
display: flex; display: flex;
align-items: center; align-items: center;
......
import { Component, effect, inject, OnInit } from '@angular/core'; import { Component, effect, inject, OnInit } from '@angular/core';
import { RouterModule } from '@angular/router'; import { Router, RouterModule } from '@angular/router';
import { Menu } from '../model/sidebar/menu'; import { Menu } from '../model/sidebar/menu';
import { Sidebar } from '../interface/sidebar'; import { Sidebar } from '../interface/sidebar';
import { ThemeModeChangerComponent } from '../../../component-library/theme-mode-changer/theme-mode-changer.component'; import { ThemeModeChangerComponent } from '../../../component-library/theme-mode-changer/theme-mode-changer.component';
...@@ -17,15 +17,13 @@ import { InitThemeService } from '../../../style-guide/service/initialize-theme. ...@@ -17,15 +17,13 @@ import { InitThemeService } from '../../../style-guide/service/initialize-theme.
templateUrl: './sidebar.component.html', templateUrl: './sidebar.component.html',
styleUrl: './sidebar.component.scss' styleUrl: './sidebar.component.scss'
}) })
export class SidebarComponent implements OnInit { export class SidebarComponent {
public sideBarNavigationItems: Sidebar[] = Menu.getSideBarNavigationItems;
public isNightModeActive: boolean = false;
public ngOnInit(): void {
}
public router = inject(Router);
public sideBarNavigationItems: Sidebar[] = Menu.getSideBarNavigationItems;
public isNightModeActive: boolean = false;
// trackById(index: number, item: any): any { // trackById(index: number, item: any): any {
// return item.id || index; // Ensure 'item.id' is unique, otherwise fall back to index // return item.id || index; // Ensure 'item.id' is unique, otherwise fall back to index
// } // }
......
...@@ -18,17 +18,17 @@ ...@@ -18,17 +18,17 @@
<!-- <app-theme-mode-changer /> --> <!-- <app-theme-mode-changer /> -->
<div class="topbar_navigation_items topbar_profile_menu"> <div class="topbar_navigation_items topbar_profile_menu">
<img <!-- <img
[ngSrc]="'./assets/image/Avatar.png'" [ngSrc]="'./assets/image/Avatar.png'"
width="100" width="100"
height="100" height="100"
alt="user image" alt="user image"
class="user_image" class="user_image"
/> /> -->
<div class="user_profile_info"> <div class="user_profile_info">
<p class="user_name"> <p class="user_name">
{{userProfileInformation.name}} {{userProfileInformation.name}}
<span class="material-symbols-outlined"> keyboard_arrow_down </span> <!-- <span class="material-symbols-outlined"> keyboard_arrow_down </span> -->
</p> </p>
<p class="user_role">{{userProfileInformation.role_name}}</p> <p class="user_role">{{userProfileInformation.role_name}}</p>
</div> </div>
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
justify-content: space-between; justify-content: space-between;
gap: 5px; gap: 5px;
font-family: var(--font-mid); font-family: var(--font-mid);
white-space: nowrap;
span { span {
font-size: 21px; font-size: 21px;
cursor: pointer; cursor: pointer;
......
...@@ -40,4 +40,8 @@ export class TopBarComponent { ...@@ -40,4 +40,8 @@ export class TopBarComponent {
private _fetchProfileDetails(): void { private _fetchProfileDetails(): void {
this.userProfileInformation = this._getProfileInformation.getProfileInformation(); this.userProfileInformation = this._getProfileInformation.getProfileInformation();
} }
public createLogoUrl(){
// localStorage.
}
} }
<!-- <h6> {{studentDropdown | json}} </h6> -->
<div class="portal_dashboard_container"> <div class="portal_dashboard_container">
<div class="portal_dashboard_inner"> <div class="portal_dashboard_inner">
<div class="portal_card_container"> <div class="portal_card_container">
......
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
.portal_card_colored_card { .portal_card_colored_card {
width: 23.5%; width: 23.5%;
} }
.student_dropdown{
width: 80%;
}
.portal_small_card_container { .portal_small_card_container {
display: flex; display: flex;
gap: 2%; gap: 2%;
......
...@@ -92,8 +92,10 @@ export class PortalDashboardComponent implements OnInit { ...@@ -92,8 +92,10 @@ export class PortalDashboardComponent implements OnInit {
this._setSetStudentInfoInLocalStorage(this.students[0]); this._setSetStudentInfoInLocalStorage(this.students[0]);
this.studentDropdown = response['data'].themeDataSourceFields.map((student: Student, index: number) => { this.studentDropdown = response['data'].themeDataSourceFields.map((student: Student, index: number) => {
return { return {
"name": student.name.en, "name": `${student.name.en} (${student.section_details['en']})`,
"value": student.id "value": student.id
} }
}) })
......
<form class="routine_form" [formGroup]="updatePasswordForm">
<div class="routine_type_dropdown mat_input">
<mat-form-field class="full_width">
<mat-label>Current Password</mat-label>
<input
type="text"
matInput
placeholder="Current Password"
#input
formControlName="currentPassword"
>
<mat-error>This field is required</mat-error>
</mat-form-field>
</div>
<div class="routine_type_dropdown mat_input">
<mat-form-field class="full_width">
<mat-label>New Password</mat-label>
<input
type="text"
matInput
placeholder="New Password"
#input
formControlName="newPassword"
>
<mat-error>This field is required</mat-error>
</mat-form-field>
</div>
<div class="routine_type_dropdown mat_input">
<mat-form-field class="full_width">
<mat-label>Confirm Password</mat-label>
<input
type="text"
matInput
placeholder="Confirm Password"
#input
formControlName="confirmPassword"
>
<mat-error>This field is required</mat-error>
</mat-form-field>
</div>
<div class="save_btn">
<app-square-button
class="save_btn"
[buttonText]="'Save'"
(emitSquareButtonClick)="changePassword()"
/>
</div>
</form>
\ No newline at end of file
.save_btn{
margin-top: 20px;
float: right;
}
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ChangePasswordComponent } from './change-password.component';
describe('ChangePasswordComponent', () => {
let component: ChangePasswordComponent;
let fixture: ComponentFixture<ChangePasswordComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ChangePasswordComponent]
})
.compileComponents();
fixture = TestBed.createComponent(ChangePasswordComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { CommonModule } from '@angular/common';
import { Component, inject } from '@angular/core';
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';
import { SquareButtonComponent } from "../../../component-library/square-button/square-button.component";
import { ToasterService } from '../../../component-library/toaster/toaster.service';
@Component({
selector: 'app-change-password',
imports: [
CommonModule,
MatFormFieldModule,
MatSelectModule,
ReactiveFormsModule,
MatInputModule,
SquareButtonComponent
],
templateUrl: './change-password.component.html',
styleUrl: './change-password.component.scss'
})
export class ChangePasswordComponent {
public toaster = inject(ToasterService)
public updatePasswordForm = new FormGroup({
currentPassword: new FormControl("", [Validators.required]),
newPassword: new FormControl("", [Validators.required]),
confirmPassword: new FormControl("", [Validators.required]),
});
public changePassword(): void {
if(this.updatePasswordForm.invalid) return;
if(this.updatePasswordForm.value.confirmPassword !== this.updatePasswordForm.value.newPassword) {
this.toaster.error("Confirm password does not match new password", 'Ok');
return;
}
console.log(this.updatePasswordForm.value);
// call API for change password
}
// {
// "old_password": "password",
// "new_password": "P@$$w0rd"
// }
// https://magicoweb.com/webomagic-user/v1/user/change-password
}
import { Routes } from "@angular/router";
import { verifyRoleGuard } from "../../auth/guard/verify-role.guard";
import { RequestMapperService } from "../../mappers/request-mapper.service";
import { Menu } from "../navigation/model/sidebar/menu";
import { ChangePasswordComponent } from "./change-password/change-password.component";
export const PROFILE_ROUTES: Routes = [
{
path: RequestMapperService.BASE_RELATIVE_URL,
redirectTo: RequestMapperService.CHANGE_PASSWORD_URL,
pathMatch: 'full'
},
{
path: RequestMapperService.CHANGE_PASSWORD_URL,
loadComponent: () =>
import(
'./change-password/change-password.component'
)
.then((m) => m.ChangePasswordComponent),
data: { roles: Menu.ProfileItems.roles },
canActivate: [verifyRoleGuard],
},
]
...@@ -123,7 +123,7 @@ export class RoutineComponent { ...@@ -123,7 +123,7 @@ export class RoutineComponent {
isUniqueValueRequiredForFieldToDisplay: false, isUniqueValueRequiredForFieldToDisplay: false,
language: "en", language: "en",
limit: 10, limit: 10,
orderBy: "ASC", orderBy: "DESC",
page: 1, page: 1,
fieldName: `${this._urlConfig.getFiledNameFilter('routine')},routine_type`, fieldName: `${this._urlConfig.getFiledNameFilter('routine')},routine_type`,
operators: `${this._urlConfig.getFieldOperatorFilter('routine')},eq`, operators: `${this._urlConfig.getFieldOperatorFilter('routine')},eq`,
......
...@@ -34,7 +34,7 @@ export class PrepareRoutineTableDataService { ...@@ -34,7 +34,7 @@ export class PrepareRoutineTableDataService {
public prepareMatTableColumn(): CustomTableColumn[] { public prepareMatTableColumn(): CustomTableColumn[] {
let columnArray = [ let columnArray = [
{ key: 'class_details', label: 'Class' }, // { key: 'class_details', label: 'Class' },
{ key: 'section_details', label: 'Section' }, { key: 'section_details', label: 'Section' },
{ key: 'details', label: 'Details' }, { key: 'details', label: 'Details' },
{ key: 'action', label: 'Action' }, { key: 'action', label: 'Action' },
......
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