Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Promote to prod - Bug Bash 3 #1096

Merged
merged 14 commits into from
Mar 22, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix for issue #1083 Complete Appeals shown only when Submitter role p…
…resent

Added a new (boolean) variable in challenge services, isSubmitter. This is
true only when Submitter role is present. A condition ng-if
in challenge-tile jade checks if this variable is true. Only then the Complete
 Appeals appears. Test with two different accounts one with role submitter and
one with other roles (copilot) in a challenges that is in appeals phase.
  • Loading branch information
Savvas-cl committed Mar 19, 2017
commit 257bd5fc9cd8690ac3d560dddef2a5a4475cf4f2
4 changes: 2 additions & 2 deletions app/directives/challenge-tile/challenge-tile.jade
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
.stalled-challenge(ng-hide="challenge.userCurrentPhaseEndTime") This challenge is currently paused.

.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="Submit", ng-href="{{challenge|challengeLinks:'submit'}}") Submit
a.tc-btn.tc-btn-s.tc-btn-wide.btn-danger.submit(ng-switch-when="Submit", ng-href="{{challenge|challengeLinks:'unRegister'}}") Unregister
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.btn-danger.submit(ng-switch-when="Appeal", ng-href="{{challenge|challengeLinks:'completeAppeals'}}") Complete Appeals
a.tc-btn.tc-btn-s.tc-btn-wide.btn-danger.submit(ng-if="challenge.isSubmitter")(ng-switch-when="Appeal", ng-href="{{challenge|challengeLinks:'completeAppeals'}}") Complete Appeals

.submitted(ng-switch-when="Submitted") Submitted

Expand Down
4 changes: 4 additions & 0 deletions app/services/challenge.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import moment from 'moment'
challenge.userCurrentPhase = 'Stalled'
challenge.userCurrentPhaseEndTime = null
challenge.userAction = null
challenge.isSubmitter = false

if (phases && phases.length) {
hasCurrentPhase = true
Expand Down Expand Up @@ -96,6 +97,9 @@ import moment from 'moment'
if (roles && roles.length > 0) {
var submitterRole = _.findIndex(roles, function(role) {
var lRole = role.toLowerCase()
if (lRole === 'submitter') {
challenge.isSubmitter = true
}
return lRole === 'submitter'
})
if (submitterRole === -1) {
Expand Down