vault/ui/app/forms/transform/role.ts
Vault Automation 1779d0b264
Backport [UI] Ember Data Migration - Transform Role and Transformation views | VAULT-45708 | VAULT-45709 into ce/main (#15234)
* 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>
2026-06-05 22:28:33 +05:30

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.' }],
};
}