Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

[WIP]feat(fbcnms-ui): Add Host Portal Login Page #171

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HannaFar
Copy link
Contributor

@HannaFar HannaFar commented Mar 7, 2022

Signed-off-by: HannaFar [email protected]
Add Host Portal and Organization Portal Login page

Host Portal Login Page :
Capture d’écran 2022-03-15 à 18 14 36

Organization Portal Login Page :
Capture d’écran 2022-03-15 à 18 14 27

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 7, 2022
@HannaFar HannaFar marked this pull request as draft March 7, 2022 16:18
@HannaFar HannaFar changed the title feat(fbcnms-ui): Add Host Portal Login Page [WIP]feat(fbcnms-ui): Add Host Portal Login Page Mar 7, 2022
@HannaFar HannaFar marked this pull request as ready for review March 15, 2022 17:21
Copy link
Contributor

@andreilee andreilee left a comment

Choose a reason for hiding this comment

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

There's a few changes that this needs, and merging this will need to wait until after migrating from 'master' to 'host' as well, but otherwise this looks fairly straightforward.

fbcnms-packages/fbcnms-ui/components/auth/LoginForm.js Outdated Show resolved Hide resolved
const params = new URLSearchParams(window.location.search);
const to = params.get('to');

const hostPortal = window.location.hostname.slice(0, 4) === 'mast';
Copy link
Contributor

Choose a reason for hiding this comment

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

Add typing annotations

const params = new URLSearchParams(window.location.search);
const to = params.get('to');

const hostPortal = window.location.hostname.slice(0, 4) === 'mast';
Copy link
Contributor

Choose a reason for hiding this comment

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

While this works, you should really be parsing the entire organization name

ie. in master.nms.com/master, you should check up until the first period.

There could be legitimate organization names that start with 'mast'.

Copy link
Contributor Author

@HannaFar HannaFar Mar 16, 2022

Choose a reason for hiding this comment

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

Sorry this was just to test.
This will be replaced by 'host'

const params = new URLSearchParams(window.location.search);
const to = params.get('to');

const hostPortal = window.location.hostname.slice(0, 4) === 'mast';
const hostname = window.location.hostname;
Copy link
Contributor

Choose a reason for hiding this comment

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

While a decent substitute for the organization name, you'll want to access the proper spelling and capitalization for the organization through @fbcnms/sequelize-models.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants