Merge branch 'release' of https://github.com/appsmithorg/appsmith into release

This commit is contained in:
Automated Github Action 2020-10-19 09:07:55 +00:00
commit db0a23c540

View File

@ -42,7 +42,7 @@ import {
} from "actions/controlActions";
import { isDynamicValue } from "utils/DynamicBindingUtils";
import { WidgetProps } from "widgets/BaseWidget";
import _ from "lodash";
import _, { isString } from "lodash";
import WidgetFactory from "utils/WidgetFactory";
import {
buildWidgetBlueprint,
@ -867,6 +867,26 @@ function* pasteWidgetSaga() {
}
});
}
// Update the tabs for the tabs widget.
if (widget.tabs && widget.type === WidgetTypes.TABS_WIDGET) {
try {
const tabs = isString(widget.tabs)
? JSON.parse(widget.tabs)
: widget.tabs;
if (Array.isArray(tabs)) {
widget.tabs = JSON.stringify(
tabs.map(tab => {
tab.widgetId = widgetIdMap[tab.widgetId];
return tab;
}),
);
}
} catch (error) {
log.debug("Error updating tabs", error);
}
}
// If it is the copied widget, update position properties
if (widget.widgetId === widgetIdMap[copiedWidget.widgetId]) {
newWidgetId = widget.widgetId;