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(slice-machine): add GitHub settings page #1285

Merged
merged 6 commits into from
Feb 8, 2024

Conversation

bapmrl
Copy link
Collaborator

@bapmrl bapmrl commented Feb 5, 2024

Completes DT-1804, DT-1848 and DT-1950.

@bapmrl bapmrl self-assigned this Feb 5, 2024
Copy link

vercel bot commented Feb 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
slice-machine ✅ Ready (Inspect) Visit Preview Feb 8, 2024 2:40pm

Copy link
Collaborator Author

@bapmrl bapmrl left a comment

Choose a reason for hiding this comment

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

Hello @angeloashmore,

Here are some notes and questions I would like you to review ^^

Thank you,

Copy link
Member

@angeloashmore angeloashmore left a comment

Choose a reason for hiding this comment

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

The UI works great! It looks and feels how it should. 🙂 There are some small changes requested below.

const providerConfig = gitProviderToConfig[repo.provider];
const { updateToken } = useWriteAPIToken({ git: repo });
return (
<Dialog size={{ width: 448, height: "auto" }} trigger={trigger}>
Copy link
Member

Choose a reason for hiding this comment

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

The Dialog is closable while the token is being saved. Is it possible to disable closing it while it is loading? Or maybe we can disable the "X" and clicking outside the dialog completely, and only allow closing via the "Cancel" button?

Copy link
Collaborator Author

@bapmrl bapmrl Feb 6, 2024

Choose a reason for hiding this comment

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

I think it's possible, but not now as we would need to update the Editor's Dialog component to:

  1. Disable the ESC keyboard shortcut.
  2. Disable dismissal by clicking the overlay.
  3. Potentially disable the "Cancel" button.

Before doing any of that, I think it would be safer to have @benjammartin's thoughts (knowing we need to have accessibility in mind).

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to continue processing in the background after closing the modal? We'll need a toaster for confirmation or error messages in this scenario.

Do we need to check the viability of the token?

Copy link
Collaborator Author

@bapmrl bapmrl Feb 8, 2024

Choose a reason for hiding this comment

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

Is there a way to continue processing in the background after closing the modal? We'll need a toaster for confirmation or error messages in this scenario.

I think we can either:

  1. Completely disable closing the dialog.
    → It could be frustrating for users.
  2. Allow closing the dialog, but disable the Connect/Disconnect buttons while the request is running. Once it succeeds, display a success toast.
    → It would probably better as users would be able to leave the Settings page.

What do you think? Do you see a better way of handling it?

Do we need to check the viability of the token?

What do you mean? Are you asking if there's a specific token format that we could validate in the dialog's form?

Copy link
Contributor

Choose a reason for hiding this comment

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

The second solution is good.

In both solutions one and two, my only concern is the token's validity. Do we implement a way to check the token’s validity?

Since it’s a temporary solution, I believe that’s not an issue anyway.

Copy link
Contributor

@benjammartin benjammartin Feb 8, 2024

Choose a reason for hiding this comment

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

If the second solution requires more time, I’m ok with releasing the first one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let me know.

Copy link
Collaborator Author

@bapmrl bapmrl Feb 8, 2024

Choose a reason for hiding this comment

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

Hello @angeloashmore,

Does the backend reject invalid Write API tokens? Do you think there's a format we could validate on the frontend?

Thank you,

@bapmrl bapmrl force-pushed the bmo/add-github-settings-page branch from fd8de81 to aa83662 Compare February 8, 2024 13:39
@bapmrl bapmrl force-pushed the bmo/add-github-settings-page branch from d4e705f to e15005f Compare February 8, 2024 14:35
@bapmrl bapmrl merged commit 71c73a5 into main Feb 8, 2024
34 checks passed
@bapmrl bapmrl deleted the bmo/add-github-settings-page branch February 8, 2024 15:11
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