Skip to content

Commit

Permalink
feat: integrate kanban (#1696)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zitrone44 authored Oct 29, 2024
1 parent 28a3072 commit 591df37
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/fbs-core/api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ compile:
jwt:
secret: ${JWT_SECRET:8Dsupersecurekeydf0}
expiration:
time: 300
time: 43200
ldap:
enabled: ${LDAP_ENABLED:false}
allowLogin: ${LDAP_ALLOW_LOGIN:false}
Expand Down
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")) // TODO: Remove as soon as possible
@RequestMapping(value = Array("/courses", "/sqlplayground", "/analytics", "/modelling", "/kanban")) // TODO: Remove as soon as possible
def redirectRoot: String = "forward:/"

/**
Expand Down
8 changes: 7 additions & 1 deletion modules/fbs-core/web/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { SqlPlaygroundComponent } from "./page-components/sql-playground/sql-pla
import { AnalyticsToolComponent } from "./page-components/analytics-tool/analytics-tool.component";
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";

const routes: Routes = [
{ path: "login", component: LoginComponent },
Expand Down Expand Up @@ -108,7 +109,12 @@ const routes: Routes = [
component: FbsModellingComponent,
canActivate: [AuthGuard],
},

// Kanban
{
path: "kanban",
component: FbsKanbanComponent,
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 @@ -123,6 +123,7 @@ import { NewGroupDialogComponent } from "./dialogs/new-group-dialog/new-group-di
import { GroupPreviewComponent } from "./page-components/group-preview/group-preview.component";
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";

@Injectable()
export class ApiURIHttpInterceptor implements HttpInterceptor {
Expand Down Expand Up @@ -230,6 +231,7 @@ export const httpInterceptorProviders = [
GroupPreviewComponent,
GroupDetailComponent,
GroupDeregisterDialogComponent,
FbsKanbanComponent,
],
imports: [
BrowserModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<iframe [src]="getURL()" title="FBS-Kanban" 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-kanban",
templateUrl: "./fbs-kanban.component.html",
styleUrls: ["./fbs-kanban.component.scss"],
})
export class FbsKanbanComponent 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 Kanban");
}

getURL(): SafeResourceUrl {
const url = `https://feedback.mni.thm.de/kanban?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 @@ -78,6 +78,11 @@ <h1>
<mat-icon>format_shapes</mat-icon>
<p>FBS Modelling</p>
</button>

<button mat-list-item (click)="moveAndHideSidebar('/kanban')">
<mat-icon>view_kanban</mat-icon>
<p>FBS Kanban</p>
</button>
</mat-nav-list>

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

0 comments on commit 591df37

Please sign in to comment.