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

Fix for CANFAR specific menu items. #71

Merged
merged 3 commits into from
Jul 16, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/gradle-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

runs-on: ubuntu-latest
permissions:
contents: read
contents: write

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -70,4 +70,4 @@ jobs:
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
uses: gradle/actions/dependency-submission@v3
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# tags with and without build number so operators use the versioned
# tag but we always keep a timestamped tag in case a semantic tag gets
# replaced accidentally
VER=0.2.6
VER=0.2.7
TAGS="${VER} ${VER}-$(date -u +"%Y%m%dT%H%M%S")"
unset VER
20 changes: 8 additions & 12 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ const URLS = {
}

const HEADER_URL_DEFAULTS = {
"acctrequest": "",
"acctupdate": "",
"passreset": "",
"passchg": "",
"gmui": "",
"search": "",
"ivo://cadc.nrc.ca/acctrequest": "",
"ivo://cadc.nrc.ca/acctupdate": "",
"ivo://cadc.nrc.ca/passreset": "",
"ivo://cadc.nrc.ca/passchg": "",
"ivo://cadc.nrc.ca/groups": "",
"ivo://cadc.nrc.ca/search": "",
"baseURLCanfar": "https://www.canfar.net"
}

Expand Down Expand Up @@ -194,15 +194,11 @@ class SciencePortalApp extends React.Component {
}

setHeaderURLs(hURLs) {
var curState = this.state
curState.headerURLs = hURLs
this.setState(curState)
this.setState({headerURLs: hURLs})
}

setThemeName(themeName) {
const currState = this.state
currState.themeName = themeName
this.setState(currState)
this.setState({themeName: themeName})
}

getAccessToken() {
Expand Down
6 changes: 4 additions & 2 deletions src/react/canfar/CanfarLoginModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import Modal from "react-bootstrap/Modal";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faRightToBracket } from "@fortawesome/free-solid-svg-icons";

const PASS_RESET_URI = "ivo://cadc.nrc.ca/passreset"
const ACCOUNT_REQUEST_URI = "ivo://cadc.nrc.ca/acctrequest"

class CanfarLoginModal extends React.Component {

Expand Down Expand Up @@ -75,12 +77,12 @@ class CanfarLoginModal extends React.Component {
placeholder="Password"/>
</div>
{errMsg}
<a href={this.state.modalURLs.passreset}
<a href={this.state.modalURLs[PASS_RESET_URI]}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is passreset still required in HEADER_URL_DEFAULTS, if it's no longer referenced in this location?

I have the same question for acctrequest, groups, and search.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch. I've updated those to match the URIs.

className="account_access_info"
tabIndex="5" title="Forgot Password">
Forgot your Account information?</a>
<br/>
<a href={this.state.modalURLs.acctrequest}
<a href={this.state.modalURLs[ACCOUNT_REQUEST_URI]}
className="account_access_info"
tabIndex="6" title="Register" >
Request a CADC Account</a>
Expand Down
13 changes: 9 additions & 4 deletions src/react/canfar/CanfarNavbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faRightFromBracket} from "@fortawesome/free-solid-svg-icons";
import {faCaretDown} from "@fortawesome/free-solid-svg-icons";

const GROUP_MANAGEMENT_URI = "ivo://cadc.nrc.ca/groups"
const ADVANCED_SEARCH_URI = "ivo://cadc.nrc.ca/search"
const ACCOUNT_UPDATE_URI = "ivo://cadc.nrc.ca/acctupdate"
const PASSWORD_CHANGE_URI = "ivo://cadc.nrc.ca/passchg"

class CanfarNavbar extends React.Component {

Expand All @@ -37,6 +41,7 @@ class CanfarNavbar extends React.Component {
});
}
}

renderButton() {
return (
<Button size="sm" variant="outline-primary">{this.state.authenticatedUser}<span className="sp-buffer-span-left"><FontAwesomeIcon icon={faCaretDown} /></span></Button>
Expand Down Expand Up @@ -69,10 +74,10 @@ class CanfarNavbar extends React.Component {
<Nav.Link href={baseURLCanfar + "/en/docs/quick_start/"}>Documentation</Nav.Link>
<NavDropdown title="Services">
<NavDropdown.Item href={baseURLCanfar + "/storage/list"} target="_blank">Storage Management</NavDropdown.Item>
<NavDropdown.Item href={this.state.headerURLs.groups} target="_blank">Group Management</NavDropdown.Item>
<NavDropdown.Item href={this.state.headerURLs[GROUP_MANAGEMENT_URI]} target="_blank">Group Management</NavDropdown.Item>
<NavDropdown.Item href={baseURLCanfar + "/citation"} target="_blank">Data Publication</NavDropdown.Item>
<NavDropdown.Item href={baseURLCanfar + "/science-portal"} target="_blank">Science Portal</NavDropdown.Item>
<NavDropdown.Item href={this.state.headerURLs.search} target="_blank">CADC Search</NavDropdown.Item>
<NavDropdown.Item href={this.state.headerURLs[ADVANCED_SEARCH_URI]} target="_blank">CADC Search</NavDropdown.Item>
<NavDropdown.Item href="https://arbutus-canfar.cloud.computecanada.ca" target="_blank">OpenStack Cloud</NavDropdown.Item>
</NavDropdown>
<Nav.Link href={baseURLCanfar + "/en/about/organization/"}>About</Nav.Link>
Expand Down Expand Up @@ -122,8 +127,8 @@ class CanfarNavbar extends React.Component {
}
{this.state.isAuthenticated === true &&
<NavDropdown align="end" title={this.renderButton()} id="authenticated_nav_dropdown" className="sp-auth-dropdown">
<NavDropdown.Item href={this.state.headerURLs.acctupdate} target="_blank">Update Profile</NavDropdown.Item>
<NavDropdown.Item href={this.state.headerURLs.passchg} target="_blank">Reset Password</NavDropdown.Item>
<NavDropdown.Item href={this.state.headerURLs[ACCOUNT_UPDATE_URI]} target="_blank">Update Profile</NavDropdown.Item>
<NavDropdown.Item href={this.state.headerURLs[PASSWORD_CHANGE_URI]} target="_blank">Reset Password</NavDropdown.Item>
<NavDropdown.Item href="https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/cred/priv?daysValid=30">Obtain Certificate</NavDropdown.Item>
<NavDropdown.Item href={baseURLCanfar + "/access/logout?target=" + baseURLCanfar + "/science-portal/"}>
<span className="sp-buffer-span-right"><FontAwesomeIcon icon={faRightFromBracket} /></span>Logout
Expand Down
Loading