-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Reverting Anvil currently open modal state implementation (#33067)
[![workerB](https://img.shields.io/endpoint?url=https%3A%2F%2Fworkerb.linearb.io%2Fv2%2Fbadge%2Fprivate%2FU2FsdGVkX1p4H4db8lSv1xTwGoYFAZnRwWdBNC5Y%2Fcollaboration.svg%3FcacheSeconds%3D60)](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=MA2NqRe) ## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ In #33040 we added a state exclusively to capture modals that are opened/closed to avoid computing which modal is open based on meta state. However the problem with this approach that I had understood after testing it with deployed apps is that closing a modal is not done only via the saga, but is done via actions and the modal itself without dispatching the common saga. Obviously the above implementation dunked. Reverting to the previous implementation of relying on meta state to select visible detached widgets. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!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.Anvil" ### 🔍 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/8895170744> > Commit: 517ffc6 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8895170744&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 - [ ] No
- Loading branch information
Showing
12 changed files
with
28 additions
and
125 deletions.
There are no files selected for viewing
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
1 change: 1 addition & 0 deletions
1
app/client/src/layoutSystems/anvil/editor/canvasArenas/styles.module.css
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
21 changes: 0 additions & 21 deletions
21
app/client/src/layoutSystems/anvil/integrations/actions/detachedWidgetActions.ts
This file was deleted.
Oops, something went wrong.
12 changes: 11 additions & 1 deletion
12
app/client/src/layoutSystems/anvil/integrations/modalSelectors.ts
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,5 +1,15 @@ | ||
import type { AppState } from "@appsmith/reducers"; | ||
import { getAllDetachedWidgetIds, getWidgetsMeta } from "sagas/selectors"; | ||
|
||
export const getCurrentlyOpenAnvilDetachedWidgets = (state: AppState) => { | ||
return state.ui.anvilDetachedWidgets.currentlyOpenDetachedWidgets; | ||
const allExistingDetachedWidgets = getAllDetachedWidgetIds(state); | ||
if (allExistingDetachedWidgets.length === 0) { | ||
return []; | ||
} | ||
const metaWidgets = getWidgetsMeta(state); | ||
const currentlyOpenWidgets = allExistingDetachedWidgets.filter((modalId) => { | ||
const modal = metaWidgets[modalId]; | ||
return modal && modal.isVisible; | ||
}); | ||
return currentlyOpenWidgets; | ||
}; |
36 changes: 0 additions & 36 deletions
36
app/client/src/layoutSystems/anvil/integrations/reducers/anvilDetachedWidgetsReducer.ts
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
app/client/src/layoutSystems/anvil/integrations/sagas/anvilDetachedWidgetSagas.ts
This file was deleted.
Oops, something went wrong.
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
10 changes: 0 additions & 10 deletions
10
app/client/src/layoutSystems/anvil/integrations/sagas/utils.ts
This file was deleted.
Oops, something went wrong.
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