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

Disable editing for media type questions with uploads #4725

Merged
merged 6 commits into from Nov 14, 2023

Conversation

RuthShryock
Copy link
Member

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes

Description

This feature restricts editing for questions supporting uploads within the bulk-edit modal.

Notes

Added the disableEdit function which determines if the Edit text button is disabled (and if so, the color changed as well) based on the question.type.

Copy link

@LMNTL LMNTL self-requested a review November 14, 2023 15:17
Copy link
Contributor

@LMNTL LMNTL left a comment

Choose a reason for hiding this comment

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

This does the job well! I just have a couple style/accessibility concerns to address before it gets merged.

jsapp/js/components/modalForms/bulkEditSubmissionsForm.es6 Outdated Show resolved Hide resolved
onClick={this.selectQuestion.bind(this, question)}
disabled={this.disableEdit(question.type)}
Copy link
Contributor

@LMNTL LMNTL Nov 14, 2023

Choose a reason for hiding this comment

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

It's preferable to avoid using the disabled attribute on buttons, since it hides information from screen readers and removes the button from the tab order. (The first part of this article outlines a bit of the dilemma.) You can check out this PR for an example with the <Button> component.

I think you'd only need to take two steps to make that change:

  • Use aria-disabled instead of disabled
  • In the onClick handler function (selectQuestion), don't do anything if this.disableEdit is true

See this internal thread for additional details.

@LMNTL LMNTL merged commit 86537bc into beta Nov 14, 2023
4 checks passed
@LMNTL LMNTL deleted the block-edit-mediatype-questions branch November 14, 2023 20:47
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.

None yet

2 participants