mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-27 10:00:32 -04:00
* no-op commit * migrates transform role and transformation views * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * fixed failing tests and updated query selectors --------- Co-authored-by: Mohit Ojha <mohit.ojha@hashicorp.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
35 lines
970 B
TypeScript
35 lines
970 B
TypeScript
/**
|
|
* Copyright IBM Corp. 2016, 2026
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Form from 'vault/forms/form';
|
|
import FormField from 'vault/utils/forms/field';
|
|
import type { Validations } from 'vault/app-types';
|
|
|
|
type RoleData = {
|
|
name?: string;
|
|
transformations?: string[];
|
|
backend?: string;
|
|
};
|
|
|
|
export default class RoleForm extends Form<RoleData> {
|
|
idPrefix = 'role/';
|
|
|
|
formFields = [
|
|
new FormField('name', 'string', {
|
|
editDisabled: true,
|
|
subText: 'The name for your role. This cannot be edited later.',
|
|
}),
|
|
new FormField('transformations', 'array', {
|
|
isSectionHeader: true,
|
|
label: 'Transformations',
|
|
subText: 'Select which transformations this role will have access to. It must already exist.',
|
|
}),
|
|
];
|
|
|
|
validations: Validations = {
|
|
name: [{ type: 'presence', message: 'Name is required.' }],
|
|
transformations: [{ type: 'presence', message: 'At least one transformation is required.' }],
|
|
};
|
|
}
|