AwardsBestowalEditForm

AwardsBestowalEditForm

Awards Bestowal Edit Form Controller

Modal form for editing a single bestowal with state-driven field rules, court slot loading, and recommendation link/unlink controls.

Constructor

new AwardsBestowalEditForm()

Source:

Members

_courtOptionDates

Description:
  • Court session activity ID => bestowal date (Y-m-d).

Source:

Court session activity ID => bestowal date (Y-m-d).

_courtSlotsAvailable

Description:
  • Whether the selected gathering has Event Schedule entries for court sessions.

Source:

Whether the selected gathering has Event Schedule entries for court sessions.

_gatheringStartDate

Description:
  • First day of the selected gathering (Y-m-d).

Source:

First day of the selected gathering (Y-m-d).

Methods

applyDefaultGivenDate()

Description:
  • Default bestowed date for Given state; respects manual edits.

Source:

awardTargetConnected()

Description:
  • Sync award field enablement when award autocomplete connects.

Source:

bindAutocompleteClear()

Description:
  • Wire clear button to paired-field handlers (ac#clear does not emit change).

Source:

clearAutocomplete()

Description:
  • Reset an autocomplete control to empty.

Source:

clearPairedAwardFields()

Description:
  • Clear award autocomplete when domain is cleared (works before targets connect).

Source:

clearSpecialtyOptions()

Description:
  • Hide, disable, and clear the specialty selector when the selected award does not use specialties.

Source:

connect()

Description:
  • Initialize submit button state and modal listeners when the form connects.

Source:

courtSlotBlockTargetConnected()

Description:
  • Apply server-provided court slot availability when the block connects.

Source:

disconnect()

Description:
  • Clean up modal listeners when the form disconnects.

Source:

domainTargetConnected()

Description:
  • Sync award field enablement when domain autocomplete connects.

Source:

extractBestowalIdFromTrigger(trigger)

Source:
Parameters:
Name Type Description
trigger HTMLElement | null

getAutocompleteController()

Description:
  • Return the Stimulus autocomplete controller for a wrapper when available.

Source:

getAutocompleteOptions()

Description:
  • Read autocomplete options from the live controller, falling back to the wrapper.

Source:

getAwardComboElement() → {HTMLElement|null}

Source:
Returns:
Type
HTMLElement | null

getAwardId()

Description:
  • Read selected award ID from autocomplete hidden field.

Source:

getDomainComboElement() → {HTMLElement|null}

Source:
Returns:
Type
HTMLElement | null

getDomainId()

Description:
  • Read selected domain ID from autocomplete hidden field.

Source:

getGatheringId()

Description:
  • Read selected gathering ID from autocomplete hidden field.

Source:

getHiddenValue()

Description:
  • Read hidden value from an autocomplete wrapper.

Source:

getMemberValue()

Description:
  • Read selected member ID or public ID from add/edit form fields.

Source:

getModalElement() → {HTMLElement|null}

Source:
Returns:
Type
HTMLElement | null

getSelectedAwardOption()

Description:
  • Return the selected award option including custom data payloads.

Source:

getSelectedMemberValue()

Description:
  • Read only selected member ID/public ID values, excluding custom typed names.

Source:

getSpecialtyValue()

Description:
  • Read specialty value from a combo-box wrapper or native field.

Source:

getTurboFrame() → {HTMLElement|null}

Source:
Returns:
Type
HTMLElement | null

givenDateTargetConnected()

Description:
  • Store initial bestowed date and track manual edits.

Source:

handleAutocompleteChange()

Description:
  • Route autocomplete.change from domain/award combos to paired-field handlers.

Source:

handleEditTriggerClick()

Description:
  • Load the edit form when an edit trigger is clicked (grid or detail page).

Source:

handleModalShow()

Description:
  • Load the edit form when the modal opens from a grid or detail trigger.

Source:

handleModalShown()

Description:
  • Refresh field state after the Bootstrap modal becomes visible.

Source:

handleOutletClick()

Description:
  • Load form when grid outlet-btn dispatches row data (same pattern as app settings).

Source:

hasValidAwardSelection() → {boolean}

Source:
Returns:
Type
boolean

hasValidMemberSelection() → {boolean}

Source:
Returns:
Type
boolean

hasValidSpecialtySelection() → {boolean}

Source:
Returns:
Type
boolean

isFormSubmittable() → {boolean}

Source:
Returns:
Type
boolean

isGivenState() → {boolean}

Source:
Returns:
Type
boolean

linkRecommendationTargetConnected()

Description:
  • Re-evaluate unlink guard when link checkbox connects.

Source:

loadBestowalForm(bestowalId)

Source:
Parameters:
Name Type Description
bestowalId string | number

memberTargetConnected()

Description:
  • Sync lookup and submit state when member autocomplete connects.

Source:

normalizeSpecialties()

Description:
  • Normalize award specialty metadata from endpoint and embedded combo options.

Source:

onAwardChange()

Description:
  • Handle award selection changes, including clear.

Source:

onCourtSlotChange()

Description:
  • Re-default bestowed date when court session selection changes.

Source:

onDomainChange()

Description:
  • Handle award type changes, including clear.

Source:

onGatheringChange()

Description:
  • Re-default bestowed date when gathering changes in Given state.

Source:

onIncludePastGatheringsChange()

Description:
  • Include or exclude past gatherings in the gathering picker.

Source:

onMemberChange()

Description:
  • Handle member selection changes for ad-hoc bestowal creation.

Source:

onTurboFrameLoad()

Description:
  • Stimulus action handler for turbo frame load events.

Source:

outletBtnOutletConnected()

Description:
  • Register listener when outlet-btn connects.

Source:

outletBtnOutletDisconnected()

Description:
  • Remove listener when outlet-btn disconnects.

Source:

planToGiveGatheringTargetConnected()

Description:
  • Store initial gathering value on target connect.

Source:

populateAwardDescriptions()

Description:
  • Fetch awards for domain and populate award selection.

Source:

readBestowedDateHints()

Description:
  • Load server-provided gathering / court session date hints from the turbo frame.

Source:

readStatusMap()

Description:
  • Read status map embedded in turbo frame when available.

Source:

replaceSelectOptions()

Description:
  • Replace select options safely without innerHTML.

Source:

replaceSpecialtyOptions()

Description:
  • Replace specialty options safely without innerHTML.

Source:

reportAwardValidation()

Description:
  • Surface native validation for required award fields.

Source:

resolveDefaultBestowedDate() → {string}

Source:
Returns:
Type
string

setAutocompleteDisabled()

Description:
  • Set disabled state on an autocomplete wrapper or native field.

Source:

setAutocompleteOptions()

Description:
  • Update autocomplete options on both the live controller and wrapper fallback.

Source:

setAutocompleteValue()

Description:
  • Set an autocomplete value on both the live controller and hidden fallback fields.

Source:

setAwardFieldEnabled()

Description:
  • Enable or disable the award autocomplete based on domain selection.

Source:

setFieldRules()

Description:
  • Parse JSON state rules and apply Visible/Required/Disabled field states.

Source:

setGatheringRequired()

Description:
  • Sync required state to autocomplete text input.

Source:

setId()

Description:
  • Set bestowal ID and update Turbo Frame source and form action.

Source:

setSpecialtyRequired()

Description:
  • Set required state on the specialty combo text field or select.

Source:

stateRulesBlockTargetConnected()

Description:
  • Apply field rules once state rules JSON is available in the turbo frame.

Source:

stateTargetConnected()

Description:
  • Apply field rules when state target connects.

Source:

submit()

Description:
  • Block submit and close modal when the form is submittable.

Source:

syncAwardFieldState()

Description:
  • Keep award disabled until a domain is selected.

Source:

syncCourtSlotVisibility()

Description:
  • Show help, select, or no-schedule message based on gathering Event Schedule.

Source:

syncMemberTextValue()

Description:
  • Ensure custom typed recipient names are copied into the submitted hidden text field.

Source:

syncSpecialtyOptions()

Description:
  • Populate specialty selector from the selected award's configured specialties.

Source:

turboFrameTargetConnected()

Description:
  • Read linked recommendation count and re-bind handlers when turbo frame loads.

Source:

turboFrameTargetDisconnected()

Description:
  • Re-evaluate submit state after turbo frame content loads.

Source:

unlinkRecommendationTargetConnected()

Description:
  • Initialize unlink guard when unlink checkbox connects.

Source:

updateCourtSlots()

Description:
  • Load court session options when gathering changes.

Source:

updateGatherings()

Description:
  • Update backend lookup URL for gathering autocomplete.

Source:

updateStatusDisplay()

Description:
  • Update read-only status label when state changes.

Source:

updateSubmitState()

Description:
  • Enable submit only when required fields are satisfied.

Source:

updateUnlinkAvailability()

Description:
  • Keep at least one recommendation linked when choosing unlink targets.

Source: