Skip to content

[hotfix] Parameterize category names for allowlist#1588

Merged
michellexliu merged 6 commits into
masterfrom
metrics-spaced-names
Sep 22, 2022
Merged

[hotfix] Parameterize category names for allowlist#1588
michellexliu merged 6 commits into
masterfrom
metrics-spaced-names

Conversation

@michellexliu

@michellexliu michellexliu commented Sep 17, 2022

Copy link
Copy Markdown
Contributor

Description

Previously, nothing would happen when a user clicked on the switch icon between the "Included" and "Excluded" list for assignment categories that have spaces in the names (e.g. "Optional Assignments"). This was caused because the category names were being used as ID's, which caused the jQuery to return undefined for categories with spaces. This was fixed by altering the jQuery to look for [id='included_${category}'], rather than individual id tags (which looks for id's separated by spaces separately, causing nothing to be returned).

How Has This Been Tested?

  • Toggled included/excluded for both categories with and without spaces and made sure it saved properly.
  • Category names with other non-alphanumeric characters (e.g. $, %, etc.)
  • Category names with trailing whitespaces or multiple non-alphanumeric characters in a row

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have run rubocop for style check. If you haven't, run overcommit --install && overcommit --sign to use pre-commit hook for linting
  • My change requires a change to the documentation, which is located at Autolab Docs
  • I have updated the documentation accordingly, included in this PR

Comment thread app/assets/javascripts/metrics_config.js
Comment thread app/assets/javascripts/metrics_config.js Outdated

@damianhxy damianhxy left a comment

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.

LGTM!

@michellexliu michellexliu merged commit d8b2765 into master Sep 22, 2022
@michellexliu michellexliu deleted the metrics-spaced-names branch September 22, 2022 16:34
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