Skip to content

Commit

Permalink
Fixed issue with gradle build and redirect on login
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed May 26, 2021
1 parent e88b46d commit c4d5e8d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void indexHtml(HttpServletRequest request, HttpServletResponse response)
.lines()
.collect(Collectors.joining("\n"));

content = content.replaceFirst("<base.+>", "<base href=\"" + request.getContextPath() + "/\">");
content = content.replaceFirst("<base[^>]+>", "<base href=\"" + request.getContextPath() + "/\">");
response.setContentType("text/html");
try (OutputStream writer = response.getOutputStream()) {
writer.write(content.getBytes());
Expand Down
6 changes: 6 additions & 0 deletions ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ npm_run_build {
outputs.dir 'build'
}

npm_run_buildProd {
inputs.dir 'src'
inputs.dir 'public'
outputs.dir 'build'
}

npm_run_start {
if (project.hasProperty('npm-args')) {
args = project.'npm-args'.tokenize()
Expand Down
3 changes: 0 additions & 3 deletions ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
<meta charset="utf-8">
<title>Shibboleth IDP UI</title>
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
3 changes: 3 additions & 0 deletions ui/src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ function App() {
<Route path="/metadata/attributes" component={Attribute} />
<Route path={`/metadata/provider/:id/filter`} component={Filter} />
<Route path="/metadata/:type/:id" component={Metadata} />
<Route path="*">
<Redirect to="/dashboard" />
</Route>
</Switch>
<NotificationList />
</main>
Expand Down
8 changes: 5 additions & 3 deletions ui/src/app/admin/container/UserManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ export default function UserManagement({ users, children, reload }) {
const deleteUser = (id) => {
deleteUserRequest(deleting);
setDeleting(null);
}
};

console.log(deleting)

return (
<div className="user-management">
{children(users, roles, setUserRoleRequest, (id) => setDeleting(id))}
<Modal.Dialog show={!!deleting} onHide={() => setDeleting(null)}>
<Modal show={!!deleting} onHide={() => setDeleting(null)}>
<Modal.Header toggle={toggle}><Translate value="message.delete-user-title">Delete User?</Translate></Modal.Header>
<Modal.Body className="d-flex align-content-center">
<FontAwesomeIcon className="text-danger mr-4" size="4x" icon={faExclamationTriangle} />
Expand All @@ -82,7 +84,7 @@ export default function UserManagement({ users, children, reload }) {
<Translate value="action.cancel">Cancel</Translate>
</button>
</Modal.Footer>
</Modal.Dialog>
</Modal>
</div>
);
}
12 changes: 6 additions & 6 deletions ui/src/app/core/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export function Header () {
<Translate value={'action.advanced'} />
</Dropdown.Toggle>
<Dropdown.Menu>
<Link to="/metadata/attributes" className="dropdown-item text-primary py-2">
<Dropdown.Item as={Link} to="/metadata/attributes" className="text-primary py-2">
<FontAwesomeIcon icon={faCube} className="mr-2" />
<Translate value="action.custom-entity-attributes" />
</Link>
</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
<Dropdown className="" id="basic-nav-dropdown">
Expand All @@ -44,14 +44,14 @@ export function Header () {
<Translate value={'action.add-new'} />
</Dropdown.Toggle>
<Dropdown.Menu>
<Link to="/metadata/source/new" className="dropdown-item text-primary py-2">
<Dropdown.Item as={Link} to="/metadata/source/new" className="text-primary py-2">
<FontAwesomeIcon icon={faCube} className="mr-2" />
<Translate value="action.add-new-source" />
</Link>
<Link to="/metadata/provider/new" className="dropdown-item text-primary py-2">
</Dropdown.Item>
<Dropdown.Item as={Link} to="/metadata/provider/new" className="text-primary py-2">
<FontAwesomeIcon icon={faCubes} className="mr-2" />
<Translate value="action.add-new-provider" />
</Link>
</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
<Link to="/dashboard" className="nav-link" aria-label="Metadata Dashboard">
Expand Down

0 comments on commit c4d5e8d

Please sign in to comment.