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

Feature/project wizard next button validation #2773

Merged
merged 4 commits into from
Apr 15, 2024

Conversation

sharon-wang
Copy link
Member

Intent

Disable the Next and Create buttons if user input is invalid or missing for a particular step.

Shows the Next/Create buttons in disabled state

proj_wiz_next_button_validation.mp4
proj_name_next.mp4

Shows different theme colours for the button enabled/disabled state

buttons_enabled_disabled_theme.mp4

Approach

  • specify the appropriate disable condition for the nextButtonConfig/okButtonConfig on each step
  • add some colours for the disabled button styling (foreground, background, border)
  • add missing border on the Browse... button for the labeledFolderInput component
  • fix some logic around the selected interpreter (check that the preferred/selected interpreter is an option in the dropdown list)

QA Notes

  • On the project type step, the Next button should be disabled until the user selects one of the options
  • On the project name and location step, the Next button should be disabled if the project name is empty (a future PR will address providing feedback to inform the user that they need to enter a project name)
  • On the environment/configuration steps, the Create button should be disabled until a valid Python or R interpreter is selected

Note that the conda python interpreter dropdown items are hardcoded, so none of the options are valid (and thus, the Create button cannot be enabled). Once the conda interpreters are attributed to actual runtimes, we will be able to validate the selected item in the dropdown list.

- also fixes the missing border on the Browse... button for the labeledFolderInput component
Note that the conda dropdown items are hardcoded, so none of the options are valid. Once the conda interpreters are attributed to actual runtimes, we will be able to validate the selected item in the dropdown list.
First, try to use the existing selection. If it's not an option in the dropdown, then try to use the preferred interpreter. If that's still not an option, then there isn't a default selection.
@@ -1528,6 +1528,14 @@ export const POSITRON_MODAL_DIALOG_BUTTON_ACTIVE_BACKGROUND = registerColor('pos
hcLight: darken(POSITRON_MODAL_DIALOG_BUTTON_BACKGROUND, 0.15)
}, localize('positronModalDialog.buttonActiveBackground', "Positron modal dialog button active background color."));

// Positron modal dialog button disabled background color.
export const POSITRON_MODAL_DIALOG_BUTTON_DISABLED_BACKGROUND = registerColor('positronModalDialog.buttonDisabledBackground', {
dark: null,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these null because disabled buttons assume the dialog background for their background?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes exactly 👍

@sharon-wang sharon-wang merged commit 4289bc3 into main Apr 15, 2024
1 check passed
@sharon-wang sharon-wang deleted the feature/project-wizard-next-button-validation branch April 15, 2024 20:35
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.

2 participants