Skip to content

Disagg IML: Add IML Input Form

Add new IML input control for disaggregation application:

  • Update @ghsc/nshmp-web-utils dependency to latest version
  • Add input form under return period controls, modify the control-panel.component.html
  • Add iml to the control form interface (alphabetize)
  • Add iml to default values with value of null (alphabetize)
  • Add iml to query interface (alphabetize)
  • Add iml to formValues in effect: iml: query.iml ? Number.parseFloat(query.iml) : defaultValues.iml (alphabetize)
  • Keep as simple as possible, no logic to use the new form yet

This should be a simple input form:

Update to control-panel.component.html:

    <!-- IML Controls -->
    <div class="grid-row">
      <mat-form-field class="grid-col-12">
        <mat-label>Intensity Measure Level {{ (imlRange$ | async)?.units }}</mat-label>

        <input
          type="number"
          matInput
          [ngrxFormControlState]="formState?.controls?.iml"
          step="any"
          [min]="(imlRange$ | async)?.min"
          [max]="(imlRange$ | async)?.max"
        />

        <mat-error>
          [{{ (imlRange$ | async)?.min }}, {{ (imlRange$ | async)?.max }}]
        </mat-error>
      </mat-form-field>
    </div>

Updates to control-panel.component.ts:

 imlRange$ = combineLatest([this.facade.usage$, this.facade.controlForm$]).pipe(
    map(([usage, form]) => {
      if (usage && form) {
        return usage.response.iml.range[form.value.imt];
      } else {
        return null;
      }
    })
  );

See main issue for bigger picture: #93 (closed)