Skip to content

Commit

Permalink
fix(evaluate): apply changed EVAL name validation planning
Browse files Browse the repository at this point in the history
Signed-off-by: samuel.park <[email protected]>
  • Loading branch information
piggggggggy committed Jan 7, 2025
1 parent 6c43f41 commit 0f9bd90
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import WidgetFormDataTableCardTransformFormWrapper
import WidgetFormDataTableGlobalVariableViewButton
from '@/common/modules/widgets/_components/WidgetFormDataTableGlobalVariableViewButton.vue';
import { DATA_TABLE_FIELD_TYPE, DATA_TABLE_OPERATOR } from '@/common/modules/widgets/_constants/data-table-constant';
import { isFieldNameValid } from '@/common/modules/widgets/_helpers/widget-data-table-helper';
import { useWidgetGenerateStore } from '@/common/modules/widgets/_store/widget-generate-store';
import type { TransformDataTableInfo, TransformDataTableProps } from '@/common/modules/widgets/types/widget-data-table-type';
import type { EvalOptions } from '@/common/modules/widgets/types/widget-model';
Expand Down Expand Up @@ -87,6 +86,12 @@ const getInvalidFieldNameText = (fieldName?: string): TranslateResult|undefined
if (!isFieldNameValid(fieldName, storeState.currentDataTable)) return i18n.t('COMMON.WIDGETS.DATA_TABLE.FORM.DUPLICATED_FIELD_NAME');
return undefined;
};
const isFieldNameValid = (fieldName: string, dataTable?: PublicDataTableModel|PrivateDataTableModel): boolean => {
if (!dataTable) return true;
const _dataInfoKeys = Object.keys(dataTable.data_info || {});
return !_dataInfoKeys.includes(fieldName);
};
/* Events */
const handleToggleExpressionCard = (idx: number) => {
Expand Down

0 comments on commit 0f9bd90

Please sign in to comment.