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

CB-4401 feat: save value panel state per column #2272

Merged
merged 4 commits into from
Jan 11, 2024

Conversation

Wroud
Copy link
Member

@Wroud Wroud commented Jan 4, 2024

No description provided.

@Wroud Wroud self-assigned this Jan 4, 2024
setCurrentTabId(firstTabId);
lastTabId.current = firstTabId;
}
if (displayed.length > 0 && (!currentTabId || !displayed.some(tab => tab.key === currentTabId))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

const hasCurrentTabCells = currentTabId && displayed.some(tab => tab.key === currentTabId) 

if (displayed.length > 0 && !hasCurrentTabCells)

Copy link
Member Author

Choose a reason for hiding this comment

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

thank you, changed

@@ -166,27 +161,40 @@ export const TextValuePresentation: TabContainerPanelComponent<IDataValuePanelPr
}
}

let currentContentType = state.currentContentType;

if (activeTabs.length > 0 && !activeTabs.some(tab => tab.key === currentContentType)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for first condition

Copy link
Member Author

Choose a reason for hiding this comment

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

actually needed because some() acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns false for any condition.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some

@Wroud Wroud merged commit b0586e7 into devel Jan 11, 2024
3 of 4 checks passed
@Wroud Wroud deleted the feat/cb-4401/save-value-pannel-state-per-column branch January 11, 2024 11:53
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.

4 participants