From 8076639088a150474da9e0584b733673b3065fed Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 월, 20 12월 2021 11:41:16 +0900
Subject: [PATCH] - 이슈상세에서 하위이슈 추가 검색시 상위 이슈는 검색 리스트에서 나오지 말아야함 - 이슈상세에서 연관 이슈/하위 이슈 리스트 전체 불러오기

---
 src/main/webapp/scripts/components/utils/autoComplete.controller.js |   41 +++++++++++++++++++++++++++++++++++------
 1 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/src/main/webapp/scripts/components/utils/autoComplete.controller.js b/src/main/webapp/scripts/components/utils/autoComplete.controller.js
index 638c1dd..3712643 100644
--- a/src/main/webapp/scripts/components/utils/autoComplete.controller.js
+++ b/src/main/webapp/scripts/components/utils/autoComplete.controller.js
@@ -32,6 +32,7 @@
                 $scope.fn.getUserList = getUserList;    //  �궗�슜�옄 紐⑸줉 �젙蹂대�� 議고쉶�븳�떎.
                 $scope.fn.getProjectList = getProjectList;  //  �봽濡쒖젥�듃 紐⑸줉 �젙蹂대�� 議고쉶�븳�떎.
                 $scope.fn.getIssueList = getIssueList;  //  �씪媛� 紐⑸줉 �젙蹂대�� 議고쉶�븳�떎.
+                $scope.fn.getRelIssueList = getRelIssueList;   // �뿰愿� �씠�뒋 紐⑸줉 �젙蹂대�� 議고쉶�븳�떎.
                 $scope.fn.getDownIssueList = getDownIssueList;  //  �븯�쐞 �씠�뒋 紐⑸줉 �젙蹂대�� 議고쉶�븳�떎.
                 $scope.fn.getWorkflowList = getWorkflowList;    //  �썙�겕�뵆濡쒖슦 紐⑸줉 �젙蹂대�� 議고쉶�븳�떎.
                 $scope.fn.getUserDepartmentList = getUserDepartmentList;    //  遺��꽌 紐⑸줉 �젙蹂대�� 議고쉶�븳�떎.
@@ -171,8 +172,37 @@
                     return deferred.promise;
                 }
 
+                function getRelIssueList(query, issueTypeId, excludeList, page, callBack) {
+                    var conditions = {
+                        name : query,
+                        excludeIds : (function () {
+                            var excludeIds = [];
 
-                function getDownIssueList(query, issueTypeId, excludeList, page, callBack) {
+                            angular.forEach(excludeList, function (exclude) {
+                                excludeIds.push(exclude.id);
+                            });
+                            return excludeIds;
+                        })()
+                    };
+
+                    var deferred = $q.defer();
+
+                    Issue.find($resourceProvider.getContent(
+                        conditions)).then(function (result) {
+                        if (result.data.message.status === "success") {
+                            if ($rootScope.isDefined(callBack)) {
+                                callBack(result);
+                            }
+                            deferred.resolve(result.data.data);
+                        }
+                        else {
+                            SweetAlert.swal($filter("translate")("common.failedToIssueListLookUp"), result.data.message.message, "error"); // "�썙�겕�뵆濡쒖슦 紐⑸줉 議고쉶 �떎�뙣"
+                        }
+                    });
+                    return deferred.promise;
+                }
+
+                function getDownIssueList(query, issueTypeId, parentIssueId, excludeList, page, callBack) {
                     var conditions = {
                         name : query,
                         issueTypeIds : (function () {
@@ -189,27 +219,26 @@
                                 excludeIds.push(exclude.id);
                             });
 
+                            if(parentIssueId != null) {
+                                excludeIds.push(parentIssueId);
+                            }
                             return excludeIds;
                         })()
                     };
-
                     var deferred = $q.defer();
 
                     Issue.find($resourceProvider.getContent(         //  �럹�씠吏� �뾽�뜲�씠�듃媛� �븘�슂�븳 而댄룷�꼳�듃 �씪寃쎌슦, page �뾽�뜲�씠�듃媛� �엳�쓣 寃쎌슦 湲곕낯 10媛쒖뵫 媛��졇�삤怨� �븘�땺寃쎌슦 25媛쒖뵫 媛��졇�삩�떎.
-                        conditions, $resourceProvider.getPageContent($rootScope.isDefined(page) ? page : 0, $rootScope.isDefined(page) ? 10 : 25))).then(function (result) {
+                        conditions)).then(function (result) {
                         if (result.data.message.status === "success") {
-
                             if ($rootScope.isDefined(callBack)) {
                                 callBack(result);
                             }
-
                             deferred.resolve(result.data.data);
                         }
                         else {
                             SweetAlert.swal($filter("translate")("common.failedToIssueListLookUp"), result.data.message.message, "error"); // "�썙�겕�뵆濡쒖슦 紐⑸줉 議고쉶 �떎�뙣"
                         }
                     });
-
                     return deferred.promise;
                 }
 

--
Gitblit v1.8.0