Commit 9ef4ed16 authored by achinta's avatar achinta

feat: add view event in custom table

parent 09a93397
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</ng-container> </ng-container>
<ng-container *ngIf="item =='edit'"> <ng-container *ngIf="item =='edit'">
<button class="view_button d_inline_block width_auto ml_1"> <button class="view_button d_inline_block width_auto ml_1" (click)="edit(element)">
<span class="material-symbols-outlined">edit</span> <span class="material-symbols-outlined">edit</span>
</button> </button>
</ng-container> </ng-container>
......
...@@ -26,6 +26,8 @@ export class CustomTableComponent { ...@@ -26,6 +26,8 @@ export class CustomTableComponent {
@Output() emitView: EventEmitter<string> = new EventEmitter<string>(); @Output() emitView: EventEmitter<string> = new EventEmitter<string>();
@Output() emitEdit: EventEmitter<string> = new EventEmitter<string>();
// totalRecords: number = 3400; // totalRecords: number = 3400;
// pageSize: number = 50; // pageSize: number = 50;
...@@ -44,6 +46,10 @@ export class CustomTableComponent { ...@@ -44,6 +46,10 @@ export class CustomTableComponent {
this.emitView.emit(data); this.emitView.emit(data);
} }
public edit(data:any): void {
this.emitEdit.emit(data);
}
onPageChanged(event: any): void { onPageChanged(event: any): void {
console.log("event"); console.log("event");
console.log(event); console.log(event);
......
<app-custom-table [columns]="columns" [data]="data" /> <app-custom-table
[columns]="columns"
[data]="data"
(emitEdit)="emitEditFromTable($event)"
(emitView)="emitViewFromTable($event)"
/>
import { Component } from '@angular/core'; import { Component } 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 { ManageComponent } from '../manage/manage.component';
@Component({ @Component({
selector: 'app-assignment', selector: 'app-assignment',
...@@ -9,7 +11,11 @@ import { CustomTableComponent } from '../../../component-library/custom-table/cu ...@@ -9,7 +11,11 @@ import { CustomTableComponent } from '../../../component-library/custom-table/cu
templateUrl: './assignment.component.html', templateUrl: './assignment.component.html',
styleUrl: './assignment.component.scss' styleUrl: './assignment.component.scss'
}) })
export class AssignmentComponent { export class AssignmentComponent {
constructor(
private _dialog: MatDialog,
){}
public columns = [ public columns = [
{ key: 'class', label: 'Class' }, { key: 'class', label: 'Class' },
{ key: 'subject', label: 'Subject' }, { key: 'subject', label: 'Subject' },
...@@ -23,6 +29,37 @@ export class AssignmentComponent { ...@@ -23,6 +29,37 @@ export class AssignmentComponent {
subject: "Math", subject: "Math",
section: "5A", section: "5A",
action: ['view','edit'] action: ['view','edit']
},
{
class: "VI",
subject: "Math",
section: "5B",
action: ['view','edit']
} }
]; ];
public emitViewFromTable(clickedData: string){
alert("Have to view the doc in another page");
}
public emitEditFromTable(clickedData: string): void {
// rate ? rate.is_edit_enable = true : '';
console.log(clickedData);
let dialogRef = this._dialog.open(ManageComponent, {
data: clickedData,
width: '98vw',
height: 'auto',
maxWidth: '70vw',
maxHeight: '70vh',
});
// dialogRef.afterClosed().subscribe(data => {
// if (data)
// this._getScheduleOfRates();
// });
}
} }
import { Component } from '@angular/core'; import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
@Component({ @Component({
selector: 'app-manage', selector: 'app-manage',
...@@ -7,5 +8,7 @@ import { Component } from '@angular/core'; ...@@ -7,5 +8,7 @@ import { Component } from '@angular/core';
styleUrl: './manage.component.scss' styleUrl: './manage.component.scss'
}) })
export class ManageComponent { export class ManageComponent {
constructor(
@Inject(MAT_DIALOG_DATA) public data: any,
){}
} }
...@@ -52,7 +52,7 @@ export class Menu { ...@@ -52,7 +52,7 @@ export class Menu {
public static readonly RoutineItems: Sidebar = { public static readonly RoutineItems: Sidebar = {
id: 4, id: 4,
title: 'Routine', title: 'Routine',
icon: 'assignment', icon: 'routine',
route: RequestMapperService.ROUTINE_URL, route: RequestMapperService.ROUTINE_URL,
selected: false, selected: false,
roles: [ roles: [
...@@ -64,7 +64,7 @@ export class Menu { ...@@ -64,7 +64,7 @@ export class Menu {
public static readonly ExamItems: Sidebar = { public static readonly ExamItems: Sidebar = {
id: 5, id: 5,
title: 'Exam', title: 'Exam',
icon: 'assignment', icon: 'book_3',
route: RequestMapperService.EXAM_URL, route: RequestMapperService.EXAM_URL,
selected: false, selected: false,
roles: [ roles: [
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<app-colored-card <app-colored-card
[cardTextOneHeading]="'Assignment'" [cardTextOneHeading]="'Assignment'"
[cardTextOne]="''" [cardTextOne]="''"
[cardLink]="''" [cardLink]="assignmentUrl"
[cardTextTwoHeading]="'Assignment'" [cardTextTwoHeading]="'Assignment'"
[cardTextTwo]="''" [cardTextTwo]="''"
[CardImage]=" [CardImage]="
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<app-colored-card <app-colored-card
[cardTextOneHeading]="'Routine'" [cardTextOneHeading]="'Routine'"
[cardTextOne]="''" [cardTextOne]="''"
[cardLink]="''" [cardLink]="routineUrl"
[cardTextTwoHeading]="'Routine'" [cardTextTwoHeading]="'Routine'"
[cardTextTwo]="''" [cardTextTwo]="''"
[CardImage]=" [CardImage]="
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<app-colored-card <app-colored-card
[cardTextOneHeading]="'Exam Schedule'" [cardTextOneHeading]="'Exam Schedule'"
[cardTextOne]="''" [cardTextOne]="''"
[cardLink]="''" [cardLink]="examUrl"
[cardTextTwoHeading]="'Exam Schedule'" [cardTextTwoHeading]="'Exam Schedule'"
[cardTextTwo]="''" [cardTextTwo]="''"
[CardImage]="'./assets/image/Digital_receipts_for_online_payments.svg'" [CardImage]="'./assets/image/Digital_receipts_for_online_payments.svg'"
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
// import { DummyDataTransmissionService } from '../../raintree/transmission/dummy-data-transmission.service';
// import { Dummy } from '../interface/dummy';
import { ColoredCardComponent } from '../../component-library/colored-card/colored-card.component'; import { ColoredCardComponent } from '../../component-library/colored-card/colored-card.component';
import { WhiteCardComponent } from '../../component-library/white-card/white-card.component'; import { RequestMapperService } from '../../mappers/request-mapper.service';
import { LineChartComponent } from '../../component-library/line-cart-123/line-chart/line-chart.component';
@Component({ @Component({
selector: 'app-portal-dashboard', selector: 'app-portal-dashboard',
imports: [ColoredCardComponent, WhiteCardComponent, LineChartComponent], imports: [ColoredCardComponent],
templateUrl: './portal-dashboard.component.html', templateUrl: './portal-dashboard.component.html',
styleUrl: './portal-dashboard.component.scss' styleUrl: './portal-dashboard.component.scss'
}) })
export class PortalDashboardComponent implements OnInit { export class PortalDashboardComponent implements OnInit {
constructor() {} constructor() {}
public assignmentUrl = `/${RequestMapperService.PORTAL_URL}/${RequestMapperService.ASSIGNMENT_URL}`;
public routineUrl = `/${RequestMapperService.PORTAL_URL}/${RequestMapperService.ROUTINE_URL}`;
public examUrl = `/${RequestMapperService.PORTAL_URL}/${RequestMapperService.EXAM_URL}`;
public ngOnInit(): void { public ngOnInit(): void {
} }
......
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