fix: WDS widgets not showing up in Air gapped instances. (#33035)
[](https://workerb.linearb.io/v2/badge/collaboration-page?magicLinkId=MfLLKnB) ## 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._ 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.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/8877065723> > Commit: 918fd45704546793524f2c97c05ab01e27063b6c > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8877065723&attempt=2" 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 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced widget configuration logic to better handle icons based on widget methods. - **Refactor** - Improved the filtering logic for widget cards in the editor, now supports different layout configurations more effectively. - Renamed variables for better clarity in widget card selection based on layout system. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
0a06d1820d
commit
d38e4b0b38
|
|
@ -80,7 +80,7 @@ class WidgetFactory {
|
|||
|
||||
private static configureWidget(widget: typeof BaseWidget) {
|
||||
const config = widget.getConfig();
|
||||
|
||||
const { IconCmp } = widget.getMethods();
|
||||
const features = widget.getFeatures();
|
||||
|
||||
let enhancedFeatures: Record<string, unknown> = {};
|
||||
|
|
@ -103,7 +103,7 @@ class WidgetFactory {
|
|||
...enhancedFeatures,
|
||||
searchTags: config.searchTags,
|
||||
tags: config.tags,
|
||||
hideCard: !!config.hideCard || !config.iconSVG,
|
||||
hideCard: !!config.hideCard || !(config.iconSVG || IconCmp),
|
||||
isDeprecated: !!config.isDeprecated,
|
||||
replacement: config.replacement,
|
||||
displayName: config.name,
|
||||
|
|
|
|||
|
|
@ -309,25 +309,20 @@ export const getWidgetCards = createSelector(
|
|||
getIsAnvilLayout,
|
||||
(isAutoLayout, isAnvilLayout) => {
|
||||
const widgetConfigs = WidgetFactory.getConfigs();
|
||||
|
||||
const cards = Object.values(widgetConfigs).filter((config) => {
|
||||
// if anvil is not enabled, hide all wds widgets
|
||||
if (
|
||||
Object.values(WDS_V2_WIDGET_MAP).includes(config.type) &&
|
||||
!isAnvilLayout
|
||||
) {
|
||||
return false;
|
||||
const widgetConfigsArray = Object.values(widgetConfigs);
|
||||
const layoutSystemBasesWidgets = widgetConfigsArray.filter((config) => {
|
||||
const isAnvilWidget = Object.values(WDS_V2_WIDGET_MAP).includes(
|
||||
config.type,
|
||||
);
|
||||
if (isAnvilLayout) {
|
||||
return isAnvilWidget;
|
||||
}
|
||||
|
||||
return !isAnvilWidget;
|
||||
});
|
||||
const cards = layoutSystemBasesWidgets.filter((config) => {
|
||||
if (isAirgapped()) {
|
||||
return config.widgetName !== "Map" && !config.hideCard;
|
||||
}
|
||||
|
||||
// if anvil is enabled, only show the wds widgets
|
||||
if (isAnvilLayout) {
|
||||
return Object.values(WDS_V2_WIDGET_MAP).includes(config.type);
|
||||
}
|
||||
|
||||
return !config.hideCard;
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user