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

Fixed input checkbox behavior #6663

Merged
merged 4 commits into from Jun 17, 2020

Conversation

malliaridis
Copy link
Contributor

Description of what you did:

Updated the click behavior of the input checkbox field. Now the fields can be selected without
toggling the checkbox by clicking on the white surface or the config wheel. Toggling still possible
by clicking on the word or checkbox (like before).

Also moved the input selected state to the plugin (from controller) to prevent multiple selections
of input fields (with highlighting) from different controllers. This visibility bug occurred while
fixing the actual behavior of the input checkboxes.

Fix #5437

Move click action to wrapper (parent) to allow clicks on
whole area of checkbox. Also update the highlighting and
visibility on hover of configuration wheel for better
usability. This way the user learns that clicking on the
item or wheel opens the configuration and clicking on
the text or checkbox toggles the checkbox.

Signed-off-by: Christos Malliaridis <c.malliaridis@gmail.com>
Move input selected state from controller to parent component (plugin)
to prevent multiple selections and highlighting of checkbox fields
from different controllers.

Signed-off-by: Christos Malliaridis <c.malliaridis@gmail.com>
@codecov
Copy link

codecov bot commented Jun 14, 2020

Codecov Report

Merging #6663 into master will increase coverage by 0.12%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6663      +/-   ##
==========================================
+ Coverage   19.85%   19.98%   +0.12%     
==========================================
  Files         857      858       +1     
  Lines       12076    12098      +22     
  Branches     1963     1965       +2     
==========================================
+ Hits         2398     2418      +20     
- Misses       8093     8095       +2     
  Partials     1585     1585              
Flag Coverage Δ
#front 14.67% <20.00%> (+<0.01%) ⬆️
#unit 41.71% <95.00%> (+0.45%) ⬆️
Impacted Files Coverage Δ
...admin/src/containers/InstalledPluginsPage/index.js 7.14% <ø> (ø)
...kages/strapi-admin/admin/src/translations/index.js 100.00% <ø> (ø)
...-manager/admin/src/components/DynamicZone/index.js 0.00% <ø> (ø)
...in-content-manager/admin/src/translations/index.js 0.00% <ø> (ø)
...lder/admin/src/containers/FormModal/utils/forms.js 0.00% <0.00%> (ø)
...ntent-type-builder/admin/src/translations/index.js 0.00% <ø> (ø)
...ugin-documentation/admin/src/translations/index.js 0.00% <ø> (ø)
...trapi-plugin-email/admin/src/translations/index.js 0.00% <ø> (ø)
.../containers/InputModalStepper/InputModalStepper.js 0.00% <ø> (ø)
...-upload/admin/src/containers/ModalStepper/index.js 0.00% <ø> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6774667...d77ab73. Read the comment docs.

@@ -14,9 +14,8 @@ import InputCheckbox from '../InputCheckboxPlugin';

import { Header, Label, Separator, Wrapper } from './Components';

function Controller({ actions, inputNamePath, isOpen, name }) {
function Controller({ actions, inputNamePath, isOpen, name, inputSelected, setInputSelected }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove the { useState } import since it is not needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bad idea to skip once the linter.
Updated the branch and removed the import. :)

P.S. Sorry for the multiple force-pushes (if you got any notifications). I avoided auto formatting issues while commiting. If I should run any formatting to the rest of the code let me know.

Signed-off-by: Christos Malliaridis <c.malliaridis@gmail.com>
Copy link
Contributor

@soupette soupette left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug source: plugin:users-permissions Source is plugin/users-permissions package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad behavior of endpoint fields in roles-permissions plugin admin panel
2 participants