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

Associate all form inputs with labels #5509

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft

Conversation

javierm
Copy link
Member

@javierm javierm commented Apr 26, 2024

Objectives

  • Make it easier (or, in some cases even possible) for people using screen readers to access every form input in the application

Notes

⚠️ Before merging, remove the modifications in the visit method or decide what to do regarding automated tests for accessibility.

This code isn't used since commit 041abe9.
The `manage_languages` variables is never defined when calling the site
customization information texts globalize locales partial.
This parameter isn't used since commit b86c0d3, which deleted a file
that wasn't used since commit 146c09a. Further proof that this code
wasn't used is the fact that the `enable_translation_style` method,
which this code calls, was removed in commit 5ada975.
…-languages" or "globalize-locales", but not both
<%= text_field_tag :title_or_id, params["title_or_id"], placeholder: t("admin.budget_investments.index.placeholder") %>
</div>
<%= label_tag :title_or_id %>
<%= text_field_tag :title_or_id, params["title_or_id"], placeholder: t("admin.budget_investments.index.placeholder") %>

Choose a reason for hiding this comment

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

Input field helper is missing an autocomplete attribute. If no autocomplete behaviour is desired, use the value off or nope.

class Shared::GlobalizeLocalesComponent < ApplicationComponent
attr_reader :resource, :manage_languages
use_helpers :first_translation, :first_marked_for_destruction_translation,
:enabled_locale?, :name_for_locale, :highlight_translation_html_class

Choose a reason for hiding this comment

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

Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line. (https://rubystyle.guide#no-double-indent)

Suggested change
:enabled_locale?, :name_for_locale, :highlight_translation_html_class
:enabled_locale?, :name_for_locale, :highlight_translation_html_class


def first_i18n_content_translation_locale
if I18nContentTranslation.existing_languages.count == 0 ||
I18nContentTranslation.existing_languages.include?(I18n.locale)

Choose a reason for hiding this comment

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

Layout/MultilineOperationIndentation: Align the operands of a condition in an if statement spanning multiple lines.

Suggested change
I18nContentTranslation.existing_languages.include?(I18n.locale)
I18nContentTranslation.existing_languages.include?(I18n.locale)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant