mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-25 00:21:07 +02:00
* 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
37 lines
768 B
TypeScript
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,
|
|
};
|
|
}
|
|
}
|