src/app/features/public-form/public-form-format-warning/public-form-format-warning.component.ts

Description

Warn admins that a public form is stored in the multi form format, which the fields of this admin view cannot represent.

The form keeps working for the people filling it in, only its configuration has to be changed elsewhere until the admin UI supports the format.

Example

Metadata

Relationships

Used by

No results matching.

Depends on

Index

Properties
Inputs

Inputs

entity
Type : Entity

the entity being edited (PublicFormConfig)

Properties

Readonly isMultiFormConfig
Type : unknown
Default value : computed( () => !!(this.entity() as PublicFormConfig | undefined)?.forms?.length, )
import {
  ChangeDetectionStrategy,
  Component,
  computed,
  input,
} from "@angular/core";
import { Entity } from "app/core/entity/model/entity";
import { HintBoxComponent } from "app/core/common-components/hint-box/hint-box.component";
import { PublicFormConfig } from "../public-form-config";

/**
 * Warn admins that a public form is stored in the multi form format,
 * which the fields of this admin view cannot represent.
 *
 * The form keeps working for the people filling it in, only its configuration
 * has to be changed elsewhere until the admin UI supports the format.
 */
@Component({
  changeDetection: ChangeDetectionStrategy.OnPush,
  selector: "app-public-form-format-warning",
  templateUrl: "./public-form-format-warning.component.html",
  imports: [HintBoxComponent],
})
export class PublicFormFormatWarningComponent {
  /** the entity being edited (PublicFormConfig) */
  entity = input<Entity>();

  readonly isMultiFormConfig = computed(
    () => !!(this.entity() as PublicFormConfig | undefined)?.forms?.length,
  );
}
@if (isMultiFormConfig()) {
  <app-hint-box type="warning" class="margin-bottom-regular">
    <div>
      <strong i18n>This form uses the newer multi-step format</strong>
      <p i18n>
        Forms that create several records at once cannot be configured here yet.
        The form itself keeps working for the people filling it in, but the
        fields below do not show its actual setup and saving this page can break
        it. Please contact your technical support team if you need changes.
      </p>
    </div>
  </app-hint-box>
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""