vault/ui/app/utils/forms/field.ts
Jordan Reimer 771d8c6e7f
[UI] Ember Data Migration - Sync Destination Create/Edit (#30620)
* adds field group support to forms

* adds forms for sync destination types

* adds type for sync destination form

* adds readonlyParams to sync-destinations helper and error handling to findDestination util

* updates sync destinations create/edit routes to use forms

* updates sync create-and-edit component to use form class and api service

* updates sync destinations tests
2025-05-14 20:00:28 -06:00

37 lines
768 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;
}
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,
};
}
}