vault/ui/app/utils/forms/field.ts
Vault Automation 80a5800c16
[UI] Ember Data Migration - LDAP Roles (#11196) (#11249)
* removes withConfig decorator and moves check to application route

* updates backendModel references in ldap engine to secretsEngine

* adds ldap config form class

* updates ldap config type in application route

* updates ldap configure and configuration routes to use api service

* adds capabilities service to ldap engine

* updates ldap mirage handler and scenario

* adds ldap capabilities constants and helper for fetching capabilities for roles

* updates ldap roles view to use api service

* updates ldap role details view to use api service

* updates ldap role create/edit views to use api service and form classes

* updates ldap role subdirectory view to use api service

* updates ldap role credentials view to use api service

Co-authored-by: Jordan Reimer <zofskeez@gmail.com>
2025-12-09 17:26:04 +00:00

51 lines
1.1 KiB
TypeScript

/**
* Copyright IBM Corp. 2016, 2025
* 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;
isSectionHeader?: boolean;
hideToggle?: boolean;
labelDisabled?: string;
mapToBoolean?: string;
isOppositeValue?: boolean;
defaultSubText?: string;
defaultShown?: string;
example?: string;
mode?: 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,
};
}
}