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

fix: fix widget clone #5426

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,6 @@ const getRefinedDataTables = (dataTableList: DataTableModel[]) => {
data_type: dt.data_type,
source_type: dt.source_type,
operator: dt.operator,
labels_info: dt.labels_info,
data_info: dt.data_info,
options: dt.options,
};
if (dt.data_type === DATA_TABLE_TYPE.TRANSFORMED) {
Expand All @@ -237,7 +235,7 @@ const getRefinedDataTables = (dataTableList: DataTableModel[]) => {
data_tables: _dataTableIndices,
},
};
} else if (dt.operator === 'EVAL' || dt.operator === 'QUERY') {
} else if (dt.operator === 'EVAL' || dt.operator === 'QUERY' || dt.operator === 'PIVOT' || dt.operator === 'VALUE_MAPPING' || dt.operator === 'ADD_LABELS') {
const _dataTableId = dt.options[dt.operator]?.data_table_id;
const _dataTableIdx = dataTableList.findIndex((d) => d.data_table_id === _dataTableId);
_sharedDataTable.options = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,20 @@ const _getSharedDataTableInfoList = (widgetDataTablesMap: Record<string, DataTab
data_type: dt.data_type,
source_type: dt.source_type,
operator: dt.operator,
labels_info: dt.labels_info,
data_info: dt.data_info,
options: dt.options,
};
if (dt.data_type === DATA_TABLE_TYPE.TRANSFORMED) {
if (dt.operator === 'JOIN' || dt.operator === 'CONCAT') {
const _dataTableIds = dt.options[dt.operator].data_tables;
const _dataTableIndices = _dataTableIds.map((dtId) => _dataTables.findIndex((d) => d.data_table_id === dtId));
const _dataTableIds = dt.options[dt.operator]?.data_tables;
const _dataTableIndices = _dataTableIds?.map((dtId) => _dataTables.findIndex((d) => d.data_table_id === dtId));
_sharedDataTable.options = {
[dt.operator]: {
...dt.options[dt.operator],
data_tables: _dataTableIndices,
},
};
} else if (dt.operator === 'EVAL' || dt.operator === 'QUERY' || dt.operator === 'PIVOT' || dt.operator === 'VALUE_MAPPING' || dt.operator === 'ADD_LABELS') {
const _dataTableId = dt.options[dt.operator].data_table_id;
const _dataTableId = dt.options[dt.operator]?.data_table_id;
const _dataTableIdx = _dataTables.findIndex((d) => d.data_table_id === _dataTableId);
_sharedDataTable.options = {
[dt.operator]: {
Expand Down
Loading