Skip to content

Commit

Permalink
[GLT-4333] changed external user home page to projects list (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
djcooke authored Jan 28, 2025
1 parent 2d4d04b commit eaba71c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 5 deletions.
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

0 comments on commit eaba71c

Please sign in to comment.