-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[Feature]: Add currentPageName, workspaceName and appName to appsmith context object #38046
Comments
We want to add the current environment variable as well to this. |
@Nikhil-Nandagopal Created separate feature request for environment variable as making changes in current Pr was causing cyclic dependency issues of dependencies and we may need to do CE and EE split to resolve this. Taking it up separately as it has its own complexities. #38306 |
#38114) ## Description Add currentPageName, AppName and workspace name to appsmith context object Fixes #38046 ## Automation /ok-to-test tags="@tag.JS" ### 🔍 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/12462985063> > Commit: eec4292 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12462985063&attempt=2" target="_blank">Cypress dashboard</a>. > Tags: `@tag.JS` > Spec: > <hr>Mon, 23 Dec 2024 09:14:06 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced `AppsmithEntity` interface with new properties: `currentPageName`, `workspaceName`, and `appName`. - Updated `getUnevaluatedDataTree` selector to accept additional parameters, providing more contextual information about the current application state. - Introduced a new internal selector to retrieve the current page's name. - **Bug Fixes** - Adjusted expected hint text in autocomplete tests for JavaScript objects to align with updated behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: “sneha122” <“sneha@appsmith.com”>
#38114) ## Description Add currentPageName, AppName and workspace name to appsmith context object Fixes #38046 ## Automation /ok-to-test tags="@tag.JS" ### 🔍 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/12462985063> > Commit: eec4292 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12462985063&attempt=2" target="_blank">Cypress dashboard</a>. > Tags: `@tag.JS` > Spec: > <hr>Mon, 23 Dec 2024 09:14:06 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced `AppsmithEntity` interface with new properties: `currentPageName`, `workspaceName`, and `appName`. - Updated `getUnevaluatedDataTree` selector to accept additional parameters, providing more contextual information about the current application state. - Introduced a new internal selector to retrieve the current page's name. - **Bug Fixes** - Adjusted expected hint text in autocomplete tests for JavaScript objects to align with updated behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: “sneha122” <“sneha@appsmith.com”>
Is there an existing issue for this?
Summary
The following information should be accessible as properties under the Appsmith namespace.
Workspace name
App name
Page name
For example {{ appsmith.currentPageName }} (or similar) should return the name of the page the function is called on.
Why should this be worked on?
Why should this be worked on?
This allows for scripting to be written without knowing what page it will end up on. For example we have a script that uses navigateTo() to navigate to the same page the user is already on and update the query parameters. This works great, but we have to tweak it for each page or refer to a variable in a JSObject that has the page's name. If we could programmatically collect the page's name, then we could copy that script to each of our pages without having to edit it.
Workspace name is also very useful as many users use it as a kind of test/production environment split, If you could write scripts that notice that you are in a specific workspace, you could cause certain things to function differently if you are in test mode or production mode.
The text was updated successfully, but these errors were encountered: