Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #26 #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/app/rebate/stu-reb-card/stu-reb-card.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@
<button
class="btn btn-light rebate-action-btn"
(click)="updateRebateData(p_rebate_reason, p_rebate_start, p_rebate_end)"
*ngIf="auth.isStudent()"
*ngIf="isStudentPage()"
>
Make Amendments
</button>
<button
class="btn btn-light rebate-action-btn"
(click)="deleteRebate()"
*ngIf="auth.isStudent()"
*ngIf="isStudentPage()"
>
Cancel your rebate
</button>
Expand All @@ -82,7 +82,7 @@
<button
class="btn btn-light rebate-action-btn"
(click)="updateAcceptedRebate(p_rebate_start, p_rebate_end)"
*ngIf="auth.isStudent()"
*ngIf="isStudentPage()"
>
Shrink Duration
</button>
Expand Down
7 changes: 7 additions & 0 deletions src/app/rebate/stu-reb-card/stu-reb-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export class StuRebCardComponent implements OnInit {
public p_rebate_end: string;
public p_rebate_reason: string;
public p_rebate_comment: string;
public on_admin_page: boolean;
private numToMonth: string[] = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
private adminRoutes: string[] = ["/rebate-admin","/studentcard"];
// @Input() public isApproved: boolean = false;
@Input() public approval_state: string = "pending";
@Output() public updateList = new EventEmitter();
Expand All @@ -42,6 +44,7 @@ export class StuRebCardComponent implements OnInit {
this.p_rebate_reason = this.rebate_request.reason;
this.p_rebate_comment = this.rebate_request?.comment ?? "";
// console.log(this.rebate_request)
this.on_admin_page = this.adminRoutes.some(sub => this.router.url.startsWith(sub));
}

readableDate(inp: Date): string{
Expand Down Expand Up @@ -115,5 +118,9 @@ export class StuRebCardComponent implements OnInit {
console.log(e);
})
}

isStudentPage() {
return this.auth.isStudent() && !this.on_admin_page;
}
}