Skip to content

Commit

Permalink
MID-7713 fix for summary panel (archetype vs sysconfig)
Browse files Browse the repository at this point in the history
(cherry picked from commit 32dc1f7)
  • Loading branch information
1azyman committed Mar 11, 2022
1 parent a990feb commit dc9bbd7
Showing 1 changed file with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,35 +108,35 @@ private <DP extends GuiObjectDetailsPageType> DP mergeDetailsPages(DP defaultPag
return mergedDetailsPage;
}

private SummaryPanelSpecificationType mergeSummaryPanels(SummaryPanelSpecificationType defaultSummaryPanelConfiguration, SummaryPanelSpecificationType compiledSummaryPanelConfiguration) {
if (compiledSummaryPanelConfiguration == null) {
return defaultSummaryPanelConfiguration;
private SummaryPanelSpecificationType mergeSummaryPanels(SummaryPanelSpecificationType defaultSummary, SummaryPanelSpecificationType compiledSummary) {
if (compiledSummary == null) {
return defaultSummary;
}

if (defaultSummaryPanelConfiguration == null) {
return compiledSummaryPanelConfiguration;
if (defaultSummary == null) {
return compiledSummary;
}

SummaryPanelSpecificationType mergedSummaryPanel = defaultSummaryPanelConfiguration.cloneWithoutId();
GuiFlexibleLabelType mergedIdentifier = mergeSummaryPanelFlexibleLabel(defaultSummaryPanelConfiguration.getIdentifier(), compiledSummaryPanelConfiguration.getIdentifier());
mergedSummaryPanel.setIdentifier(mergedIdentifier);
SummaryPanelSpecificationType mergedSummary = defaultSummary.cloneWithoutId();
GuiFlexibleLabelType mergedIdentifier = mergeSummaryPanelFlexibleLabel(defaultSummary.getIdentifier(), compiledSummary.getIdentifier());
mergedSummary.setIdentifier(mergedIdentifier);

GuiFlexibleLabelType mergedDisplayName = mergeSummaryPanelFlexibleLabel(defaultSummaryPanelConfiguration.getDisplayName(), compiledSummaryPanelConfiguration.getDisplayName());
mergedSummaryPanel.setIdentifier(mergedDisplayName);
GuiFlexibleLabelType mergedDisplayName = mergeSummaryPanelFlexibleLabel(defaultSummary.getDisplayName(), compiledSummary.getDisplayName());
mergedSummary.setDisplayName(mergedDisplayName);

GuiFlexibleLabelType mergedOrganization = mergeSummaryPanelFlexibleLabel(defaultSummaryPanelConfiguration.getOrganization(), compiledSummaryPanelConfiguration.getOrganization());
mergedSummaryPanel.setIdentifier(mergedOrganization);
GuiFlexibleLabelType mergedOrganization = mergeSummaryPanelFlexibleLabel(defaultSummary.getOrganization(), compiledSummary.getOrganization());
mergedSummary.setOrganization(mergedOrganization);

GuiFlexibleLabelType mergedTitle1 = mergeSummaryPanelFlexibleLabel(defaultSummaryPanelConfiguration.getTitle1(), compiledSummaryPanelConfiguration.getTitle1());
mergedSummaryPanel.setIdentifier(mergedTitle1);
GuiFlexibleLabelType mergedTitle1 = mergeSummaryPanelFlexibleLabel(defaultSummary.getTitle1(), compiledSummary.getTitle1());
mergedSummary.setTitle1(mergedTitle1);

GuiFlexibleLabelType mergedTitle2 = mergeSummaryPanelFlexibleLabel(defaultSummaryPanelConfiguration.getTitle2(), compiledSummaryPanelConfiguration.getTitle2());
mergedSummaryPanel.setIdentifier(mergedTitle2);
GuiFlexibleLabelType mergedTitle2 = mergeSummaryPanelFlexibleLabel(defaultSummary.getTitle2(), compiledSummary.getTitle2());
mergedSummary.setTitle2(mergedTitle2);

GuiFlexibleLabelType mergedTitle3 = mergeSummaryPanelFlexibleLabel(defaultSummaryPanelConfiguration.getTitle3(), compiledSummaryPanelConfiguration.getTitle3());
mergedSummaryPanel.setIdentifier(mergedTitle3);
GuiFlexibleLabelType mergedTitle3 = mergeSummaryPanelFlexibleLabel(defaultSummary.getTitle3(), compiledSummary.getTitle3());
mergedSummary.setTitle3(mergedTitle3);

return mergedSummaryPanel;
return mergedSummary;
}

private GuiFlexibleLabelType mergeSummaryPanelFlexibleLabel(GuiFlexibleLabelType defaultSummaryPanelIdentifier, GuiFlexibleLabelType compiledSummaryPanelIdentifier) {
Expand Down Expand Up @@ -413,5 +413,4 @@ private IconType mergeIcon(IconType currentIcon, IconType superIcon) {
private boolean pathsMatch(ItemPathType supperPath, ItemPathType currentPath) {
return supperPath != null && currentPath != null && supperPath.equivalent(currentPath);
}

}

0 comments on commit dc9bbd7

Please sign in to comment.