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

UHF-9216 Character counter #264

Merged
merged 16 commits into from
Feb 8, 2024
Merged

UHF-9216 Character counter #264

merged 16 commits into from
Feb 8, 2024

Conversation

khalima
Copy link
Contributor

@khalima khalima commented Feb 8, 2024

UHF-9216

What was done

  • Added theme hook suggestion for hero title and description fields.
  • Add the counter input tag, step value and total value to hero field variables
  • Added a new template for the fields with character counters.
  • Added a translations for character counter.
  • Added a library and JS for the character counter.
  • Updated hds design tokens.
  • Fixed stylelintrc typos and bumped up the level of max-nesting-level rule.
  • Themed character counter.
  • Fixed linter warnings from hero.scss.

How to install

  • Make sure your instance is up and running on latest dev branch.
    • git pull origin dev
    • make fresh
  • Update the HDBT Admin theme
    • composer require drupal/hdbt_admin:dev-UHF-9216
  • Run make drush-cr
  • Run make shell
    • In shell run drush locale:check; drush locale:update; drush cr
    • If the translations won't work, try to run drush php-eval "_locale_parse_js_file('themes/contrib/hdbt_admin/dist/js/characterCounter.min.js');" drush cr
    • If the translations still won't work, contact @khalima

How to test

  • Go to create or edit a content of type which can have a hero paragraph
  • Type into the hero title field more than 55 characters and check that a warning text appears
    image
  • Type into the hero description field more than 160 characters and check that a warning text appears
    image
    • Continue typing to more than 200 characters and check that the warning text changes to more strict message.
      image
  • Check that code follows our standards

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