From 3a75c4eecba6f001eaf4831ba1a1ccdf113fe795 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 1 Oct 2020 13:58:11 -0500 Subject: [PATCH 1/2] Issue 80: On "Active Sprints" board show icon for Milestone or Project depending on how the Sprint is populated The crafted icons are added any each reasonable location, helping improve usability via the icon as hints. This includes icons for all known ServiceTypes. This also fixes the management board, thereby allowing for the remote project management icons being displayed in this case as well. --- app/controllers/productController.js | 22 ++++++++++ app/directives/remoteProjectsIconDirective.js | 34 +++++++++++++++ app/index.html | 1 + app/resources/images/github-milestone.png | Bin 0 -> 1639 bytes app/resources/images/github-project.png | Bin 0 -> 1065 bytes app/resources/images/versionone.png | Bin 0 -> 3545 bytes .../styles/sass/directives/_all.scss | 3 +- .../sass/directives/_remoteProjectsIcon.scss | 5 +++ .../styles/sass/management/_products.scss | 21 ++++++++- app/views/directives/remoteProjectsIcon.html | 3 ++ app/views/home.html | 12 +++++- app/views/management/products.html | 19 +++++++-- .../management/remoteProjectManager.html | 5 ++- app/views/modals/addProductModal.html | 8 +++- app/views/modals/editProductModal.html | 8 +++- tests/mock/model/mockProduct.js | 8 ++-- .../unit/controllers/productControllerTest.js | 23 ++++++++++ .../directives/remoteProjectsIconDirective.js | 40 ++++++++++++++++++ 18 files changed, 196 insertions(+), 16 deletions(-) create mode 100644 app/directives/remoteProjectsIconDirective.js create mode 100644 app/resources/images/github-milestone.png create mode 100644 app/resources/images/github-project.png create mode 100644 app/resources/images/versionone.png create mode 100644 app/resources/styles/sass/directives/_remoteProjectsIcon.scss create mode 100644 app/views/directives/remoteProjectsIcon.html create mode 100644 tests/unit/directives/remoteProjectsIconDirective.js diff --git a/app/controllers/productController.js b/app/controllers/productController.js index 72866b4..384e2cc 100644 --- a/app/controllers/productController.js +++ b/app/controllers/productController.js @@ -123,6 +123,28 @@ app.controller('ProductController', function ($controller, $scope, ApiResponseAc $scope.otherUrlsChanged = true; }; + $scope.distinctRemoteProjectManagers = function (remoteProjectInfo) { + var list = []; + var matched = false; + + for (var i in remoteProjectInfo) { + matched = false; + + for (var j in list) { + if (remoteProjectInfo[i].remoteProjectManager.id === list[j].remoteProjectManager.id) { + matched = true; + break; + } + } + + if (!matched) { + list.push(remoteProjectInfo[i]); + } + } + + return list; + }; + if ($scope.isManager() || $scope.isAdmin()) { $scope.remoteProjectManagers = RemoteProjectManagerRepo.getAll(); diff --git a/app/directives/remoteProjectsIconDirective.js b/app/directives/remoteProjectsIconDirective.js new file mode 100644 index 0000000..23e1105 --- /dev/null +++ b/app/directives/remoteProjectsIconDirective.js @@ -0,0 +1,34 @@ +app.directive('remoteProjectsIcon', function ($controller) { + return { + templateUrl: 'views/directives/remoteProjectsIcon.html', + restrict: 'E', + scope: { + type: '@', + width: '@', + height: '@' + }, + link: function ($scope, element, attr) { + $scope.typeIcon = false; + $scope.tooltip = ""; + + if ($scope.type === 'GITHUB_MILESTONE') { + $scope.typeIcon = 'github-milestone.png'; + $scope.tooltip = "Github Milestone"; + } else if ($scope.type === 'GITHUB_PROJECT') { + $scope.typeIcon = 'github-project.png'; + $scope.tooltip = "Github Project"; + } else if ($scope.type === 'VERSION_ONE') { + $scope.typeIcon = 'versionone.png'; + $scope.tooltip = "Versione One"; + } + + if (angular.isUndefined($scope.width)) { + $scope.width = "16"; + } + + if (angular.isUndefined($scope.height)) { + $scope.height = "16"; + } + } + }; +}); diff --git a/app/index.html b/app/index.html index d151a9b..fff9714 100644 --- a/app/index.html +++ b/app/index.html @@ -193,6 +193,7 @@ + diff --git a/app/resources/images/github-milestone.png b/app/resources/images/github-milestone.png new file mode 100644 index 0000000000000000000000000000000000000000..1ae3fab28708ee088b3a1769f3ac8c5c0d8f46c5 GIT binary patch literal 1639 zcmV-t2AKJYP){LYK~#90?V5jx6jdC+KX2CEbHzRG_N^!AKbKMjX<!H?CkCBo!Y2@@d=nYb7l%iG-X(AL@70YXlUq-M%#~1Ksud{ z>`*QvPv>&E`xLpUjXT#WYUz~D2 zlhwH*NTpI6fa5;uSF+j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mpIDg00000NkvXXu0mjfM-|mr literal 0 HcmV?d00001 diff --git a/app/resources/images/versionone.png b/app/resources/images/versionone.png new file mode 100644 index 0000000000000000000000000000000000000000..1082c62695d87bdcef55c300d799a8f615a68efe GIT binary patch literal 3545 zcmV;~4JPu5P)~Bu5*P=GffZhqhFN3awQ*E#B)*>re|=Z8h39N}i~Xhi09kE zrcIl|+uPf7%x3cvo6WWuK(gI#R{~H1kOHs*7zbct7^YVw67@(VlFP}-$(^T8of@9+ z_?Y>)1s-_dfuy0Kq4id)^*`)(`!WPZG_frEy+|ZFrBEo2bai!|3wE495DD17f4{i8 zy1K}0Hvf@`asV*FusaKeVJ=G~l7spA`R~5_?z=aFW_PXx{E~Q?*=+tZ5hVmGFn3@W zW>g}P{C9qS{@;T^#GD97NlD2WA0OXML`%KZ6^q4)iHSi{QW6#}T!_%nP=thpz-F^y za&i)5V`I?ibkON^uvjeK180~)xm^Bdy3D~)FXUMKyyZ&aiTK@zOT|F%= z4S9KaSh;c~GBYy~5)$Iow#{b4g$ozZ-rkOrCr{$+*|V_Q?QZLfM50f!v$LOTX=xep zHxD2H0+uaXmU#8*)dnKUa8)jo$*^I=29%bTA}uW~keGPr@9#%bQxgsxIDnB6*Euo_ zGY}CGv9YVGtKDDwei4wGnwmW}Hr5OvLRc0O5`xW}H>13~9CzJym%nj%#q{(v>g(%K zQ&WSnu`yRwZpvh`KVH3h^{_v7eI_6&Dd|6rMq?uYxv*^Y>eYDbt+$YnFz;g^#>U1_ zU0sd(`g#zNu$ZJ$=}Q9x18@6k&nE&B6B8eqoSggzfCY|vsZ@%}%1S)<+;d=)Tk;^X533Od+OC=_UHY{Y{P zJ}4{-85tRAC@LyadTQ_X7Ko0H-fFQ}b~@@JA|i0�e~3ym)R=&jThVCQwjNfFFMN zfu|RVM2CllhMsZP&Lsg^Sy_wpdi{3*!e(_W%c8Nd5vy0P1^`$r7MM&Xu8mkMMtFGm z+%v(gWE>|y;o;#Bi@mR>`uh5io0|)x(a6(>h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styles/sass/directives/_all.scss +++ b/app/resources/styles/sass/directives/_all.scss @@ -1,2 +1,3 @@ @import "header"; -@import "footer"; \ No newline at end of file +@import "footer"; +@import "remoteProjectsIcon"; diff --git a/app/resources/styles/sass/directives/_remoteProjectsIcon.scss b/app/resources/styles/sass/directives/_remoteProjectsIcon.scss new file mode 100644 index 0000000..c07e6f0 --- /dev/null +++ b/app/resources/styles/sass/directives/_remoteProjectsIcon.scss @@ -0,0 +1,5 @@ +.remote-product-icon { + display: inline-block; + position: relative; + top: 0px; +} diff --git a/app/resources/styles/sass/management/_products.scss b/app/resources/styles/sass/management/_products.scss index 1b541b6..e69a642 100644 --- a/app/resources/styles/sass/management/_products.scss +++ b/app/resources/styles/sass/management/_products.scss @@ -2,6 +2,20 @@ cursor: pointer; } +.management-table { + .product-table { + .product-rpm-row { + clear: both; + } + } +} + +.product-rpm-icons { + .remote-product-icon { + padding: 0px 3px; + } +} + .remote-product-panel { margin-top: 20px; @@ -20,4 +34,9 @@ ul { margin-bottom: 0; } -} \ No newline at end of file + + .remote-product-icon { + top: -4px; + padding-right: 6px; + } +} diff --git a/app/views/directives/remoteProjectsIcon.html b/app/views/directives/remoteProjectsIcon.html new file mode 100644 index 0000000..c6e7262 --- /dev/null +++ b/app/views/directives/remoteProjectsIcon.html @@ -0,0 +1,3 @@ + + + diff --git a/app/views/home.html b/app/views/home.html index 13d0ee5..fe232f4 100644 --- a/app/views/home.html +++ b/app/views/home.html @@ -34,7 +34,10 @@ {{sprint.id}} {{sprint.name}} - {{sprint.product}} + + + {{sprint.product}} + {{sprint.cards.length}} {{getSprintEstimateTotal(sprint)}} @@ -102,7 +105,12 @@ Internal Count - {{product.name}} + + + + + {{product.name}} + {{product.stats.backlogItemCount}} {{product.stats.featureCount}} {{product.stats.defectCount}} diff --git a/app/views/management/products.html b/app/views/management/products.html index f9e4822..0852dda 100644 --- a/app/views/management/products.html +++ b/app/views/management/products.html @@ -15,9 +15,22 @@ {{product.name}} - {{product.remoteProjectManager.name}} - {{product.remoteProject.name}} - {{product.scopeId}} + +
+ + {{rpi.remoteProjectManager.name}} +
+ + +
+
{{getRemoteProjectByRemoteProjectInfo(rpi).name}}
+
+ + +
+
{{rpi.scopeId}}
+
+ diff --git a/app/views/management/remoteProjectManager.html b/app/views/management/remoteProjectManager.html index d6d3202..b325422 100644 --- a/app/views/management/remoteProjectManager.html +++ b/app/views/management/remoteProjectManager.html @@ -10,7 +10,10 @@ Actions - {{remoteProjectManager.name}} + + + {{remoteProjectManager.name}} + {{remoteProjectManager.url}} diff --git a/app/views/modals/addProductModal.html b/app/views/modals/addProductModal.html index 472c014..ced4b05 100644 --- a/app/views/modals/addProductModal.html +++ b/app/views/modals/addProductModal.html @@ -38,8 +38,12 @@
    -
  • {{getRemoteProjectByRemoteProjectInfo(remoteProject).name}} - +
  • + {{getRemoteProjectByRemoteProjectInfo(remoteProject).name}} + + + +
diff --git a/app/views/modals/editProductModal.html b/app/views/modals/editProductModal.html index 9798f75..6a6651e 100644 --- a/app/views/modals/editProductModal.html +++ b/app/views/modals/editProductModal.html @@ -39,8 +39,12 @@
    -
  • {{getRemoteProjectByRemoteProjectInfo(remoteProject).name}} - +
  • + {{getRemoteProjectByRemoteProjectInfo(remoteProject).name}} + + + +
diff --git a/tests/mock/model/mockProduct.js b/tests/mock/model/mockProduct.js index d17ce81..513eb29 100644 --- a/tests/mock/model/mockProduct.js +++ b/tests/mock/model/mockProduct.js @@ -5,7 +5,7 @@ var dataProduct1 = { remoteProjectManager: { id: 1, name: "Remote Project Manager 1", - type: "VERSION_ONE", + type: "GITHUB_MILESTONE", url: "url1", token: "username1:password1" }, @@ -18,8 +18,8 @@ var dataProduct2 = { name: "Product 2", remoteProjectInfo: [{ remoteProjectManager: { - id: 1, - name: "Remote Project Manager 1", + id: 2, + name: "Remote Project Manager 2", type: "VERSION_ONE", url: "url2", token: "username2:password2" @@ -35,7 +35,7 @@ var dataProduct3 = { remoteProjectManager: { id: 1, name: "Remote Project Manager 1", - type: "VERSION_ONE", + type: "GITHUB_MILESTONE", url: "url1", token: "username1:password1" }, diff --git a/tests/unit/controllers/productControllerTest.js b/tests/unit/controllers/productControllerTest.js index 06ef2de..6d25612 100644 --- a/tests/unit/controllers/productControllerTest.js +++ b/tests/unit/controllers/productControllerTest.js @@ -99,6 +99,7 @@ describe("controller: ProductController", function () { "confirmDeleteProduct", "createProduct", "deleteProduct", + "distinctRemoteProjectManagers", "editProduct", "getRemoteProjectByRemoteProjectInfo", "getRemoteProjectManagerRemoteProjects", @@ -208,6 +209,28 @@ describe("controller: ProductController", function () { expect($scope.cancelDeleteProduct).toHaveBeenCalled(); }); + it("distinctRemoteProjectManagers should return a distinct list", function () { + var response; + var rpis = [ + { + scopeId: "0010", + remoteProjectManager: dataRemoteProjectManager1 + }, + { + scopeId: "0020", + remoteProjectManager: dataRemoteProjectManager2 + }, + { + scopeId: "0030", + remoteProjectManager: dataRemoteProjectManager1 + } + ] + + response = $scope.distinctRemoteProjectManagers(rpis); + + expect(response.length).toEqual(2); + }); + it("editProduct set the productToEdit and open the modal", function () { spyOn($scope, "openModal"); diff --git a/tests/unit/directives/remoteProjectsIconDirective.js b/tests/unit/directives/remoteProjectsIconDirective.js new file mode 100644 index 0000000..cab5570 --- /dev/null +++ b/tests/unit/directives/remoteProjectsIconDirective.js @@ -0,0 +1,40 @@ +describe("directive: remoteProjectsIcon", function () { + var $compile, $q, $scope, directive, element; + + var initializeVariables = function () { + inject(function (_$q_, _$compile_) { + $q = _$q_; + $compile = _$compile_; + }); + }; + + var initializeDirective = function (settings) { + inject(function (_$rootScope_) { + $scope = _$rootScope_.$new(); + + var attr = settings && settings.attr ? settings.attr : "type=\"GITHUB_MILESTONE\""; + var body = settings && settings.body ? settings.body : ""; + + element = angular.element("" + body + ""); + directive = $compile(element)($scope); + + $scope.$digest(); + }); + }; + + beforeEach(function () { + module("core"); + module("app"); + module("templates"); + + installPromiseMatchers(); + initializeVariables(); + }); + + describe("Is the directive", function () { + it("defined", function () { + initializeDirective(); + expect(directive).toBeDefined(); + }); + }); +}); From 6ded475c04d9c8de6c97a0d526ecb1c0939fa934 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 1 Oct 2020 14:10:23 -0500 Subject: [PATCH 2/2] Increase coverage with directive tests. --- .../directives/remoteProjectsIconDirective.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/unit/directives/remoteProjectsIconDirective.js b/tests/unit/directives/remoteProjectsIconDirective.js index cab5570..a783637 100644 --- a/tests/unit/directives/remoteProjectsIconDirective.js +++ b/tests/unit/directives/remoteProjectsIconDirective.js @@ -12,7 +12,7 @@ describe("directive: remoteProjectsIcon", function () { inject(function (_$rootScope_) { $scope = _$rootScope_.$new(); - var attr = settings && settings.attr ? settings.attr : "type=\"GITHUB_MILESTONE\""; + var attr = settings && settings.attr ? settings.attr : ""; var body = settings && settings.body ? settings.body : ""; element = angular.element("" + body + ""); @@ -36,5 +36,20 @@ describe("directive: remoteProjectsIcon", function () { initializeDirective(); expect(directive).toBeDefined(); }); + + it("defined using GITHUB_MILESTONE", function () { + initializeDirective({attr: "type=\"GITHUB_MILESTONE\""}); + expect(directive).toBeDefined(); + }); + + it("defined using GITHUB_PROJECT", function () { + initializeDirective({attr: "type=\"GITHUB_PROJECT\""}); + expect(directive).toBeDefined(); + }); + + it("defined using VERSION_ONE", function () { + initializeDirective({attr: "type=\"VERSION_ONE\""}); + expect(directive).toBeDefined(); + }); }); });