Unexpected output: Affected paths: relative - resubmit patch.
⚙ D315 INP-1712 - Trigger "change" event, when checkbox value is changed by script
Page MenuHomeIn-Portal Phabricator

INP-1712 - Trigger "change" event, when checkbox value is changed by script
ClosedPublic

Authored by alex on Jul 4 2017, 7:05 AM.

Details

Test Plan

Preparations

  1. in the /core/admin_templates/languages/phrase_list.tpl template before incs/footer template inclusion add this <script>$('div.multioptions_filter input[type=checkbox]').change(function () { console.log('change on ', this); });</script>
  2. in the /core/admin_templates/groups/groups_edit_permissions.tpl template before incs/footer template inclusion add this <script>$('input[type=checkbox]').change(function () { console.log('change on ', this); });</script>

Part 1

  1. login to Admin Console
  2. go to Website & ContentLabels & Phrases section
  3. open Console in Web Browser (where all console.log statements go)
  4. click on Open Filter in Location column
  5. confirm, that all (4) checkboxes in DIV, that appeared are unchecked
  6. check Select All checkbox
  7. confirm, that:
    • all option checkboxes + Select All checkboxes are checked
    • in Console 4 messages about change event appeared (for 3 option checkboxes + Select All itself)
  8. uncheck 1 of option checkboxes
  9. confirm, that:
    • 2 option checkboxes only are checked
    • in Console 2 messages about change event appeared (option checkbox itself + Select All checkbox)
  10. uncheck 1 of option checkboxes
  11. confirm, that:
    • 1 option checkbox only is checked
    • in Console 1 messages about change event appeared (checkbox itself)
  12. check Select All checkbox
  13. confirm, that:
    • all option checkboxes + Select All checkboxes are checked
    • in Console 3 messages about change event appeared (for 2 option checkboxes + Select All itself)

Part 2

  1. login to Admin Console
  2. go to User ManagementGroups section
  3. open admin user group for editing
  4. go to Permissions tab
  5. open Console in Web Browser (where all console.log statements go)
  6. for Labels & Phrases row:
    • ensure, that all checkboxes are checked
    • uncheck View checkbox
    • confirm, that all checkboxes in same row are unchecked
    • confirm, that in Console 4 messages about change event appeared (for 3 other permission checkboxes + this checkbox)
    • uncheck Edit checkbox
    • confirm, that in Console 1 message about change event appeared (for this checkbox)
    • check View checkbox
    • confirm, that in Console 3 messages about change event appeared (for 2 other permission checkboxes + this checkbox)

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 747
Build 747: arc lint + arc unit

Event Timeline

alex created this revision.Jul 4 2017, 7:05 AM
alex added a project: Restricted Project.Jul 4 2017, 7:05 AM
erik accepted this revision.Jul 14 2017, 6:07 AM

All works properly, but test plan may be corrected:
Part 1, 13 - may be "confirm, that in Console 3 messages about change event appeared (for 2 option checkboxes + select all itself)" - because by previous part of the plan 2 options were unchecked.

Second script in the preparations part may be fixed by removing first 3 symbols "$('", that are excessive and produces js error.

This revision is now accepted and ready to land.Jul 14 2017, 6:07 AM
alex edited the test plan for this revision. (Show Details)Jul 16 2017, 5:38 AM
In D315#6193, @erik wrote:

All works properly, but test plan may be corrected:
Part 1, 13 - may be "confirm, that in Console 3 messages about change event appeared (for 2 option checkboxes + select all itself)" - because by previous part of the plan 2 options were unchecked.

Second script in the preparations part may be fixed by removing first 3 symbols "$('", that are excessive and produces js error.

Thanks for noticing. I've updated test plan.

This revision was automatically updated to reflect the committed changes.