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

Commit e59fe15

Browse files
committed
Latest changes for challenge listings
1 parent e56da76 commit e59fe15

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

app/listings/listings.controller.js

100644100755
Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
11
import angular from 'angular'
2+
import { loadUser, getCurrentUser } from '../services/userv3.service.js'
23

34
(function () {
45
'use strict'
56

67
angular.module('tc.listings').controller('ListingsCtrl', ListingsCtrl)
78

8-
ListingsCtrl.$inject = ['CONSTANTS', 'logger', '$q',
9-
'TcAuthService', 'UserService', 'UserStatsService', 'ProfileService', 'ChallengeService', 'ExternalAccountService',
10-
'ngDialog', '$anchorScroll'
9+
ListingsCtrl.$inject = ['CONSTANTS', 'logger', '$q','TcAuthService', 'UserService',
10+
'UserStatsService', 'ProfileService', 'ChallengeService',
11+
'ExternalAccountService', 'ngDialog', '$anchorScroll', '$scope',
1112
]
1213

13-
function ListingsCtrl(CONSTANTS, logger, $q, TcAuthService, UserService, UserStatsService, ProfileService, ChallengeService, ExternalAccountService, ngDialog, $anchorScroll) {
14+
function ListingsCtrl(CONSTANTS, logger, $q, TcAuthService, UserService, UserStatsService, ProfileService,
15+
ChallengeService, ExternalAccountService, ngDialog, $anchorScroll, $scope) {
16+
var vm = this
1417

1518
activate()
1619

1720
function activate() {
21+
$scope.myChallenges = []
22+
$scope.userProps = { isAuth: false }
1823
logger.debug('Calling ListingsController activate()')
1924

25+
loadUser().then(function(token) {
26+
// update auth flag
27+
if(TcAuthService.isAuthenticated()) {
28+
$scope.userProps = { isAuth: true }
29+
}
30+
}, function(error) {
31+
// do nothing, just show non logged in state of navigation bar
32+
})
2033
}
34+
2135
}
2236

2337
})()

app/listings/listings.jade

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
react-component(name="ChallengeFiltersExample")
1+
2+
<react-component name="ChallengeFiltersExample" props="userProps" watch-depth="reference"/>

app/listings/listings.module.js

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { ChallengeFiltersExample } from 'appirio-tech-react-components'
1212
'tcUIComponents',
1313
'angularSlideables',
1414
'ngDialog',
15-
'react'
15+
'react',
1616
]
1717

1818
angular.module('tc.listings', dependencies)

app/listings/listings.routes.js

100644100755
File mode changed.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"appirio-styles": "0.x.x",
5757
"appirio-tech-ng-iso-constants": "^1.0.6",
5858
"appirio-tech-ng-ui-components": "^2.1.2",
59-
"appirio-tech-react-components": "appirio-tech/react-components.git#challenge-listings",
59+
"appirio-tech-react-components": "nomo-kazza/react-components.git#challenge-listings",
6060
"auth0-angular": "^4.1.0",
6161
"auth0-js": "^6.8.0",
6262
"d3": "^3.5.14",

0 commit comments

Comments
 (0)