Skip to content

Generate input fields for custom types in connected formsΒ #924

@chultquist

Description

@chultquist

Environment information

carl@Carls-MacBook-Pro ~/Devel/.../website (rel_20241010) npx ampx info
System:
  OS: macOS 14.6.1
  CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 1.10 GB / 32.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 22.4.1 - /usr/local/bin/node
  Yarn: undefined - undefined
  npm: 10.8.1 - /usr/local/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/auth-construct: 1.4.0
  @aws-amplify/backend: 1.6.0
  @aws-amplify/backend-auth: 1.3.0
  @aws-amplify/backend-cli: 1.4.0
  @aws-amplify/backend-data: 1.1.6
  @aws-amplify/backend-deployer: 1.1.6
  @aws-amplify/backend-function: 1.7.3
  @aws-amplify/backend-output-schemas: 1.4.0
  @aws-amplify/backend-output-storage: 1.1.3
  @aws-amplify/backend-secret: 1.1.4
  @aws-amplify/backend-storage: 1.2.2
  @aws-amplify/cli-core: 1.2.0
  @aws-amplify/client-config: 1.5.1
  @aws-amplify/deployed-backend-client: 1.4.2
  @aws-amplify/form-generator: 1.0.3
  @aws-amplify/model-generator: 1.0.8
  @aws-amplify/platform-core: 1.1.0
  @aws-amplify/plugin-types: 1.3.1
  @aws-amplify/sandbox: 1.2.4
  @aws-amplify/schema-generator: 1.2.5
  aws-amplify: 6.6.0
  aws-cdk: 2.165.0
  aws-cdk-lib: 2.165.0
  typescript: 5.5.4
AWS environment variables:
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Describe the feature

When generating connected forms using npx ampx generate forms, the resulting forms should include elements for custom types.

Use case

One of my models has a few custom types, for example:

  // Installation table
  Installation: a
    .model({
...
      // The location of the installation
      location: a.customType({
        lat: a.float(),
        lon: a.float(),
      }),

      // Fields required for Victron integration
      victronConfiguration: a.customType({
        installationId: a.string(),
        portalId: a.string(),
      }),

      // Solar PV plane configuration
      planes: a.ref('Plane').array(),

...


  // Solar plane definition
  Plane: a.customType({
    name: a.string(),
    azimuth: a.integer().required(),
    declination: a.integer().required(),
    kwp: a.float().required()
  }),

The connected forms generation is really helpful, except that it does not include form elements for custom types like the ones shown above. It would be really useful if it did. For arrays, what would be particularly handy is the ability to also add/remove elements from the array (see the "planes" element above).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtransferredIssue has been transferred from another Amplify repository

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions