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

Commit 93f5e32

Browse files
authored
Merge pull request #488 from appirio-tech/dev
Bug Bash 3
2 parents cb5078d + 4f505fe commit 93f5e32

File tree

5 files changed

+80
-52
lines changed

5 files changed

+80
-52
lines changed

src/css/challenge-detail-software.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,9 @@ h1.center {
429429
padding-right: 20px;
430430
}
431431

432+
.challenge-detail .tableWrap pre {
433+
overflow-x: auto;
434+
}
432435
.challenge-detail .currentTab-checkpoints .tableWrap,
433436
.challenge-detail .currentTab-submissions .tableWrap,
434437
.challenge-detail .currentTab-winner .tableWrap {

src/footer.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ <h2>Comment Examples</h2>
249249
],
250250
'community': [
251251
{ 'href': '/community/members/', 'text': 'OVERVIEW', 'icon': '/mf/i/nav/members.svg' },
252+
{ 'href': '/tco', 'text': 'TCO', 'icon': '/mf/i/nav/tco-generic.svg', 'target': '_blank' },
252253
{ 'href': '/community/member-programs/', 'text': 'PROGRAMS', 'icon': '/mf/i/nav/programs.svg' },
253254
{ 'href': 'https://' + tcconfig.forumsAppURL, 'text': 'FORUMS', 'icon': '/mf/i/nav/forums.svg' },
254255
{ 'href': '/community/statistics/', 'text': 'STATISTICS', 'icon': '/mf/i/nav/statistics.svg' },

src/js/app/challenge-details/index.html

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,12 @@
1111
<div class="container rightSplit grid-3-3">
1212

1313
<div class="leftColumn">
14-
<div ng-if="!CD.isDesign">
15-
<div ng-repeat="button in CD.buttons track by $index">
16-
<a class="btn btnAction {{button.classes}}" target="_blank" ng-href="{{button.href || 'javascript:void(0);'}}" ng-click="button.onClick()">
17-
<span>{{$index + 1}}</span>
18-
<strong>{{button.text}}</strong>
19-
</a>
20-
</div>
14+
<div ng-repeat="button in CD.buttons track by $index">
15+
<a class="btn btnAction {{button.classes}}" target="_blank" ng-href="{{button.href || 'javascript:void(0);'}}" ng-click="button.onClick()">
16+
<span>{{$index + 1}}</span>
17+
<strong>{{button.text}}</strong>
18+
</a>
2119
</div>
22-
<a ng-show="CD.isDesign" ng-click="CD.challenge.allowToUnregister?CD.unregisterFromChallenge():CD.registerToChallenge()" ng-class="{disabled:!CD.challenge.allowToUnregister && (CD.challenge.registrationDisabled || !CD.callComplete), disabledNOT:!CD.challenge.registrationDisabled, unregister: CD.challenge.allowToUnregister}" class="btn btnAction challengeRegisterBtn" href="javascript:;">
23-
<span>1</span>
24-
<strong ng-hide="CD.isRegistered">
25-
Register For This Challenge
26-
</strong>
27-
<strong ng-show="CD.isRegistered">
28-
Unregister From This Challenge
29-
</strong>
30-
</a>
31-
<a ng-show="CD.isDesign" ng-class="{disabled:CD.challenge.submissionDisabled || !CD.callComplete, disabledNOT:!CD.challenge.submissionDisabled}" class="btn btnAction" target="_blank"
32-
ng-href="/challenges/{{CD.challenge.challengeId}}/submit/file">
33-
<span>2</span> <strong>Submit Your Entries</strong>
34-
</a>
35-
<a ng-show="CD.isDesign" ng-class="{disabled:CD.challenge.submissionDisabled || !CD.callComplete, disabledNOT:!CD.challenge.submissionDisabled}" class="btn btnAction" target="_blank"
36-
ng-href="//studio.{{CD.domain}}/?module=ViewSubmission&ct={{CD.challenge.challengeId}}">
37-
<span>3</span> <strong>View Your Submission</strong>
38-
</a>
39-
<a ng-show="!CD.isDesign && CD.isPeerReviewed" ng-class="{disabled:CD.challenge.peerReviewDisabled || !CD.callComplete, disabledNOT:!CD.challenge.peerReviewDisabled}" class="btn btnAction" ng-href="/challenges/{{CD.challenge.challengeId}}/reviews/" target="_blank">
40-
<span>3</span><strong>Review This Challenge</strong>
41-
</a>
4220
</div>
4321

4422
<div class="middleColumn member-program-path" ng-show="CD.isPeerReviewed && CD.phaseProgram">

src/js/app/challenge-details/js/controllers/challenge-details-controller.js

Lines changed: 70 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,7 @@
183183
ChallengeService.getChallengeTerms(challengeId).then(function (termsList) {
184184
vm.termsList = termsList;
185185
});
186-
ChallengeService
187-
.getUserChallenges(vm.handle, vm.challengeApiParams)
188-
.then(function (challenge) {
189-
if (challenge[0] && challenge[0].result.content.length) {
190-
challenge = challenge[0].result.content[0];
191-
vm.userRole = challenge.userDetails ? challenge.userDetails.roles : [];
192-
} else {
193-
vm.userRole = [];
194-
}
195-
//Set to test value if defined
196-
vm.userRole = vm.mockUserRole ? vm.mockUserRole : vm.userRole;
197-
});
186+
getUserRole();
198187
ChallengeService
199188
.getChallenge(challengeId)
200189
.then(function (challenge) {
@@ -213,6 +202,27 @@
213202
.then(function (challenge) {
214203
processChallenge(challenge, vm.handle, vm, ChallengeService);
215204
});
205+
getUserRole();
206+
}
207+
208+
/**
209+
*
210+
* Updates User Role for the challenge
211+
* @param ChallengeService
212+
*/
213+
function getUserRole() {
214+
ChallengeService
215+
.getUserChallenges(vm.handle, vm.challengeApiParams)
216+
.then(function (challenge) {
217+
if (challenge[0] && challenge[0].result.content.length) {
218+
challenge = challenge[0].result.content[0];
219+
vm.userRole = challenge.userDetails ? challenge.userDetails.roles : [];
220+
} else {
221+
vm.userRole = [];
222+
}
223+
//Set to test value if defined
224+
vm.userRole = vm.mockUserRole ? vm.mockUserRole : vm.userRole;
225+
});
216226
}
217227

218228
/**
@@ -396,7 +406,8 @@
396406
}
397407

398408
// If is not submited, then enable submission
399-
if (((moment(challenge.submissionEndDate)) > moment()) && regList.indexOf(handle) > -1) {
409+
var challengeSubmissionPhase = _.find(vm.challenge.phases, function(phase) { return phase.type === 'Submission'; })
410+
if ((challengeSubmissionPhase && challengeSubmissionPhase.status === 'Open') && regList.indexOf(handle) > -1) {
400411
vm.challenge.submissionDisabled = false;
401412
}
402413

@@ -562,17 +573,7 @@
562573

563574
function initButtons(vm) {
564575
vm.buttons = [];
565-
if (vm.challenge.currentPhaseName === 'Appeals' && vm.hasSubmitted) {
566-
vm.buttons.push(newButton({
567-
text: 'View Scorecard',
568-
href: '//' + vm.reviewAppURL + '/actions/ViewProjectDetails?pid=' + vm.challenge.challengeId,
569-
}));
570-
vm.buttons.push(newButton({
571-
text: 'Complete Appeals',
572-
href: '//' + vm.reviewAppURL + '/actions/EarlyAppeals?pid=' + vm.challenge.challengeId,
573-
classes: 'unregister'
574-
}));
575-
} else {
576+
if (vm.isDesign) {
576577
if (vm.challenge.allowToUnregister) {
577578
vm.buttons.push(newButton({
578579
classes: 'challengeRegisterBtn unregister',
@@ -591,6 +592,51 @@
591592
classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'),
592593
text: 'Submit Your Entries'
593594
}));
595+
vm.buttons.push(newButton({
596+
href: '//studio.' + vm.domain + '/?module=ViewSubmission&ct=' + vm.challenge.challengeId,
597+
text: 'View Your Submission',
598+
classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'),
599+
}))
600+
} else {
601+
if (vm.challenge.currentPhaseName === 'Appeals') {
602+
vm.buttons.push(newButton({
603+
text: 'View Scorecard',
604+
href: '//' + vm.reviewAppURL + '/actions/ViewProjectDetails?pid=' + vm.challenge.challengeId,
605+
}));
606+
if (vm.hasSubmitted) {
607+
vm.buttons.push(newButton({
608+
text: 'Complete Appeals',
609+
href: '//' + vm.reviewAppURL + '/actions/EarlyAppeals?pid=' + vm.challenge.challengeId,
610+
classes: 'unregister'
611+
}));
612+
}
613+
} else {
614+
if (vm.challenge.allowToUnregister) {
615+
vm.buttons.push(newButton({
616+
classes: 'challengeRegisterBtn unregister',
617+
onClick: vm.unregisterFromChallenge,
618+
text: 'Unregister From This Challenge'
619+
}));
620+
} else {
621+
vm.buttons.push(newButton({
622+
classes: 'challengeRegisterBtn ' + (vm.challenge.registrationDisabled ? 'disabled ' : 'disabledNOT'),
623+
onClick: vm.registerToChallenge,
624+
text: 'Register For This Challenge'
625+
}));
626+
}
627+
vm.buttons.push(newButton({
628+
href: '/challenge-details/' + vm.challenge.challengeId + '/submit/?type=develop',
629+
classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'),
630+
text: 'Submit Your Entries'
631+
}));
632+
if (!vm.challenge.peerReviewDisabled) {
633+
vm.buttons.push(newButton({
634+
href: '/challenges/' + vm.challenge.challengeId + '/reviews/',
635+
classes: (vm.challenge.peerReviewDisabled ? 'disabled ' : 'disabledNOT'),
636+
text: 'Review This Challenge'
637+
}));
638+
}
639+
}
594640
}
595641
}
596642

wp/wp-content/themes/tcs-responsive/footer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ function getHashParameterByName(name, source) {
268268
],
269269
'community': [
270270
{ 'href': '/community/members/', 'text': 'OVERVIEW', 'icon': '/mf/i/nav/members.svg' },
271-
{ 'href': '/tco', 'text': 'TCO', 'icon': '/mf/i/nav/tco-generic.svg' },
271+
{ 'href': '/tco', 'text': 'TCO', 'icon': '/mf/i/nav/tco-generic.svg' },
272272
{ 'href': '/community/member-programs/', 'text': 'PROGRAMS', 'icon': '/mf/i/nav/programs.svg' },
273273
{ 'href': 'https://' + tcconfig.forumsAppURL, 'text': 'FORUMS', 'icon': '/mf/i/nav/forums.svg' },
274274
{ 'href': '/community/statistics/', 'text': 'STATISTICS', 'icon': '/mf/i/nav/statistics.svg' },

0 commit comments

Comments
 (0)