2
2
* Routing of Wipro Community.
3
3
*/
4
4
5
- // import ChallengeDetails from 'routes/ChallengeDetails';
6
- // import ChallengeListing from 'routes/Communities/ChallengeListing';
7
- // import ChallengeListingBanner from
8
- // 'components/tc-communities/communities/zurich/ChallengeListingBanner';
9
- // import Submission from 'routes/Submission';
10
- // import SubmissionManagement from 'routes/SubmissionManagement';
11
- // import TermsDetail from 'routes/TermsDetail';
12
5
import _ from 'lodash' ;
6
+ import { connect } from 'react-redux' ;
13
7
import Error404 from 'components/Error404' ;
14
8
import FAQ from 'components/tc-communities/communities/zurich/FAQ' ;
15
9
import Footer from 'components/tc-communities/communities/zurich/Footer' ;
@@ -23,11 +17,11 @@ import theme from 'components/tc-communities/communities/zurich/theme';
23
17
import { ThemeProvider } from 'react-css-super-themr' ;
24
18
import { Route , Switch } from 'react-router-dom' ;
25
19
26
- export default function Zurich ( { base, meta } ) {
20
+ function Zurich ( { base, meta, userGroups } ) {
27
21
// Only members of `Requestor`|`Approver` gropus
28
22
// should can see catalog with links to connect
29
23
const isRequestorOrApprover = _ . intersection (
30
- meta . authorizedGroupIds ,
24
+ _ . map ( userGroups , 'id' ) ,
31
25
meta . authorizedGroupIdsCatalog ,
32
26
) ;
33
27
return (
@@ -40,47 +34,6 @@ export default function Zurich({ base, meta }) {
40
34
pageId = { match . params . pageId || 'home' }
41
35
/>
42
36
< Switch >
43
- { /* <Route
44
- component={() => ChallengeListing({
45
- challengesUrl: `${base}/challenges`,
46
- ChallengeListingBanner,
47
- listingOnly: true,
48
- meta,
49
- newChallengeDetails: true,
50
- }) }
51
- exact
52
- path={`${base}/challenges` }
53
- />
54
- <Route
55
- component={routeProps => ChallengeDetails({
56
- ...routeProps,
57
- challengesUrl: `${base}/challenges`,
58
- communityId: meta.communityId,
59
- }) }
60
- exact
61
- path={`${base}/challenges/:challengeId(\\d{8})` }
62
- />
63
- <Route
64
- component={routeProps => Submission({
65
- ...routeProps,
66
- challengesUrl: `${base}/challenges`,
67
- }) }
68
- exact
69
- path={`${base}/challenges/:challengeId(\\d{8})/submit` }
70
- />
71
- <Route
72
- component={routeProps => SubmissionManagement({
73
- ...routeProps,
74
- challengesUrl: `${base}/challenges`,
75
- }) }
76
- exact
77
- path={`${base}/challenges/:challengeId(\\d{8})/my-submissions` }
78
- />
79
- <Route
80
- component={TermsDetail}
81
- exact
82
- path={`${base}/challenges/terms/detail/:termId` }
83
- /> */ }
84
37
< Route
85
38
component = { FAQ }
86
39
exact
@@ -141,4 +94,9 @@ Zurich.defaultProps = {
141
94
Zurich . propTypes = {
142
95
base : PT . string ,
143
96
meta : PT . shape ( ) . isRequired ,
97
+ userGroups : PT . arrayOf ( PT . shape ( ) ) . isRequired ,
144
98
} ;
99
+
100
+ export default connect ( state => ( {
101
+ userGroups : state . auth . profile . groups ,
102
+ } ) ) ( Zurich ) ;
0 commit comments