Skip to content

Commit 01f1582

Browse files
committed
Merge branch 'feature-tickets' of https://github.com/ksraj123/social-platform-donut-frontend into feature-tickets
2 parents 2c8035e + e7ce4ca commit 01f1582

File tree

26 files changed

+1528
-121
lines changed

26 files changed

+1528
-121
lines changed

README.md

Lines changed: 123 additions & 110 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 354 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/actions/types.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const GET_DEVICE_ANALYTICS ="GET_DEVICE_ANALYTICS"
5353
export const GET_MOSTVIEWED_ANALYTICS ="GET_MOSTVIEWED_ANALYTICS"
5454
export const GET_PROPOSALVIEW_ANALYTICS="GET_PROPOSALVIEW_ANALYTICS"
5555
export const ACTIVATE_DEACTIVATE_ACCOUNT_TOGGLER = "ACTIVATE_DEACTIVATE_ACCOUNT_TOGGLER";
56+
export const GET_WIKIS = "GET_WIKIS";
5657
export const CLEAR_INVITE_LINK = "CLEAR_INVITE_LINK";
5758
export const GET_LOGIN_OPTIONS = "GET_LOGIN_OPTIONS";
5859
export const GET_TICKETs = "GET_TICKETs";

src/actions/usersAction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export const activateDeactivateToggler = () => async (dispatch) => {
216216
const res = await axios.patch(`${BASE_URL}/user/deactivate/toggler`)
217217
if (res.status === 200) {
218218
console.log('Deactivation toggler', res.data);
219-
dispatch(getProfile());
219+
dispatch(getProfile(userId));
220220
}
221221
} catch (error) {
222222
dispatch(errorHandler(error))

src/actions/wikisAction.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import axios from "axios";
2+
import { GET_WIKIS } from "./types";
3+
import { BASE_URL } from "./baseApi";
4+
import { errorHandler } from "../utils/errorHandler";
5+
6+
export const getWikis = () => async (dispatch) => {
7+
try {
8+
const res = await axios.get(`${BASE_URL}/wikis`);
9+
dispatch({
10+
type: GET_WIKIS,
11+
payload: res.data.wikis,
12+
});
13+
} catch (error) {
14+
dispatch(errorHandler(error));
15+
}
16+
};

src/common/Popups.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { MdVerifiedUser } from 'react-icons/md';
55
import { FaUserSlash } from 'react-icons/fa';
66
import { connect } from 'react-redux';
77
import { forgotPassword, changePassword } from '../actions/authAction';
8-
import { activateDeactivateToggler } from '../actions/usersAction';
8+
import { activateDeactivateToggler, updateProfile } from '../actions/usersAction';
99
import { ToastContainer, toast } from "react-toastify";
1010
import "react-toastify/dist/ReactToastify.css";
1111

@@ -415,5 +415,6 @@ const mapStateToProps = (state) => {
415415
export default connect( mapStateToProps, {
416416
forgotPassword,
417417
changePassword,
418+
updateProfile,
418419
activateDeactivateToggler
419420
})(Popups);

src/reducers/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import adminReducers from "./adminReducers";
1515
import commentReducer from "./commentReducer";
1616
import analyticsReducer from './analyticsReducer';
1717
import ticketReducer from './ticketReducer';
18+
import wikisReducer from './wikisReducer';
1819

1920
const rootReducer = combineReducers({
2021
auth: authReducers,
@@ -23,6 +24,7 @@ const rootReducer = combineReducers({
2324
notification: notificationReducer,
2425
error: errorReducer,
2526
dashboard: dashboardReducer,
27+
wikis: wikisReducer,
2628
insight: insightReducer,
2729
org: orgReducer,
2830
event: eventReducer,

src/reducers/wikisReducer.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { GET_WIKIS } from "../actions/types";
2+
const initialState = {
3+
wikis: "",
4+
};
5+
6+
export default (state = initialState, action) => {
7+
switch (action.type) {
8+
case GET_WIKIS: {
9+
console.log(`Action Recieved in reducer! ${action.type}`);
10+
console.log(action.payload);
11+
return {
12+
...state,
13+
wikis: action.payload,
14+
};
15+
}
16+
default: {
17+
return state;
18+
}
19+
}
20+
};

src/router.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Dashboard from "./user/dashboard/dashboard";
55
import PinnedPosts from "./user/pinned-posts/pinned-posts";
66
import Profile from "./user/profile/profile";
77
import Organization from "./user/organization/organization";
8+
import Wikis from "./user/wikis/Wikis";
89
import NotFound from "./404/notFound";
910
import Settings from "./user/dashboard/settings/Settings";
1011
import Projects from "./user/projects/projects";
@@ -36,6 +37,7 @@ const Router = () => (
3637
<PrivateRoute exact path="/profile/:id" component={Profile} />
3738
<PrivateRoute exact path="/:id/proj-info" component={ProjInfo} />
3839
<PrivateRoute exact path="/organization" component={Organization} />
40+
<PrivateRoute exact path="/wikis" component={Wikis} />
3941
<PrivateRoute exact path="/settings" component={Settings} />
4042
<PrivateRoute exact path="/projects" component={Projects} />
4143
<PrivateRoute exact path="/events" component={Events} />

src/user/dashboard/navigation/navigation.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ class Navigation extends Component {
105105
className={this.props.org ? "active" : "inactive"}
106106
link="/organization"
107107
/>
108-
108+
<ListItem
109+
name="Wikis"
110+
className={this.props.wikis ? "active" : "inactive"}
111+
link="/wikis"
112+
/>
109113
<ListItem
110114
name="Events"
111115
className={this.props.event ? "active" : "inactive"}
@@ -205,7 +209,12 @@ class Navigation extends Component {
205209
link="/organization"
206210
isMobile="true"
207211
/>
208-
212+
<ListItem
213+
name="Wikis"
214+
className={this.props.wikis ? "active" : "inactive"}
215+
link="/wikis"
216+
isMobile="true"
217+
/>
209218
<ListItem
210219
name="Events"
211220
className={this.props.event ? "active" : "inactive"}

0 commit comments

Comments
 (0)