From 27ebda343938d0fe428ea612d826d51f545fd093 Mon Sep 17 00:00:00 2001 From: tristanliu <37809633+sevenliu1896@users.noreply.github.com> Date: Mon, 27 Nov 2023 21:26:55 +0800 Subject: [PATCH] [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas. (#431) * [improvement][semantic-fe] Add model alias setting & Add view permission restrictions to the model permission management tab. [improvement][semantic-fe] Add permission control to the action buttons for the main domain; apply high sensitivity filtering to the authorization of metrics/dimensions. [improvement][semantic-fe] Optimize the editing mode in the dimension/metric/datasource components to use the modelId stored in the database for data, instead of relying on the data from the state manager. * [improvement][semantic-fe] Add time granularity setting in the data source configuration. * [improvement][semantic-fe] Dictionary import for dimension values supported in Q&A visibility * [improvement][semantic-fe] Modification of data source creation prompt wording" * [improvement][semantic-fe] metric market experience optimization * [improvement][semantic-fe] enhance the analysis of metric trends * [improvement][semantic-fe] optimize the presentation of metric trend permissions * [improvement][semantic-fe] add metric trend download functionality * [improvement][semantic-fe] fix the dimension initialization issue in metric correlation * [improvement][semantic-fe] Fix the issue of database changes not taking effect when creating based on an SQL data source. * [improvement][semantic-fe] Optimizing pagination logic and some CSS styles * [improvement][semantic-fe] Fixing the API for the indicator list by changing "current" to "pageNum" * [improvement][semantic-fe] Fixing the default value setting for the indicator list * [improvement][semantic-fe] Adding batch operations for indicators/dimensions/models * [improvement][semantic-fe] Replacing the single status update API for indicators/dimensions with a batch update API * [improvement][semantic-fe] Redesigning the indicator homepage to incorporate trend charts and table functionality for indicators * [improvement][semantic-fe] Optimizing the logic for setting dimension values and editing data sources, and adding system settings functionality * [improvement][semantic-fe] Upgrading antd version to 5.x, extracting the batch operation button component, optimizing the interaction for system settings, and expanding the configuration generation types for list-to-select component. * [improvement][semantic-fe] Adding the ability to filter dimensions based on whether they are tags or not. * [improvement][semantic-fe] Adding the ability to edit relationships between models in the canvas. --- webapp/packages/supersonic-fe/src/global.less | 1 + .../components/DataSourceBasicForm.tsx | 40 +- .../components/DataSourceCreateForm.tsx | 72 +- .../components/DataSourceFieldForm.tsx | 3 +- .../Datasource/components/SqlSide.tsx | 2 +- .../Metric/components/MetricTrendSection.tsx | 62 +- .../DataSourceRelationFormDrawer.tsx | 4 +- .../XflowJsonSchemaFormDrawerForm.tsx | 2 +- .../SemanticModel/SemanticFlows/service.ts | 6 +- .../SemanticGraph/CustomNodeRegister.tsx | 802 +++++++++++++++++ .../SemanticGraph/components/ContextMenu.tsx | 10 +- .../SemanticGraph/components/GraphToolBar.tsx | 6 +- .../components/ModelRelationFormDrawer.tsx | 249 ++++++ .../components/NodeInfoDrawer.tsx | 11 - .../SemanticGraph/components/ToolTips.tsx | 19 +- .../SemanticModel/SemanticGraph/index.tsx | 510 +++++++++-- .../SemanticModel/SemanticGraph/index_b.tsx | 817 ++++++++++++++++++ .../SemanticModel/SemanticGraph/test.tsx | 490 +++++++++++ .../SemanticModel/SemanticGraph/utils.ts | 24 +- .../components/BindMeasuresTable.tsx | 4 - .../components/ClassDataSourceTable.tsx | 167 ---- .../components/ClassDataSourceTypeModal.tsx | 17 +- .../components/ClassDimensionTable.tsx | 88 +- .../components/DimensionInfoModal.tsx | 14 - .../DimensionMetricRelationTableTransfer.tsx | 8 +- .../components/DomainManagerTab.tsx | 33 +- .../components/MetricInfoCreateForm.tsx | 21 +- .../components/ModelCreateFormModal.tsx | 15 +- .../SemanticModel/components/ModelTable.tsx | 23 +- .../pages/SemanticModel/components/style.less | 4 + .../src/pages/SemanticModel/data.d.ts | 4 +- .../src/pages/SemanticModel/service.ts | 43 +- 32 files changed, 3134 insertions(+), 437 deletions(-) create mode 100644 webapp/packages/supersonic-fe/src/pages/SemanticModel/SemanticGraph/CustomNodeRegister.tsx create mode 100644 webapp/packages/supersonic-fe/src/pages/SemanticModel/SemanticGraph/components/ModelRelationFormDrawer.tsx create mode 100644 webapp/packages/supersonic-fe/src/pages/SemanticModel/SemanticGraph/index_b.tsx create mode 100644 webapp/packages/supersonic-fe/src/pages/SemanticModel/SemanticGraph/test.tsx delete mode 100644 webapp/packages/supersonic-fe/src/pages/SemanticModel/components/ClassDataSourceTable.tsx diff --git a/webapp/packages/supersonic-fe/src/global.less b/webapp/packages/supersonic-fe/src/global.less index 54de84b5a..25875cfbb 100644 --- a/webapp/packages/supersonic-fe/src/global.less +++ b/webapp/packages/supersonic-fe/src/global.less @@ -224,6 +224,7 @@ ol { min-width: 100px; h3 { padding-bottom: 5px; + margin: 0; border-bottom: 1px solid #4E86F5; } li { diff --git a/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/DataSourceBasicForm.tsx b/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/DataSourceBasicForm.tsx index 6869988d8..e53016dd4 100644 --- a/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/DataSourceBasicForm.tsx +++ b/webapp/packages/supersonic-fe/src/pages/SemanticModel/Datasource/components/DataSourceBasicForm.tsx @@ -2,8 +2,8 @@ import React, { useState } from 'react'; import { Form, Input, Spin, Select, message } from 'antd'; import type { FormInstance } from 'antd/lib/form'; import { getDbNames, getTables } from '../../service'; -import SqlEditor from '@/components/SqlEditor'; import { ISemantic } from '../../data'; +import { isString } from 'lodash'; const FormItem = Form.Item; const { TextArea } = Input; @@ -109,28 +109,40 @@ const DataSourceBasicForm: React.FC = ({ isEdit, databaseConfigList, mode - -