-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implements markdown and priview functionality * Parsing content within comment * Comment notifications (#501) * Initial * Addition of comments section * requested changes * Changes for Jitsi UI (#518) * css changes for jitsi box ui change * edited jitsi.scss for jitsi ui and reverted changes of comment.scss * changes made for making same fonts * added modals in jitsi ui * removed unnecessary code from jitsi.scss * fixing dev branch issues (#525) * implemented user activity and fix inconsistencies (#527) * Settings integrate and deploy configuration (#530) * integrated settings page and user activity modification * configure to deploy * Insights (#529) * Adding reactGA * Insights section * removing /hompage path * Requested changes * initial changes * Fetching data from the backend and integrating redux * Fixing modal issues (#531) * social links fix (#545) * fix issues (#555) * Fixing proposal functionality issues (#553) Co-authored-by: Asel <[email protected]> Co-authored-by: Nisarg Shah <[email protected]> Co-authored-by: Rupesh Krishna Jha <[email protected]>
- Loading branch information
1 parent
f2b9369
commit 489eef1
Showing
114 changed files
with
4,930 additions
and
1,095 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#.env.development | ||
REACT_APP_API_ENDPOINT = "http://localhost:5000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#.env.production | ||
REACT_APP_API_ENDPOINT = "https://codeuino-donut-development.herokuapp.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# NODE_ENV will always be set to "production" for a build | ||
# more details at https://create-react-app.dev/docs/deployment/#customizing-environment-variables-for-arbitrary-build-environments | ||
|
||
REACT_APP_CUSTOM_NODE_ENV = "staging" | ||
REACT_APP_API_ENDPOINT = "https://codeuino-donut-development.herokuapp.com" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,50 @@ | ||
import React, { Component } from "react"; | ||
import React, { Component, useEffect } from "react"; | ||
import Router from "./router"; | ||
import "./App.css"; | ||
|
||
import { Provider } from "react-redux"; | ||
import store from "./store"; | ||
import jwt_decode from "jwt-decode"; | ||
import { setAuthToken } from "./utils/setAuthToken"; | ||
import { setCurrentUser, logoutUser } from "./actions/authAction"; | ||
import "./css/main.scss"; | ||
import ReactGA from "react-ga"; | ||
|
||
class App extends Component { | ||
componentDidMount() { | ||
// check if user already loggedIn | ||
const token = JSON.parse(localStorage.getItem("jwtToken")); | ||
console.log("CHECKING TOKEN ", token); | ||
if (token) { | ||
const decodedData = jwt_decode(token); | ||
// set auth token in axios header | ||
setAuthToken(token); | ||
// set user in the state | ||
setCurrentUser(decodedData); | ||
// check if token is valid or expired | ||
const currentTime = Date.now() / 1000; // in ms | ||
const expiryTime = decodedData.iat + 10800000; // 24 hrs | ||
if (expiryTime <= currentTime) { | ||
store.dispatch(logoutUser()); | ||
// now redirect to home page | ||
window.location.href = "/"; | ||
} | ||
} | ||
} | ||
render() { | ||
return ( | ||
<Provider store={store}> | ||
<React.Fragment> | ||
<link | ||
rel="stylesheet" | ||
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" | ||
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" | ||
crossOrigin="anonymous" | ||
/> | ||
<Router /> | ||
</React.Fragment> | ||
</Provider> | ||
); | ||
// check if user already loggedIn | ||
const token = localStorage.getItem("jwtToken"); | ||
console.log("CHECKING TOKEN ", token); | ||
if (token) { | ||
const decodedData = jwt_decode(token); | ||
// set auth token in axios header | ||
setAuthToken(token); | ||
// set user in the state | ||
setCurrentUser(decodedData); | ||
// check if token is valid or expired | ||
const currentTime = Date.now() / 1000; // in ms | ||
const expiryTime = decodedData.iat + 10800000; // 24 hrs | ||
if (expiryTime <= currentTime) { | ||
store.dispatch(logoutUser()); | ||
window.location.href = "/"; | ||
} | ||
} | ||
document.title = "Donut"; | ||
|
||
function App() { | ||
useEffect(() => { | ||
ReactGA.initialize("UA-173245995-1"); | ||
}); | ||
return ( | ||
<Provider store={store}> | ||
<React.Fragment> | ||
<link | ||
rel="stylesheet" | ||
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" | ||
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" | ||
crossOrigin="anonymous" | ||
/> | ||
<Router /> | ||
</React.Fragment> | ||
</Provider> | ||
); | ||
} | ||
|
||
document.title = "Donut"; | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
import axios from "axios"; | ||
import { errorHandler } from "../utils/errorHandler"; | ||
import { setRequestStatus } from "../utils/setRequestStatus"; | ||
import { | ||
GET_BROWSER_ANALYTICS, | ||
GET_COUNTRY_ANALYTICS, | ||
GET_DEVICE_ANALYTICS, | ||
GET_MOSTVIEWED_ANALYTICS, | ||
GET_PROPOSALVIEW_ANALYTICS | ||
} from "../actions/types"; | ||
import moment from "moment"; | ||
|
||
// GET BROWSER ANALYTICS | ||
export const getBrowserAnalytics = ( | ||
startingDate, | ||
endingDate, | ||
proposalId | ||
) => async (dispatch) => { | ||
try { | ||
let data = { | ||
startDate: moment(startingDate).format("YYYY-MM-DD"), | ||
endDate: moment(endingDate).format("YYYY-MM-DD"), | ||
proposalId: proposalId, | ||
}; | ||
const res = await axios.post("/analytics/browser", data); | ||
dispatch(setRequestStatus(false)); | ||
if (res.status === 200) { | ||
dispatch(setRequestStatus(true)); | ||
dispatch({ | ||
type: GET_BROWSER_ANALYTICS, | ||
payload: res.data.analytics || res.data.msg, | ||
}); | ||
} | ||
} catch (error) { | ||
dispatch(errorHandler(error)); | ||
} | ||
}; | ||
|
||
// GET MOSTVIEWED ANALYTICS | ||
export const getMostViewedAnalytics = (startingDate, endingDate) => async ( | ||
dispatch | ||
) => { | ||
try { | ||
let data = { | ||
startDate: moment(startingDate).format("YYYY-MM-DD"), | ||
endDate: moment(endingDate).format("YYYY-MM-DD"), | ||
}; | ||
const res = await axios.post("/analytics/mostviewed", data); | ||
dispatch(setRequestStatus(false)); | ||
if (res.status === 200) { | ||
dispatch(setRequestStatus(true)); | ||
dispatch({ | ||
type: GET_MOSTVIEWED_ANALYTICS, | ||
payload: res.data.analytics || res.data.msg, | ||
}); | ||
} | ||
} catch (error) { | ||
dispatch(errorHandler(error)); | ||
} | ||
}; | ||
|
||
// GET PROPOSAL VIEW ANALYTICS | ||
export const getProposalviewAnalytics = ( | ||
startingDate, | ||
endingDate, | ||
proposalId | ||
) => async (dispatch) => { | ||
try { | ||
let data = { | ||
startDate: moment(startingDate).format("YYYY-MM-DD"), | ||
endDate: moment(endingDate).format("YYYY-MM-DD"), | ||
proposalId: proposalId, | ||
}; | ||
const res = await axios.post("/analytics/views", data); | ||
dispatch(setRequestStatus(false)); | ||
if (res.status === 200) { | ||
dispatch(setRequestStatus(true)); | ||
console.log(res.data.analytics) | ||
dispatch({ | ||
type: GET_PROPOSALVIEW_ANALYTICS, | ||
payload: res.data.analytics || res.data.msg, | ||
}); | ||
} | ||
} catch (error) { | ||
dispatch(errorHandler(error)); | ||
} | ||
}; | ||
|
||
// GET COUNTRIES ANALYTICS | ||
export const getCountryAnalytics = ( | ||
startingDate, | ||
endingDate, | ||
proposalId | ||
) => async (dispatch) => { | ||
try { | ||
let data = { | ||
startDate: moment(startingDate).format("YYYY-MM-DD"), | ||
endDate: moment(endingDate).format("YYYY-MM-DD"), | ||
proposalId: proposalId, | ||
}; | ||
const res = await axios.post("/analytics/countries", data); | ||
dispatch(setRequestStatus(false)); | ||
if (res.status === 200) { | ||
dispatch(setRequestStatus(true)); | ||
dispatch({ | ||
type: GET_COUNTRY_ANALYTICS, | ||
payload: res.data.analytics || res.data.msg, | ||
}); | ||
} | ||
} catch (error) { | ||
dispatch(errorHandler(error)); | ||
} | ||
}; | ||
|
||
// GET DEVICE ANALYTICS | ||
export const getDeviceAnalytics = ( | ||
startingDate, | ||
endingDate, | ||
proposalId | ||
) => async (dispatch) => { | ||
try { | ||
let data = { | ||
startDate: moment(startingDate).format("YYYY-MM-DD"), | ||
endDate: moment(endingDate).format("YYYY-MM-DD"), | ||
proposalId: proposalId, | ||
}; | ||
const res = await axios.post("/analytics/device", data); | ||
dispatch(setRequestStatus(false)); | ||
if (res.status === 200) { | ||
dispatch(setRequestStatus(true)); | ||
dispatch({ | ||
type: GET_DEVICE_ANALYTICS, | ||
payload: res.data.analytics || res.data.msg, | ||
}); | ||
} | ||
} catch (error) { | ||
dispatch(errorHandler(error)); | ||
} | ||
}; |
Oops, something went wrong.