From 204030575b36f741a5b82ba852f08319198a247d Mon Sep 17 00:00:00 2001 From: yuda Date: Fri, 3 Jan 2025 23:14:28 +0900 Subject: [PATCH 1/2] fix: fix widget clone Signed-off-by: yuda --- .../dashboard-detail/DashboardWidgetContainerV2.vue | 4 +--- .../src/services/dashboards/helpers/dashboard-share-helper.ts | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/web/src/services/dashboards/components/dashboard-detail/DashboardWidgetContainerV2.vue b/apps/web/src/services/dashboards/components/dashboard-detail/DashboardWidgetContainerV2.vue index 713bf8e282..09d2c75cf8 100644 --- a/apps/web/src/services/dashboards/components/dashboard-detail/DashboardWidgetContainerV2.vue +++ b/apps/web/src/services/dashboards/components/dashboard-detail/DashboardWidgetContainerV2.vue @@ -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) { @@ -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 = { diff --git a/apps/web/src/services/dashboards/helpers/dashboard-share-helper.ts b/apps/web/src/services/dashboards/helpers/dashboard-share-helper.ts index 82996d6418..ad73051694 100644 --- a/apps/web/src/services/dashboards/helpers/dashboard-share-helper.ts +++ b/apps/web/src/services/dashboards/helpers/dashboard-share-helper.ts @@ -74,8 +74,6 @@ const _getSharedDataTableInfoList = (widgetDataTablesMap: Record Date: Fri, 3 Jan 2025 23:16:16 +0900 Subject: [PATCH 2/2] chore: fix type error Signed-off-by: yuda --- .../services/dashboards/helpers/dashboard-share-helper.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/services/dashboards/helpers/dashboard-share-helper.ts b/apps/web/src/services/dashboards/helpers/dashboard-share-helper.ts index ad73051694..b0d017e637 100644 --- a/apps/web/src/services/dashboards/helpers/dashboard-share-helper.ts +++ b/apps/web/src/services/dashboards/helpers/dashboard-share-helper.ts @@ -78,8 +78,8 @@ const _getSharedDataTableInfoList = (widgetDataTablesMap: Record _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], @@ -87,7 +87,7 @@ const _getSharedDataTableInfoList = (widgetDataTablesMap: Record d.data_table_id === _dataTableId); _sharedDataTable.options = { [dt.operator]: {