Skip to content

Commit

Permalink
Add branding-dependent login text, add back appstoreicon for now unti…
Browse files Browse the repository at this point in the history
…l a replacement is decided
  • Loading branch information
frostyfan109 committed Dec 18, 2023
1 parent 20605dd commit d715228
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 18 deletions.
26 changes: 25 additions & 1 deletion src/contexts/environment-context.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { createContext, useContext, useEffect, useState } from 'react'
import React, { Fragment, createContext, useContext, useEffect, useState } from 'react'
import axios, { CanceledError } from 'axios';
import {
ActiveView,
Expand Down Expand Up @@ -86,6 +86,30 @@ export const EnvironmentProvider = ({ children }) => {
/** Context defaults */
if (!context.appstore_asset_branch) context.appstore_asset_branch = "master"
if (!context.brand) context.brand = "helx"
/** Hardcoded for now, if you want custom login text for a brand add it as a case here. */
switch (context.brand) {
case "eduhelx":
context.login_text = (
<Fragment>
<a href="https://helxplatform.github.io/">HeLx</a> empowers researchers in domains from plant genomics to neuroscience to work with their preferred tools and apps in the cloud at scale.
EduHeLx, which is a derivative of HeLx, is designed for educational purposes.
HeLx/EduHeLx empower researchers, students and educators to leverage advanced analytical tools without installation or other infrastructure concerns, which has broad reaching benefits and can be applied in many domains.
<br />&nbsp;<br />
The HeLx and EduHeLx Workspaces provide a wide array of data science tools for use by these researchers. Through the Workspaces, users explore and interact with analytic tools and data to support scientific discovery.
</Fragment>
)
break
default:
context.login_text = (
<Fragment>
<a href="https://helxplatform.github.io/">HeLx</a> empowers researchers in domains from plant genomics to neuroscience to work with their preferred tools and apps in the cloud at scale.
Its ability to empower researchers to leverage advanced analytical tools without installation or other infrastructure concerns has broad reaching benefits and can be applied in many domains.
<br />&nbsp;<br />
The HeLx Workspaces provide a wide array of data science tools for use by these researchers. Through the Workspaces, users explore and interact with analytic tools and data to support scientific discovery.
</Fragment>
)
break
}

// split the comma-separated string which tells ui the support section to hide
// also trim leading/trailing spaces to allow spaces between commas
Expand Down
13 changes: 4 additions & 9 deletions src/views/workspaces/login/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const WorkspaceLoginView = withAPIReady(({
const [revalidateForm, setRevalidateForm] = useState(false)

const [form] = useForm()
const { basePath } = useEnvironment()
const { context, basePath } = useEnvironment()
const { api, user, loggedIn, loginProviders } = useWorkspacesAPI()
const { redirectToDest, redirectWithCurrentDest } = useDest()

Expand All @@ -84,7 +84,7 @@ export const WorkspaceLoginView = withAPIReady(({
}

const allowBasicLogin = useMemo(() => loginProviders.includes("Django"), [loginProviders])
const allowUncLogin = useMemo(() => loginProviders.includes("UNC Chapel Hill Single Sign-On"), [loginProviders])
const allowUncLogin = useMemo(() => loginProviders.includes("UNC Chapel Hill Single Sign-On"), [loginProviders])
const allowGoogleLogin = useMemo(() => loginProviders.includes("Google"), [loginProviders])
const allowGithubLogin = useMemo(() => loginProviders.includes("GitHub"), [loginProviders])

Expand Down Expand Up @@ -181,15 +181,10 @@ export const WorkspaceLoginView = withAPIReady(({
)
}}
title="HeLx Workspaces"
logo={ <AppstoreOutlined /> }
subTitle={
!asComponent ? <Paragraph style={{ fontSize: 14, maxWidth: 800, margin: "0 auto" }}>
<a href="https://helxplatform.github.io/">HeLx</a> empowers researchers in domains from plant genomics to neuroscience to work with their preferred tools and apps in the cloud at scale.
EduHeLx, which is a derivative of HeLx, is designed for educational purposes.
HeLx/EduHeLx empower researchers, students and educators to leverage advanced analytical tools without installation or other infrastructure concerns, which has broad reaching benefits and can be applied in many domains.
<br />&nbsp;<br />
The HeLx and EduHeLx Workspaces provide a wide array of data science tools for use by these researchers. Through the Workspaces, users explore and interact with analytic tools and data to support scientific discovery.
<br />&nbsp;<br />
Please sign in with one of the following options to access the HeLx Workspaces.
{ context.login_text }
</Paragraph> : null
}
actions={ hasAdditionalProviders ? (
Expand Down
11 changes: 3 additions & 8 deletions src/views/workspaces/login/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const WorkspaceSignupView = withSocialSignupAllowed(({
const [revalidateForm, setRevalidateForm] = useState(false)

const [form] = useForm()
const { basePath } = useEnvironment()
const { context, basePath } = useEnvironment()
const { api, user, loggedIn, loginProviders } = useWorkspacesAPI()
const { redirectToDest, redirectWithCurrentDest } = useDest()

Expand Down Expand Up @@ -159,16 +159,11 @@ export const WorkspaceSignupView = withSocialSignupAllowed(({
)
}}
title="HeLx Workspaces"
logo={ <AppstoreOutlined /> }
subTitle={
<div style={{ display: "flex", flexDirection: "column" }}>
{ !asComponent ? <Paragraph style={{ fontSize: 14, maxWidth: 800, margin: "0 auto" }}>
<a href="https://helxplatform.github.io/">HeLx</a> empowers researchers in domains from plant genomics to neuroscience to work with their preferred tools and apps in the cloud at scale.
EduHeLx, which is a derivative of HeLx, is designed for educational purposes.
HeLx/EduHeLx empower researchers, students and educators to leverage advanced analytical tools without installation or other infrastructure concerns, which has broad reaching benefits and can be applied in many domains.
<br />&nbsp;<br />
The HeLx and EduHeLx Workspaces provide a wide array of data science tools for use by these researchers. Through the Workspaces, users explore and interact with analytic tools and data to support scientific discovery.
<br />&nbsp;<br />
Please sign in with one of the following options to access the HeLx Workspaces.
{ context.login_text }
</Paragraph> : null }
<Paragraph style={{ fontSize: 14, maxWidth: 800, margin: "0 auto", textAlign: "start" }}>
<Alert
Expand Down

0 comments on commit d715228

Please sign in to comment.