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

likyh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 20bac4c7fae3cf5daa81d23bb01b02da18931158
Author: Julien Chinapen <[email protected]>
AuthorDate: Tue Oct 18 10:27:04 2022 -0400

    fix: add providerId to entity type data models
---
 config-ui/src/data/Variants.js        | 25 +++++++++++++++++++++++++
 config-ui/src/models/GithubProject.js |  2 ++
 config-ui/src/models/GitlabProject.js |  2 ++
 config-ui/src/models/JenkinsJob.js    |  2 ++
 config-ui/src/models/JiraBoard.js     |  2 ++
 5 files changed, 33 insertions(+)

diff --git a/config-ui/src/data/Variants.js b/config-ui/src/data/Variants.js
new file mode 100644
index 00000000..251c144d
--- /dev/null
+++ b/config-ui/src/data/Variants.js
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ *
+ */
+
+const Variants = {
+  PROJECT: 'project',
+  BOARD: 'board',
+  JOB: 'job'
+}
+
+export { Variants }
diff --git a/config-ui/src/models/GithubProject.js 
b/config-ui/src/models/GithubProject.js
index 99854413..d7aebbd8 100644
--- a/config-ui/src/models/GithubProject.js
+++ b/config-ui/src/models/GithubProject.js
@@ -29,6 +29,7 @@
  * @property {string?} repo
  * @property {boolean?} useApi
  * @property {project|board?} variant
+ * @property {string?} providerId
  */
 class GitHubProject {
   constructor(data = {}) {
@@ -47,6 +48,7 @@ class GitHubProject {
 
     this.useApi = data?.useApi || false
     this.variant = data?.variant || 'project'
+    this.providerId = 'github'
   }
 
   get(property) {
diff --git a/config-ui/src/models/GitlabProject.js 
b/config-ui/src/models/GitlabProject.js
index c9aecbeb..6ab3b0d9 100644
--- a/config-ui/src/models/GitlabProject.js
+++ b/config-ui/src/models/GitlabProject.js
@@ -48,6 +48,7 @@
  * @property {boolean?} archived
  * @property {boolean?} useApi
  * @property {project|board?} variant
+ * @property {string?} providerId
  */
 class GitlabProject {
   constructor(data = {}) {
@@ -86,6 +87,7 @@ class GitlabProject {
 
     this.useApi = data?.useApi || false
     this.variant = data?.variant || 'project'
+    this.providerId = 'gitlab'
   }
 
   get(property) {
diff --git a/config-ui/src/models/JenkinsJob.js 
b/config-ui/src/models/JenkinsJob.js
index f43d29bf..a5fe7c8d 100644
--- a/config-ui/src/models/JenkinsJob.js
+++ b/config-ui/src/models/JenkinsJob.js
@@ -26,6 +26,7 @@
  * @property {string|number?} title
  * @property {boolean?} useApi
  * @property {project|board|job?} variant
+ * @property {string?} providerId
  */
 class JenkinsJob {
   constructor(data = {}) {
@@ -37,6 +38,7 @@ class JenkinsJob {
 
     this.useApi = data?.useApi || true
     this.variant = data?.variant || 'job'
+    this.providerId = 'jenkins'
   }
 
   get(property) {
diff --git a/config-ui/src/models/JiraBoard.js 
b/config-ui/src/models/JiraBoard.js
index 94d86aee..89573bf0 100644
--- a/config-ui/src/models/JiraBoard.js
+++ b/config-ui/src/models/JiraBoard.js
@@ -30,6 +30,7 @@
  * @property {object?} location
  * @property {boolean?} useApi
  * @property {project|board?} variant
+ * @property {string?} providerId
  */
 class JiraBoard {
   constructor(data = {}) {
@@ -56,6 +57,7 @@ class JiraBoard {
 
     this.useApi = data?.useApi || true
     this.variant = data?.variant || 'board'
+    this.providerId = 'jira'
   }
 
   get(property) {

Reply via email to