Skip to content

Commit 036af91

Browse files
committed
Zurich auth update
1 parent 669083d commit 036af91

File tree

2 files changed

+9
-51
lines changed

2 files changed

+9
-51
lines changed

src/server/tc-communities/zurich/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"communityId": "zurich",
1313
"communityName": "Zurich Community",
1414
"groupIds": ["20000145"],
15-
"authorizedGroupIdsCatalog": ["20000080", "20000081"],
15+
"authorizedGroupIdsCatalog": ["20000160", "20000161"],
1616
"logos": [{
1717
"img": "/community-app-assets/themes/zurich/zurich.svg",
1818
"url": "https://www.zurich.com/"

src/shared/routes/Communities/Zurich/Routes.jsx

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
* Routing of Wipro Community.
33
*/
44

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';
125
import _ from 'lodash';
6+
import { connect } from 'react-redux';
137
import Error404 from 'components/Error404';
148
import FAQ from 'components/tc-communities/communities/zurich/FAQ';
159
import Footer from 'components/tc-communities/communities/zurich/Footer';
@@ -23,11 +17,11 @@ import theme from 'components/tc-communities/communities/zurich/theme';
2317
import { ThemeProvider } from 'react-css-super-themr';
2418
import { Route, Switch } from 'react-router-dom';
2519

26-
export default function Zurich({ base, meta }) {
20+
function Zurich({ base, meta, userGroups }) {
2721
// Only members of `Requestor`|`Approver` gropus
2822
// should can see catalog with links to connect
2923
const isRequestorOrApprover = _.intersection(
30-
meta.authorizedGroupIds,
24+
_.map(userGroups, 'id'),
3125
meta.authorizedGroupIdsCatalog,
3226
);
3327
return (
@@ -40,47 +34,6 @@ export default function Zurich({ base, meta }) {
4034
pageId={match.params.pageId || 'home'}
4135
/>
4236
<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-
/> */}
8437
<Route
8538
component={FAQ}
8639
exact
@@ -141,4 +94,9 @@ Zurich.defaultProps = {
14194
Zurich.propTypes = {
14295
base: PT.string,
14396
meta: PT.shape().isRequired,
97+
userGroups: PT.arrayOf(PT.shape()).isRequired,
14498
};
99+
100+
export default connect(state => ({
101+
userGroups: state.auth.profile.groups,
102+
}))(Zurich);

0 commit comments

Comments
 (0)