diff --git a/app/index.js b/app/index.js index a11c18e81..56c242efa 100644 --- a/app/index.js +++ b/app/index.js @@ -22,6 +22,7 @@ require('angucomplete-alt') require('angularjs-toaster') require('ng-dialog') require('xml2js') +require('ngreact') require('appirio-tech-ng-ui-components') require('appirio-tech-ng-iso-constants') diff --git a/app/listings/listings.controller.js b/app/listings/listings.controller.js new file mode 100644 index 000000000..5ed5eae6a --- /dev/null +++ b/app/listings/listings.controller.js @@ -0,0 +1,23 @@ +import angular from 'angular' + +(function () { + 'use strict' + + angular.module('tc.listings').controller('ListingsCtrl', ListingsCtrl) + + ListingsCtrl.$inject = ['CONSTANTS', 'logger', '$q', + 'TcAuthService', 'UserService', 'UserStatsService', 'ProfileService', 'ChallengeService', 'ExternalAccountService', + 'ngDialog', '$anchorScroll' + ] + + function ListingsCtrl(CONSTANTS, logger, $q, TcAuthService, UserService, UserStatsService, ProfileService, ChallengeService, ExternalAccountService, ngDialog, $anchorScroll) { + + activate() + + function activate() { + logger.debug('Calling ListingsController activate()') + + } + } + +})() diff --git a/app/listings/listings.jade b/app/listings/listings.jade new file mode 100644 index 000000000..1774c70e3 --- /dev/null +++ b/app/listings/listings.jade @@ -0,0 +1 @@ +react-component(name="ChallengeFiltersExample") diff --git a/app/listings/listings.module.js b/app/listings/listings.module.js new file mode 100644 index 000000000..102cdcab2 --- /dev/null +++ b/app/listings/listings.module.js @@ -0,0 +1,21 @@ +import angular from 'angular' +import { ChallengeFiltersExample } from 'appirio-tech-react-components' + +(function() { + 'use strict' + + var dependencies = [ + 'angular-jwt', + 'ui.router', + 'ngCookies', + 'tc.services', + 'tcUIComponents', + 'angularSlideables', + 'ngDialog', + 'react' + ] + + angular.module('tc.listings', dependencies) + .value('ChallengeFiltersExample', ChallengeFiltersExample.default) + +})() diff --git a/app/listings/listings.routes.js b/app/listings/listings.routes.js new file mode 100644 index 000000000..bffcc1672 --- /dev/null +++ b/app/listings/listings.routes.js @@ -0,0 +1,43 @@ +import angular from 'angular' + +(function() { + 'use strict' + + angular.module('tc.listings').config([ + '$stateProvider', + routes + ]).run(['$rootScope', '$state', function($rootScope, $state) { + $rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error) { +// if (toState.name.indexOf('sloog') > -1 && 400 <= error.status <= 500 ) { +// +// // unable to find a member with that username +// $state.go('404') +// } + }) + }]) + + function routes($stateProvider) { + var states = { + 'listings': { + parent: 'root', + url: '/listings/', + template: require('./listings')(), + controller: 'ListingsCtrl as vm', + resolve: { + userHandle: ['$stateParams', function($stateParams) { + return $stateParams.userHandle + }] + }, + data: { + authRequired: false, + title: 'Listings' + } + } + } + + for (var name in states) { + var state = states[name] + $stateProvider.state(name, state) + } + } +})() diff --git a/app/topcoder.module.js b/app/topcoder.module.js index d8fdfee83..d2bbce8b2 100644 --- a/app/topcoder.module.js +++ b/app/topcoder.module.js @@ -10,6 +10,7 @@ import { getCurrentUser, loadUser } from './services/userv3.service.js' 'tc.account', 'tc.peer-review', 'tc.myDashboard', + 'tc.listings', 'tc.mySRMs', 'tc.myChallenges', 'tc.profile', diff --git a/package.json b/package.json index 72c20d151..d31ee074f 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": "^0.0.12", + "appirio-tech-react-components": "appirio-tech/react-components.git#challenge-filters", "auth0-angular": "^4.1.0", "auth0-js": "^6.8.0", "d3": "^3.5.14",