RetentionPolicyInputController

RetentionPolicyInputController

Retention Policy Input Controller

Provides a structured interface for retention policy configuration with real-time preview. Replaces simple JSON textarea with user-friendly inputs (years, months, days, anchor).

Targets:

  • anchorSelect: The anchor point selection (gathering_end_date, upload_date, permanent)
  • yearsInput: Years input field
  • monthsInput: Months input field
  • daysInput: Days input field
  • durationSection: Container for duration inputs (hidden when anchor=permanent)
  • preview: Preview text showing formatted policy
  • hiddenInput: Hidden input that stores the JSON value for form submission

Actions:

  • updatePreview: Updates preview text and hidden JSON field when any input changes

Constructor

new RetentionPolicyInputController()

Source:

Methods

connect()

Description:
  • Initialize controller

Source:

formatPreviewText(anchor, years, months, days) → {string}

Description:
  • Format preview text in human-readable format

Source:
Parameters:
Name Type Description
anchor string

The anchor point

years number

Years duration

months number

Months duration

days number

Days duration

Returns:

Formatted preview text

Type
string

parseJson(jsonValue)

Description:
  • Parse existing JSON value into form fields Called when editing an existing waiver type

Source:
Parameters:
Name Type Description
jsonValue string

JSON string from database

updatePreview()

Description:
  • Update preview text and hidden JSON field Called whenever any input changes

Source:

validate() → {boolean}

Description:
  • Validate inputs before form submission

Source:
Returns:

True if valid, false otherwise

Type
boolean