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

feat: pass in query param for role #374

Merged
merged 2 commits into from
Feb 22, 2024
Merged

Conversation

Kodylow
Copy link
Member

@Kodylow Kodylow commented Feb 12, 2024

Lets you pass in role as a query param so we can skip the first setup page, we've found it a hiccup when doing setups for fedi

@Kodylow Kodylow requested a review from a team as a code owner February 12, 2024 23:38
apps/guardian-ui/src/setup/FederationSetup.tsx Outdated Show resolved Hide resolved
apps/guardian-ui/src/setup/FederationSetup.tsx Outdated Show resolved Hide resolved
@okjodom
Copy link
Collaborator

okjodom commented Feb 19, 2024

Lgtm. I'll test in a bit.
PS, we can squash all commits into one

@Kodylow
Copy link
Member Author

Kodylow commented Feb 19, 2024

squashed

const roleQueryParam = getQueryParam('role')?.toLowerCase();
if (
roleQueryParam &&
progress === SetupProgress.Start &&
Copy link
Collaborator

@okjodom okjodom Feb 20, 2024

Choose a reason for hiding this comment

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

  • line 93 is now redundant
  • forcing roleQueryParam to lower case is a bug because http://localhost:3000/?role=Host never matches the include check or as GuardianRole type coercion later

@@ -94,6 +112,7 @@ export const FederationSetup: React.FC = () => {
title = t('setup.progress.tos.title');
content = <TermsOfService next={() => setNeedsTosAgreement(false)} />;
} else {
// Removed the roleQueryParam handling from here as it's moved to useEffect
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can delete the comment

@okjodom
Copy link
Collaborator

okjodom commented Feb 20, 2024

@Kodylow when I was testing this, I found some bugs (tagged) but I actually took a step back wondering if we actually need to skip the first page because of query param. Might it be better to pre-select the role from the value of query param, but let the guardian click next to proceed?

Here is a cherry pick from validating the issue 9a9503d

@Kodylow
Copy link
Member Author

Kodylow commented Feb 20, 2024

I agree that's better, then people acknowledge their role too. will update.

@Kodylow
Copy link
Member Author

Kodylow commented Feb 21, 2024

Updated, made it way simpler too just a single useeffect in RoleSelector.

Copy link
Collaborator

@okjodom okjodom left a comment

Choose a reason for hiding this comment

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

ship it!

@Kodylow Kodylow merged commit 8e742f3 into fedimint:master Feb 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants