You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ke...@apache.org on 2021/11/06 02:12:07 UTC

[dolphinscheduler] branch dev updated: [Fix-6649][UI] Get project according to code (#6649) (#6650)

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

kerwin pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new a728c85  [Fix-6649][UI] Get project according to code (#6649) (#6650)
a728c85 is described below

commit a728c85a92faff6539daa86defa5206f986d38a9
Author: Yanbin Lin <35...@users.noreply.github.com>
AuthorDate: Sat Nov 6 10:12:01 2021 +0800

    [Fix-6649][UI] Get project according to code (#6649) (#6650)
    
    Co-authored-by: linyanbin <li...@lizhi.fm>
---
 dolphinscheduler-ui/src/js/conf/home/router/index.js           | 7 +++----
 dolphinscheduler-ui/src/js/conf/home/store/projects/actions.js | 4 ++--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/dolphinscheduler-ui/src/js/conf/home/router/index.js b/dolphinscheduler-ui/src/js/conf/home/router/index.js
index d2aed56..9c93560 100644
--- a/dolphinscheduler-ui/src/js/conf/home/router/index.js
+++ b/dolphinscheduler-ui/src/js/conf/home/router/index.js
@@ -54,10 +54,9 @@ const router = new Router({
       },
       beforeEnter: (to, from, next) => {
         const blacklist = ['projects', 'projects-list']
-        if (!blacklist.includes(to.name) && to.params.projectId && to.params.projectId !== localStore.getItem('projectId')) {
-          store.dispatch('projects/getProjectById', {
-            projectId: to.params.projectId
-          }).then(res => {
+        const { projectCode } = to.params || {}
+        if (!blacklist.includes(to.name) && projectCode && projectCode !== localStore.getItem('projectCode')) {
+          store.dispatch('projects/getProjectByCode', projectCode).then(res => {
             store.commit('dag/setProjectId', res.id)
             store.commit('dag/setProjectCode', res.code)
             store.commit('dag/setProjectName', res.name)
diff --git a/dolphinscheduler-ui/src/js/conf/home/store/projects/actions.js b/dolphinscheduler-ui/src/js/conf/home/store/projects/actions.js
index d8927c1..2241609 100644
--- a/dolphinscheduler-ui/src/js/conf/home/store/projects/actions.js
+++ b/dolphinscheduler-ui/src/js/conf/home/store/projects/actions.js
@@ -31,9 +31,9 @@ export default {
     })
   },
   /**
-   * Get project by id
+   * Get project by code
    */
-  getProjectById ({ state }, payload) {
+  getProjectByCode ({ state }, payload) {
     return new Promise((resolve, reject) => {
       io.get(`projects/${payload}`, {}, res => {
         resolve(res.data)