Skip to content

Commit

Permalink
Merge pull request #32 from scientist-softserv/i17-put-sign-up-link-b…
Browse files Browse the repository at this point in the history
…ehind-env-flag

i17 Put sign up link behind ENV flag
  • Loading branch information
bkiahstroud authored Sep 18, 2024
2 parents 8d381bb + 2d5ccb8 commit b5e294a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ RAILS_DB_HOST=postgres
RAILS_DB_PORT=5432
RAILS_DB_NAME=manifold_production
RAILS_REDIS_URL=redis://redis:6379

ALLOW_SIGNUP=false
1 change: 1 addition & 0 deletions chart/princeton-manifold/templates/configmap-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
ALLOW_SIGNUP: "false"
API_CABLE_HOST: princeton-manifold-production-api-cable
API_CABLE_PORT: "3021"
API_HOST: princeton-manifold-production-api-rails
Expand Down
9 changes: 6 additions & 3 deletions client/src/global/components/sign-in-up/LoginForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default function LoginForm({
hideOverlay,
willRedirect
}) {
const signupEnabled = process.env.ALLOW_SIGNUP === 'true';
const { t } = useTranslation();
const dispatch = useDispatch();
const authentication = useFromStore("authentication");
Expand Down Expand Up @@ -116,9 +117,11 @@ export default function LoginForm({
<SharedStyles.ViewLink onClick={e => handleViewChange("password", e)}>
{t("forms.signin_overlay.forgot_password")}
</SharedStyles.ViewLink>
<SharedStyles.ViewLink onClick={e => handleViewChange("terms", e)}>
{t("forms.signin_overlay.need_account")}
</SharedStyles.ViewLink>
{signupEnabled && (
<SharedStyles.ViewLink onClick={e => handleViewChange("terms", e)}>
{t("forms.signin_overlay.need_account")}
</SharedStyles.ViewLink>
)}
</SharedStyles.LinksWrapper>
<OAuthOptions />
</div>
Expand Down
1 change: 1 addition & 0 deletions client/webpack/templates/www_env.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ process.env.DOMAIN = "<%= env.DOMAIN %>"
process.env.CLIENT_BROWSER_API_URL = "<%= env.CLIENT_BROWSER_API_URL %>"
process.env.CLIENT_BROWSER_API_CABLE_URL = "<%= env.CLIENT_BROWSER_API_CABLE_URL %>"
process.env.SSL_ENABLED = "<%= env.SSL_ENABLED %>"
process.env.ALLOW_SIGNUP = "<%= env.ALLOW_SIGNUP %>"
process.version = "<%= process.version %>"

0 comments on commit b5e294a

Please sign in to comment.