Commit 3fb06089 authored by Arko Dey Bhowmick's avatar Arko Dey Bhowmick

Merge branch 'dev_achinta' into test-elements

parents 9cc07e50 8c8724bd
...@@ -7,20 +7,20 @@ import { RoleMapperService } from './mappers/role-mapper.service'; ...@@ -7,20 +7,20 @@ import { RoleMapperService } from './mappers/role-mapper.service';
export const routes: Routes = [ export const routes: Routes = [
{ // {
path: RequestMapperService.STYLE_GUIDE, // path: RequestMapperService.STYLE_GUIDE,
loadComponent: () => // loadComponent: () =>
import('./style-guide/style-guide/style-guide.component').then((m) => m.StyleGuideComponent), // import('./style-guide/style-guide/style-guide.component').then((m) => m.StyleGuideComponent),
data: { roles: [] }, // data: { roles: [] },
children: [ // children: [
{ // {
path: RequestMapperService.BASE_RELATIVE_URL, // path: RequestMapperService.BASE_RELATIVE_URL,
loadChildren: () => // loadChildren: () =>
import('./style-guide/style-guide.routes') // import('./style-guide/style-guide.routes')
.then(r => r.STYLE_GUIDE_ROTES) // .then(r => r.STYLE_GUIDE_ROTES)
}, // },
] // ]
}, // },
{ {
path: RequestMapperService.LOGIN_URL, path: RequestMapperService.LOGIN_URL,
loadComponent: () => loadComponent: () =>
......
...@@ -13,8 +13,8 @@ export const verifyRoleGuard: CanActivateFn = ( ...@@ -13,8 +13,8 @@ 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;
if( userRole && isRoleValid(requiredRoles, userRole) ) return true; if( userRole && isRoleValid(requiredRoles, userRole) ) return true;
......
import { CommonModule, NgOptimizedImage, isPlatformBrowser } from '@angular/common'; import { CommonModule, NgOptimizedImage, isPlatformBrowser } from '@angular/common';
import { Component, Inject, PLATFORM_ID } from '@angular/core'; import { Component, Inject, PLATFORM_ID } from '@angular/core';
import { Router, RouterModule } from '@angular/router'; import { Router, RouterModule } from '@angular/router';
import { RequestMapperService } from '../../mappers/request-mapper.service';
import { RoundedButtonComponent } from '../../component-library/rounded-button/rounded-button.component';
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';
...@@ -13,7 +11,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; ...@@ -13,7 +11,6 @@ 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 { AbstractControl, 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 { UserProfileResponse } from '../../raintree/interface/user-profile-response';
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';
...@@ -22,7 +19,6 @@ import { ToasterService } from '../../component-library/toaster/toaster.service' ...@@ -22,7 +19,6 @@ import { ToasterService } from '../../component-library/toaster/toaster.service'
imports: [ imports: [
NgOptimizedImage, NgOptimizedImage,
RouterModule, RouterModule,
// RoundedButtonComponent,
RoundedButtonFullWidthComponent, RoundedButtonFullWidthComponent,
MatFormFieldModule, MatFormFieldModule,
MatInputModule, MatInputModule,
...@@ -46,8 +42,8 @@ export class LoginComponent { ...@@ -46,8 +42,8 @@ export class LoginComponent {
public hidePassword: boolean = true; public hidePassword: boolean = true;
public loginForm = new FormGroup({ public loginForm = new FormGroup({
email: new FormControl('', [Validators.required]), email: new FormControl('achintadey.websofttechs@gmail.com', [Validators.required]),
password: new FormControl('', [Validators.required]), password: new FormControl('P@$$w0rd', [Validators.required]),
}); });
public authenticate(): void { public authenticate(): void {
...@@ -68,7 +64,6 @@ export class LoginComponent { ...@@ -68,7 +64,6 @@ export class LoginComponent {
if (this._transmissionMessageHandler.hasError(response)) { if (this._transmissionMessageHandler.hasError(response)) {
this.errorMessage = response['message']; this.errorMessage = response['message'];
console.log(this.errorMessage); console.log(this.errorMessage);
return; return;
}; };
......
...@@ -22,14 +22,20 @@ export class AuthService { ...@@ -22,14 +22,20 @@ export class AuthService {
} }
public prepareLoginProcess(userProfileData: UserProfile): void { public prepareLoginProcess(userProfileData: UserProfile): void {
console.log(userProfileData);
this._setProfileInformationInLocalStorage(userProfileData); this._setProfileInformationInLocalStorage(userProfileData);
if (this.isBrowser) { if (this.isBrowser) {
localStorage.setItem('isLoggedIn', 'true'); localStorage.setItem('isLoggedIn', 'true');
localStorage.setItem('role', userProfileData.role_name); // TODO: This is for temporary
// localStorage.setItem('role','FO,accountant'); //TODO: for testing if(userProfileData.role_name === 'Teacher') {
localStorage.setItem('role', 'EDITOR');
} else{
localStorage.setItem('role', userProfileData.role_name);
}
this._router.navigate([RequestMapperService.PORTAL_URL]); this._router.navigate([RequestMapperService.PORTAL_URL]);
} }
} }
...@@ -38,4 +44,17 @@ export class AuthService { ...@@ -38,4 +44,17 @@ export class AuthService {
// console.log(jwtToken); // console.log(jwtToken);
localStorage.setItem('userProfile', JSON.stringify(userProfileData)); localStorage.setItem('userProfile', JSON.stringify(userProfileData));
} }
public localStorageGetItemByKey(key: string): string{
const localStorageItem = JSON.parse(localStorage.getItem('userProfile')!);
return localStorageItem[key] || '';
}
public getUserRole(): string {
return this.localStorageGetItemByKey('role');
}
} }
<div class="log_viewer_component">
<div class="log_col full_width">
<app-page-heading [title]="'Audit Log Details'"/>
</div>
<div class="log_col">
<h3>ID</h3>
<p>{{data.id}}</p>
</div>
<div class="log_col">
<h3>User Id</h3>
<p>{{data.user_id}}</p>
</div>
<div class="log_col">
<h3>User Name</h3>
<p>{{data.user_name}}</p>
</div>
<div class="log_col">
<h3>Created At</h3>
<p>{{data.created_at}}</p>
</div>
<div class="log_col">
<h3>IP Address</h3>
<p>{{data.ip_address}}</p>
</div>
<div class="log_col full_width">
<h3>endpoint</h3>
<p>{{temp(data.request_payload)}}</p>
</div>
<div class="log_col full_width">
<h3>Notes</h3>
<p>{{temp(data.request_payload) }}</p>
</div>
</div>
.log_viewer_component {
display: flex;
flex-wrap: wrap;
padding: 20px;
background-color: var(--primary-bg-color);
color: var(--primary-color);
.log_col {
width: 20%;
h3 {
font-size: 14px;
}
&.full_width {
width: 100%;
}
}
}
.mat-mdc-dialog-surface::ng-deep {
background: var(--secondary-bg-color) !important;
}
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AuditLogDetailsComponent } from './audit-log-details.component';
describe('AuditLogDetailsComponent', () => {
let component: AuditLogDetailsComponent;
let fixture: ComponentFixture<AuditLogDetailsComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AuditLogDetailsComponent]
})
.compileComponents();
fixture = TestBed.createComponent(AuditLogDetailsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent, MatDialogTitle } from '@angular/material/dialog';
import { AuditLog } from '../interface/audit-log';
import { PageHeadingComponent } from '../../page-heading/page-heading.component';
@Component({
selector: 'app-audit-log-details',
imports: [
// MatDialogTitle,
// MatDialogContent,
// MatDialogActions,
// MatDialogClose,
PageHeadingComponent
],
templateUrl: './audit-log-details.component.html',
styleUrl: './audit-log-details.component.scss'
})
export class AuditLogDetailsComponent {
constructor(
private _dialogRef: MatDialogRef<AuditLogDetailsComponent>,
@Inject(MAT_DIALOG_DATA) public data: AuditLog,
) {}
public onNoClick(): void {
this._dialogRef.close(this.data);
}
public ngOnInit(): void {
console.log(this.data)
}
public temp(request_payload: any): any {
return JSON.stringify(request_payload, null, 2);
}
}
<app-page-heading [title]="'Audit Log'" />
<app-filter-with-export-and-print
[placeholder]="'Ex: User ID, User Name'"
(inputData)="applyFilter($event)"
[dropDownData]="endPoints"
(emitDropDownData)="selectDropdownFromFilter($event)"
></app-filter-with-export-and-print>
<table mat-table [dataSource]="dataSource">
<!-- ID Column -->
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef>ID</th>
<td mat-cell *matCellDef="let log" data-label="id">
{{ log.id }}
</td>
</ng-container>
<!-- User ID Column -->
<ng-container matColumnDef="user_id">
<th mat-header-cell *matHeaderCellDef>User ID</th>
<td mat-cell *matCellDef="let log">{{ log.user_id }}</td>
</ng-container>
<!-- User Name Column -->
<ng-container matColumnDef="user_name">
<th mat-header-cell *matHeaderCellDef>User Name</th>
<td mat-cell *matCellDef="let log">{{ log.user_name }}</td>
</ng-container>
<!-- IP Address Column -->
<ng-container matColumnDef="ip_address">
<th mat-header-cell *matHeaderCellDef>IP Address</th>
<td mat-cell *matCellDef="let log">{{ log.ip_address }}</td>
</ng-container>
<!-- Method Column -->
<ng-container matColumnDef="method">
<th mat-header-cell *matHeaderCellDef>Method</th>
<td mat-cell *matCellDef="let log">{{ log.method }}</td>
</ng-container>
<!-- Created Column -->
<ng-container matColumnDef="created_at">
<th mat-header-cell *matHeaderCellDef>Created</th>
<td mat-cell *matCellDef="let log">{{ log.created_at }}</td>
</ng-container>
<!-- CTA Column -->
<ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef>Action</th>
<td mat-cell *matCellDef="let log">
<button (click)="openDialog(log)" class="view_button">
<span class="material-symbols-outlined"> visibility </span>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
<mat-paginator
[length]="totalItems"
[pageSize]="pageSize"
showFirstLastButtons
[pageSizeOptions]="[5, 10, 20]"
(page)="pageChanged($event)"
*ngIf="dataSource && dataSource.data.length"
#paginator
></mat-paginator>
// .mat-mdc-table::ng-deep {
// background: var(--secondary-bg-color);
// box-shadow: var(--box-shadow-small);
// font-family: var(--font-light);
// .mat-mdc-header-row {
// background: var(--accent-color);
// border: none;
// color: white;
// }
// .mdc-data-table__content{
// td {
// color: var(--primary-color);
// border-bottom: 1px solid var(--border-color);
// }
// .mdc-data-table__row:last-child .mat-mdc-cell {
// border-bottom: none;
// }
// }
// }
// .view_button {
// all: unset;
// display: block;
// text-align: center;
// width: 100%;
// cursor: pointer;
// }
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AuditLogComponent } from './audit-log.component';
describe('AuditLogComponent', () => {
let component: AuditLogComponent;
let fixture: ComponentFixture<AuditLogComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AuditLogComponent]
})
.compileComponents();
fixture = TestBed.createComponent(AuditLogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { AfterViewInit, Component, Input, OnInit, ViewChild } from '@angular/core';
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
import { AuditLog } from '../interface/audit-log';
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
import { AuditLogDetailsComponent } from '../audit-log-details/audit-log-details.component';
import { MatPaginator, MatPaginatorModule, PageEvent } from '@angular/material/paginator';
import { PipeModule } from '../../../pipe/pipe.module';
import { FilterWithExportAndPrintComponent } from '../../filter-with-export-and-print/filter-with-export-and-print.component';
import { PageHeadingComponent } from '../../page-heading/page-heading.component';
import { MatModalConfig } from '../model/mat-modal-config';
import { AuditLogTransmissionService } from '../../../raintree/transmission/audit-log-transmission.service';
import { TransmissionMapperService } from '../../../mappers/transmission-mapper.service';
import { CommonModule } from '@angular/common';
import { Dropdown } from '../../dropdown/interface/dropdown';
import { PaginationComponent } from '../../pagination/pagination/pagination.component';
@Component({
selector: 'app-audit-log',
imports: [
MatTableModule,
PageHeadingComponent,
PipeModule,
MatDialogModule,
MatPaginatorModule,
FilterWithExportAndPrintComponent,
CommonModule,
// PaginationComponent
],
templateUrl: './audit-log.component.html',
styleUrls: [
'../../../style-guide/css/table-theme.scss'
]
})
export class AuditLogComponent implements AfterViewInit, OnInit{
@ViewChild(MatPaginator) private paginator!: MatPaginator;
@Input() public logs: AuditLog[] = [];
@Input() public endPoints: Dropdown[] = [];
public displayedColumns: string[] = ['id', 'user_id', 'user_name', 'ip_address', 'method', 'created_at', 'action'];
public dataSource: MatTableDataSource<AuditLog> = {} as MatTableDataSource<AuditLog>;
public pageSize: number = 5;
public pageNumber: number = 1;
public totalItems = 0;
constructor(
private _dialog: MatDialog,
private _auditLogTransmission: AuditLogTransmissionService
) {
this.dataSource = new MatTableDataSource(this.logs);
}
public openDialog(log: AuditLog): void {
this._dialog.open(AuditLogDetailsComponent, {
data: log,
...MatModalConfig.getLogConfig
});
}
public ngOnInit(): void {
this._getLogCount(this.endPoints[0].value, this.pageNumber, this.pageSize);
}
public ngAfterViewInit(): void {
this.dataSource.paginator = this.paginator;
}
public applyFilter(filterString: string): void {
this.dataSource.filter = filterString.trim().toLowerCase();
if (this.dataSource.paginator) {
this.dataSource.paginator.firstPage();
}
}
private _getLogs(endPoint: string, pageNumber: number, pageSize: number): void {
this._auditLogTransmission.getLogs(
TransmissionMapperService.AUDIT_LOG_TRANSMISSION_URL+`?endpoint=${endPoint}&page=${pageNumber?pageNumber:1}&page_size=${pageSize}`,
()=> {},
()=> {},
(response)=> { //success
this.logs = response;
this.dataSource = new MatTableDataSource(this.logs);
},
()=> {}, //failure
()=> {},
);
}
private _getLogCount(endPoint: string, pageNumber: number, pageSize: number): void {
this._auditLogTransmission.getLogCount(
TransmissionMapperService.AUDIT_LOG_COUNT_TRANSMISSION_URL+`?endpoint=${endPoint}&page=${pageNumber?pageNumber:1}&page_size=${pageSize}`,
()=> {},
()=> {},
(response)=> { //success
this.totalItems = response.count;
this._getLogs(endPoint, pageNumber, pageSize);
},
()=> {}, //failure
()=> {},
);
}
public selectDropdownFromFilter(selectedData: string): void {
let endpoint: string = encodeURIComponent(selectedData);
// this.paginator.firstPage();
this._getLogCount(endpoint, 1, this.pageSize);
}
public pageChanged(event: PageEvent) : void {
this.pageSize = event.pageSize;
this.pageNumber = event.pageIndex + 1;
this._getLogCount(this.endPoints[0].value, this.pageNumber, this.pageSize);
}
}
export interface AuditLogConfig {
width: string,
height: string,
maxWidth: string,
maxHeight: string,
}
export interface AuditLog {
id: number,
user_id: number,
user_name: string,
ip_address: string,
endpoint: string,
method: string,
request_payload: any,
query_params: any,
created_at: string
}
import { ChartsOfAccountLog } from './charts-of-account-log';
describe('ChartsOfAccountLog', () => {
it('should create an instance', () => {
expect(new ChartsOfAccountLog()).toBeTruthy();
});
});
import { AuditLog } from "../interface/audit-log";
export class ChartsOfAccountLog {
private static readonly _log1: AuditLog = {
id: 1,
user_id: 123,
user_name: 'Deep Dey',
ip_address: '103.220.209.138',
endpoint: '/nkda/v1/user/get',
method: 'POST',
request_payload: {
key1: 'value1',
key2: 'value2',
key3: 'value3',
key4: 'value4',
},
query_params: {
key1: 'value1',
key2: 'value2',
key3: 'value3',
key4: 'value4',
},
created_at: '20-5-2024'
}
private static readonly _logItems : AuditLog[] = [
ChartsOfAccountLog._log1,
ChartsOfAccountLog._log1,
ChartsOfAccountLog._log1,
ChartsOfAccountLog._log1,
ChartsOfAccountLog._log1,
ChartsOfAccountLog._log1,
];
public static get getLogItems(): AuditLog[] {
return ChartsOfAccountLog._logItems;
}
}
import { AuditLogConfig } from "../interface/audit-log-config";
export class MatModalConfig {
private static readonly _config: AuditLogConfig = {
width: '98vw',
height: 'auto',
maxWidth: '70vw',
maxHeight: '70vh',
}
public static get getLogConfig(): AuditLogConfig {
return MatModalConfig._config;
}
}
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
@for (item of element[column.key]; track item) { @for (item of element[column.key]; track item) {
<ng-container *ngIf="item =='view'"> <ng-container *ngIf="item =='view'">
<button class="view_button d_inline_block width_auto ml_1" (click)="view(element)"> <button class="view_button d_inline_block width_auto " (click)="view(element)">
<span class="material-symbols-outlined"> visibility </span> &nbsp; <span class="material-symbols-outlined"> visibility </span> &nbsp;
</button> </button>
</ng-container> </ng-container>
<ng-container *ngIf="item =='edit'"> <ng-container *ngIf="item =='edit' && authService.getUserRole() !== 'student'">
<button class="view_button d_inline_block width_auto ml_1" (click)="edit(element)"> <button class="view_button d_inline_block width_auto " (click)="edit(element)">
<span class="material-symbols-outlined">edit</span> <span class="material-symbols-outlined">edit</span>
</button> </button>
</ng-container> </ng-container>
......
// @media only screen and (max-width: 999px) and (min-width: 300px) {
// .mat-mdc-header-row{
// }
// }
\ No newline at end of file
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { Component, EventEmitter, Input, Output } from '@angular/core'; import { Component, EventEmitter, inject, Input, Output } from '@angular/core';
import { MatTableModule } from '@angular/material/table'; import { MatTableModule } from '@angular/material/table';
import { MatPaginator } from '@angular/material/paginator'; import { MatPaginator } from '@angular/material/paginator';
import { AuthService } from '../../auth/service/auth.service';
@Component({ @Component({
selector: 'app-custom-table', selector: 'app-custom-table',
...@@ -28,6 +29,8 @@ export class CustomTableComponent { ...@@ -28,6 +29,8 @@ export class CustomTableComponent {
@Output() emitEdit: EventEmitter<string> = new EventEmitter<string>(); @Output() emitEdit: EventEmitter<string> = new EventEmitter<string>();
public authService = inject(AuthService);
// totalRecords: number = 3400; // totalRecords: number = 3400;
// pageSize: number = 50; // pageSize: number = 50;
...@@ -67,7 +70,11 @@ export class CustomTableComponent { ...@@ -67,7 +70,11 @@ export class CustomTableComponent {
// ]; // ];
// data = [ // data = [
// { id: 1, name: 'John Doe', age: 30 }, // {
// id: 1,
// name: 'John Doe',
// age: 30
// },
// { id: 2, name: 'Jane Doe', age: 28 }, // { id: 2, name: 'Jane Doe', age: 28 },
// { id: 3, name: 'Alice', age: 25 } // { id: 3, name: 'Alice', age: 25 }
// ]; // ];
......
...@@ -24,7 +24,4 @@ export class RequestMapperService { ...@@ -24,7 +24,4 @@ export class RequestMapperService {
public static readonly ROUTINE_URL: string = 'routine'; public static readonly ROUTINE_URL: string = 'routine';
public static readonly TEST_DRAG_AND_DROP: string = 'drag-and-drop'; public static readonly TEST_DRAG_AND_DROP: string = 'drag-and-drop';
} }
...@@ -9,7 +9,7 @@ export class RoleMapperService { ...@@ -9,7 +9,7 @@ export class RoleMapperService {
// NOTE:: this will be same value which is come from backend role // NOTE:: this will be same value which is come from backend role
public static readonly TEACHER_ROLE: string = 'Teacher'; public static readonly TEACHER_ROLE: string = 'EDITOR';
public static readonly STUDENT_ROLE: string = 'Student'; public static readonly STUDENT_ROLE: string = 'Student';
public static get getAllRole(): string[] { public static get getAllRole(): string[] {
......
import { TestBed } from '@angular/core/testing';
import { TransmissionMapperService } from './transmission-mapper.service';
describe('TransmissionMapperService', () => {
let service: TransmissionMapperService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(TransmissionMapperService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root'
}) })
export class TransmissionMapperService { export class TransmissionMapperService {
constructor() { } constructor() { }
public static readonly DEV_TRANSMISSION_URL: string = public static readonly DEV_TRANSMISSION_URL: string =
'https://magicoweb.com'; 'https://magicoweb.com';
...@@ -14,24 +16,31 @@ export class TransmissionMapperService { ...@@ -14,24 +16,31 @@ export class TransmissionMapperService {
public static readonly USER_PROFILE_TRANSMISSION_URL: string = public static readonly USER_PROFILE_TRANSMISSION_URL: string =
TransmissionMapperService.DEV_TRANSMISSION_URL + '/user/get-profile'; TransmissionMapperService.DEV_TRANSMISSION_URL + '/user/get-profile';
public static readonly SCHEDULE_OF_RATES_TRANSMISSION_URL: string =
TransmissionMapperService.DEV_TRANSMISSION_URL + public static readonly GET_TRANSMISSION_URL: string =
'/schedule-of-rates/get-all'; TransmissionMapperService.DEV_TRANSMISSION_URL + '/webomagic/getWebDataSourceByWebsiteDataSourceForFilter?';
public static readonly SCHEDULE_OF_RATES_ADD_TRANSMISSION_URL: string =
TransmissionMapperService.DEV_TRANSMISSION_URL + '/schedule-of-rates/add';
public static readonly SCHEDULE_OF_RATES_UPDATE_TRANSMISSION_URL: string =
TransmissionMapperService.DEV_TRANSMISSION_URL +
'/schedule-of-rates/update';
public static readonly SCHEDULE_OF_RATE_TYPE_TRANSMISSION_URL: string =
TransmissionMapperService.DEV_TRANSMISSION_URL +
'/schedule-of-rate-type/get-all';
public static readonly AUDIT_LOG_TRANSMISSION_URL: string =
TransmissionMapperService.DEV_TRANSMISSION_URL + '/entry-log/get';
public static readonly AUDIT_LOG_COUNT_TRANSMISSION_URL: string =
TransmissionMapperService.DEV_TRANSMISSION_URL + '/entry-log/count';
public static readonly CHARTS_OF_ACCOUNT_TRANSMISION_URL: string = public static readonly SAVE_TRANSMISSION_URL: string =
TransmissionMapperService.DEV_TRANSMISSION_URL + TransmissionMapperService.DEV_TRANSMISSION_URL + '/webomagic/saveWebDataSourceFieldsBasedOnDataSourceType?';
'/chart-of-account/get-all?head_type=income&get_only_head=false&get_nested_preview=true&page=1&page_size=100';
// aggregationOnUniqueFld=false&datasourceId=3188&dontIncludeForeignKey=false&expand=false&isUniqueValueRequiredForFieldToDisplay=false&language=en&limit=10&orderBy=ASC&page=1&user_id=206&roleBasedFiltering=true
// public static readonly SCHEDULE_OF_RATES_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL +
// '/schedule-of-rates/get-all';
// public static readonly SCHEDULE_OF_RATES_ADD_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL + '/schedule-of-rates/add';
// public static readonly SCHEDULE_OF_RATES_UPDATE_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL +
// '/schedule-of-rates/update';
// public static readonly SCHEDULE_OF_RATE_TYPE_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL +
// '/schedule-of-rate-type/get-all';
// public static readonly AUDIT_LOG_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL + '/entry-log/get';
// public static readonly AUDIT_LOG_COUNT_TRANSMISSION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL + '/entry-log/count';
// public static readonly CHARTS_OF_ACCOUNT_TRANSMISION_URL: string =
// TransmissionMapperService.DEV_TRANSMISSION_URL +
// '/chart-of-account/get-all?head_type=income&get_only_head=false&get_nested_preview=true&page=1&page_size=100';
} }
import {Pipe, PipeTransform} from "@angular/core"; import { Pipe, PipeTransform } from "@angular/core";
​
@Pipe({ @Pipe({
name: 'formatDate', name: 'formatDate',
standalone: false standalone: false
}) })
export class FormatDatePipe implements PipeTransform { export class FormatDatePipe implements PipeTransform {
​
transform(timestamp: number): string { transform(timestamp: number): string {
const date = new Date(timestamp); const date = new Date(timestamp);
const day = date.getDate(); const day = date.getDate();
const month = this.getMonthName(date.getMonth()); const month = this.getMonthName(date.getMonth());
const year = date.getFullYear(); const year = date.getFullYear();
const ordinalSuffix = this.getOrdinalSuffix(day); const ordinalSuffix = this.getOrdinalSuffix(day);
​
return `${day}${ordinalSuffix} ${month}, ${year}`; return `${day}${ordinalSuffix} ${month}, ${year}`;
} }
​
private getMonthName(month: number): string { private getMonthName(month: number): string {
const months = [ const months = [
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
]; ];
​
return months[month]; return months[month];
} }
​
private getOrdinalSuffix(day: number): string { private getOrdinalSuffix(day: number): string {
const suffixes = ['th', 'st', 'nd', 'rd']; const suffixes = ['th', 'st', 'nd', 'rd'];
const teenDigits = [11, 12, 13]; const teenDigits = [11, 12, 13];
const lastDigit = day % 10; const lastDigit = day % 10;
​
if (teenDigits.includes(day)) { if (teenDigits.includes(day)) {
return suffixes[0]; return suffixes[0];
} }
​
return suffixes[lastDigit] || suffixes[0]; return suffixes[lastDigit] || suffixes[0];
} }
​
} }
<app-custom-table <div class="custom_table">
[columns]="columns" <app-custom-table
[data]="data" [columns]="columns"
(emitEdit)="emitEditFromTable($event)" [data]="data"
(emitView)="emitViewFromTable($event)" (emitEdit)="emitEditFromTable($event)"
/> (emitView)="emitViewFromTable($event)"
/>
</div>
<div class="add_btn" *ngIf="authService.getUserRole() !== 'student'">
<app-square-button
[buttonIcon]="'add'"
(emitSquareButtonClick)="addAssignment()"
/>
</div>
.add_btn{
position: fixed;
bottom: 20px;
right: 0;
padding: 0px 15px;
margin: auto;
}
\ No newline at end of file
import { Component } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { CustomTableComponent } from '../../../component-library/custom-table/custom-table.component'; import { CustomTableComponent } from '../../../component-library/custom-table/custom-table.component';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { ManageComponent } from '../manage/manage.component'; import { ManageComponent } from '../manage/manage.component';
import { SquareButtonComponent } from '../../../component-library/square-button/square-button.component';
import { AssignmentTransmissionService } from '../../../raintree/transmission/assignment-transmission.service';
import { AssignmentsResponse } from '../../../raintree/interface/assignment-respons';
import { TransmissionMapperService } from '../../../mappers/transmission-mapper.service';
import { UrlConfigService } from '../../service/url-config.service';
import { Assignment } from '../interface/assignment';
import { PrepareAssignmentTableDataService } from '../service/prepare-assignment-table-data.service';
import { DataSourceService } from '../../service/data-source.service';
import { AuthService } from '../../../auth/service/auth.service';
import { CommonModule } from '@angular/common';
@Component({ @Component({
selector: 'app-assignment', selector: 'app-assignment',
imports: [ imports: [
CustomTableComponent CustomTableComponent,
CommonModule,
SquareButtonComponent
], ],
templateUrl: './assignment.component.html', templateUrl: './assignment.component.html',
styleUrl: './assignment.component.scss' styleUrl: './assignment.component.scss'
}) })
export class AssignmentComponent { export class AssignmentComponent implements OnInit {
constructor( constructor(
private _dialog: MatDialog, private _dialog: MatDialog,
){} private _assignmentTransmission: AssignmentTransmissionService,
private _urlConfig: UrlConfigService,
private _prepareAssignmentTableData: PrepareAssignmentTableDataService,
public authService: AuthService
) { }
public columns = [ public columns = [
{ key: 'class', label: 'Class' }, { key: 'class_subject_subject_txt', label: 'Class' },
{ key: 'subject', label: 'Subject' }, { key: 'subject', label: 'Subject' },
{ key: 'section', label: 'Section' }, { key: 'section', label: 'Section' },
{ key: 'action', label: 'Action' }, { key: 'action', label: 'Action' },
]; ];
public data = [
{
class: "VI",
subject: "Math",
section: "5A",
action: ['view','edit']
},
{
class: "VI",
subject: "Math",
section: "5B",
action: ['view','edit']
}
];
public emitViewFromTable(clickedData: string){ public data: any[] = [];
public ngOnInit(): void {
this.columns = this._prepareAssignmentTableData.prepareMatTableColumn();
this._getAssignments();
}
private _getAssignments(): void {
this._assignmentTransmission.getAssignment(
TransmissionMapperService.GET_TRANSMISSION_URL + this._urlConfig.generateDatasourceConfigUrl({
aggregationOnUniqueFld: false,
datasourceId: DataSourceService.ASSIGNMENT_DATA_SOURCE_ID,
dontIncludeForeignKey: false,
expand: false,
isUniqueValueRequiredForFieldToDisplay: false,
language: "en",
limit: 100,
orderBy: "ASC",
page: 1,
roleBasedFiltering: true
}),
() => { },
(response) => { },
(response: AssignmentsResponse) => {
this.data = this._prepareAssignmentTableData.prepareMatTableData(
response.data.themeDataSourceFields
);
},
(error) => {
console.log(error);
},
() => { }
)
}
public emitViewFromTable(clickedData: string): void {
alert("Have to view the doc in another page"); alert("Have to view the doc in another page");
} }
public emitEditFromTable(clickedData: string): void { public emitEditFromTable(emitData: string): void {
// rate ? rate.is_edit_enable = true : ''; // rate ? rate.is_edit_enable = true : '';
console.log(clickedData);
let dialogRef = this._dialog.open(ManageComponent, { let dialogRef = this._dialog.open(ManageComponent, {
data: clickedData, data: emitData,
width: '98vw', width: '98vw',
height: 'auto', height: 'auto',
maxWidth: '70vw', maxWidth: '70vw',
...@@ -62,4 +101,14 @@ export class AssignmentComponent { ...@@ -62,4 +101,14 @@ export class AssignmentComponent {
// }); // });
} }
public addAssignment(): void {
let dialogRef = this._dialog.open(ManageComponent, {
data: '',
width: '98vw',
height: 'auto',
maxWidth: '70vw',
maxHeight: '70vh',
});
}
} }
import { Data } from "../../data-source/interface/data";
import { LocalizedField } from "../../data-source/interface/localizedField";
// ThemeDataSourceField Interface
export interface Assignments extends Data {
themeDataSourceFields: Assignment[];
}
// ThemeDataSourceField Interface
export interface Assignment {
session: LocalizedField;
subject: LocalizedField;
assigned_on: LocalizedField;
last_submission_date: LocalizedField;
section: LocalizedField;
docs: LocalizedField;
class_subject: LocalizedField;
session_session_name: LocalizedField;
section_details: LocalizedField;
id: string;
subject_subject_name: LocalizedField;
class_subject_subject_txt: LocalizedField;
}
import { CommonModule } from '@angular/common';
import { Component, Inject } from '@angular/core'; import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MAT_DIALOG_DATA } from '@angular/material/dialog';
@Component({ @Component({
selector: 'app-manage', selector: 'app-manage',
imports: [], imports: [CommonModule],
templateUrl: './manage.component.html', templateUrl: './manage.component.html',
styleUrl: './manage.component.scss' styleUrl: './manage.component.scss'
}) })
......
import { TestBed } from '@angular/core/testing';
import { PrepareAssignmentTableDataService } from './prepare-assignment-table-data.service';
describe('PrepareAssignmentTableDataService', () => {
let service: PrepareAssignmentTableDataService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(PrepareAssignmentTableDataService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { Assignment } from '../interface/assignment';
@Injectable({
providedIn: 'root'
})
export class PrepareAssignmentTableDataService {
constructor() { }
public prepareMatTableData(data: Assignment[]): any {
let dataArray = data.map((assignment: Assignment) => {
return {
['subject']: assignment.class_subject_subject_txt['en'],
['section_details']: assignment.section_details['en'],
['session_name']: assignment.session_session_name['en'],
['id']: assignment.id,
['action']: ['view', 'edit']
}
})
return dataArray;
// return [];
}
public prepareMatTableColumn(): any[] {
let columnArray = [
{ key: 'subject', label: 'Subject' },
{ key: 'section_details', label: 'Subject Details' },
{ key: 'session_name', label: 'Session Name' },
{ key: 'action', label: 'Action' },
];
console.log(columnArray);
return columnArray;
}
}
import { Data } from "./data";
import { LocalizedField } from "./localizedField";
// ThemeDataSourceField Interface
export interface Classes extends Data {
themeDataSourceFields: StudentClass[];
}
// ThemeDataSourceField Interface
export interface StudentClass {
id: string;
className: LocalizedField;
details: LocalizedField;
school: LocalizedField;
}
import { ForeignKeyMap } from "./foreignKeyMap";
// Data Interface
export interface Data {
count: number;
id: number | string;
dataSourceName: string;
websiteId: number;
type: string;
foreignKeyMapping: any;
foreignKeyMap: ForeignKeyMap;
requiredPresentationField: string;
favourite: boolean;
icon: string;
dependentFields: any;
dsType: any;
[index:string]: any;
}
\ No newline at end of file
// ForeignKeyListForDataSource Interface
export interface ForeignKeyListForDataSource {
fieldName: string;
foreignTableId: number;
presentationFieldPattern: any;
presenterField: any;
isMultiSelect: boolean;
foreignUniqueField: any;
id: any;
remotePresenterField: string;
}
\ No newline at end of file
import { ForeignKeyListForDataSource } from "./foreignKeyListForDataSource";
export interface ForeignKeyMap {
dataSourceId: number;
foreignKeyListForDataSource: ForeignKeyListForDataSource[];
}
\ No newline at end of file
// LocalizedField Interface (replaces repeated language-specific fields)
export interface LocalizedField {
default?: string;
beng: string;
hindi: string;
en: string;
}
\ No newline at end of file
import { Data } from "./data";
import { LocalizedField } from "./localizedField";
// ThemeDataSourceField Interface
export interface Sections extends Data {
themeDataSourceFields: StudentSection[];
}
// ThemeDataSourceField Interface
export interface StudentSection {
id: string;
class: LocalizedField;
section: LocalizedField;
class_teacher: LocalizedField;
details: LocalizedField;
class_details: LocalizedField;
class_teacher_name: LocalizedField;
}
<p>exam works!</p> <div class="custom_table">
<app-custom-table
[columns]="columns"
[data]="data"
(emitEdit)="emitEditFromTable($event)"
(emitView)="emitViewFromTable($event)"
/>
</div>
<div class="add_btn">
<app-square-button
[buttonIcon]="'add'"
(emitSquareButtonClick)="addExam()"
/>
</div>
\ No newline at end of file
.add_btn{
position: fixed;
bottom: 20px;
right: 0;
padding: 0px 15px;
margin: auto;
}
\ No newline at end of file
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CustomTableComponent } from '../../../component-library/custom-table/custom-table.component';
import { SquareButtonComponent } from '../../../component-library/square-button/square-button.component';
import { MatDialog } from '@angular/material/dialog';
import { ManageComponent } from '../manage/manage.component';
import { ExamScheduleService } from '../../../raintree/transmission/exam-schedule.service';
import { TransmissionMapperService } from '../../../mappers/transmission-mapper.service';
import { UrlConfigService } from '../../service/url-config.service';
import { DataSourceService } from '../../service/data-source.service';
import { PrepareExamTableDataService } from '../service/prepare-exam-table-data.service';
import { RaintreeResponse } from '../../../raintree/interface/raintree-response';
@Component({ @Component({
selector: 'app-exam', selector: 'app-exam',
imports: [], imports: [
CommonModule,
CustomTableComponent,
SquareButtonComponent
],
templateUrl: './exam.component.html', templateUrl: './exam.component.html',
styleUrl: './exam.component.scss' styleUrl: './exam.component.scss'
}) })
export class ExamComponent { export class ExamComponent {
constructor(
private _dialog: MatDialog,
private _examSchedule:ExamScheduleService,
private _urlConfig: UrlConfigService,
private _prepareExamTableData: PrepareExamTableDataService
) { }
public columns: any = [];
public data: any = [];
ngOnInit(): void {
this.columns = this._prepareExamTableData.prepareMatTableColumn();
this._getExamSchedule();
}
public emitViewFromTable(emitData: any) {
let docLink = emitData.image.replace('BASE_URL', TransmissionMapperService.DEV_TRANSMISSION_URL);
window.open(docLink, '_blank');
}
private matModalConfig = {
width: '98vw',
height: 'auto',
maxWidth: '70vw',
maxHeight: '70vh',
}
public emitEditFromTable(emitData: string): void {
this._dialog.open(ManageComponent, {
data: emitData,
...this.matModalConfig
});
}
public addExam(): void {
this._dialog.open(ManageComponent, {
data: '',
...this.matModalConfig
});
}
private _getExamSchedule(): void {
this._examSchedule.getExamSchedule(
TransmissionMapperService.GET_TRANSMISSION_URL + this._urlConfig.generateDatasourceConfigUrl({
aggregationOnUniqueFld: false,
datasourceId: DataSourceService.EXAM_SCHEDULE_DATA_SOURCE_ID,
dontIncludeForeignKey: false,
expand: false,
isUniqueValueRequiredForFieldToDisplay: false,
language: "en",
limit: 10,
orderBy: "ASC",
page: 1,
roleBasedFiltering: true
}),
() => { },
(response) => { },
(response: RaintreeResponse) => {
this.data = this._prepareExamTableData.prepareMatTableData(response['data'].themeDataSourceFields);
},
(error) => {
console.log(error);
},
() => { }
)
}
} }
import { RaintreeResponse } from "../../../raintree/interface/raintree-response";
import { Data } from "../../data-source/interface/data";
import { LocalizedField } from "../../data-source/interface/localizedField";
// ThemeDataSourceField Interface
export interface ExamSchedules extends Data {
themeDataSourceFields: ExamSchedule[];
}
// ThemeDataSourceField Interface
export interface ExamSchedule {
id: string;
session: LocalizedField;
Term: LocalizedField;
image: LocalizedField;
details: LocalizedField;
class: LocalizedField;
session_session_name: LocalizedField;
class_details: LocalizedField;
}
<p>manage works!</p> <pre> {{data|json}} </pre>
\ No newline at end of file
import { Component } from '@angular/core'; import { CommonModule } from '@angular/common';
import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
@Component({ @Component({
selector: 'app-manage', selector: 'app-manage',
imports: [], imports: [
CommonModule
],
templateUrl: './manage.component.html', templateUrl: './manage.component.html',
styleUrl: './manage.component.scss' styleUrl: './manage.component.scss'
}) })
export class ManageComponent { export class ManageComponent {
constructor(
@Inject(MAT_DIALOG_DATA) public data: any,
) { }
} }
import { TestBed } from '@angular/core/testing';
import { PrepareExamTableDataService } from './prepare-exam-table-data.service';
describe('PrepareExamTableDataService', () => {
let service: PrepareExamTableDataService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(PrepareExamTableDataService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { ExamSchedule } from '../interface/exam-schedule';
@Injectable({
providedIn: 'root'
})
export class PrepareExamTableDataService {
constructor() { }
public prepareMatTableData(data: ExamSchedule[]): any {
let dataArray = data.map((schedule: ExamSchedule) => {
return {
['id']: schedule.id,
['Term']: schedule.Term['en'],
['image']: schedule.image['en'],
['details']: schedule.details['en'],
['class_details']: schedule.class_details['en'],
['action']: ['view', 'edit']
}
})
return dataArray;
}
public prepareMatTableColumn(): any[] {
let columnArray = [
{ key: 'Term', label: 'Term' },
{ key: 'details', label: 'Details' },
{ key: 'class_details', label: 'Class' },
{ key: 'action', label: 'Action' },
];
return columnArray;
}
}
...@@ -20,7 +20,7 @@ export class LogoutService { ...@@ -20,7 +20,7 @@ export class LogoutService {
} }
public logout(): void { public logout(message:string = 'Successfully Logged out'): void {
if (this.isBrowser) { if (this.isBrowser) {
...@@ -30,7 +30,7 @@ export class LogoutService { ...@@ -30,7 +30,7 @@ export class LogoutService {
this._router.navigate([RequestMapperService.LOGIN_URL]).then(() => { this._router.navigate([RequestMapperService.LOGIN_URL]).then(() => {
// window.location.reload(); // window.location.reload();
this._toaster.success('Successfully Logged out','Ok'); this._toaster.success(message,'Ok');
}); });
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
justify-content: space-between; justify-content: space-between;
position: relative; // position: relative;
} }
.sidebar_navigation_container a { .sidebar_navigation_container a {
...@@ -85,8 +85,9 @@ ...@@ -85,8 +85,9 @@
} }
.theme_mode_changer { .theme_mode_changer {
position: absolute; position: fixed;
bottom: 0; bottom: 0;
transform: translate(50px, -30px);
} }
@media only screen and (max-width: 999px) and (min-width: 300px) { @media only screen and (max-width: 999px) and (min-width: 300px) {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
{{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.user_type}}</p> <p class="user_role">{{userProfileInformation.role_name}}</p>
</div> </div>
</div> </div>
......
import { Data } from "../../data-source/interface/data";
import { LocalizedField } from "../../data-source/interface/localizedField";
// ThemeDataSourceField Interface
export interface Routines extends Data {
themeDataSourceFields: Routine[];
dataSourceTypeFieldsList?: Routine[]
}
// ThemeDataSourceField Interface
export interface Routine {
id: string;
class: LocalizedField;
section: LocalizedField;
schedule: LocalizedField;
details: LocalizedField;
session: LocalizedField;
document: LocalizedField;
routine_type: LocalizedField;
session_session_name?: LocalizedField;
class_details?: LocalizedField;
section_details?: LocalizedField;
}
<p>manage works!</p> <!-- <h1> Hi Manage </h1> -->
<form class="login_form" [formGroup]="routineForm">
<div class="mat_input_container">
<div class="class_dropdown">
<app-drop-down
[dropDownData] ="classDropDownData"
(emitDropDownData)="classOnChange($event)"
/>
</div>
<div class="section_dropdown">
<app-drop-down
[dropDownData] ="sectionDropDownData"
(emitDropDownData)="sectionOnChange($event)"
/>
</div>
<div class="details_field">
<mat-form-field class="full_width">
<span class="material-symbols-outlined" matPrefix>
person
</span>
<input
matInput
placeholder="{{ 'Enter details' }}"
#input
formControlName="details"
/>
<mat-error>This field is required</mat-error>
</mat-form-field>
</div>
<mat-form-field style="width: 100%;">
<mat-label>Schedule</mat-label>
<button mat-icon-button matPrefix (click)="f_input.click()">
<mat-icon>attach_file</mat-icon>
</button>
<input type="text" readonly matInput />
<input
type="file"
multiple
hidden
#f_input
/>
<mat-error>This field is required</mat-error>
</mat-form-field>
</div>
<div class="add_btn">
<app-square-button
[buttonIcon]="''"
[buttonText]="'submit'"
(emitSquareButtonClick)="submitRoutine()"
/>
</div>
</form>
\ No newline at end of file
import { Component } from '@angular/core'; import { CommonModule } from "@angular/common";
import { Component, Inject } from "@angular/core";
import { MAT_DIALOG_DATA } from "@angular/material/dialog";
import { ClassTransmissionService } from "../../../raintree/transmission/class-transmission.service";
import { TransmissionMapperService } from "../../../mappers/transmission-mapper.service";
import { DataSourceService } from "../../service/data-source.service";
import { classResponse } from "../../../raintree/interface/class-respons";
import { UrlConfigService } from "../../service/url-config.service";
import { DropDownComponent } from "../../../component-library/dropdown/drop-down/drop-down.component";
import { Dropdown } from "../../../component-library/dropdown/interface/dropdown";
import { StudentClass } from "../../data-source/interface/class";
import {
FormControl,
FormControlName,
FormGroup,
ReactiveFormsModule,
Validators,
} from "@angular/forms";
import { MatFormFieldModule } from "@angular/material/form-field";
import { MatInputModule } from "@angular/material/input";
import { MatIconModule } from "@angular/material/icon";
import { SquareButtonComponent } from "../../../component-library/square-button/square-button.component";
import { SectionResponse } from "../../../raintree/interface/section-respons";
import { StudentSection } from "../../data-source/interface/section";
import { RoutineTransmissionService } from "../../../raintree/transmission/routine-transmission.service";
import { AuthService } from "../../../auth/service/auth.service";
import { RaintreeResponse } from "../../../raintree/interface/raintree-response";
import { Routines } from "../interface/routine";
import { ForeignKeyMap } from "../../data-source/interface/foreignKeyMap";
@Component({ @Component({
selector: 'app-manage', selector: "app-manage",
imports: [], imports: [
templateUrl: './manage.component.html', CommonModule,
styleUrl: './manage.component.scss' DropDownComponent,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
MatIconModule,
SquareButtonComponent,
],
templateUrl: "./manage.component.html",
styleUrl: "./manage.component.scss",
}) })
export class ManageComponent { export class ManageComponent {
constructor(
@Inject(MAT_DIALOG_DATA) public data: any,
private _classTransmission: ClassTransmissionService,
private _urlConfig: UrlConfigService,
private _routineTransmission: RoutineTransmissionService,
private _auth: AuthService
) {}
public classDropDownData: Dropdown[] = [];
public sectionDropDownData: Dropdown[] = [];
public routineForm = new FormGroup({
details: new FormControl("", [Validators.required]),
});
ngOnInit(): void {
this._getClasses();
this._getSection();
}
public classOnChange(value: string) {
console.log(value);
}
public sectionOnChange(value: string) {
console.log(value);
}
public submitRoutine(): void {
// alert("Submit Clicked!!");
// console.log(this.routineFormPayload);
console.log(
this.routineForm.value
)
// this._routineTransmission.submitRoutine(
// TransmissionMapperService.SAVE_TRANSMISSION_URL + `websiteId=${this._auth.localStorageGetItemByKey('project_id')}`,
// this.routineFormPayload,
// () => { },
// () => { },
// (response: RaintreeResponse) => {
// console.log(response);
// },
// (error) => {
// console.log(error);
// },
// () => { }
// );
}
private _getClasses() {
this._classTransmission.getClasses(
TransmissionMapperService.GET_TRANSMISSION_URL +
this._urlConfig.generateDatasourceConfigUrl({
aggregationOnUniqueFld: false,
datasourceId: DataSourceService.CLASS_DATA_SOURCE_ID,
dontIncludeForeignKey: false,
expand: false,
isUniqueValueRequiredForFieldToDisplay: false,
language: "en",
limit: 100,
orderBy: "ASC",
page: 1,
roleBasedFiltering: true,
}),
() => {},
(response) => {},
(response: classResponse) => {
this.classDropDownData = response.data["themeDataSourceFields"].map(
(sClass: StudentClass) => {
return {
["name"]: sClass.details["en"],
["value"]: sClass.id,
};
}
);
},
(error) => {
console.log(error);
},
() => {}
);
}
private _getSection() {
this._classTransmission.getSection(
TransmissionMapperService.GET_TRANSMISSION_URL +
this._urlConfig.generateDatasourceConfigUrl({
aggregationOnUniqueFld: false,
datasourceId: DataSourceService.SECTION_DATA_SOURCE_ID,
dontIncludeForeignKey: false,
expand: false,
isUniqueValueRequiredForFieldToDisplay: false,
language: "en",
limit: 100,
orderBy: "ASC",
page: 1,
roleBasedFiltering: true,
}),
() => {},
(response) => {},
(response: SectionResponse) => {
this.sectionDropDownData = response.data["themeDataSourceFields"].map(
(sSection: StudentSection) => {
return {
["name"]: sSection.section["en"],
["value"]: sSection.id,
};
}
);
},
(error) => {
console.log(error);
},
() => {}
);
}
private routineFormPayload:Routines = {
themeDataSourceFields: [
{
id: "",
class: {
en: "48f353051f9d724f619491d4f0d0a8ec",
beng: "48f353051f9d724f619491d4f0d0a8ec",
hindi: "48f353051f9d724f619491d4f0d0a8ec",
},
section: {
en: "5d53b27058d1f6067a4b4bd1350a24d4",
beng: "5d53b27058d1f6067a4b4bd1350a24d4",
hindi: "5d53b27058d1f6067a4b4bd1350a24d4",
},
schedule: {
en: "BASE_URL/webomagic/getFile?fid=2910",
beng: "BASE_URL/webomagic/getFile?fid=2910",
hindi: "BASE_URL/webomagic/getFile?fid=2910",
},
details: {
en: "test 1 c",
beng: "test 1 c",
hindi: "test 1 c",
},
session: {
en: "86af4d6b5675a82df4581f00c67f0c7f",
beng: "86af4d6b5675a82df4581f00c67f0c7f",
hindi: "86af4d6b5675a82df4581f00c67f0c7f",
},
document: {
en: "",
beng: "",
hindi: "",
},
routine_type: {
en: "class_routine",
beng: "class_routine",
hindi: "class_routine",
},
},
],
dataSourceName: "Routine",
id: "3021",
type: "1327",
themeId: "278",
slideLst: null,
heading: "undefined",
dataSourceTypeFieldsList: [
{
id: "",
class: {
en: "48f353051f9d724f619491d4f0d0a8ec",
beng: "48f353051f9d724f619491d4f0d0a8ec",
hindi: "48f353051f9d724f619491d4f0d0a8ec",
},
section: {
en: "5d53b27058d1f6067a4b4bd1350a24d4",
beng: "5d53b27058d1f6067a4b4bd1350a24d4",
hindi: "5d53b27058d1f6067a4b4bd1350a24d4",
},
schedule: {
en: "BASE_URL/webomagic/getFile?fid=2910",
beng: "BASE_URL/webomagic/getFile?fid=2910",
hindi: "BASE_URL/webomagic/getFile?fid=2910",
},
details: {
en: "test 1 c",
beng: "test 1 c",
hindi: "test 1 c",
},
session: {
en: "86af4d6b5675a82df4581f00c67f0c7f",
beng: "86af4d6b5675a82df4581f00c67f0c7f",
hindi: "86af4d6b5675a82df4581f00c67f0c7f",
},
document: {
en: "",
beng: "",
hindi: "",
},
routine_type: {
en: "class_routine",
beng: "class_routine",
hindi: "class_routine",
},
},
],
count:10,
websiteId: 1,
foreignKeyMapping: {},
foreignKeyMap: {} as ForeignKeyMap,
requiredPresentationField: "",
favourite: true,
icon: "",
dependentFields: {},
dsType: {}
};
} }
<p>routine works!</p> <div class="custom_table">
<app-custom-table
[columns]="columns"
[data]="data"
(emitEdit)="emitEditFromTable($event)"
(emitView)="emitViewFromTable($event)"
/>
</div>
<div class="add_btn">
<app-square-button
[buttonIcon]="'add'"
(emitSquareButtonClick)="addRoutine()"
/>
</div>
\ No newline at end of file
.add_btn{
position: fixed;
bottom: 20px;
right: 0;
padding: 0px 15px;
margin: auto;
}
\ No newline at end of file
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { RoutineTransmissionService } from '../../../raintree/transmission/routine-transmission.service';
import { TransmissionMapperService } from '../../../mappers/transmission-mapper.service';
import { DataSourceService } from '../../service/data-source.service';
import { RoutineResponse } from '../../../raintree/interface/routine-respons';
import { UrlConfigService } from '../../service/url-config.service';
import { CustomTableComponent } from '../../../component-library/custom-table/custom-table.component';
import { SquareButtonComponent } from '../../../component-library/square-button/square-button.component';
import { MatDialog } from '@angular/material/dialog';
import { ManageComponent } from '../manage/manage.component';
import { PrepareRoutineTableDataService } from '../service/prepare-routine-table-data.service';
@Component({ @Component({
selector: 'app-routine', selector: 'app-routine',
imports: [], standalone: true,
imports: [
CustomTableComponent,
SquareButtonComponent
],
templateUrl: './routine.component.html', templateUrl: './routine.component.html',
styleUrl: './routine.component.scss' styleUrl: './routine.component.scss'
}) })
export class RoutineComponent { export class RoutineComponent {
constructor(
private _routineTransmission: RoutineTransmissionService,
private _urlConfig: UrlConfigService,
private _dialog: MatDialog,
private _prepareRoutineTableData: PrepareRoutineTableDataService
) { }
public columns: any[] = [];
public data: any[] = [];
ngOnInit(): void {
this.columns = this._prepareRoutineTableData.prepareMatTableColumn();
this._getRoutines();
}
public addRoutine(): void {
let dialogRef = this._dialog.open(ManageComponent, {
data: '',
width: '98vw',
height: 'auto',
maxWidth: '70vw',
maxHeight: '70vh',
});
}
public emitViewFromTable(emitData: any) {
let docLink = emitData.schedule.replace('BASE_URL', TransmissionMapperService.DEV_TRANSMISSION_URL);
window.open(docLink, '_blank');
}
public emitEditFromTable(emitData: string): void {
let dialogRef = this._dialog.open(ManageComponent, {
data: emitData,
width: '98vw',
height: 'auto',
maxWidth: '70vw',
maxHeight: '70vh',
});
}
private _getRoutines(): void {
this._routineTransmission.getRoutine(
TransmissionMapperService.GET_TRANSMISSION_URL + this._urlConfig.generateDatasourceConfigUrl({
aggregationOnUniqueFld: false,
datasourceId: DataSourceService.ROUTINE_DATA_SOURCE_ID,
dontIncludeForeignKey: false,
expand: false,
isUniqueValueRequiredForFieldToDisplay: false,
language: "en",
limit: 10,
orderBy: "ASC",
page: 1,
roleBasedFiltering: true
}),
() => { },
(response) => { },
(response: RoutineResponse) => {
this.data = this._prepareRoutineTableData.prepareMatTableData(response.data.themeDataSourceFields);
},
(error) => {
console.log(error);
},
() => { }
)
}
} }
import { TestBed } from '@angular/core/testing';
import { PrepareRoutineTableDataService } from './prepare-routine-table-data.service';
describe('PrepareRoutineTableDataService', () => {
let service: PrepareRoutineTableDataService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(PrepareRoutineTableDataService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { Routine } from '../interface/routine';
@Injectable({
providedIn: 'root'
})
export class PrepareRoutineTableDataService {
constructor() { }
public prepareMatTableData(data: Routine[]): any {
let dataArray = data.map((routine: Routine) => {
return {
['id']: routine.id,
['session_session_name']: routine.session_session_name?['en']:'',
['class_details']: routine.class_details?['en']:'',
['section_details']: routine.section_details?['en']:'',
['schedule']: routine.schedule['en'],
['action']: ['view', 'edit']
}
})
return dataArray;
}
public prepareMatTableColumn(): any[] {
let columnArray = [
{ key: 'session_session_name', label: 'Session' },
{ key: 'class_details', label: 'Class' },
{ key: 'section_details', label: 'Section' },
{ key: 'action', label: 'Action' },
];
return columnArray;
}
}
import { TestBed } from '@angular/core/testing';
import { DataSourceService } from './data-source.service';
describe('DataSourceService', () => {
let service: DataSourceService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(DataSourceService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class DataSourceService {
constructor() { }
public static readonly ASSIGNMENT_DATA_SOURCE_ID: number = 3188;
public static readonly ROUTINE_DATA_SOURCE_ID: number = 3021;
public static readonly CLASS_DATA_SOURCE_ID: number = 3008;
public static readonly SECTION_DATA_SOURCE_ID: number = 3013;
public static readonly EXAM_SCHEDULE_DATA_SOURCE_ID: number = 3018;
}
import { TestBed } from '@angular/core/testing';
import { UrlConfigService } from './url-config.service';
describe('UrlConfigService', () => {
let service: UrlConfigService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(UrlConfigService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class UrlConfigService {
constructor() {}
public generateDatasourceConfigUrl(obj: any): string {
return Object.entries(obj)
.map(([key, value]) => `${key}=${encodeURIComponent(value as string | number | boolean)}`)
.join('&');
}
}
...@@ -12,12 +12,12 @@ export class ErrorHandlerService { ...@@ -12,12 +12,12 @@ export class ErrorHandlerService {
public handle(error: number): void { public handle(error: number): void {
if(error === 401) this._handle401Error(error); if(error === 401 || error === 400) this._handle401Error(error);
else if (error === 422) this._handle422Error(error); else if (error === 422) this._handle422Error(error);
} }
private _handle401Error(error: number): void { private _handle401Error(error: number): void {
this._logoutService.logout(); this._logoutService.logout('Session expired !');
} }
private _handle422Error(error: number): void { private _handle422Error(error: number): void {
......
import { Assignments } from "../../portal/assignment/interface/assignment";
import { RaintreeResponse } from "./raintree-response";
export interface AssignmentsResponse extends RaintreeResponse {
data: Assignments ;
}
\ No newline at end of file
import { Jwt } from "./jwt"; import { UserProfile } from "../../auth/interface/user-profile";
import { RaintreeResponse } from "./raintree-response"; import { RaintreeResponse } from "./raintree-response";
export interface AUthResponse extends RaintreeResponse { export interface AUthResponse extends RaintreeResponse {
data: Jwt; data: UserProfile;
} }
import { Classes } from "../../portal/data-source/interface/class";
import { RaintreeResponse } from "./raintree-response";
export interface classResponse extends RaintreeResponse {
data: Classes;
}
\ No newline at end of file
import { ExamSchedules } from "../../portal/exam/interface/exam-schedule";
import { RaintreeResponse } from "./raintree-response";
export interface ExamScheduleResponse extends RaintreeResponse{
data: ExamSchedules
}
\ No newline at end of file
export interface RaintreeResponse { export interface RaintreeResponse {
[index: string]: any;
status_code: number; status_code: number;
message: string; message: string;
[index: string]: any;
} }
import { ResponseCount } from "../../component-library/audit-log/interface/response-count";
import { RaintreeResponse } from "./raintree-response";
export interface ResponseCountResponse extends RaintreeResponse {
data: ResponseCount;
}
import { Routines } from "../../portal/routine/interface/routine";
import { RaintreeResponse } from "./raintree-response";
export interface RoutineResponse extends RaintreeResponse{
data: Routines
}
\ No newline at end of file
import { Sections } from "../../portal/data-source/interface/section";
import { RaintreeResponse } from "./raintree-response";
export interface SectionResponse extends RaintreeResponse {
data: Sections;
}
\ No newline at end of file
import { TestBed } from '@angular/core/testing';
import { AssignmentTransmissionService } from './assignment-transmission.service';
describe('AssignmentTransmissionService', () => {
let service: AssignmentTransmissionService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(AssignmentTransmissionService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { TransmissionService } from './transmission.service';
import { RaintreeResponse } from '../interface/raintree-response';
import { AssignmentsResponse } from '../interface/assignment-respons';
@Injectable({
providedIn: 'root'
})
export class AssignmentTransmissionService extends TransmissionService {
public getAssignment(
url: string,
onPreExecute: () => void,
onPostExecute: (response: any) => void,
onSuccess: (response: any) => void,
onFailure: (error: string) => void,
onComplete: () => void
): void {
this.executePostPayload(
url,
{},
onPreExecute,
onPostExecute,
onSuccess,
onFailure,
onComplete,
true
);
}
}
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpErrorHandlerService } from '../http-error-handler.service';
import { JWTService } from './jwt.service';
import { TransmissionService } from './transmission.service'; import { TransmissionService } from './transmission.service';
import { Auth } from '../../auth/interface/auth'; import { Auth } from '../../auth/interface/auth';
import { RaintreeResponse } from '../interface/raintree-response'; import { RaintreeResponse } from '../interface/raintree-response';
import { UserProfileResponse } from '../interface/user-profile-response'; import { UserProfileResponse } from '../interface/user-profile-response';
import { UserProfile } from '../../auth/interface/user-profile'; import { UserProfile } from '../../auth/interface/user-profile';
import { ErrorHandlerService } from '../error-handler.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class AuthTransmissionService extends TransmissionService { export class AuthTransmissionService extends TransmissionService {
constructor(
_http: HttpClient,
_httpErrorHandler: HttpErrorHandlerService,
_jwt: JWTService,
_errorHandler: ErrorHandlerService
) {
super(_http, _httpErrorHandler, _jwt, _errorHandler );
}
public getAuthToken( public getAuthToken(
url: string, url: string,
......
import { TestBed } from '@angular/core/testing';
import { ClassTransmissionService } from './class-transmission.service';
describe('ClassTransmissionService', () => {
let service: ClassTransmissionService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ClassTransmissionService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { TransmissionService } from './transmission.service';
@Injectable({
providedIn: 'root'
})
export class ClassTransmissionService extends TransmissionService{
public getClasses(
url: string,
onPreExecute: () => void,
onPostExecute: (response: any) => void,
onSuccess: (response: any) => void,
onFailure: (error: string) => void,
onComplete: () => void
): void {
this.executePostPayload(
url,
{},
onPreExecute,
onPostExecute,
onSuccess,
onFailure,
onComplete,
true
);
}
public getSection(
url: string,
onPreExecute: () => void,
onPostExecute: (response: any) => void,
onSuccess: (response: any) => void,
onFailure: (error: string) => void,
onComplete: () => void
){
this.executePostPayload(
url,
{},
onPreExecute,
onPostExecute,
onSuccess,
onFailure,
onComplete,
true
);
}
}
import { TestBed } from '@angular/core/testing';
import { ExamScheduleService } from './exam-schedule.service';
describe('ExamScheduleService', () => {
let service: ExamScheduleService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ExamScheduleService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { TransmissionService } from './transmission.service';
import { RaintreeResponse } from '../interface/raintree-response';
@Injectable({
providedIn: 'root'
})
export class ExamScheduleService extends TransmissionService {
public getExamSchedule(
url: string,
onPreExecute: () => void,
onPostExecute: (response: RaintreeResponse) => void,
onSuccess: (response: RaintreeResponse) => void,
onFailure: (error: string) => void,
onComplete: () => void
): void {
this.executePostPayload(
url,
{},
onPreExecute,
onPostExecute,
onSuccess,
onFailure,
onComplete,
true
);
}
}
import { HttpHeaders } from '@angular/common/http'; import { HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { AuthService } from '../../auth/service/auth.service';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class JWTService { export class JWTService {
constructor() {} constructor(
private _auth:AuthService
) {}
private _jwtToken: string | null = null; private _jwtToken: string | null = null;
private _expirationDate: Date | null = null; private _expirationDate: Date | null = null;
...@@ -13,11 +16,12 @@ export class JWTService { ...@@ -13,11 +16,12 @@ export class JWTService {
public injectToken(token: string): HttpHeaders { public injectToken(token: string): HttpHeaders {
let authorizationToken: string = localStorage.getItem('Bearer') || ''; let authorizationToken: string = localStorage.getItem('Bearer') || '';
let userId = this._auth.localStorageGetItemByKey('user_id');
// TODO: check if token exist in Local storage and handle accordingly // TODO: check if token exist in Local storage and handle accordingly
return new HttpHeaders({ return new HttpHeaders({
Authorization: `Bearer ${authorizationToken}`, "user-id": userId,
"apikey": authorizationToken,
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}); });
} }
......
import { TestBed } from '@angular/core/testing';
import { RoutineTransmissionService } from './routine-transmission.service';
describe('RoutineTransmissionService', () => {
let service: RoutineTransmissionService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(RoutineTransmissionService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { TransmissionService } from './transmission.service';
@Injectable({
providedIn: 'root'
})
export class RoutineTransmissionService extends TransmissionService{
public getRoutine(
url: string,
onPreExecute: () => void,
onPostExecute: (response: any) => void,
onSuccess: (response: any) => void,
onFailure: (error: string) => void,
onComplete: () => void
): void {
this.executePostPayload(
url,
{},
onPreExecute,
onPostExecute,
onSuccess,
onFailure,
onComplete,
true
);
}
public submitRoutine(
url: string,
payload:any,
onPreExecute: () => void,
onPostExecute: (response: any) => void,
onSuccess: (response: any) => void,
onFailure: (error: string) => void,
onComplete: () => void
){
this.executePostPayload(
url,
payload,
onPreExecute,
onPostExecute,
onSuccess,
onFailure,
onComplete,
true
);
}
}
import { TestBed } from '@angular/core/testing';
import { SectionTransmissionService } from './section-transmission.service';
describe('SectionTransmissionService', () => {
let service: SectionTransmissionService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(SectionTransmissionService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class SectionTransmissionService {
constructor() { }
}
...@@ -5,6 +5,8 @@ import { catchError } from 'rxjs/operators'; ...@@ -5,6 +5,8 @@ import { catchError } from 'rxjs/operators';
import { HttpErrorHandlerService } from '../http-error-handler.service'; import { HttpErrorHandlerService } from '../http-error-handler.service';
import { JWTService } from './jwt.service'; import { JWTService } from './jwt.service';
import { ErrorHandlerService } from '../error-handler.service'; import { ErrorHandlerService } from '../error-handler.service';
import { Router } from '@angular/router';
import { RequestMapperService } from '../../mappers/request-mapper.service';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
...@@ -14,7 +16,7 @@ export class TransmissionService { ...@@ -14,7 +16,7 @@ export class TransmissionService {
private _http: HttpClient, private _http: HttpClient,
private _httpErrorHandler: HttpErrorHandlerService, private _httpErrorHandler: HttpErrorHandlerService,
private _jwt: JWTService, private _jwt: JWTService,
private _errorHandler: ErrorHandlerService private _errorHandler: ErrorHandlerService,
) {} ) {}
public executeBasicGet( public executeBasicGet(
...@@ -103,13 +105,13 @@ export class TransmissionService { ...@@ -103,13 +105,13 @@ export class TransmissionService {
if (response.status_code) onSuccess(response); if (response.status_code) onSuccess(response);
// else // else
// onFailure( // onFailure(
// isEmptyString(response.message)
// ? MessageService.RESOURCE_VALIDATION_FAILED
// : response.message
// ); // );
}, },
(error) => { (error) => {
onFailure(error); onFailure(error);
// TODO:handle 401 and 422 error
this._errorHandler.handle(error);
onComplete(); onComplete();
}, },
() => onComplete() () => onComplete()
......
@import "./app/style-guide/css/theme.scss"; // main theme @use "./app/style-guide/css/theme.scss"; // main theme
.material-symbols-outlined { .material-symbols-outlined {
font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24; font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
......
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