-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Adding no access state for Datasource tab based on permissions…
… given via GAC (#38268) ## Description - Today, when a user gives only View/Edit access to a Datasource, the schema tables are still being seen on the Datasource tabs while it doesn't show on the Datasource Editor page. This has been fixed with this PR. It should only be seen when Datasource has create action permissions, hence we show the "We can’t show the schema for this datasource" screen in this case. - When the user has not given View access to a Datasource, the UI is broken in Datasource tab. This has been fixed with this PR. We now show the No access state in this case. **BEFORE**: When view access is not given: <img width="1147" alt="Screenshot 2024-12-20 at 5 52 58 PM" src="https://github.com/user-attachments/assets/c1d1fd39-d6d3-4fd8-99bf-895698f61490" /> When create action permission is not given but view access is given: <img width="1138" alt="Screenshot 2024-12-20 at 5 54 10 PM" src="https://github.com/user-attachments/assets/abf0aa86-e541-4453-b7e4-071d123f7a60" /> **AFTER**: When view access is not given: <img width="1136" alt="Screenshot 2024-12-20 at 5 58 22 PM" src="https://github.com/user-attachments/assets/e160250b-963c-457e-81b1-380aef1332a1" /> When create action permission is not given but view access is given: <img width="1139" alt="Screenshot 2024-12-20 at 5 57 53 PM" src="https://github.com/user-attachments/assets/1967a657-622c-46f7-b6d4-78451b6106f0" /> Fixes [#38093](#38093) ## Automation /ok-to-test tags="@tag.Sanity, @tag.Datasource, @tag.IDE, @tag.JS, @tag.Git" ### 🔍 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/12452839374> > Commit: ee5bc17 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12452839374&attempt=3" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity, @tag.Datasource, @tag.IDE, @tag.JS, @tag.Git` > Spec: > <hr>Mon, 23 Dec 2024 08:29:06 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** - Introduced new icons and improved conditional rendering for datasource components. - Added a "not found" message for empty datasource options. - Enhanced user feedback with clearer messaging for missing resources. - **Bug Fixes** - Adjusted rendering logic to ensure edit buttons only appear when both conditions are met. - **Enhancements** - Improved permission checks and logic for managing datasource visibility. - Streamlined component logic for better readability and maintainability. - Enhanced error handling practices in saga functions. - **Tests** - Simplified test structure by removing unnecessary context providers. - **Chores** - Updated import statements and component names for consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
1 parent
e45cbdf
commit 5855115
Showing
17 changed files
with
215 additions
and
169 deletions.
There are no files selected for viewing
24 changes: 11 additions & 13 deletions
24
...tionEditor/components/PluginActionResponse/components/DatasourceTab/CurrentDataSource.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...src/PluginActionEditor/components/PluginActionResponse/components/DatasourceTab/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./Datasource"; | ||
export * from "./DatasourceTab"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.