Unverified Commit 18d8a598 authored by zhu-mingye's avatar zhu-mingye Committed by GitHub

refactor: delete global var alias (#1599)

* refactor: delete global var alias * refactor: delete global var alias && format code * added sql * refactor: delete studiofragment tsx
parent 3114c400
......@@ -21,8 +21,6 @@ package org.dinky.model;
import org.dinky.db.model.SuperEntity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
......@@ -43,9 +41,6 @@ import lombok.NoArgsConstructor;
@TableName("dinky_fragment")
public class FragmentVariable extends SuperEntity {
@TableField(fill = FieldFill.INSERT)
private String alias;
private Integer tenantId;
private String fragmentValue;
private String note;
......
......@@ -34,9 +34,6 @@
<if test='param.name!=null and param.name!=""'>
and a.name like "%${param.name}%"
</if>
<if test='param.alias!=null and param.alias!=""'>
and a.alias like "%${param.alias}%"
</if>
<if test='param.note!=null and param.note!=""'>
and a.note like "%${param.note}%"
</if>
......
......@@ -441,7 +441,6 @@ DROP TABLE IF EXISTS `dinky_fragment`;
CREATE TABLE `dinky_fragment` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'fragment name',
`alias` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'alias',
`tenant_id` int(11) NOT NULL DEFAULT 1 COMMENT 'tenant id',
`fragment_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'fragment value',
`note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'note',
......
......@@ -70,5 +70,5 @@ ALTER TABLE dinky_user_tenant RENAME INDEX `dlink_user_role_un` TO `user_tenant_
ALTER TABLE dinky_catalogue RENAME INDEX `dlink_catalogue_un` TO `catalogue_un_idx1`;
ALTER TABLE dinky_schema_history RENAME INDEX `dlink_schema_history_s_idx` TO `schema_history_idx`;
ALTER TABLE dinky_fragment DROP COLUMN `alias`;
ALTER TABLE dinky_database DROP COLUMN `alias`;
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import React, {useState} from "react";
import {ProColumns, ProTable} from "@ant-design/pro-table";
import {Drawer} from "antd";
import ProDescriptions from '@ant-design/pro-descriptions';
import {queryData} from "@/components/Common/crud";
import {FragmentVariableTableListItem} from "@/pages/RegistrationCenter/data";
const StudioFragment = (props: any) => {
const {toolHeight, dispatch} = props;
const [row, setRow] = useState<{}>();
const url = "/api/fragment"
const getColumns: ProColumns<FragmentVariableTableListItem>[] = [
{
title: '名称',
dataIndex: 'name',
tip: '名称是唯一的',
sorter: true,
render: (dom, entity) => {
return <a onClick={() => setRow(entity)}>{dom}</a>;
},
},
{
title: '引用名称',
copyable: true,
render: (dom, entity) => {
return <>
${"{" + entity?.name + "}"}
</>;
},
},
];
return (
<>
<ProTable<FragmentVariableTableListItem>
columns={getColumns}
style={{width: '100%'}}
request={(params, sorter, filter) => queryData(url, {params, sorter, filter})}
pagination={{
defaultPageSize: 10,
showSizeChanger: true,
}}
search={false}
size="small"
/>
<Drawer
width={600}
visible={!!row?.name}
onClose={() => {
setRow(undefined);
}}
closable={false}
>
<ProDescriptions
column={1}
title={row?.name}
request={async () => ({
data: row || {},
})}
params={{
name: row?.name,
}}
columns={getColumns}
/>
</Drawer>
</>
);
};
export default StudioFragment;
......@@ -52,13 +52,6 @@ const StudioLeftTool = (props: any) => {
<TabPane tab={<span><AppstoreOutlined/> {l('pages.datastudio.label.meta')}</span>} key="MetaData">
<StudioMetaData/>
</TabPane>
{/*<TabPane tab={<span><CloudOutlined/> {l('pages.datastudio.label.globalvariable')}</span>}*/}
{/* key="fragment">*/}
{/* <StudioFragment/>*/}
{/*</TabPane>*/}
{/*<TabPane tab={<span><FunctionOutlined/> {l('pages.datastudio.label.function')}</span>} key="Function">*/}
{/* <Empty image={Empty.PRESENTED_IMAGE_SIMPLE}/>*/}
{/*</TabPane>*/}
</Tabs>
);
};
......
......@@ -770,7 +770,6 @@ export default {
'pages.rc.fv.Management': 'Global Variable Management',
'pages.rc.fv.id': 'Global Variable ID',
'pages.rc.fv.name': 'Name',
'pages.rc.fv.alias': 'Alias',
'pages.rc.fv.fragmentValue': 'Global Variable value',
'pages.rc.fv.create': 'Create Global Variable',
'pages.rc.fv.modify': 'Modify Global Variables',
......@@ -782,7 +781,6 @@ export default {
'pages.rc.fv.disableConfirm': 'Are you sure you want to disable the selected Global Variable? ',
'pages.rc.fv.disableTotalOf': 'Total Of {total} Global Variables Is Disabled',
'pages.rc.fv.namePlaceholder': 'Please enter a name!',
'pages.rc.fv.aliasPlaceholder': 'Please enter an alias!',
'pages.rc.fv.fragmentValuePlaceholder': 'Please enter the Global Variable value',
'pages.rc.fv.enabledPlaceholder': 'Please choose whether to enable!',
......
......@@ -773,7 +773,6 @@ export default {
'pages.rc.fv.Management': '全局变量管理',
'pages.rc.fv.id': '全局变量 ID',
'pages.rc.fv.name': '名称',
'pages.rc.fv.alias': '别名',
'pages.rc.fv.fragmentValue': '全局变量值',
'pages.rc.fv.create': '创建全局变量',
'pages.rc.fv.modify': '修改全局变量',
......@@ -785,7 +784,6 @@ export default {
'pages.rc.fv.disableConfirm': '确定禁用选中的全局变量吗?',
'pages.rc.fv.disableTotalOf': '被禁用的全局变量共 {total} 个',
'pages.rc.fv.namePlaceholder': '请输入名称!',
'pages.rc.fv.aliasPlaceholder': '请输入别名!',
'pages.rc.fv.fragmentValuePlaceholder': '请输入全局变量值',
'pages.rc.fv.enabledPlaceholder': '请选择是否启用!',
......
......@@ -46,7 +46,6 @@ const FragmentForm: React.FC<FragmentFormProps> = (props: any) => {
const [formVals, setFormVals] = useState<Partial<FragmentVariableTableListItem>>({
id: props.values.id,
name: props.values.name,
alias: props.values.alias,
fragmentValue: props.values.fragmentValue,
note: props.values.note,
enabled: props.values.enabled,
......@@ -77,12 +76,6 @@ const FragmentForm: React.FC<FragmentFormProps> = (props: any) => {
rules={[{required: true, message: l('pages.rc.fv.namePlaceholder')}]}>
<Input placeholder={l('pages.rc.fv.namePlaceholder')}/>
</FormItem>
<FormItem
name="alias"
label={l('pages.rc.fv.alias')}
rules={[{required: true, message: l('pages.rc.fv.aliasPlaceholder')}]}>
<Input placeholder={l('pages.rc.fv.aliasPlaceholder')}/>
</FormItem>
<FormItem
name="note"
label={l('global.table.note')}
......@@ -124,7 +117,7 @@ const FragmentForm: React.FC<FragmentFormProps> = (props: any) => {
bodyStyle={{padding: '32px 40px 48px'}}
destroyOnClose
title={formVals.id ? l('pages.rc.fv.modify') : l('pages.rc.fv.create')}
visible={modalVisible}
open={modalVisible}
footer={renderFooter()}
onCancel={() => handleModalVisible()}
>
......
......@@ -94,13 +94,6 @@ const FragmentTableList: React.FC<{}> = (props: any) => {
return <a onClick={() => setRow(entity)}>{dom}</a>;
},
},
{
title: l('pages.rc.fv.alias'),
dataIndex: 'alias',
hideInForm: false,
hideInSearch: false,
hideInTable: false,
},
{
title: l('pages.rc.fv.fragmentValue'),
sorter: true,
......
......@@ -142,7 +142,6 @@ export type DocumentTableListItem = {
export type FragmentVariableTableListItem = {
id: number,
name: string,
alias: string,
fragmentValue: string,
note: string,
enabled: boolean,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment