Browse Source

REPORT-66304 【组件商城风格优化】下载存在高版本组件的组件包,提示和效果跟设计不符

【问题原因】
使用组件包的designerVersion来判断兼容性不可靠,需要依次检查其中的每个组件的
兼容性

【改动思路】
同上
bugfix/11.0
Starryi 3 years ago
parent
commit
62912360e2
  1. 19
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java
  2. 7
      designer-form/src/main/java/com/fr/design/mainframe/share/util/OnlineShopUtils.java

19
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/mini/bridge/NativeProductBridge.java

@ -13,6 +13,7 @@ import com.fr.design.mainframe.share.ui.online.installation.ComponentInstallatio
import com.fr.design.mainframe.share.ui.online.installation.ComponentsPackageInstallation;
import com.fr.design.mainframe.share.ui.online.installation.TemplateThemeInstallation;
import com.fr.design.mainframe.share.ui.online.mini.MiniComponentShopDialog;
import com.fr.design.mainframe.share.util.OnlineShopUtils;
import com.fr.form.share.Group;
import com.fr.form.share.SharableWidgetProvider;
import com.fr.form.share.bean.OnlineShareWidget;
@ -306,23 +307,31 @@ public class NativeProductBridge {
@Override
public void run() {
boolean allowedDownload;
if (!widget.isCompatibleWithCurrentEnv()) {
int result = FineJOptionPane.showConfirmDialog(
OnlineShareWidget[] childrenWidgets = OnlineShopUtils.getPackageWidgets(widget, false);
boolean isCompatibleWithCurrentEnv = true;
for (OnlineShareWidget children: childrenWidgets) {
if (!children.isCompatibleWithCurrentEnv()) {
isCompatibleWithCurrentEnv = false;
break;
}
}
int result;
if (!isCompatibleWithCurrentEnv) {
result = FineJOptionPane.showConfirmDialog(
MiniComponentShopDialog.getInstance().getContentPane(),
Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Incompatible_Components_Package_Tip", childrenCount),
"",
FineJOptionPane.YES_NO_OPTION
);
allowedDownload = result == JOptionPane.YES_OPTION;
} else {
int result = FineJOptionPane.showConfirmDialog(
result = FineJOptionPane.showConfirmDialog(
MiniComponentShopDialog.getInstance().getContentPane(),
Toolkit.i18nText("Fine-Design_Share_Online_Mini_Shop_Download_Components_Package_Tip", childrenCount),
"",
FineJOptionPane.YES_NO_OPTION
);
allowedDownload = result == JOptionPane.YES_OPTION;
}
allowedDownload = result == JOptionPane.YES_OPTION;
if (allowedDownload) {
fireStartEvent(null);
action.install();

7
designer-form/src/main/java/com/fr/design/mainframe/share/util/OnlineShopUtils.java

@ -256,7 +256,12 @@ public class OnlineShopUtils {
}
public static OnlineShareWidget[] getPackageWidgets(OnlineShareWidget widgetPackage) {
String plistUrl = getPackageChildrenPath() + widgetPackage.getId() + "?designerVersion="+ ProductConstants.RELEASE_VERSION;
return getPackageWidgets(widgetPackage, true);
}
public static OnlineShareWidget[] getPackageWidgets(OnlineShareWidget widgetPackage, boolean requireCompatible) {
String targetDesignerVersion = requireCompatible ? ProductConstants.RELEASE_VERSION : "0";
String plistUrl = getPackageChildrenPath() + widgetPackage.getId() + "?designerVersion="+ targetDesignerVersion;
OnlineShareWidget[] widgets = getOnlineShareWidgets(plistUrl);
for (OnlineShareWidget widget : widgets) {
widget.setParentPackage(widgetPackage);

Loading…
Cancel
Save