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

fix: Show loading state of application until all jsobject update calls are complete #33545

Merged
merged 10 commits into from
May 24, 2024

Conversation

dvj1988
Copy link
Contributor

@dvj1988 dvj1988 commented May 17, 2024

Description

Show loader when the jsobject update is ongoing. The loader should start showing when the body update starts and it should end when the actions update is complete.

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

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.All"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9218512788
Commit: abccd2e
Cypress dashboard url: Click here!

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

@github-actions github-actions bot added the Bug Something isn't working label May 17, 2024
@dvj1988 dvj1988 added the ok-to-test Required label for CI label May 17, 2024
@dvj1988 dvj1988 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 17, 2024
@dvj1988
Copy link
Contributor Author

dvj1988 commented May 17, 2024

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9125033210.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 33545.
recreate: .

Copy link

Deploy-Preview-URL: https://ce-33545.dp.appsmith.com

@trishaanand trishaanand removed the ok-to-test Required label for CI label May 20, 2024
@trishaanand
Copy link
Contributor

Previous test run :
Caution

🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9124918410
Commit: 2379d2b
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC1_spec.ts
cypress/e2e/Regression/ClientSide/Autocomplete/JS_AC2_spec.ts
cypress/e2e/Regression/ClientSide/BugTests/JSParse_Spec.ts
cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts
cypress/e2e/Regression/ClientSide/SettingsPane/EmbedSettings_spec.ts
cypress/e2e/Regression/ClientSide/VisualTests/JSEditorIndent_spec.js
To know the list of identified flaky tests - Refer here

@trishaanand trishaanand added the ok-to-test Required label for CI label May 20, 2024
@dvj1988 dvj1988 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 21, 2024
@dvj1988
Copy link
Contributor Author

dvj1988 commented May 21, 2024

Previous test run :

🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9167792219
Commit: 983bbab
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts
cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters1_spec.ts
To know the list of identified flaky tests - Refer here

@dvj1988 dvj1988 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 21, 2024
@dvj1988
Copy link
Contributor Author

dvj1988 commented May 22, 2024

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9188651630.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 33545.
recreate: .

Copy link

Deploy-Preview-URL: https://ce-33545.dp.appsmith.com

@dvj1988 dvj1988 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 22, 2024
@dvj1988
Copy link
Contributor Author

dvj1988 commented May 22, 2024

/build-deploy-preview skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9189051494.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 33545.
recreate: .

Copy link

Deploy-Preview-URL: https://ce-33545.dp.appsmith.com

@dvj1988
Copy link
Contributor Author

dvj1988 commented May 22, 2024

The following are new failures, please fix them before merging the PR:

cypress/e2e/Regression/ClientSide/BugTests/GitBugs_Spec.ts
cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js

@dvj1988 dvj1988 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 22, 2024
@dvj1988 dvj1988 marked this pull request as ready for review May 23, 2024 02:49
@dvj1988 dvj1988 requested a review from ayushpahwa as a code owner May 23, 2024 02:49
Copy link
Contributor

coderabbitai bot commented May 23, 2024

Walkthrough

The changes primarily focus on enhancing the handling of JavaScript collection actions within the application. This involves removing deprecated functions, adding new ones to manage save actions, updating constants, and modifying selectors and reducers to support the new save status functionality. The overall goal is to ensure that the save status for JS objects is accurately reflected in the UI during updates.

Changes

File Path Change Summary
app/client/src/actions/jsPaneActions.ts Removed updateJSCollection, added jsSaveActionStart and jsSaveActionComplete, repositioned updateJSCollectionBody.
app/client/src/ce/constants/ReduxActionConstants.tsx Removed UPDATE_JS_ACTION_INIT, added JS_ACTION_SAVE_START and JS_ACTION_SAVE_COMPLETE.
app/client/src/ce/selectors/entitiesSelector.ts Converted getApiPaneSavingMap to an exported function.
app/client/src/reducers/uiReducers/jsPaneReducer.ts Renamed action types and adjusted handling of saving and dirty states for JS actions.
app/client/src/sagas/ActionSagas.ts Replaced UPDATE_JS_ACTION_BODY_SUCCESS with EXECUTE_JS_UPDATES in updateEntitySavingStatus.
app/client/src/sagas/JSPaneSagas.ts Added getCurrentLayoutId, jsSaveActionComplete, and jsSaveActionStart, removed refactorJSCollectionAction, refactored handleRefactorJSActionNameSaga.
app/client/src/selectors/editorSelectors.tsx Refactored getIsPageSaving to use createSelector, updated getCurrentLayoutId to define return type explicitly.
app/client/src/utils/JSPaneUtils.tsx Added JSCollectionDifference interface, modified getDifferenceInJSCollection to return JSCollectionDifference.

Assessment against linked issues

Objective Addressed Explanation
Show loader when the JS object update is ongoing (#4209)
Loader should start showing when the body update starts and end when the actions update is complete (#4209)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dvj1988 dvj1988 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 23, 2024
@dvj1988 dvj1988 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 24, 2024
@dvj1988 dvj1988 merged commit b6c506d into release May 24, 2024
82 checks passed
@dvj1988 dvj1988 deleted the fix/js-object-save-status branch May 24, 2024 06:19
trishaanand pushed a commit that referenced this pull request Jun 13, 2024
## Description
PR #33545 removed the action `REFACTOR_JS_ACTION_NAME` and called the
saga `handleRefactorJSActionNameSaga` directly. This caused a regression
in the refactor of functions in js modules. This PR reverts this code.

Fixes #34148

## Automation

/ok-to-test tags="@tag.All"

### 🔍 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/9494201779>
> Commit: 3b7c67d
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9494201779&attempt=1"
target="_blank">Click here!</a>

<!-- 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**
- Added new actions for refactoring JavaScript collections to improve
management and updating of JS collections in the application.

- **Refactor**
- Simplified dummy JavaScript functions, removing comments and
unnecessary code to streamline function bodies.
  - Updated variable initialization values for cleaner code.

- **Tests**
- Updated network status assertions for JS collections in test scripts.
- Switched test specifications in the Cypress test suite to ensure
better coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
dvj1988 added a commit that referenced this pull request Jun 13, 2024
PR #33545 removed the action `REFACTOR_JS_ACTION_NAME` and called the
saga `handleRefactorJSActionNameSaga` directly. This caused a regression
in the refactor of functions in js modules. This PR reverts this code.

Fixes #34148

/ok-to-test tags="@tag.All"

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9494201779>
> Commit: 3b7c67d
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9494201779&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->

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

- **New Features**
- Added new actions for refactoring JavaScript collections to improve
management and updating of JS collections in the application.

- **Refactor**
- Simplified dummy JavaScript functions, removing comments and
unnecessary code to streamline function bodies.
  - Updated variable initialization values for cleaner code.

- **Tests**
- Updated network status assertions for JS collections in test scripts.
- Switched test specifications in the Cypress test suite to ensure
better coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working ok-to-test Required label for CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants