Skip to content

fix(js): only require one participants field - #566

Closed
wesleyboar wants to merge 14 commits into
mainfrom
fix/manage-participants-field-required-attr
Closed

fix(js): only require one participants field#566
wesleyboar wants to merge 14 commits into
mainfrom
fix/manage-participants-field-required-attr

Conversation

@wesleyboar

@wesleyboar wesleyboar commented Jul 16, 2026

Copy link
Copy Markdown
Member

Overview

If a field has two ways to provide participants, then only one of those fields should be required.

Related

Changes

  • added ad hoc javascript
  • fixed required asterisk missing, and both/neither fields required, when the form plugin doesn't mark either field required by default

Testing

  1. Open Sabey Tour Request Form.
  2. Enter content in text area.
  3. Verify file upload is not required.
  4. Delete content in text area.
  5. Verify file upload is again required.
  6. Choose a file to upload.
  7. Verify text area is not required.

Additional case: neither field required by the form plugin by default

  1. Open a form where the plugin does not mark either participants field required.
  2. Verify the text area shows the required asterisk on load, and the file upload does not.
  3. Choose a file to upload.
  4. Verify the asterisk moves to the file upload field and the text area becomes optional.
  5. Clear the file selection again.
  6. Verify the asterisk returns to the text area (never both fields, never neither).

UI

only.require.one.participants.field.mov

Notes

Note

Reverted this PR's edit to js-ad-hoc-scripts.html — that snippet is now versioned in Core-CMS-Custom and is being deleted from this repo in #569.

@wesleyboar
wesleyboar marked this pull request as ready for review July 16, 2026 22:23
wesleyboar and others added 7 commits July 16, 2026 17:28
To reduce and simplify diff.
…default

Inject the missing asterisk indicator when the form plugin doesn't
mark a field required by default, and make the text field the sole
default-required field so the text/file-upload pair is never both
required or both optional at once.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
wesleyboar added a commit to TACC/Core-CMS-Custom that referenced this pull request Jul 31, 2026
## Overview

Update `tup/html/` with every snippet change from a currently-open
tup-ui PR.

## Related

- requires #559
- migrates snippet changes from:
    - TACC/tup-ui#568
    - TACC/tup-ui#325
    - TACC/tup-ui#535
    - TACC/tup-ui#557
    - TACC/tup-ui#562
    - TACC/tup-ui#565
    - TACC/tup-ui#566

## Changes

- **added** `embed-vislab-*.html`
    <sup>latest versions from:</sup>
    - TACC/tup-ui#568
- **updated** `css-ad-hoc-styles.html`
    <sup>hand-composed from:</sup>
    - TACC/tup-ui#325
    - TACC/tup-ui#535
    - TACC/tup-ui#557
    - TACC/tup-ui#562
    - TACC/tup-ui#565
- **updated** `js-ad-hoc-scripts.html`
    <sup>hand-composed from:</sup>
    - TACC/tup-ui#535
    - TACC/tup-ui#566

## Testing

1. Compare `embed-vislab-*` files against the branch of
TACC/tup-ui#568 to confirm content matches.
2. For `css-ad-hoc-styles.html` and `js-ad-hoc-scripts.html`, compare
against each contributing PR's diff to confirm every intended change
made it in.
That snippet is being deleted from this repo in favor of Core-CMS-Custom
(#569); keep it untouched here so #569 doesn't conflict with this PR.
Both are being moved to Core-CMS-Custom (TACC/Core-CMS-Custom#564); keep
them untouched/absent here so tup-ui#571 doesn't conflict with this PR
once it also deletes the ad-hoc JS files.
@wesleyboar

Copy link
Copy Markdown
Member Author

Closing because zero changes since 0f8454a because TACC/Core-CMS-Custom#564.

@wesleyboar wesleyboar closed this Aug 3, 2026
@wesleyboar
wesleyboar deleted the fix/manage-participants-field-required-attr branch August 3, 2026 23:01
wesleyboar added a commit to TACC/Core-CMS-Custom that referenced this pull request Aug 3, 2026
## Overview

Migrates CSS/JS assets (that `tup/html/css-ad-hoc-styles.html` and
`js-ad-hoc-scripts.html` load) from [TACC/tup-ui] to here.

<details>

[TACC/tup-ui]: https://github.com/TACC/

The snippets files were already migrated (#559, #560); this closes the
loop so those snippets' `<link>`/`<script>` tags can point at this
repo's CDN pins instead of tup-ui's.

</details>

## Related

- adds to #563
- integrates changes from:
    - TACC/tup-ui#566
    - TACC/tup-ui#535
    - TACC/tup-ui#562

> [!IMPORTANT]
> **Follow-up:** Repoint `tup/html/css-ad-hoc-styles.html` and
`js-ad-hoc-scripts.html`'s CDN URLs at this repo (not done in this PR).

## Changes

- **added** `tup/css/ad-hoc/` (many files)
- **added** `tup/js/ad-hoc.js`
- **added** `tup/js/ad-hoc/manage-participants-field-required-attr.js`
- **added** `tup/css/ad-hoc/hide-blog-list-back-link.css` (from
TACC/tup-ui#562, open)
- **added** `tup/css/ad-hoc/adjust-logo.css` (from TACC/tup-ui#535,
open)
- **updated** `navbar-width-horz-scrollbar.css`

## Testing

1. Confirm each file's content matches TACC/tup-ui's current copy
exactly **except**:
    - `navbar-width-horz-scrollbar.css` matches TACC/tup-ui#535's branch
- `adjust-logo.css` matches TACC/tup-ui#535's branch (doesn't exist on
tup-ui `main`)
- `hide-blog-list-back-link.css` matches TACC/tup-ui#562's branch
(doesn't exist on tup-ui `main`)
- `ad-hoc.js`/`manage-participants-field-required-attr.js` matches the
commit already pinned in the live snippet, TACC/tup-ui@0c0beee5
jarosenb pushed a commit that referenced this pull request Aug 10, 2026
* chore(cms): delete snippets migrated to Core-CMS-Custom

These 9 template copies were reference-only records of djangocms-snippet
content per this repo's "Save Snippets" convention. They now live in
Core-CMS-Custom (TACC/Core-CMS-Custom#559) with no open PR here still
editing them, so the local copies are redundant.

* chore(cms): delete remaining snippets migrated to Core-CMS-Custom

css-ad-hoc-styles.html and js-ad-hoc-scripts.html were held back from the
prior commit because open PRs (#325, #535, #557, #562, #565, #566) still
edited them here. Those PRs are being updated to drop their edits to these
two files in favor of Core-CMS-Custom (TACC/Core-CMS-Custom#560), so the
local copies can go too.

* chore(cms): delete redirect.html and open-external-post.html

Unlike this PR's other deletions, these two were never migrated to
Core-CMS-Custom (they're djangocms-snippet "template"-field templates,
not manually-synced reference copies, per the original migration's
notes). They're deleted here because #535 already deletes them
independently — the external-post-link and redirect behavior they
provide is now handled by Core-CMS itself.
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.

1 participant