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

[GLT-4333] changed external user home page to projects list #256

Merged
merged 1 commit into from
Jan 28, 2025
Merged
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
1 change: 1 addition & 0 deletions changes/change_external_home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Home page for external users to the Projects list
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public class CaseController {
@Autowired
private CaseService caseService;

@GetMapping
public String getCaseListPage() {
return "case-list";
}

@GetMapping("/{caseId}")
public String getCaseDetailsPage(@PathVariable String caseId, ModelMap model,
HttpServletRequest request) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ca.on.oicr.gsi.dimsum.controller.mvc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
Expand All @@ -9,9 +10,18 @@
@Controller
public class HomeController {

@Autowired
private CaseController caseController;
@Autowired
private ProjectController projectController;

@GetMapping("/")
public String getHomePage() {
return "index";
public String getHomePage(@AuthenticationPrincipal DimsumPrincipal principal) {
if (principal.isInternal()) {
return caseController.getCaseListPage();
} else {
return projectController.getProjectListPage();
}
}

@GetMapping("/login")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<head>
<meta charset="UTF-8" />
<title>Home</title>
<title>Cases</title>
</head>

<body>
Expand All @@ -14,7 +14,7 @@ <h1 class="text-green-200 font-sarabun font-light font text-32">QC Dashboard</h1

<div id="casesTableContainer"></div>

<script src="/js/index.js"></script>
<script src="/js/caseList.js"></script>

</div>
</body>
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
</div>
</div>
<nav th:unless="${hideNav}" class="noprint text-right">
<a th:href="@{/cases}" class="text-green-200 font-bold hover:underline">Cases</a>
<span class="text-grey-200 font-bold"> | </span>
<a th:href="@{/projects}" class="text-green-200 font-bold hover:underline">Projects</a>
<div th:if="${internalUser}" class="inline">
<span class="text-grey-200 font-bold"> | </span>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const webpack = require("webpack");
module.exports = {
mode: "production",
entry: {
index: "./ts/index.ts",
caseList: "./ts/case-list.ts",
details: "./ts/details.ts",
projectDetails: "./ts/project-details.ts",
notifications: "./ts/notifications.ts",
Expand Down
Loading