Repository: hashicorp/vault
File: ui/lib/core/addon/components/form-field.js (JavaScript)

Code before:
  constructor() {
    super(...arguments);
    const { attr, model } = this.args;
    const valuePath = attr.options?.fieldValue || attr.name;
    assert(
      'Form is attempting to modify an ID. Ember-data does not allow this.',
      valuePath.toLowerCase() !== 'id'
    );
    const modelValue = model[valuePath];
    this.showToggleTextInput = !!modelValue;
    this.toggleInputEnabled = !!modelValue;
  }

  // ---------------------------------------------------------------
  // IMPORTANT:
  // this controls the top-level logic in the associated template
  // to decide which type of form field to render (Vault or HDS)
  // ---------------------------------------------------------------
  //
  get isHdsFormField() {
    const { type, options } = this.args.attr;

    // here we replicate the logic in the template, to make sure we don't change the order in which the "ifs" are evaluated
    if (options?.possibleValues?.length > 0) {
      if (options?.editType === 'checkboxList') {
        return true;
      } else {
        // we still have to migrate the `radio` and `select` use cases
        return false;
      }
    } else {
      if (type === 'number' || type === 'string') {
        // here we will add the logic for `FormField` inputs (textarea, password, regular text input) that are "converted" to HDS fields
        // for example: if (options?.editType === 'textarea' || options?.editType === 'password') { return true; }
        return false;
      } else {
        // we leave these fields as they are (for now)
        return false;
      }
    }
  }

  get hasRadioSubText() {
    // for 'radio' editType, check to see if every of the possibleValues has a subText and label
    return this.args?.attr?.options?.possibleValues?.any((v) => v.subText);
  }

  get hideLabel() {
    const { type, options } = this.args.attr;
    if (type === 'boolean' || type === 'object' || options?.isSectionHeader) {
      return true;

Review comment (suggestion):
An aside, a good component to check for editType radio in this use case is during MFA. Navigate to `http://localhost:4200/ui/vault/access/mfa/methods/create?type=totp` and under Algorithm you'll see a radio with possibleValue 
![image](https://github.com/user-attachments/assets/566ed255-10ca-4a3a-ba0d-c2bf7a16a033)


Code after:
  constructor() {
    super(...arguments);
    const { attr, model } = this.args;
    const valuePath = attr.options?.fieldValue || attr.name;
    assert(
      'Form is attempting to modify an ID. Ember-data does not allow this.',
      valuePath.toLowerCase() !== 'id'
    );
    const modelValue = model[valuePath];
    this.showToggleTextInput = !!modelValue;
    this.toggleInputEnabled = !!modelValue;
  }

  // ---------------------------------------------------------------
  // IMPORTANT:
  // this controls the top-level logic in the associated template
  // to decide which type of form field to render (Vault or HDS)
  // ---------------------------------------------------------------
  //
  get isHdsFormField() {
    const { type, options } = this.args.attr;

    // here we replicate the logic in the template, to make sure we don't change the order in which the "ifs" are evaluated
    if (options?.possibleValues?.length > 0) {
      // we still have to migrate the `radio` use case
      if (options?.editType === 'radio') {
        return false;
      } else {
        return true;
      }
    } else {
      if (type === 'number' || type === 'string') {
        // here we will add the logic for `FormField` inputs (textarea, password, regular text input) that are "converted" to HDS fields
        // for example: if (options?.editType === 'textarea' || options?.editType === 'password') { return true; }
        return false;
      } else {
        // we leave these fields as they are (for now)
        return false;
      }
    }
  }

  get hasRadioSubText() {
    // for 'radio' editType, check to see if every of the possibleValues has a subText and label
    return this.args?.attr?.options?.possibleValues?.any((v) => v.subText);
  }

  get hideLabel() {
    const { type, options } = this.args.attr;
    if (type === 'boolean' || type === 'object' || options?.isSectionHeader) {
      return true;