Commit 09a93397 authored by achinta's avatar achinta

feat: exam and routine component with routes

parent 7160043b
...@@ -66,6 +66,24 @@ export const routes: Routes = [ ...@@ -66,6 +66,24 @@ export const routes: Routes = [
canActivate: [verifyRoleGuard], canActivate: [verifyRoleGuard],
}, },
{
path: RequestMapperService.BASE_RELATIVE_URL,
loadChildren: () =>
import('./portal/assignment/assignment.routes')
.then(r => r.ASSIGNMENT_ROUTES)
},
{
path: RequestMapperService.BASE_RELATIVE_URL,
loadChildren: () =>
import('./portal/exam/exam.routes')
.then(r => r.EXAM_ROUTES)
},
{
path: RequestMapperService.BASE_RELATIVE_URL,
loadChildren: () =>
import('./portal/routine/routine.routes')
.then(r => r.ROUTINE_ROUTES)
},
], ],
}, },
......
<div class="login_outer"> <div class="login_outer">
<div class="phone_section"> <div class="phone_section">
<div class="logo_section">
<img class="login_logo" <img class="login_logo"
[ngSrc]="'./assets/image/login_logo.png'" [ngSrc]="'./assets/image/logo_lamarts.png'"
alt="Logo" alt="Logo"
width="100" width="100"
height="100" height="100"
/> />
</div>
<h5>Welcome</h5> <h5>Welcome</h5>
<p>Enter your mobile number to recieve a one time passcode</p> <p>Enter your username and password to continue</p>
<form class="login_form" [formGroup]="loginForm"> <form class="login_form" [formGroup]="loginForm">
......
<div class="colored_card"> <a [routerLink]="cardLink">
<div class="colored_card">
<p class="cardTextOneHeading">{{cardTextOneHeading}}</p> <p class="cardTextOneHeading">{{cardTextOneHeading}}</p>
<p class="cardTextOne">{{cardTextOne}}</p> <p class="cardTextOne">{{cardTextOne}}</p>
<p class="cardTextTwoHeading">{{cardTextTwoHeading}}</p> <p class="cardTextTwoHeading">{{cardTextTwoHeading}}</p>
<p class="cardTextTwo">{{cardTextTwo}}</p> <p class="cardTextTwo">{{cardTextTwo}}</p>
<img [ngSrc]="CardImage" width="100" height="100"/> <img [ngSrc]="CardImage" width="100" height="100"/>
</div> </div>
</a>
a {
text-decoration: none;
}
.colored_card{ .colored_card{
background: var(--accent-gradient); background: var(--accent-gradient);
border-radius: 16px; border-radius: 16px;
...@@ -10,18 +13,18 @@ ...@@ -10,18 +13,18 @@
color: white; color: white;
margin: 0; margin: 0;
} }
.cardTextOneHeading { // .cardTextOneHeading {
} // }
.cardTextOne { .cardTextOne {
font-size: 33px; font-size: 33px;
font-family: "hlv_bold", sans-serif; font-family: "hlv_bold", sans-serif;
margin-top: 6px; margin-top: 6px;
margin-bottom: 14px; margin-bottom: 14px;
} }
.cardTextTwoHeading { // .cardTextTwoHeading {
} // }
.cardTextTwo { .cardTextTwo {
font-size: 33px; font-size: 33px;
font-family: "hlv_bold", sans-serif; font-family: "hlv_bold", sans-serif;
......
import { NgOptimizedImage } from '@angular/common'; import { NgOptimizedImage } from '@angular/common';
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { RouterModule } from '@angular/router';
@Component({ @Component({
selector: 'app-colored-card', selector: 'app-colored-card',
imports: [ imports: [
NgOptimizedImage NgOptimizedImage,
RouterModule
], ],
templateUrl: './colored-card.component.html', templateUrl: './colored-card.component.html',
styleUrl: './colored-card.component.scss' styleUrl: './colored-card.component.scss'
...@@ -15,7 +17,7 @@ export class ColoredCardComponent { ...@@ -15,7 +17,7 @@ export class ColoredCardComponent {
@Input() cardTextOne: string = ''; @Input() cardTextOne: string = '';
@Input() cardTextTwoHeading: string = ''; @Input() cardTextTwoHeading: string = '';
@Input() cardTextTwo: string = ''; @Input() cardTextTwo: string = '';
@Input() cardLink: string = '';
@Input() CardImage: string = ''; @Input() CardImage: string = '';
} }
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
@if (column.key !== 'action' ) { @if (column.key !== 'action' ) {
{{ element[column.key] }} {{ element[column.key] }}
<input type="text" value={{column.label}}/>
<button (click)="editField(i)">edit</button>
} @else { } @else {
@for (item of element[column.key]; track item) { @for (item of element[column.key]; track item) {
...@@ -32,5 +30,8 @@ ...@@ -32,5 +30,8 @@
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table> </table>
<mat-paginator [length]="count" [pageSize]="pageSize" (page)="onPageChanged($event)"> @if (count && pageSize ) {
</mat-paginator>
\ No newline at end of file <mat-paginator [length]="count" [pageSize]="pageSize" (page)="onPageChanged($event)">
</mat-paginator>
}
\ No newline at end of file
...@@ -32,6 +32,7 @@ export class CustomTableComponent { ...@@ -32,6 +32,7 @@ export class CustomTableComponent {
public ngOnInit(): void { public ngOnInit(): void {
// console.log(this.data); // console.log(this.data);
} }
get displayedColumns(): string[] { get displayedColumns(): string[] {
// console.log(this.data); // console.log(this.data);
return this.columns.map(col => col.key); return this.columns.map(col => col.key);
......
...@@ -18,45 +18,10 @@ export class RequestMapperService { ...@@ -18,45 +18,10 @@ export class RequestMapperService {
public static readonly PORTAL_URL: string = 'portal'; public static readonly PORTAL_URL: string = 'portal';
public static readonly DASHBOARD_URL: string = 'dashboard'; public static readonly DASHBOARD_URL: string = 'dashboard';
// accounts navigation // assignment navigation
public static readonly CHARTS_OF_ACCOUNTS_URL: string = 'charts-of-accounts'; public static readonly ASSIGNMENT_URL: string = 'assignment';
public static readonly AUDIT_LOG_URL: string = 'audit-log'; public static readonly EXAM_URL: string = 'exam';
public static readonly SCHEDULE_OF_RATES_URL: string = 'schedule-of-rates'; public static readonly ROUTINE_URL: string = 'routine';
public static readonly FUND_ALLOTMENT_URL: string = 'fund-allotment';
public static readonly FUND_ALLOTMENT_AUDIT_LOG_URL: string = 'fund-allotment-log';
public static readonly BUDGET_URL: string = 'budget';
public static readonly FUND_SUBMITTED_BUDGET: string = 'fund-submitted-budget';
static SCHEDULE_OF_RATE_AUDIT_LOG_URL: string = "schedule-of-rate-audit-log";
// temp links for guard demo start
public static readonly TEMP_ACCOUNT_URL1: string = 'acc1';
public static readonly TEMP_ACCOUNT_URL2: string = 'acc2';
public static readonly TEMP_ACCOUNT_URL3: string = 'acc3';
public static readonly TEMP_FO_URL1: string = 'of1';
public static readonly TEMP_FO_URL2: string = 'of2';
public static readonly TEMP_FO_URL3: string = 'of3';
public static readonly TEMP_EE_URL1: string = 'ee1';
public static readonly TEMP_EE_URL2: string = 'ee2';
public static readonly TEMP_EE_URL3: string = 'ee3';
// temp links for guard demo end
//water body
public static readonly WATER_BODY_URL: string = 'water-bodies';
public static readonly WATER_BODY_ADD_URL: string = 'water-body-add';
} }
import { Routes } from "@angular/router";
import { verifyRoleGuard } from "../../auth/guard/verify-role.guard";
import { RequestMapperService } from "../../mappers/request-mapper.service";
import { Submenu } from "../navigation/model/sidebar/submenu";
import { Menu } from "../navigation/model/sidebar/menu";
export const ASSIGNMENT_ROUTES: Routes = [
{
path: RequestMapperService.ASSIGNMENT_URL,
loadComponent: () =>
import(
'./assignment/assignment.component'
)
.then((m) => m.AssignmentComponent),
data: { roles: Menu.AssignmentItems.roles },
canActivate: [verifyRoleGuard],
},
]
<app-custom-table [columns]="columns" [data]="data" />
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AddAssignmentComponent } from './add-assignment.component'; import { AssignmentComponent } from './assignment.component';
describe('AddAssignmentComponent', () => { describe('AssignmentComponent', () => {
let component: AddAssignmentComponent; let component: AssignmentComponent;
let fixture: ComponentFixture<AddAssignmentComponent>; let fixture: ComponentFixture<AssignmentComponent>;
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [AddAssignmentComponent] imports: [AssignmentComponent]
}) })
.compileComponents(); .compileComponents();
fixture = TestBed.createComponent(AddAssignmentComponent); fixture = TestBed.createComponent(AssignmentComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });
......
import { Component } from '@angular/core';
import { CustomTableComponent } from '../../../component-library/custom-table/custom-table.component';
@Component({
selector: 'app-assignment',
imports: [
CustomTableComponent
],
templateUrl: './assignment.component.html',
styleUrl: './assignment.component.scss'
})
export class AssignmentComponent {
public columns = [
{ key: 'class', label: 'Class' },
{ key: 'subject', label: 'Subject' },
{ key: 'section', label: 'Section' },
{ key: 'action', label: 'Action' },
];
public data = [
{
class: "VI",
subject: "Math",
section: "5A",
action: ['view','edit']
}
];
}
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ManageComponent } from './manage.component';
describe('ManageComponent', () => {
let component: ManageComponent;
let fixture: ComponentFixture<ManageComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ManageComponent]
})
.compileComponents();
fixture = TestBed.createComponent(ManageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component } from '@angular/core'; import { Component } from '@angular/core';
@Component({ @Component({
selector: 'app-add-assignment', selector: 'app-manage',
imports: [], imports: [],
templateUrl: './add-assignment.component.html', templateUrl: './manage.component.html',
styleUrl: './add-assignment.component.scss' styleUrl: './manage.component.scss'
}) })
export class AddAssignmentComponent { export class ManageComponent {
} }
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";
export const EXAM_ROUTES: Routes = [
{
path: RequestMapperService.EXAM_URL,
loadComponent: () =>
import(
'./exam/exam.component'
)
.then((m) => m.ExamComponent),
data: { roles: Menu.ExamItems.roles },
canActivate: [verifyRoleGuard],
},
]
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ExamComponent } from './exam.component';
describe('ExamComponent', () => {
let component: ExamComponent;
let fixture: ComponentFixture<ExamComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ExamComponent]
})
.compileComponents();
fixture = TestBed.createComponent(ExamComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component } from '@angular/core';
@Component({
selector: 'app-exam',
imports: [],
templateUrl: './exam.component.html',
styleUrl: './exam.component.scss'
})
export class ExamComponent {
}
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ManageComponent } from './manage.component';
describe('ManageComponent', () => {
let component: ManageComponent;
let fixture: ComponentFixture<ManageComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ManageComponent]
})
.compileComponents();
fixture = TestBed.createComponent(ManageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component } from '@angular/core';
@Component({
selector: 'app-manage',
imports: [],
templateUrl: './manage.component.html',
styleUrl: './manage.component.scss'
})
export class ManageComponent {
}
...@@ -37,24 +37,48 @@ export class Menu { ...@@ -37,24 +37,48 @@ export class Menu {
children: [] children: []
}; };
private static readonly _AssignmentItems: Sidebar = { public static readonly AssignmentItems: Sidebar = {
id: 3, id: 3,
title: 'Assignment', title: 'Assignment',
icon: 'assignment', icon: 'assignment',
route: 'disabled', route: RequestMapperService.ASSIGNMENT_URL,
selected: false, selected: false,
roles: [ roles: [
RoleMapperService.TEACHER_ROLE RoleMapperService.TEACHER_ROLE,RoleMapperService.STUDENT_ROLE
], ],
children: Submenu.getAssignmentSubItems children: []
}; };
public static readonly RoutineItems: Sidebar = {
id: 4,
title: 'Routine',
icon: 'assignment',
route: RequestMapperService.ROUTINE_URL,
selected: false,
roles: [
RoleMapperService.TEACHER_ROLE,RoleMapperService.STUDENT_ROLE
],
children: []
};
public static readonly ExamItems: Sidebar = {
id: 5,
title: 'Exam',
icon: 'assignment',
route: RequestMapperService.EXAM_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.ExamItems
]; ];
......
...@@ -9,7 +9,7 @@ export class Submenu { ...@@ -9,7 +9,7 @@ export class Submenu {
id: 1, id: 1,
title: 'Add', title: 'Add',
icon: 'add', icon: 'add',
route: RequestMapperService.CHARTS_OF_ACCOUNTS_URL, route: RequestMapperService.ASSIGNMENT_URL,
selected: false, selected: false,
roles: [ roles: [
RoleMapperService.TEACHER_ROLE RoleMapperService.TEACHER_ROLE
...@@ -21,7 +21,7 @@ export class Submenu { ...@@ -21,7 +21,7 @@ export class Submenu {
id: 1, id: 1,
title: 'History', title: 'History',
icon: 'add', icon: 'add',
route: RequestMapperService.CHARTS_OF_ACCOUNTS_URL, route: RequestMapperService.ASSIGNMENT_URL,
selected: false, selected: false,
roles: [ roles: [
RoleMapperService.TEACHER_ROLE RoleMapperService.TEACHER_ROLE
......
<div class="topbar_navigation_wrapper"> <div class="topbar_navigation_wrapper">
<div class="topbar_logo"> <div class="topbar_logo">
<img <img
[ngSrc]="'./assets/image/logo_blue.png'" [ngSrc]="'./assets/image/logo_lamarts.png'"
width="200" width="200"
height="100" height="100"
alt="logo" alt="logo"
......
<div class="portal_dashboard_container">
<div class="portal_dashboard_inner">
<div class="portal_card_container">
<app-colored-card
[cardTextOneHeading]="'Assignment'"
[cardTextOne]="''"
[cardLink]="''"
[cardTextTwoHeading]="'Assignment'"
[cardTextTwo]="''"
[CardImage]="
'./assets/image/charts_and_calculations_for_business_analytics.svg'
"
class="portal_card_colored_card"
/>
<app-colored-card
[cardTextOneHeading]="'Routine'"
[cardTextOne]="''"
[cardLink]="''"
[cardTextTwoHeading]="'Routine'"
[cardTextTwo]="''"
[CardImage]="
'./assets/image/Mobile_banking_app_with_secure_payment.svg'
"
class="portal_card_colored_card"
/>
<app-colored-card
[cardTextOneHeading]="'Exam Schedule'"
[cardTextOne]="''"
[cardLink]="''"
[cardTextTwoHeading]="'Exam Schedule'"
[cardTextTwo]="''"
[CardImage]="'./assets/image/Digital_receipts_for_online_payments.svg'"
class="portal_card_colored_card"
/>
</div>
</div>
</div>
<!-- <p>portal-viewer works!</p> --> <!-- <p>portal-viewer works!</p> -->
<div class="portal_viewer"> <div class="portal_viewer">
<!-- <div class="top_bar"> <div class="top_bar">
<app-top-bar /> <app-top-bar />
</div> -->
<!-- <mat-drawer-container class="example-container">
<mat-drawer mode="side" opened>
<div class="sidebar">
<app-sidebar />
</div>
</mat-drawer>
<mat-drawer-content>
<div class="portal_renderer">
<div class="portal_renderer_inner">
<router-outlet />
</div> </div>
</div>
</mat-drawer-content>
</mat-drawer-container> -->
<div class="sidebar"> <div class="sidebar">
<app-sidebar /> <app-sidebar />
</div> </div>
......
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ManageComponent } from './manage.component';
describe('ManageComponent', () => {
let component: ManageComponent;
let fixture: ComponentFixture<ManageComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ManageComponent]
})
.compileComponents();
fixture = TestBed.createComponent(ManageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component } from '@angular/core';
@Component({
selector: 'app-manage',
imports: [],
templateUrl: './manage.component.html',
styleUrl: './manage.component.scss'
})
export class ManageComponent {
}
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";
export const ROUTINE_ROUTES: Routes = [
{
path: RequestMapperService.ROUTINE_URL,
loadComponent: () =>
import(
'./routine/routine.component'
)
.then((m) => m.RoutineComponent),
data: { roles: Menu.RoutineItems.roles },
canActivate: [verifyRoleGuard],
},
]
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RoutineComponent } from './routine.component';
describe('RoutineComponent', () => {
let component: RoutineComponent;
let fixture: ComponentFixture<RoutineComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [RoutineComponent]
})
.compileComponents();
fixture = TestBed.createComponent(RoutineComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component } from '@angular/core';
@Component({
selector: 'app-routine',
imports: [],
templateUrl: './routine.component.html',
styleUrl: './routine.component.scss'
})
export class RoutineComponent {
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>W.B.L.M Portal</title> <title>La Martiniere</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
......
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