diff --git a/web/package.json b/web/package.json index a7d31ebb34..48f29b05e0 100644 --- a/web/package.json +++ b/web/package.json @@ -14,8 +14,8 @@ "build": "run-s build-locales esbuild:build", "build-proxy": "run-s build-locales esbuild:build-proxy", "watch": "run-s build-locales esbuild:watch", - "lint": "cross-env NODE_OPTIONS='--max_old_space_size=16384' eslint . --max-warnings 0 --fix", - "lint:precommit": "cross-env NODE_OPTIONS='--max_old_space_size=16384' node scripts/eslint-precommit.mjs", + "lint": "cross-env NODE_OPTIONS='--max_old_space_size=65536' eslint . --max-warnings 0 --fix", + "lint:precommit": "cross-env NODE_OPTIONS='--max_old_space_size=65536' node scripts/eslint-precommit.mjs", "lint:spelling": "node scripts/check-spelling.mjs", "lit-analyse": "lit-analyzer src", "precommit": "npm-run-all --parallel tsc lit-analyse lint:spelling --sequential lint:precommit prettier", diff --git a/web/src/admin/stages/prompt/PromptForm.ts b/web/src/admin/stages/prompt/PromptForm.ts index 386ae7004f..234d0a8bb0 100644 --- a/web/src/admin/stages/prompt/PromptForm.ts +++ b/web/src/admin/stages/prompt/PromptForm.ts @@ -11,6 +11,7 @@ import { msg } from "@lit/localize"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement, state } from "lit/decorators.js"; import { ifDefined } from "lit/directives/if-defined.js"; +import { map } from "lit/directives/map.js"; import PFTitle from "@patternfly/patternfly/components/Title/title.css"; import PFGrid from "@patternfly/patternfly/layouts/Grid/grid.css"; @@ -121,120 +122,35 @@ export class PromptForm extends ModelForm { } renderTypes(): TemplateResult { - return html` - - - - - - - - - - - - - - - - - - - `; + // prettier-ignore + const promptTypesWithLabels = [ + [PromptTypeEnum.Text, msg("Text: Simple Text input")], + [PromptTypeEnum.TextArea, msg("Text Area: Multiline text input")], + [PromptTypeEnum.TextReadOnly, msg("Text (read-only): Simple Text input, but cannot be edited.")], + [PromptTypeEnum.TextAreaReadOnly, msg("Text Area (read-only): Multiline text input, but cannot be edited.")], + [PromptTypeEnum.Username, msg("Username: Same as Text input, but checks for and prevents duplicate usernames.")], + [PromptTypeEnum.Email, msg("Email: Text field with Email type.")], + [PromptTypeEnum.Password, msg("Password: Masked input, multiple inputs of this type on the same prompt need to be identical.")], + [PromptTypeEnum.Number, msg("Number")], + [PromptTypeEnum.Checkbox, msg("Checkbox")], + [PromptTypeEnum.RadioButtonGroup, msg("Radio Button Group (fixed choice)")], + [PromptTypeEnum.Dropdown, msg("Dropdown (fixed choice)")], + [PromptTypeEnum.Date, msg("Date")], + [PromptTypeEnum.DateTime, msg("Date Time")], + [PromptTypeEnum.File, msg("File")], + [PromptTypeEnum.Separator, msg("Separator: Static Separator Line")], + [PromptTypeEnum.Hidden, msg("Hidden: Hidden field, can be used to insert data into form.")], + [PromptTypeEnum.Static, msg("Static: Static value, displayed as-is.")], + [PromptTypeEnum.AkLocale, msg("authentik: Locale: Displays a list of locales authentik supports.")], + ]; + const currentType = this.instance?.type; + return html` ${map( + promptTypesWithLabels, + ([promptType, label]) => + html``, + )}`; } renderForm(): TemplateResult {