PromucFlow_constructor/app/client
Jacques Ikot bda1aa4b58
fix: JSON form generate form flow broken for tables without primaryKey and READ_WRITE permissions (#40275)
### 🧩 Problem

- Tables **without primary keys** were previously selectable in the form
generator, leading to issues with data operations that require unique
identifiers.
- **Snowflake datasources** defaulted to `READ_ONLY` mode, unnecessarily
limiting users from performing query generation operations.

---

###  Solution

- Disabled selection of tables that **lack primary keys** in the form
generator dropdown.
- Added **tooltips and helper text** to explain why certain tables are
disabled.
- Updated the **Snowflake query generator** to default to `READ_WRITE`
mode.
- Improved UI components to:
  - Gracefully handle disabled options  
  - Clearly communicate restrictions to users

---

### 💡 Why This Solution Works

- Prevents users from selecting **invalid or unsuitable tables**,
reducing runtime errors.
- Improves the **user experience** through helpful visual cues and
explanations.
- Aligns Snowflake’s behavior with user expectations for **write
capabilities**.
- Maintains **backward compatibility** for both new and existing
configurations.


Fixes - https://github.com/appsmithorg/appsmith-ee/issues/6913

## Automation

/ok-to-test tags="@tag.JSONForm, @tag.PropertyPane, @tag.GenerateCRUD,
@tag.Datasource, @tag.Sanity, @tag.Widget"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/14510160658>
> Commit: 380e8515ae5ba4ad737c8e41f2678eb43dce22ea
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14510160658&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.JSONForm, @tag.PropertyPane, @tag.GenerateCRUD,
@tag.Datasource, @tag.Sanity, @tag.Widget`
> Spec:
> <hr>Thu, 17 Apr 2025 08:51:45 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Dropdown options now visually indicate when a table lacks primary
keys, disabling selection and displaying an explanatory message.
- An informational message about primary key requirements is shown below
the table selection dropdown.
- Dropdown options can now display additional subtext for improved
context.
- **Enhancements**
- Improved handling of datasource-specific behaviors, including support
for MongoDB and Google Sheets.
	- Added connection mode detection for Snowflake datasources.
- **Chores**
- Added new utility functions and constants to support enhanced dropdown
behavior and messaging.
- **Tests**
- Added tests to verify connection mode detection for Snowflake
datasources.
- Added comprehensive tests for datasource-specific dropdown option
behavior in the table/spreadsheet selector.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-04-24 03:57:03 -07:00
..
.husky
.yarn
config fix: sourcemaps (#39301) 2025-02-16 20:05:50 +03:00
cypress ci: Fixing the page actions spec (#40328) 2025-04-22 11:35:14 +05:30
docker/templates chore: add grafana faro sdk (CE) (#38301) 2024-12-26 10:37:41 +05:30
generators
packages chore: Adjust WDS accent subtle (#40353) 2025-04-24 10:06:34 +02:00
public chore: add maximum-scale to avoid zoom on inputs in iOS (#40171) 2025-04-08 19:16:31 +05:30
scripts chore: Eject CRA (#39264) 2025-02-14 14:24:41 +05:30
src fix: JSON form generate form flow broken for tables without primaryKey and READ_WRITE permissions (#40275) 2025-04-24 03:57:03 -07:00
test chore: Removing feature flag for app IDE new entity explorer (#39912) 2025-04-03 12:07:24 +05:30
typings
.babelrc chore: Eject CRA (#39264) 2025-02-14 14:24:41 +05:30
.dockerignore
.editorconfig
.eslintrc.base.json feat: add react-compiler eslint plugin (#37139) 2024-10-31 16:40:18 +01:00
.eslintrc.js
.fork-ts-checkerrc
.gitignore
.lintstagedrc.json
.nvmrc
.prettierignore
.prettierrc
.sentryclirc
.yarnrc.yml
build.sh fix: sourcemaps (#39301) 2025-02-16 20:05:50 +03:00
cypress_ci_custom.config.ts
cypress_ci_hosted.config.ts
cypress_ci.config.ts
cypress-add-tags.js
cypress.config.ts
download-assets.js
jest.config.js chore: add grafana faro sdk (CE) (#38301) 2024-12-26 10:37:41 +05:30
knip.json chore: Eject CRA (#39264) 2025-02-14 14:24:41 +05:30
package.json fix: storybook build and small improvements for stories (#39936) 2025-03-26 18:04:30 +03:00
README.md
README.old.md
start-caddy.sh
start-https.sh chore: convert consolidated api etag to a weak one (#38939) 2025-01-31 16:35:20 +05:30
tailwind.config.js
tsconfig.json
tsconfig.path.json
vercel.json
yarn.lock chore: ab test simple git reset in git status api (#39959) 2025-04-01 21:36:08 +05:30

Appsmith Client

This project was bootstrapped with Create React App.

For details on setting up your development machine, please refer to the Setup Guide