Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate input fields for custom types in connected forms #917

Open
chultquist opened this issue Dec 12, 2024 · 1 comment
Open

Generate input fields for custom types in connected forms #917

chultquist opened this issue Dec 12, 2024 · 1 comment
Labels
Gen 2 pending-triage Issues that need further discussion to determine transferred Issue has been transferred from another Amplify repository

Comments

@chultquist
Copy link

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).

@chultquist chultquist added the pending-triage Issues that need further discussion to determine label Dec 12, 2024
@ykethan
Copy link
Member

ykethan commented Dec 12, 2024

Hey,👋 thanks for raising this! I'm going to transfer this over to our codegen repository for better assistance 🙂

@ykethan ykethan transferred this issue from aws-amplify/amplify-backend Dec 12, 2024
@ykethan ykethan added transferred Issue has been transferred from another Amplify repository Gen 2 labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gen 2 pending-triage Issues that need further discussion to determine transferred Issue has been transferred from another Amplify repository
Projects
None yet
Development

No branches or pull requests

2 participants