Skip to content

Conversation

akash-codemonk
Copy link
Contributor

Description

Deleting from the explorer doesn't update the widgets tab property. So doing the same as a special case for tabs in a tab widget in the delete widget saga.

Fixes #2885

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manually

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@@ -431,6 +432,23 @@ export function* deleteSaga(deleteAction: ReduxAction<WidgetDelete>) {
// SPECIAL HANDLING FOR TABS IN A TABS WIDGET
if (parent.type === WidgetTypes.TABS_WIDGET && widget.tabName) {
widgetName = widget.tabName;
// Deleting a tab from the explorer doesn't remove the same
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we ensure that we don't leak abstractions here? Technically, the WidgetOperationSaga should be agnostic to the widget being deleted. Since the tab widget has special handling, we should have a function called deleteWidget in the BaseWidget class with an empty implementation. If any widget requires a special handling, the specific widget should override it's implementation of the delete function to fire the specific event.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how would that work for deleting a widget from outside the widget context, in this case from the entity explorer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@riodeuno is there a good solution here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mohanarpit spoke to @riodeuno and since there is no good solution here and it needs some fundamental rearchitecting, we're merging this in

@akash-codemonk akash-codemonk requested a review from riodeuno March 1, 2021 08:01
@akash-codemonk akash-codemonk merged commit 39e4990 into release Mar 4, 2021
@akash-codemonk akash-codemonk deleted the fix/tab-widget-delete branch March 4, 2021 09:54
hetunandu added a commit that referenced this pull request Mar 4, 2021
hetunandu added a commit that referenced this pull request Mar 4, 2021
* Fix widget updates not working properly

* Revert "Fix: Deleting a tab from a tab widget from the explorer would not reflect in the canvas(#3218)"

This reverts commit 39e4990.
@hetunandu hetunandu restored the fix/tab-widget-delete branch March 4, 2021 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]Deletion of Tab from entity explorer is not working
3 participants