You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by zh...@apache.org on 2022/08/02 04:09:51 UTC

[incubator-seatunnel] branch dev updated: [Feat][UI] Add the publish modal in the data pipes. (#2332)

This is an automated email from the ASF dual-hosted git repository.

zhongjiajie pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new cbf2b75e8 [Feat][UI] Add the publish modal in the data pipes. (#2332)
cbf2b75e8 is described below

commit cbf2b75e81874afa1d24b5b15bf185daa9d2336e
Author: songjianet <17...@qq.com>
AuthorDate: Tue Aug 2 12:09:47 2022 +0800

    [Feat][UI] Add the publish modal in the data pipes. (#2332)
---
 seatunnel-ui/src/locales/en_US/data-pipes.ts       |  3 ++-
 seatunnel-ui/src/views/data-pipes/create/index.tsx | 29 ++++++++++++++++++++++
 seatunnel-ui/src/views/data-pipes/detail/index.tsx | 29 ++++++++++++++++++++++
 seatunnel-ui/src/views/data-pipes/edite/index.tsx  | 29 ++++++++++++++++++++++
 .../data-pipes/list/components/delete-modal.tsx    |  2 +-
 .../{delete-modal.tsx => publish-modal.tsx}        | 10 ++++----
 seatunnel-ui/src/views/data-pipes/list/index.tsx   | 18 +++++++++++++-
 .../src/views/data-pipes/list/use-table.ts         | 10 ++++++--
 .../user-manage/list/components/delete-modal.tsx   |  3 ++-
 9 files changed, 122 insertions(+), 11 deletions(-)

diff --git a/seatunnel-ui/src/locales/en_US/data-pipes.ts b/seatunnel-ui/src/locales/en_US/data-pipes.ts
index 94567e1bd..33488a8c5 100644
--- a/seatunnel-ui/src/locales/en_US/data-pipes.ts
+++ b/seatunnel-ui/src/locales/en_US/data-pipes.ts
@@ -55,5 +55,6 @@ export default {
   output_metrics: 'Output Metrics',
   end_time: 'End Time',
   data_pipes_delete_tips:
-    'Whether to delete the data Pipe,It cannot be restored after being deleted.'
+    'Whether to delete the data Pipe,It cannot be restored after being deleted.',
+  data_pipes_publish_tips: 'Whether to Publish the data pipe.'
 }
diff --git a/seatunnel-ui/src/views/data-pipes/create/index.tsx b/seatunnel-ui/src/views/data-pipes/create/index.tsx
new file mode 100644
index 000000000..db3e51ff8
--- /dev/null
+++ b/seatunnel-ui/src/views/data-pipes/create/index.tsx
@@ -0,0 +1,29 @@
+/*
+ * 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 { defineComponent } from 'vue'
+
+const DataPipesCreate = defineComponent({
+  setup() {},
+  render() {
+    return (
+      <div></div>
+    )
+  }
+})
+
+export default DataPipesCreate
\ No newline at end of file
diff --git a/seatunnel-ui/src/views/data-pipes/detail/index.tsx b/seatunnel-ui/src/views/data-pipes/detail/index.tsx
new file mode 100644
index 000000000..9f257f0e6
--- /dev/null
+++ b/seatunnel-ui/src/views/data-pipes/detail/index.tsx
@@ -0,0 +1,29 @@
+/*
+ * 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 { defineComponent } from 'vue'
+
+const DataPipesDetail = defineComponent({
+  setup() {},
+  render() {
+    return (
+      <div></div>
+    )
+  }
+})
+
+export default DataPipesDetail
\ No newline at end of file
diff --git a/seatunnel-ui/src/views/data-pipes/edite/index.tsx b/seatunnel-ui/src/views/data-pipes/edite/index.tsx
new file mode 100644
index 000000000..c134dcee2
--- /dev/null
+++ b/seatunnel-ui/src/views/data-pipes/edite/index.tsx
@@ -0,0 +1,29 @@
+/*
+ * 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 { defineComponent } from 'vue'
+
+const DataPipesEdit = defineComponent({
+  setup() {},
+  render() {
+    return (
+      <div></div>
+    )
+  }
+})
+
+export default DataPipesEdit
\ No newline at end of file
diff --git a/seatunnel-ui/src/views/data-pipes/list/components/delete-modal.tsx b/seatunnel-ui/src/views/data-pipes/list/components/delete-modal.tsx
index c98ab3ff5..747017d53 100644
--- a/seatunnel-ui/src/views/data-pipes/list/components/delete-modal.tsx
+++ b/seatunnel-ui/src/views/data-pipes/list/components/delete-modal.tsx
@@ -16,9 +16,9 @@
  */
 
 import { defineComponent } from 'vue'
-import type { PropType } from 'vue'
 import { useI18n } from 'vue-i18n'
 import Modal from '@/components/modal'
+import type { PropType } from 'vue'
 
 const props = {
   showModal: {
diff --git a/seatunnel-ui/src/views/data-pipes/list/components/delete-modal.tsx b/seatunnel-ui/src/views/data-pipes/list/components/publish-modal.tsx
similarity index 89%
copy from seatunnel-ui/src/views/data-pipes/list/components/delete-modal.tsx
copy to seatunnel-ui/src/views/data-pipes/list/components/publish-modal.tsx
index c98ab3ff5..5a2692af0 100644
--- a/seatunnel-ui/src/views/data-pipes/list/components/delete-modal.tsx
+++ b/seatunnel-ui/src/views/data-pipes/list/components/publish-modal.tsx
@@ -16,9 +16,9 @@
  */
 
 import { defineComponent } from 'vue'
-import type { PropType } from 'vue'
 import { useI18n } from 'vue-i18n'
 import Modal from '@/components/modal'
+import type { PropType } from 'vue'
 
 const props = {
   showModal: {
@@ -31,7 +31,7 @@ const props = {
   }
 }
 
-const DeleteModal = defineComponent({
+const PublishModal = defineComponent({
   props,
   emits: ['cancelModal', 'confirmModal'],
   setup(props, ctx) {
@@ -48,17 +48,17 @@ const DeleteModal = defineComponent({
   render() {
     return (
       <Modal
-        title={this.t('data_pipes.delete')}
+        title={this.t('data_pipes.publish')}
         show={this.showModal}
         onCancel={this.handleCancel}
         onConfirm={this.handleConfirm}
       >
         {{
-          default: () => <span>{this.t('data_pipes.data_pipes_delete_tips')}</span>
+          default: () => <span>{this.t('data_pipes.data_pipes_publish_tips')}</span>
         }}
       </Modal>
     )
   }
 })
 
-export default DeleteModal
\ No newline at end of file
+export default PublishModal
\ No newline at end of file
diff --git a/seatunnel-ui/src/views/data-pipes/list/index.tsx b/seatunnel-ui/src/views/data-pipes/list/index.tsx
index 951fa4153..e9322c8bb 100644
--- a/seatunnel-ui/src/views/data-pipes/list/index.tsx
+++ b/seatunnel-ui/src/views/data-pipes/list/index.tsx
@@ -20,6 +20,7 @@ import { useI18n } from 'vue-i18n'
 import { useTable } from './use-table'
 import { NButton, NCard, NDataTable, NPagination, NSpace } from 'naive-ui'
 import DeleteModal from './components/delete-modal'
+import PublishModal from './components/publish-modal'
 
 const DataPipesList = defineComponent({
   setup() {
@@ -34,11 +35,20 @@ const DataPipesList = defineComponent({
       state.showDeleteModal = false
     }
 
+    const handleCancelPublishModal = () => {
+      state.showPublishModal = false
+    }
+
+    const handleConfirmPublishModal = () => {
+      state.showPublishModal = false
+    }
+
+
     onMounted(() => {
       createColumns(state)
     })
 
-    return { t, ...toRefs(state), handleCancelDeleteModal, handleConfirmDeleteModal }
+    return { t, ...toRefs(state), handleCancelDeleteModal, handleConfirmDeleteModal, handleCancelPublishModal, handleConfirmPublishModal }
   },
   render() {
     return (
@@ -75,6 +85,12 @@ const DataPipesList = defineComponent({
           onCancelModal={this.handleCancelDeleteModal}
           onConfirmModal={this.handleConfirmDeleteModal}
         />
+        <PublishModal
+          showModal={this.showPublishModal}
+          row={this.row}
+          onCancelModal={this.handleCancelPublishModal}
+          onConfirmModal={this.handleConfirmPublishModal}
+        />
       </NSpace>
     )
   }
diff --git a/seatunnel-ui/src/views/data-pipes/list/use-table.ts b/seatunnel-ui/src/views/data-pipes/list/use-table.ts
index 1f95fd15a..7e784627e 100644
--- a/seatunnel-ui/src/views/data-pipes/list/use-table.ts
+++ b/seatunnel-ui/src/views/data-pipes/list/use-table.ts
@@ -30,7 +30,8 @@ export function useTable() {
     totalPage: ref(1),
     row: {},
     loading: ref(false),
-    showDeleteModal: ref(false)
+    showDeleteModal: ref(false),
+    showPublishModal: ref(false)
   })
 
   const createColumns = (state: any) => {
@@ -59,7 +60,7 @@ export function useTable() {
             default: () => [
               h(NButton, { text: true }, t('data_pipes.execute')),
               h(NButton, { text: true }, t('data_pipes.edit')),
-              h(NButton, { text: true }, t('data_pipes.publish')),
+              h(NButton, { text: true, onClick: () => handlePublish(row) }, t('data_pipes.publish')),
               h(
                 NButton,
                 {
@@ -86,5 +87,10 @@ export function useTable() {
     state.row = row
   }
 
+  const handlePublish = (row: any) => {
+    state.showPublishModal = true
+    state.row = row
+  }
+
   return { state, createColumns }
 }
diff --git a/seatunnel-ui/src/views/user-manage/list/components/delete-modal.tsx b/seatunnel-ui/src/views/user-manage/list/components/delete-modal.tsx
index 2619110aa..a5d3b481c 100644
--- a/seatunnel-ui/src/views/user-manage/list/components/delete-modal.tsx
+++ b/seatunnel-ui/src/views/user-manage/list/components/delete-modal.tsx
@@ -15,9 +15,10 @@
  * limitations under the License.
  */
 
-import { defineComponent, PropType } from 'vue'
+import { defineComponent } from 'vue'
 import { useI18n } from 'vue-i18n'
 import Modal from '@/components/modal'
+import type { PropType } from 'vue'
 
 const props = {
   showModal: {