Skip to content

Disable submit button when plugin is not selected#212

Merged
mukeshpanchal27 merged 5 commits intotrunkfrom
feature/disable-admin-button
Jun 28, 2023
Merged

Disable submit button when plugin is not selected#212
mukeshpanchal27 merged 5 commits intotrunkfrom
feature/disable-admin-button

Conversation

@jjgrainger
Copy link
Copy Markdown
Contributor

This PR disables the 'Check it' button when a plugin is not selected in the dropdown.

This has been tested and works with the 'Check this plugin' links on the plugins page.

Closes #139

Copy link
Copy Markdown
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

Thanks @jjgrainger for the PR. Only two small points of feedback here to improve the behavior a bit further. There's one edge-case we should probably address, which should be straightforward.

Comment thread assets/js/plugin-check-admin.js Outdated
}

// Handle disabling the check it button when a plugin is not selected.
pluginsList.addEventListener( 'change', canRunChecks );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit-pick: Maybe move this together with the canRunChecks() call, just to have those two places where the function is called co-located?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @felixarntz I've moved this down with the canRunChecks() call.

Comment thread assets/js/plugin-check-admin.js
@jjgrainger jjgrainger requested a review from felixarntz June 27, 2023 09:24
Copy link
Copy Markdown
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

Thanks @jjgrainger, LGTM!

Comment thread assets/js/plugin-check-admin.js Outdated
Copy link
Copy Markdown
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Thanks @jjgrainger, The changes look good to me.

@mukeshpanchal27 mukeshpanchal27 merged commit 9a467b1 into trunk Jun 28, 2023
@mukeshpanchal27 mukeshpanchal27 deleted the feature/disable-admin-button branch June 28, 2023 05:07
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.

Improve error handling if the user clicks on the 'Check it' button without selecting a plugin

3 participants