From 2fed2749b65c7926ab20fc45a830f5d84adaff41 Mon Sep 17 00:00:00 2001
From: jinhyuk jang <imlovee@naver.com>
Date: 일, 12 12월 2021 23:22:00 +0900
Subject: [PATCH] - 일반 사용자 로그인시 이슈유형 메뉴 정상적으로 뜨도록 수정 - 이슈 메뉴 클릭시 프로젝트에 속해 있는 사용자는 모든 이슈 보도록 수정

---
 src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java |   15 ++++++++-------
 src/main/resources/mybatis/query-template/issue-template.xml      |    6 +++---
 src/main/webapp/scripts/app/common/common.controller.js           |    6 +++++-
 src/main/webapp/index.html                                        |    2 +-
 src/main/webapp/scripts/main.js                                   |    2 +-
 5 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java b/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
index f05fc49..0a7bb23 100644
--- a/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
+++ b/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
@@ -752,15 +752,16 @@
         Long totalCount = 0L;
         UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId());
 
-        if (this.userWorkspaceService.checkWorkspaceManager(user)
-                || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE_PROJECT_ALL)) {
+//        if (this.userWorkspaceService.checkWorkspaceManager(user)
+//                || MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE_PROJECT_ALL)) {
             results = this.issueMapper.find(issueCondition);
             totalCount = this.issueMapper.count(issueCondition);
-        } else{
-            this.SetMyDepartmentId(issueCondition);
-            results = this.issueMapper.findByDepartment(issueCondition);
-            totalCount = this.issueMapper.countByDepartment(issueCondition);
-        }
+//        }
+//        } else{
+//            this.SetMyDepartmentId(issueCondition);
+//            results = this.issueMapper.findByDepartment(issueCondition);
+//            totalCount = this.issueMapper.countByDepartment(issueCondition);
+//        }
 
 
         //  �뒠�떇 �쟾 - 0.8, 0.9, 0.9, 0.9, 0.9
diff --git a/src/main/resources/mybatis/query-template/issue-template.xml b/src/main/resources/mybatis/query-template/issue-template.xml
index 6916ce6..6e07ef3 100644
--- a/src/main/resources/mybatis/query-template/issue-template.xml
+++ b/src/main/resources/mybatis/query-template/issue-template.xml
@@ -254,7 +254,7 @@
         LEFT OUTER JOIN (SELECT issue_id, COUNT(id) as issueCommentCount FROM issue_comment GROUP BY issue_id)
         temp_issue_comment on (temp_issue_comment.issue_id = issue.id)
         WHERE 1=1
-        <if test="keyWord != null and !keyWord.equals('') and myDepartmentIds.size != 0">
+        <if test="keyWord != null and !keyWord.equals('')">
             AND issue.title like CONCAT('%',#{keyWord},'%')
             OR issue.description like CONCAT('%',#{keyWord},'%')
             OR issue.start_date like CONCAT('%',#{keyWord},'%')
@@ -312,7 +312,7 @@
         </if>
 
         <choose>
-            <when test="myDepartmentIds.size != 0">
+            <when test="myDepartmentIds != null and myDepartmentIds.size != 0">
                 AND isd.department_id IN
                 <foreach collection="myDepartmentIds" item="item" index="index" separator="," open="(" close=")">
                     #{item}
@@ -714,7 +714,7 @@
         </if>
 
         <choose>
-            <when test="myDepartmentIds.size != 0">
+            <when test="myDepartmentIds != null and myDepartmentIds.size != 0">
                 AND isd.department_id IN
                 <foreach collection="myDepartmentIds" item="item" index="index" separator="," open="(" close=")">
                     #{item}
diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html
index 20c4e0a..a147d6e 100644
--- a/src/main/webapp/index.html
+++ b/src/main/webapp/index.html
@@ -40,7 +40,7 @@
     <link type="text/css" rel="stylesheet" href="custom_components/js-autocomplete-single/js-autocomplete-single.css">
     <link type="text/css" rel="stylesheet" href="custom_components/js-autocomplete-multi/js-autocomplete-multi.css">
     <link type="text/css" rel="stylesheet" href="custom_components/js-html-diff/js-html-diff.css">
-    <link type="text/css" rel="stylesheet" href="assets/styles/main.css?version=0.9.0">
+    <link type="text/css" rel="stylesheet" href="assets/styles/main.css?version=0.9.2">
     <link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Rubik:300,400,500">
 
     <!--    google font -->
diff --git a/src/main/webapp/scripts/app/common/common.controller.js b/src/main/webapp/scripts/app/common/common.controller.js
index 4c12bea..9cd2e1a 100644
--- a/src/main/webapp/scripts/app/common/common.controller.js
+++ b/src/main/webapp/scripts/app/common/common.controller.js
@@ -202,9 +202,9 @@
                                     }
 
                                     var id = $rootScope.workProject.id === -1 ? null : $rootScope.workProject.id;
-                                    $scope.fn.findIssueList(id);
                                 }
                                 $rootScope.projects = datas;
+                                $scope.fn.findIssueList(id);
                             }
 
                             if ($rootScope.user.lastProjectId == null) {
@@ -259,6 +259,10 @@
 
                 // �씠�뒋 �쑀�삎 紐⑸줉 媛��졇�삤湲�
                function findIssueList(projectId) {
+
+                    if ($rootScope.projects == null || $rootScope.projects.length <= 1)
+                        return;
+
                    //  �씠�뒋 ���엯 紐⑸줉 寃��깋 議곌굔�쓣 留뚮뱺�떎.
                    var conditions = {
                        projectId : projectId > -1 ? projectId : null,
diff --git a/src/main/webapp/scripts/main.js b/src/main/webapp/scripts/main.js
index 203fcdb..9a8899e 100644
--- a/src/main/webapp/scripts/main.js
+++ b/src/main/webapp/scripts/main.js
@@ -4,7 +4,7 @@
 'use strict';
 
 require.config({
-    urlArgs : "bust=v0.9.0",
+    urlArgs : "bust=v0.9.2",
     paths : {
         'jquery' : '../bower_components/jquery/dist/jquery',
         'jquery-ui' : '../bower_components/jquery-ui/jquery-ui',

--
Gitblit v1.8.0