From 725dcc23d6dd79b49790d98a3248e42173d8eb54 Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Thu, 9 Feb 2017 16:26:33 +0200 Subject: [PATCH 1/3] Add a Complete appeals button on challenge card --- app/directives/challenge-tile/challenge-tile.jade | 4 ++++ app/filters/challengeLinks.filter.js | 4 ++++ app/services/challenge.service.js | 3 +++ assets/css/directives/challenge-tile.scss | 7 ++++--- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/directives/challenge-tile/challenge-tile.jade b/app/directives/challenge-tile/challenge-tile.jade index 092f8e700..0cbb43640 100644 --- a/app/directives/challenge-tile/challenge-tile.jade +++ b/app/directives/challenge-tile/challenge-tile.jade @@ -21,6 +21,8 @@ .phase-action(ng-show="challenge.userAction", ng-switch="challenge.userAction") a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost.submit(ng-switch-when="Submit", ng-href="{{challenge|challengeLinks:'submit'}}") Submit + a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost.submit(ng-switch-when="Appeal", ng-href="{{challenge|challengeLinks:'viewScorecards'}}") View Scorecards + a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost.submit(ng-switch-when="Appeal", ng-href="{{challenge|challengeLinks:'completeAppeals'}}") Complete Appeals .submitted(ng-switch-when="Submitted") Submitted @@ -97,6 +99,8 @@ .phase-action(ng-switch="challenge.userAction") a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost.submit(ng-switch-when="Submit", ng-href="{{challenge|challengeLinks:'submit'}}") Submit + a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost.submit(ng-switch-when="Appeal", ng-href="{{challenge|challengeLinks:'viewScorecards'}}") View Scorecards + a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost.submit(ng-switch-when="Appeal", ng-href="{{challenge|challengeLinks:'completeAppeals'}}") Complete Appeals .submitted(ng-switch-when="Submitted") Submitted diff --git a/app/filters/challengeLinks.filter.js b/app/filters/challengeLinks.filter.js index 67439916c..d68ad4f53 100644 --- a/app/filters/challengeLinks.filter.js +++ b/app/filters/challengeLinks.filter.js @@ -69,6 +69,10 @@ import _ from 'lodash' return String.supplant('https://{subdomain}.{domain}/challenge-details/{id}/?type={track}', data) case 'detail': return String.supplant('https://{subdomain}.{domain}/challenge-details/{id}/?type={track}', data) + case 'viewScorecards': + return String.supplant('https://software.{domain}/review/actions/ViewProjectDetails?pid={id}', data) + case 'completeAppeals': + return String.supplant('https://software.{domain}/review/actions/EarlyAppeals?pid={id}', data) } } } diff --git a/app/services/challenge.service.js b/app/services/challenge.service.js index a9ecd0492..0a22232ce 100644 --- a/app/services/challenge.service.js +++ b/app/services/challenge.service.js @@ -105,6 +105,9 @@ import moment from 'moment' } }) } + if (challenge.userCurrentPhase === 'Appeals') { + challenge.userAction = 'Appeal' + } if (challenge.userCurrentPhaseEndTime) { var fullTime = challenge.userCurrentPhaseEndTime diff --git a/assets/css/directives/challenge-tile.scss b/assets/css/directives/challenge-tile.scss index ef8b13dc8..28e6de3e3 100644 --- a/assets/css/directives/challenge-tile.scss +++ b/assets/css/directives/challenge-tile.scss @@ -245,8 +245,8 @@ challenge-tile .challenge.tile-view { min-height: 55px; .submit { - margin-bottom: 25px; - display: inline-block; + margin: 12px; + display: block; } .submitted { @@ -498,7 +498,8 @@ challenge-tile .challenge.list-view { .phase-action { .submit { - display: inline-block; + display: block; + margin: 6px 0; } .submitted { From e59fe155015bfec244f1202fc1233a304b5a0c8d Mon Sep 17 00:00:00 2001 From: Tom Ladendorf Date: Fri, 10 Feb 2017 19:19:47 +0100 Subject: [PATCH 2/3] Latest changes for challenge listings --- app/listings/listings.controller.js | 22 ++++++++++++++++++---- app/listings/listings.jade | 3 ++- app/listings/listings.module.js | 2 +- app/listings/listings.routes.js | 0 package.json | 2 +- 5 files changed, 22 insertions(+), 7 deletions(-) mode change 100644 => 100755 app/listings/listings.controller.js mode change 100644 => 100755 app/listings/listings.jade mode change 100644 => 100755 app/listings/listings.module.js mode change 100644 => 100755 app/listings/listings.routes.js diff --git a/app/listings/listings.controller.js b/app/listings/listings.controller.js old mode 100644 new mode 100755 index 5ed5eae6a..427ac5754 --- a/app/listings/listings.controller.js +++ b/app/listings/listings.controller.js @@ -1,23 +1,37 @@ import angular from 'angular' +import { loadUser, getCurrentUser } from '../services/userv3.service.js' (function () { 'use strict' angular.module('tc.listings').controller('ListingsCtrl', ListingsCtrl) - ListingsCtrl.$inject = ['CONSTANTS', 'logger', '$q', - 'TcAuthService', 'UserService', 'UserStatsService', 'ProfileService', 'ChallengeService', 'ExternalAccountService', - 'ngDialog', '$anchorScroll' + ListingsCtrl.$inject = ['CONSTANTS', 'logger', '$q','TcAuthService', 'UserService', + 'UserStatsService', 'ProfileService', 'ChallengeService', + 'ExternalAccountService', 'ngDialog', '$anchorScroll', '$scope', ] - function ListingsCtrl(CONSTANTS, logger, $q, TcAuthService, UserService, UserStatsService, ProfileService, ChallengeService, ExternalAccountService, ngDialog, $anchorScroll) { + function ListingsCtrl(CONSTANTS, logger, $q, TcAuthService, UserService, UserStatsService, ProfileService, + ChallengeService, ExternalAccountService, ngDialog, $anchorScroll, $scope) { + var vm = this activate() function activate() { + $scope.myChallenges = [] + $scope.userProps = { isAuth: false } logger.debug('Calling ListingsController activate()') + loadUser().then(function(token) { + // update auth flag + if(TcAuthService.isAuthenticated()) { + $scope.userProps = { isAuth: true } + } + }, function(error) { + // do nothing, just show non logged in state of navigation bar + }) } + } })() diff --git a/app/listings/listings.jade b/app/listings/listings.jade old mode 100644 new mode 100755 index 1774c70e3..ccbc73bd0 --- a/app/listings/listings.jade +++ b/app/listings/listings.jade @@ -1 +1,2 @@ -react-component(name="ChallengeFiltersExample") + + \ No newline at end of file diff --git a/app/listings/listings.module.js b/app/listings/listings.module.js old mode 100644 new mode 100755 index 102cdcab2..e990da228 --- a/app/listings/listings.module.js +++ b/app/listings/listings.module.js @@ -12,7 +12,7 @@ import { ChallengeFiltersExample } from 'appirio-tech-react-components' 'tcUIComponents', 'angularSlideables', 'ngDialog', - 'react' + 'react', ] angular.module('tc.listings', dependencies) diff --git a/app/listings/listings.routes.js b/app/listings/listings.routes.js old mode 100644 new mode 100755 diff --git a/package.json b/package.json index 5e5663811..6ae0eaaae 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "appirio-styles": "0.x.x", "appirio-tech-ng-iso-constants": "^1.0.6", "appirio-tech-ng-ui-components": "^2.1.2", - "appirio-tech-react-components": "appirio-tech/react-components.git#challenge-listings", + "appirio-tech-react-components": "nomo-kazza/react-components.git#challenge-listings", "auth0-angular": "^4.1.0", "auth0-js": "^6.8.0", "d3": "^3.5.14", From c514513ffd41700c4c76902eab5f4758899dac85 Mon Sep 17 00:00:00 2001 From: Tom Ladendorf Date: Fri, 10 Feb 2017 19:27:50 +0100 Subject: [PATCH 3/3] fixing linting errors --- app/listings/listings.controller.js | 5 ++--- app/listings/listings.module.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/listings/listings.controller.js b/app/listings/listings.controller.js index 427ac5754..9d0774758 100755 --- a/app/listings/listings.controller.js +++ b/app/listings/listings.controller.js @@ -1,5 +1,5 @@ import angular from 'angular' -import { loadUser, getCurrentUser } from '../services/userv3.service.js' +import { loadUser } from '../services/userv3.service.js' (function () { 'use strict' @@ -8,12 +8,11 @@ import { loadUser, getCurrentUser } from '../services/userv3.service.js' ListingsCtrl.$inject = ['CONSTANTS', 'logger', '$q','TcAuthService', 'UserService', 'UserStatsService', 'ProfileService', 'ChallengeService', - 'ExternalAccountService', 'ngDialog', '$anchorScroll', '$scope', + 'ExternalAccountService', 'ngDialog', '$anchorScroll', '$scope' ] function ListingsCtrl(CONSTANTS, logger, $q, TcAuthService, UserService, UserStatsService, ProfileService, ChallengeService, ExternalAccountService, ngDialog, $anchorScroll, $scope) { - var vm = this activate() diff --git a/app/listings/listings.module.js b/app/listings/listings.module.js index e990da228..102cdcab2 100755 --- a/app/listings/listings.module.js +++ b/app/listings/listings.module.js @@ -12,7 +12,7 @@ import { ChallengeFiltersExample } from 'appirio-tech-react-components' 'tcUIComponents', 'angularSlideables', 'ngDialog', - 'react', + 'react' ] angular.module('tc.listings', dependencies)