From 5cb08f23db304d174b9d1f0d8a2ffe2c89bce371 Mon Sep 17 00:00:00 2001 From: Dahyun Yu Date: Wed, 6 Nov 2024 11:39:41 +0900 Subject: [PATCH] chore: disable values from until select data source (#5009) Signed-off-by: yuda --- .../dashboard-detail/DashboardVariablesFormDynamic.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/web/src/services/dashboards/components/dashboard-detail/DashboardVariablesFormDynamic.vue b/apps/web/src/services/dashboards/components/dashboard-detail/DashboardVariablesFormDynamic.vue index 4e8c63edf0..676cb121ec 100644 --- a/apps/web/src/services/dashboards/components/dashboard-detail/DashboardVariablesFormDynamic.vue +++ b/apps/web/src/services/dashboards/components/dashboard-detail/DashboardVariablesFormDynamic.vue @@ -73,6 +73,7 @@ const state = reactive({ const _resourceType = state.selectedSourceFrom === 'asset' ? MetricDataVariableModel.meta.resourceType : CostVariableModel.meta.resourceType; return { method: 'dynamic', + type: 'reference', reference: { resourceType: _resourceType, dataSourceId: state.selectedCostDataSourceId || state.selectedMetricId, @@ -85,6 +86,7 @@ const state = reactive({ } return { method: 'dynamic', + type: 'reference', reference: { resourceType: state.selectedSourceFrom, }, @@ -108,6 +110,12 @@ const state = reactive({ selectedSourceFrom: 'asset' as string|undefined, selectedValuesFrom: undefined as string|undefined, selectedSelectionType: 'single' as SelectionType, + disableValuesFrom: computed(() => { + if (!state.selectedSourceFrom) return true; + if (state.selectedSourceFrom === 'asset' && !state.selectedMetricId) return true; + if (state.selectedSourceFrom === 'cost' && !state.selectedCostDataSourceId) return true; + return false; + }), /* Asset */ // category categoryMenuItems: computed(() => { @@ -357,6 +365,7 @@ watch(() => props.originalData, (originalData) => { >