Skip to content

Commit

Permalink
feat(core): integrate scicheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Zitrone44 committed Dec 10, 2024
1 parent 768760a commit d7e2828
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class HomeController {
* Forward every access that is not defined to the index page.
* @return Forward undefined access to index.
*/
@RequestMapping(value = Array("/courses", "/sqlplayground", "/analytics", "/modelling", "/kanban")) // TODO: Remove as soon as possible
@RequestMapping(value = Array("/courses", "/sqlplayground", "/analytics", "/modelling", "/kanban", "/sci-check")) // TODO: Remove as soon as possible
def redirectRoot: String = "forward:/"

/**
Expand Down
7 changes: 7 additions & 0 deletions modules/fbs-core/web/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { AnalyticsToolComponent } from "./page-components/analytics-tool/analyti
import { FbsModellingComponent } from "./page-components/fbs-modelling/fbs-modelling.component";
import { GroupDetailComponent } from "./page-components/group-detail/group-detail.component";
import { FbsKanbanComponent } from "./page-components/fbs-kanban/fbs-kanban.component";
import { FbsSciCheckComponent } from "./page-components/fbs-sci-check/fbs-sci-check.component";

const routes: Routes = [
{ path: "login", component: LoginComponent },
Expand Down Expand Up @@ -115,6 +116,12 @@ const routes: Routes = [
component: FbsKanbanComponent,
canActivate: [AuthGuard],
},
// Sci-Check
{
path: "sci-check",
component: FbsSciCheckComponent,
canActivate: [AuthGuard],
},
// Admin
{
path: "admin/user-management",
Expand Down
2 changes: 2 additions & 0 deletions modules/fbs-core/web/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ import { GroupPreviewComponent } from "./page-components/group-preview/group-pre
import { GroupDetailComponent } from "./page-components/group-detail/group-detail.component";
import { GroupDeregisterDialogComponent } from "./dialogs/group-deregister-dialog/group-deregister-dialog.component";
import { FbsKanbanComponent } from "./page-components/fbs-kanban/fbs-kanban.component";
import { FbsSciCheckComponent } from "./page-components/fbs-sci-check/fbs-sci-check.component";

@Injectable()
export class ApiURIHttpInterceptor implements HttpInterceptor {
Expand Down Expand Up @@ -232,6 +233,7 @@ export const httpInterceptorProviders = [
GroupDetailComponent,
GroupDeregisterDialogComponent,
FbsKanbanComponent,
FbsSciCheckComponent,
],
imports: [
BrowserModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<iframe [src]="getURL()" title="FBS-Modellierung" frameBorder="0"></iframe>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
iframe{
width: 100%;
position: absolute;
left: 0;
height: calc(100% - 64px);
margin-top: -10px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Component, OnInit, ChangeDetectorRef } from "@angular/core";
import { AuthService } from "src/app/service/auth.service";
import { TitlebarService } from "src/app/service/titlebar.service";
import { DomSanitizer, SafeResourceUrl } from "@angular/platform-browser";

@Component({
selector: "app-fbs-sci-check",
templateUrl: "./fbs-sci-check.component.html",
styleUrls: ["./fbs-sci-check.component.scss"],
})
export class FbsSciCheckComponent implements OnInit {
token: string;
safeUrl: SafeResourceUrl;

constructor(
private titlebar: TitlebarService,
private auth: AuthService,
private sanitizer: DomSanitizer,
private cdr: ChangeDetectorRef
) {
this.token = this.auth.loadToken();
}
ngOnInit() {
this.titlebar.emitTitle("FBS SciCheck");
}

getURL(): SafeResourceUrl {
const url = `https://feedback.mni.thm.de/scicheck/#/login?token=${this.token}&iframe=true`;
this.safeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(url);
this.cdr.detach(); // stops iframe from reloading
return this.safeUrl;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ <h1>
<mat-icon>view_kanban</mat-icon>
<p>FBS Kanban</p>
</button>

<button mat-list-item (click)="moveAndHideSidebar('/sci-check')">
<mat-icon>description</mat-icon>
<p>FBS SciCheck</p>
</button>
</mat-nav-list>

<span class="filler"></span>
Expand Down

0 comments on commit d7e2828

Please sign in to comment.