vault/ui/app/utils/forms/field.ts
Jordan Reimer 863ab9408c
[UI] Ember Data Migration - Auth Method Enable (#31394)
* adds form for auth method and updates mount backend form to use it

* fixes tests
2025-08-01 08:54:41 -06:00

42 lines
897 B
TypeScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
export interface FieldOptions {
label?: string;
subText?: string;
fieldValue?: string;
editType?: string;
defaultValue?: unknown;
possibleValues?: unknown[];
allowWhiteSpace?: boolean;
isSingleRow?: boolean;
keyPlaceholder?: string;
valuePlaceholder?: string;
editDisabled?: boolean;
sensitive?: boolean;
noCopy?: boolean;
docLink?: string;
helpText?: string;
helperTextDisabled?: string;
helperTextEnabled?: string;
placeholder?: string;
noDefault?: boolean;
}
export default class FormField {
name = '';
type: string | undefined;
options: FieldOptions = {};
constructor(key: string, type?: string, options: FieldOptions = {}) {
this.name = key;
this.type = type;
this.options = {
...options,
fieldValue: options.fieldValue || key,
};
}
}