Kaizen
Browse modulesFormsforms/sharedFunctions

Function: isFirstStep()

function isFirstStep(step: {
  description: string | null;
  fields: {
     additionalInfo?: {
        body?: string;
        title?: string;
     };
     adoptionStatement?: string;
     allowedFonts?: string[];
     asset?: {
        alt?: string;
        fileId?: string;
        filename?: string;
        mimeType?: string;
        url?: string;
     };
     dataSource?: string;
     defaultValue?:   | string
        | {
        from: string;
        to: string | null;
      };
     description?: string;
     fields?: {
        additionalInfo?: {
           body?: string;
           title?: string;
        };
        adoptionStatement?: string;
        allowedFonts?: string[];
        asset?: {
           alt?: string;
           fileId?: string;
           filename?: string;
           mimeType?: string;
           url?: string;
        };
        dataSource?: string;
        defaultValue?:   | string
           | {
           from: string;
           to: string | null;
         };
        description?: string;
        format?: string;
        label: string;
        maxDate?: string;
        maxFiles?: number;
        maxLength?: number;
        minDate?: string;
        name: string;
        options?: (
           | string
           | {
           description?: ... | ...;
           value: string;
        })[];
        placeholder?: string;
        prefillFrom?: string;
        required: boolean;
        showRange?: boolean;
        showTime?: boolean;
        signatureMode?: "typed" | "drawn";
        timezone?: string;
        type:   | "number"
           | "date"
           | "file"
           | "email"
           | "url"
           | "select"
           | "text"
           | "checkbox"
           | "textarea"
           | "phone"
           | "radio-group"
           | "multiselect"
           | "field-array"
           | "image"
           | "file-download"
           | "section-header"
           | "section-unset"
           | "signature"
           | "signature-adopted";
     }[];
     format?: string;
     label: string;
     maxDate?: string;
     maxFiles?: number;
     maxLength?: number;
     maxRows?: number;
     minDate?: string;
     minRows?: number;
     name: string;
     options?: (
        | string
        | {
        description?: string;
        value: string;
     })[];
     placeholder?: string;
     prefillFrom?: string;
     required: boolean;
     showRange?: boolean;
     showTime?: boolean;
     signatureMode?: "typed" | "drawn";
     timezone?: string;
     type:   | "number"
        | "date"
        | "file"
        | "email"
        | "url"
        | "select"
        | "text"
        | "checkbox"
        | "textarea"
        | "phone"
        | "radio-group"
        | "multiselect"
        | "field-array"
        | "image"
        | "file-download"
        | "section-header"
        | "section-unset"
        | "signature"
        | "signature-adopted";
  }[];
  formSchemaVersionId: string;
  id: string;
  key: string;
  label: string | null;
}, transitions: {
  fromStepId: string;
  id: string;
  label: string | null;
  priority: number;
  ruleId: string | null;
  ruleVersionId: string | null;
  toStepId: string;
}[]): boolean;

Defined in: shared/forms/dag.ts:203

Given a step and a list of transitions, return true if the step is the first step in the form (i.e., this step does not transition from any other step)

NOTE: This is likely a superset of steps since this could be true for steps that are effectively orphaned, but it's a useful convenience function in any case.

Parameters

ParameterType
step{ description: string | null; fields: { additionalInfo?: { body?: string; title?: string; }; adoptionStatement?: string; allowedFonts?: string[]; asset?: { alt?: string; fileId?: string; filename?: string; mimeType?: string; url?: string; }; dataSource?: string; defaultValue?: | string | { from: string; to: string | null; }; description?: string; fields?: { additionalInfo?: { body?: string; title?: string; }; adoptionStatement?: string; allowedFonts?: string[]; asset?: { alt?: string; fileId?: string; filename?: string; mimeType?: string; url?: string; }; dataSource?: string; defaultValue?: | string | { from: string; to: string | null; }; description?: string; format?: string; label: string; maxDate?: string; maxFiles?: number; maxLength?: number; minDate?: string; name: string; options?: ( | string | { description?: ... | ...; value: string; })[]; placeholder?: string; prefillFrom?: string; required: boolean; showRange?: boolean; showTime?: boolean; signatureMode?: "typed" | "drawn"; timezone?: string; type: | "number" | "date" | "file" | "email" | "url" | "select" | "text" | "checkbox" | "textarea" | "phone" | "radio-group" | "multiselect" | "field-array" | "image" | "file-download" | "section-header" | "section-unset" | "signature" | "signature-adopted"; }[]; format?: string; label: string; maxDate?: string; maxFiles?: number; maxLength?: number; maxRows?: number; minDate?: string; minRows?: number; name: string; options?: ( | string | { description?: string; value: string; })[]; placeholder?: string; prefillFrom?: string; required: boolean; showRange?: boolean; showTime?: boolean; signatureMode?: "typed" | "drawn"; timezone?: string; type: | "number" | "date" | "file" | "email" | "url" | "select" | "text" | "checkbox" | "textarea" | "phone" | "radio-group" | "multiselect" | "field-array" | "image" | "file-download" | "section-header" | "section-unset" | "signature" | "signature-adopted"; }[]; formSchemaVersionId: string; id: string; key: string; label: string | null; }
step.descriptionstring | null
step.fields{ additionalInfo?: { body?: string; title?: string; }; adoptionStatement?: string; allowedFonts?: string[]; asset?: { alt?: string; fileId?: string; filename?: string; mimeType?: string; url?: string; }; dataSource?: string; defaultValue?: | string | { from: string; to: string | null; }; description?: string; fields?: { additionalInfo?: { body?: string; title?: string; }; adoptionStatement?: string; allowedFonts?: string[]; asset?: { alt?: string; fileId?: string; filename?: string; mimeType?: string; url?: string; }; dataSource?: string; defaultValue?: | string | { from: string; to: string | null; }; description?: string; format?: string; label: string; maxDate?: string; maxFiles?: number; maxLength?: number; minDate?: string; name: string; options?: ( | string | { description?: ... | ...; value: string; })[]; placeholder?: string; prefillFrom?: string; required: boolean; showRange?: boolean; showTime?: boolean; signatureMode?: "typed" | "drawn"; timezone?: string; type: | "number" | "date" | "file" | "email" | "url" | "select" | "text" | "checkbox" | "textarea" | "phone" | "radio-group" | "multiselect" | "field-array" | "image" | "file-download" | "section-header" | "section-unset" | "signature" | "signature-adopted"; }[]; format?: string; label: string; maxDate?: string; maxFiles?: number; maxLength?: number; maxRows?: number; minDate?: string; minRows?: number; name: string; options?: ( | string | { description?: string; value: string; })[]; placeholder?: string; prefillFrom?: string; required: boolean; showRange?: boolean; showTime?: boolean; signatureMode?: "typed" | "drawn"; timezone?: string; type: | "number" | "date" | "file" | "email" | "url" | "select" | "text" | "checkbox" | "textarea" | "phone" | "radio-group" | "multiselect" | "field-array" | "image" | "file-download" | "section-header" | "section-unset" | "signature" | "signature-adopted"; }[]
step.formSchemaVersionIdstring
step.idstring
step.keystring
step.labelstring | null
transitions{ fromStepId: string; id: string; label: string | null; priority: number; ruleId: string | null; ruleVersionId: string | null; toStepId: string; }[]

Returns

boolean

On this page