Skip to content

Commit

Permalink
Update group-detail component (#1675)
Browse files Browse the repository at this point in the history
  • Loading branch information
scmet committed Jul 9, 2024
1 parent e5dbbda commit 9dd95e4
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<p>group-detail works!</p>
<div class="group-details">
<button mat-icon-button color="primary">
<mat-icon (click)="navigateToKanban()">view_kanban</mat-icon>
</button>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import "../../../colors";

.group-details {
.mat-icon {
color: $cPrimary;
margin-top: 100px;
transform: scale(10);
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,41 @@
import { Component, OnInit } from "@angular/core";
import { Observable, of } from "rxjs";
import { Group } from "../../model/group";
import { GroupService } from "../../service/group.service";
import { ActivatedRoute } from "@angular/router";
import { TitlebarService } from "../../service/titlebar.service";

@Component({
selector: "app-group-detail",
templateUrl: "./group-detail.component.html",
styleUrls: ["./group-detail.component.scss"],
})
export class GroupDetailComponent implements OnInit {
constructor() {}
constructor(
private groupService: GroupService,
private route: ActivatedRoute,
private titlebar: TitlebarService
) {}
courseID: number;
groupID: number;
group$: Observable<Group> = of();

ngOnInit(): void {}
ngOnInit(): void {
this.route.params.subscribe((param) => {
this.courseID = param.courseId;
this.groupID = param.id;
this.loadGroup();
});
}

loadGroup(): void {
this.group$ = this.groupService.getGroup(this.courseID, this.groupID);
this.group$.subscribe((group) => {
this.titlebar.emitTitle(group.name);
});
}

navigateToKanban() {
window.location.href = "http://localhost:3000/";
}
}

0 comments on commit 9dd95e4

Please sign in to comment.