| | |
| | | initForm : initForm, |
| | | getPriorities : getPriorities, |
| | | getSeverities : getSeverities, |
| | | start : start, |
| | | onChangeColumnSetting : onChangeColumnSetting, |
| | | getIssueTypes : getIssueTypes, |
| | | onChangeIssueType : onChangeIssueType, |
| | | reset : reset, |
| | |
| | | onChangeIssueTypeOverlap : onChangeIssueTypeOverlap, |
| | | getIssueTypeCustomFields : getIssueTypeCustomFields, |
| | | getCurrentIssueTypeVo : getCurrentIssueTypeVo, |
| | | loadSpec : loadSpec, |
| | | getIssueStatuses : getIssueStatuses, |
| | | onChangeIssueTypeSpec : onChangeIssueTypeSpec, |
| | | createRequestModifyJson : createRequestModifyJson, |
| | | createRequestAddJson : createRequestAddJson, |
| | | createCustomFields : createCustomFields, |
| | | getProjectList : getProjectList |
| | | getProjects : getProjects, |
| | | formSubmitCompleteIssueStatus : formSubmitCompleteIssueStatus, |
| | | loadPage : loadPage, |
| | | resetCompleteIssueStatus : resetCompleteIssueStatus |
| | | }; |
| | | |
| | | $scope.vm = { |
| | | tab : "API_COL_SETTING", |
| | | tab : "", |
| | | issueTypes : [], |
| | | issueStatuses : [], |
| | | completeIssueStatuses : [], |
| | | severities : [], |
| | | priorities : [], |
| | | projects : [], |
| | |
| | | // totalPage : 0 |
| | | // } |
| | | }, |
| | | completeIssueStatusId : "", |
| | | issueTypeId : "", |
| | | issueTypeName : "", |
| | | |
| | |
| | | projectId : "", |
| | | projectName : "", |
| | | }; |
| | | |
| | | angular.extend(this, $controller('autoCompleteController', {$scope : $scope, $injector : $injector})); |
| | | |
| | | function initForm() { |
| | | $scope.vm.form.issueApiDefault.title = ""; |
| | |
| | | $scope.fn.formSubmit(); |
| | | } |
| | | |
| | | // 자동종료 설정 초기화 |
| | | function resetCompleteIssueStatus() { |
| | | $scope.vm.completeIssueStatusId = ""; |
| | | } |
| | | |
| | | // 하위 이슈 처리 기준 항목 초기화(중복처리할 항목) |
| | | function resetOverlap() { |
| | | $scope.vm.form.customFieldIds = []; |
| | | $scope.fn.form.formSubmitOverlap(); |
| | |
| | | Api.findApiOverlap($resourceProvider.getContent( |
| | | conditions, $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | if (result.data.message.status === "success") { |
| | | |
| | | let customFieldApiOverlaps = result.data.data; |
| | | $scope.vm.form.customFields = []; |
| | | let customFieldApiOverlaps = result.data.data; |
| | | |
| | | if (customFieldApiOverlaps != null) { |
| | | if (customFieldApiOverlaps != null && customFieldApiOverlaps.length > 0) { |
| | | customFieldApiOverlaps.forEach(function (customFieldApiOverlap) { |
| | | $scope.vm.form.customFields.push(customFieldApiOverlap.customFieldVo); |
| | | }); |
| | |
| | | }); |
| | | } |
| | | |
| | | $scope.$watch("vm.issueTypeId", function (newValue){ |
| | | if (newValue != null && newValue !== "") { |
| | | $scope.fn.loadPage(); |
| | | } |
| | | }); |
| | | |
| | | function getIssueTypes() { |
| | | var conditions = { |
| | | }; |
| | |
| | | if (result.data.message.status === "success") { |
| | | $scope.vm.issueTypes = result.data.data; |
| | | if ($scope.vm.issueTypes != null && $scope.vm.issueTypes.length > 0) { |
| | | $scope.vm.issueTypeId = $scope.vm.issueTypes[0].id.toString(); |
| | | if ($scope.vm.tab === "API_COL_SETTING") { |
| | | $scope.fn.onChangeIssueType(); |
| | | } else if ($scope.vm.tab === "API_SPEC_SETTING") { |
| | | $scope.fn.onChangeIssueTypeSpec(); |
| | | if ($scope.vm.issueTypeId === "") { |
| | | $scope.vm.issueTypeId = $scope.vm.issueTypes[0].id.toString(); |
| | | } |
| | | if ($scope.vm.tab === "") { |
| | | $scope.fn.changeTab("API_COL_SETTING"); |
| | | } |
| | | |
| | | // if ($scope.vm.tab === "API_COL_SETTING") { |
| | | // $scope.fn.onChangeIssueType(); |
| | | // } else if ($scope.vm.tab === "API_SPEC_SETTING") { |
| | | // $scope.fn.onChangeIssueTypeSpec(); |
| | | // } else if ($scope.vm.tab === "API_OVERLAP_SETTING") { |
| | | // } |
| | | } |
| | | } |
| | | else { |
| | |
| | | } |
| | | |
| | | function onChangeIssueTypeOverlap() { |
| | | $scope.fn.getIssueStatuses(); |
| | | $scope.fn.getIssueTypeCustomFields(); |
| | | $scope.fn.getOverlapList(); |
| | | } |
| | | |
| | |
| | | Api.findApiDefault($resourceProvider.getContent( |
| | | conditions, $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | $scope.fn.initForm(); |
| | | $scope.fn.getIssueTypeCustomFields(); |
| | | |
| | | if (result.data.message.status === "success") { |
| | | if (angular.isDefined(result.data.data)) { |
| | |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | function formSubmitCompleteIssueStatus() { |
| | | if ($scope.vm.issueTypeId != null) { |
| | | let content = { |
| | | id: $scope.vm.issueTypeId, |
| | | completeIssueStatusId: $scope.vm.completeIssueStatusId |
| | | } |
| | | |
| | | Api.saveCompleteIssueStatus($resourceProvider.getContent( |
| | | content, $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | |
| | | if (result.data.message.status === "success") { |
| | | SweetAlert.swal($filter("translate")("api.successToApiAutoCompleteIssueStatus"), result.data.message.message, "success"); // "설정 성공" |
| | | $scope.fn.getIssueTypes(); |
| | | $scope.fn.getIssueStatuses(); |
| | | $scope.fn.getIssueTypeCustomFields(); |
| | | } else { |
| | | SweetAlert.swal($filter("translate")("api.failedToApiAutoCompleteIssueStatus"), result.data.message.message, "error"); // "설정 실패" |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // 폼 체크 |
| | |
| | | }); |
| | | } |
| | | |
| | | // 이슈 유형에 연결된 사용자 정의 필드 |
| | | // 이슈 유형에 연결된 사용자 정의 필드 |
| | | function getIssueTypeCustomFields() { |
| | | |
| | | $scope.vm.form.issueCustomFields = []; |
| | | |
| | | var issueTypeVo = $scope.fn.getCurrentIssueTypeVo(); |
| | | var projectId = $scope.vm.projectId; |
| | | |
| | | if (issueTypeVo == null) return; |
| | | if (issueTypeVo == null || projectId == null) return; |
| | | |
| | | IssueTypeCustomField.find($resourceProvider.getContent({ |
| | | projectId : $scope.vm.projectId, |
| | | projectId : projectId, |
| | | IssueTypeId : issueTypeVo.id }, |
| | | $resourceProvider.getPageContent(0, 1000))).then(function (result) { |
| | | $scope.vm.form.issueCustomFields = []; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | // 중요도 목록 |
| | | function getSeverities() { |
| | | Severity.find($resourceProvider.getContent({}, |
| | |
| | | }); |
| | | } |
| | | |
| | | $rootScope.$on("changeColumnSettingTab", function (event, args){ |
| | | $scope.fn.start(); |
| | | }); |
| | | |
| | | |
| | | $rootScope.$on("changeOverlapSettingTab", function (event, args){ |
| | | $scope.fn.getOverlapList(); |
| | | }); |
| | | |
| | | $rootScope.$on("changeSpecSettingTab", function (event, args){ |
| | | $scope.fn.loadSpec(); |
| | | }); |
| | | |
| | | $scope.$on("getIssueTypeListComplete", function (event, args) { |
| | | if ($scope.vm.tab === "API_SPEC_SETTING") { |
| | | $scope.fn.createRequestAddJson(); |
| | |
| | | |
| | | function changeTab(tab) { |
| | | $scope.vm.tab = tab; |
| | | $scope.fn.loadPage(); |
| | | } |
| | | |
| | | // 현재 탭 페이지 불러오기 |
| | | function loadPage() { |
| | | let tab = $scope.vm.tab; |
| | | |
| | | if (tab === "API_COL_SETTING") { |
| | | $rootScope.$broadcast("changeColumnSettingTab"); |
| | | $scope.fn.onChangeColumnSetting(); |
| | | } else if (tab === "API_OVERLAP_SETTING") { |
| | | $rootScope.$broadcast("changeOverlapSettingTab"); |
| | | $scope.fn.onChangeIssueTypeOverlap(); |
| | | } else if (tab === "API_SPEC_SETTING") { |
| | | $rootScope.$broadcast("changeSpecSettingTab"); |
| | | $scope.fn.onChangeIssueTypeSpec(); |
| | | } |
| | | } |
| | | |
| | | $scope.$on("getIssueStatusComplete", function (event, args){ |
| | | if ($scope.vm.issueStatuses != null) { |
| | | $scope.vm.completeIssueStatuses = []; |
| | | |
| | | $scope.vm.issueStatuses.forEach(function (issueStatus) { |
| | | if (issueStatus.issueStatusType === "CLOSE") { |
| | | $scope.vm.completeIssueStatuses.push(issueStatus); |
| | | } |
| | | }); |
| | | |
| | | // 설정된 상태 지정 |
| | | $scope.vm.completeIssueStatusId = ""; |
| | | let issueTypeVo = $scope.fn.getCurrentIssueTypeVo(); |
| | | if (issueTypeVo.completeIssueStatusVo != null) { |
| | | $scope.vm.completeIssueStatuses.forEach(function (issueStatus) { |
| | | if (issueStatus.id === issueTypeVo.completeIssueStatusVo.id) { |
| | | $scope.vm.completeIssueStatusId = issueStatus.id.toString(); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | function getIssueStatuses() { |
| | | var condition = { |
| | |
| | | |
| | | if (result.data.message.status === "success") { |
| | | $scope.vm.issueStatuses = result.data.data; |
| | | $scope.vm.issueStatusId = ""; |
| | | if ($scope.vm.issueStatuses != null && $scope.vm.issueStatuses.length > 0) { |
| | | $scope.vm.issueStatusId = $scope.vm.issueStatuses[0].id.toString(); |
| | | } |
| | | $scope.$broadcast("getIssueStatusComplete", $scope.vm.issueStatuses); |
| | | } |
| | | else { |
| | | SweetAlert.swal($filter("translate")("issue.failedToCriticalListLookup"), result.data.message.message, "error"); // 중요도 목록 조회 실패 |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function onChangeColumnSetting() { |
| | | $scope.fn.getSeverities(); |
| | | $scope.fn.getPriorities(); |
| | | $scope.fn.onChangeIssueType(); |
| | | } |
| | | |
| | | |
| | | function onChangeIssueTypeSpec() { |
| | | $scope.fn.getIssueTypeCustomFields(); |
| | |
| | | $scope.vm.sampleJsonModify = JSON.stringify(jsonData, undefined, 2); |
| | | } |
| | | |
| | | function getProjectList() { |
| | | $scope.$watch(function() { |
| | | return $rootScope.projects; |
| | | }, function() { |
| | | if ($rootScope.projects != null && $rootScope.projects.length > 0) { |
| | | // 공통 데이터 불러오기 |
| | | $scope.fn.getProjects(); |
| | | $scope.fn.getIssueTypes(); |
| | | } |
| | | }, true); |
| | | |
| | | |
| | | function getProjects() { |
| | | if ($rootScope.projects != null) { |
| | | $scope.vm.projects = []; |
| | | $rootScope.projects.forEach(function (project){ |
| | |
| | | $scope.vm.projects.push(project); |
| | | } |
| | | }); |
| | | $scope.vm.projectId = $scope.vm.projects[0].id.toString(); |
| | | |
| | | if ( $scope.vm.projects.length > 0) { |
| | | $scope.vm.projectId = $scope.vm.projects[0].id.toString(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | function loadSpec() { |
| | | $scope.fn.getIssueStatuses(); |
| | | $scope.fn.getIssueTypeCustomFields(); |
| | | } |
| | | |
| | | function start() { |
| | | $scope.fn.initForm(); |
| | | $scope.fn.getProjectList(); |
| | | $scope.fn.getSeverities(); |
| | | $scope.fn.getPriorities(); |
| | | $scope.fn.getIssueTypes(); |
| | | } |
| | | $scope.fn.start(); |
| | | |
| | | }]); |
| | | }); |