Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge in iteration by Just5Coders #42

Merged
merged 138 commits into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
ce2dd4e
Merge pull request #1 from team-snapdesk/master
skang1004 Feb 25, 2020
0714c36
fixed webpack not loading static images
jdnordy Feb 26, 2020
40b13cc
changed the routes in the html for static files
jdnordy Feb 26, 2020
c6dbe60
Merge pull request #2 from jdnordy/master
skang1004 Feb 26, 2020
2620a6a
started converting css over into sass
jdnordy Feb 26, 2020
2e28281
updated styling on login page
jdnordy Feb 26, 2020
28f2a35
added acceptTicket middleware to ticketsController.js and added route…
eamoranto Feb 26, 2020
b507eda
Merge pull request #3 from eamoranto/master
skang1004 Feb 26, 2020
5a79434
added cancelTicket middleware to ticketsController and added api rout…
Feb 26, 2020
18ec7e4
implemented accept_ticket & cancel_accept reducers
arazulu Feb 26, 2020
8b3ed93
ticket actions for accept ticket
skang1004 Feb 26, 2020
27c0360
changes
arazulu Feb 26, 2020
45d5428
Merge branch 'master' into cancel_controller
skang1004 Feb 26, 2020
b86b94a
Merge pull request #4 from hellokritty/cancel_controller
skang1004 Feb 26, 2020
59856bb
styling changes
jdnordy Feb 26, 2020
be7b4e7
Merge branch 'master' of https://github.com/Just5Coders/snapdesk_1 in…
skang1004 Feb 26, 2020
38b2397
Merge pull request #5 from arazulu/aris_feature_branch
skang1004 Feb 26, 2020
6c49023
tickets reducer
skang1004 Feb 26, 2020
69a4b6d
inserted closing bracket in ticketsController
arazulu Feb 26, 2020
7445d6d
Merge pull request #6 from jdnordy/styling
skang1004 Feb 26, 2020
0b01e8b
Merge pull request #7 from arazulu/aris_feature_branch
skang1004 Feb 26, 2020
8de4930
merged from upstream, cleaned up the logic for delete_ticket in ticke…
skang1004 Feb 26, 2020
c3e32f3
cleaned up code for accept_ticket functionality
arazulu Feb 26, 2020
e498618
Merge pull request #8 from skang1004/feature1
skang1004 Feb 26, 2020
315b21c
ticketsController.resloverTicket was added to ticketsController.js an…
eamoranto Feb 26, 2020
1cca864
Merge branch 'master' into aris_feature_branch
skang1004 Feb 26, 2020
64bf919
added leaderdboard controller middleware and route handler
Feb 26, 2020
dfe4096
Merge pull request #9 from arazulu/aris_feature_branch
skang1004 Feb 26, 2020
b04185e
Merge pull request #10 from eamoranto/resolve
skang1004 Feb 26, 2020
251db69
Merge branch 'master' into leaderboard_backend
skang1004 Feb 26, 2020
22dcfa6
Merge pull request #11 from hellokritty/leaderboard_backend
skang1004 Feb 26, 2020
fb6da50
fixed syntax error in api.js, added require leaderboardController to …
eamoranto Feb 26, 2020
24c4034
fixed syntax error in api.js, included require leaderboardController …
eamoranto Feb 26, 2020
9203ce5
Merge pull request #12 from eamoranto/bugfix
skang1004 Feb 26, 2020
4f76207
after accept, other users are unable to click on that ticket. prop dr…
skang1004 Feb 26, 2020
6e26e2b
Merge pull request #13 from skang1004/feature3
skang1004 Feb 26, 2020
45ef02d
finished working on left-nav style
jdnordy Feb 26, 2020
61cd184
Merge pull request #14 from jdnordy/style-left-nav
skang1004 Feb 26, 2020
39643f4
updated leftnav component
jdnordy Feb 26, 2020
f473a83
reformated rightnav
jdnordy Feb 26, 2020
c9de42b
started working on right navbar styling
jdnordy Feb 26, 2020
9d07996
cancelAccept button changes status from pending to active, makes acce…
skang1004 Feb 26, 2020
e449089
Merge pull request #15 from skang1004/feature5
eamoranto Feb 26, 2020
ca0dfb3
debugged the accept button and cleaned up code
jdnordy Feb 26, 2020
4cba4da
Merge branch 'master' into debug
jdnordy Feb 26, 2020
12330df
Merge pull request #16 from jdnordy/debug
skang1004 Feb 26, 2020
15bccd6
Merge branch 'style-left-nav' into style-right-nav
jdnordy Feb 26, 2020
f9aa921
added byTopic middleware to leaderboardController.js and route for le…
eamoranto Feb 26, 2020
0bb0aa7
Merge pull request #17 from eamoranto/byTopic
skang1004 Feb 26, 2020
bb3864a
fixed bug in cancelAccept
jdnordy Feb 26, 2020
4dec214
Merge pull request #18 from jdnordy/debug
skang1004 Feb 26, 2020
92f4121
Merge branch 'style-right-nav' into style-feed-container
jdnordy Feb 26, 2020
3199952
minimal left navbar styling and snaps cursor on hover
jdnordy Feb 26, 2020
1fbdb8e
Merge pull request #19 from jdnordy/style-right-nav
skang1004 Feb 26, 2020
9632782
Merge branch 'master' into style-feed-container
jdnordy Feb 26, 2020
31805ee
added scroll back into feed container
jdnordy Feb 26, 2020
9fd69e4
Merge pull request #20 from jdnordy/style-feed-container
skang1004 Feb 26, 2020
05f3a7c
added SHOW_MODAL constant
jdnordy Feb 26, 2020
e0e0ea0
changed const show modal to toggle modal
jdnordy Feb 26, 2020
aaf459e
added reducer logic for modal
jdnordy Feb 26, 2020
22967e1
finished action creator for toggleModal
jdnordy Feb 26, 2020
400e258
prop drilled toggleModal action creator into MenteeTicketBox
jdnordy Feb 27, 2020
cb7e733
updated addTicket middleware to add tag with post, updated middleware…
eamoranto Feb 27, 2020
ee8491c
Merge pull request #21 from eamoranto/addTopic
skang1004 Feb 27, 2020
3118c0b
changed leaderboardController.getLeaderBoard in leaderboardController…
eamoranto Feb 27, 2020
a88d576
Merge pull request #22 from eamoranto/leaderboard
skang1004 Feb 27, 2020
ea04eb4
updated variable names of modal
jdnordy Feb 27, 2020
e72306e
added feedback box in modal
jdnordy Feb 27, 2020
98f1967
finished resolve modal
jdnordy Feb 27, 2020
b4c9a63
merged in source of truth
jdnordy Feb 27, 2020
5776db9
finished resolved
jdnordy Feb 27, 2020
1eb2e79
Merge pull request #23 from jdnordy/resolve-modal
skang1004 Feb 27, 2020
295cf9b
beginnings of css grid
jdnordy Feb 27, 2020
68db81e
created leaderboard: component, action type, action creator, reducer,…
Feb 27, 2020
c5ab7f9
added leaderboard frontend: action type, action creater, container, c…
Feb 27, 2020
d2012ce
Merge branch 'master' into fe_leaderByTopic
skang1004 Feb 27, 2020
f268ff8
Merge pull request #24 from hellokritty/fe_leaderByTopic
skang1004 Feb 27, 2020
bf1ec46
added res.locals.LeaderboardTopic to line 43 in leaderboardController.js
eamoranto Feb 27, 2020
1ebf72d
Merge pull request #25 from eamoranto/bugfixes
skang1004 Feb 27, 2020
c90e1a9
centered ticket container and scroll
jdnordy Feb 27, 2020
40ba76c
Merge pull request #26 from jdnordy/styling-feedContainer
skang1004 Feb 27, 2020
64a9a35
updated the action creator for toggle modal
jdnordy Feb 27, 2020
a9c3496
updated the ticket reducer case for toggle modal
jdnordy Feb 27, 2020
924ee39
removed modal from mentee ticket box and clean up the code a bit
jdnordy Feb 27, 2020
6b9d28c
cleaned up code in ticket creator
jdnordy Feb 27, 2020
e936120
added modal component in feed conatiner
jdnordy Feb 27, 2020
f01dc99
created a new resolve modal component
jdnordy Feb 27, 2020
e9c9117
Merge pull request #27 from jdnordy/modal-debug
skang1004 Feb 27, 2020
03b189e
fixed query for leaderboardController.byTopic, changed ticketsControl…
eamoranto Feb 27, 2020
91a3abb
Merge branch 'master' into displayName
skang1004 Feb 27, 2020
f04bcf0
progress on ticket creator
jdnordy Feb 27, 2020
e588a0a
added dropdown menu for choosing a topic, connects to the database
skang1004 Feb 27, 2020
5ede70c
Merge pull request #28 from eamoranto/displayName
skang1004 Feb 27, 2020
3755840
Merge branch 'master' into feature12
skang1004 Feb 27, 2020
de8ec8e
Merge pull request #29 from skang1004/feature12
skang1004 Feb 27, 2020
572da6d
topic is shown in mentee ticket box and repositioned the layout of ea…
skang1004 Feb 27, 2020
27a59b4
Merge pull request #30 from skang1004/feature13
skang1004 Feb 27, 2020
8053681
finished ticket-creator
jdnordy Feb 27, 2020
77473ba
merged in changes from new updates
jdnordy Feb 27, 2020
7b93b92
fixed bugg with scroll bar
jdnordy Feb 27, 2020
95199c6
Merge pull request #31 from jdnordy/style-ticket-creator
skang1004 Feb 27, 2020
accd150
added setInterval to the LeaderBoard.jsx file to get the leaderboard …
eamoranto Feb 27, 2020
0cbad0e
Merge branch 'master' into setTimerLeader
skang1004 Feb 27, 2020
53921b8
Merge pull request #32 from eamoranto/setTimerLeader
skang1004 Feb 27, 2020
4fa2ee0
changed the order of ticket headers
skang1004 Feb 27, 2020
dda98ff
Merge pull request #33 from skang1004/master
skang1004 Feb 27, 2020
7f4b311
fixed scrolling issue and only showing bystander tickets
jdnordy Feb 27, 2020
f7aa60d
Merge pull request #34 from jdnordy/style-ticket-creator
skang1004 Feb 27, 2020
22e1967
created separate sass file for ticketCreator
jdnordy Feb 27, 2020
ae8f4b2
got rid of a couple error messages in the console
skang1004 Feb 27, 2020
e2514e2
styled topic selector
jdnordy Feb 27, 2020
f8d7a59
the close button now closes the modal window
skang1004 Feb 27, 2020
5658a9b
Merge pull request #35 from skang1004/feature17
skang1004 Feb 27, 2020
3ba8f3a
updated selector
jdnordy Feb 27, 2020
c90bcce
Merge pull request #36 from jdnordy/topic-dropdown-styling
skang1004 Feb 27, 2020
55803b4
added styling for leaderboard table
Feb 28, 2020
a2f1fa6
Merge branch 'master' into master
skang1004 Feb 28, 2020
01ee59b
Merge pull request #37 from hellokritty/master
skang1004 Feb 28, 2020
5ac0119
some styling
jdnordy Feb 28, 2020
7ee0229
merge
jdnordy Feb 28, 2020
4c46a56
Merge pull request #38 from jdnordy/topic-dropdown-styling
skang1004 Feb 28, 2020
2f36518
centered text within columns of leaderboard component
Feb 28, 2020
991e8bd
Merge pull request #39 from hellokritty/master
skang1004 Feb 28, 2020
32d88bb
working on styling of box
jdnordy Feb 28, 2020
3dfb7d1
merge
jdnordy Feb 28, 2020
6ee9e96
finished
jdnordy Feb 28, 2020
4f55579
Merge pull request #40 from jdnordy/ticket-box-styling
skang1004 Feb 28, 2020
9be37a7
fixed ticketsController.getActiveTickets to get data from tickets tha…
eamoranto Feb 28, 2020
32f66d4
finished bystander ticket box
jdnordy Feb 28, 2020
d276593
Merge branch 'master' into mentorNameFix
skang1004 Feb 28, 2020
95e6ee8
Merge pull request #41 from eamoranto/mentorNameFix
skang1004 Feb 28, 2020
4176ccd
Merge branch 'master' into bystander-box
skang1004 Feb 28, 2020
77cda2e
Merge pull request #42 from jdnordy/bystander-box
skang1004 Feb 28, 2020
f769888
added some finishing touches
jdnordy Feb 28, 2020
990bc7d
add back in set intervals
jdnordy Feb 28, 2020
0eef434
Merge pull request #43 from jdnordy/refactor-styling
skang1004 Feb 28, 2020
af9627e
last minute bug fixes
jdnordy Feb 28, 2020
9e1a499
Merge pull request #44 from jdnordy/last-minute
skang1004 Feb 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions client/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,23 @@ class App extends Component {
const { isLoggedIn } = this.props;
if (!isLoggedIn) {
return (
<div id="landing">
<div className="flex-container" id="login-page">
<div>
<img src="image/logo2.png" alt="" />
</div>
{/* Github Oauth Login Button */}
<form id="login-form" method="GET" action="/login/oauth">
<img id="logo" src="logo2.png" alt="" />
<button
className="btn btn-outline-primary btn-lg"
id="github-login"
type="submit"
>
GitHub Login
<button className="btn btn-outline-secondary btn-lg btn-login" type="submit">
<div className="flex-container">
<div id="github-logo" className="flex-container">
<svg id="i-github" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="24" height="24">
<path strokeWidth="0" fill="currentColor" d="M32 0 C14 0 0 14 0 32 0 53 19 62 22 62 24 62 24 61 24 60 L24 55 C17 57 14 53 13 50 13 50 13 49 11 47 10 46 6 44 10 44 13 44 15 48 15 48 18 52 22 51 24 50 24 48 26 46 26 46 18 45 12 42 12 31 12 27 13 24 15 22 15 22 13 18 15 13 15 13 20 13 24 17 27 15 37 15 40 17 44 13 49 13 49 13 51 20 49 22 49 22 51 24 52 27 52 31 52 42 45 45 38 46 39 47 40 49 40 52 L40 60 C40 61 40 62 42 62 45 62 64 53 64 32 64 14 50 0 32 0 Z" />
</svg>
</div>
<div id="github-login">
GitHub Login
</div>
</div>
</button>
</form>
</div>
Expand Down
34 changes: 34 additions & 0 deletions client/actions/leaderActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* ************************************
*
* @module leaderActions.js
* @author Kritika & Aris
* @date 02/26/2020
* @description Action Creators for leaderReducer
*
* ************************************
*/

// import actionType constants
import axios from "axios";
import * as types from "../constants/actionTypes";


// CHECK BACK ON THIS - NOT QUITE DONE YET**
export const getLeaderBoard = () => dispatch =>
axios
.get("/api/leaderboard")
.then(({ data }) => {
if (!data.isLoggedIn) {
dispatch({
type: types.USER_LOGOUT,
payload: data,
})
}
else {
dispatch({
type: types.LEADER_BY_TOPIC,
payload: data
})
}
})
188 changes: 134 additions & 54 deletions client/actions/ticketActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,43 @@
*/

// import actionType constants
import axios from 'axios';
import * as types from '../constants/actionTypes';
import axios from "axios";
import * as types from "../constants/actionTypes";

export const postTicket = () => (dispatch, getState) =>

export const updateMessage = event => ({
type: types.UPDATE_MESSAGE,
payload: event.target.value
});

export const chooseTopic = event => ({
type: types.CHOOSE_TOPIC,
payload: event.target.value
});

export const updateRating = value => ({
type: types.UPDATE_RATING,
payload: value,
});

export const toggleModal = messageInfo => ({
type: types.TOGGLE_MODAL,
payload: messageInfo
});

export const updateFeedback = event => ({
type: types.UPDATE_FEEDBACK,
payload: event.target.value
});

export const updateFinalRating = value => ({
type: types.UPDATE_FINAL_RATING,
payload: value,
});

export const getTickets = () => dispatch => {
axios
.post('/api/tickets', {
mentee_id: getState().user.userId,
message: getState().tickets.messageInput,
status: 'active',
snaps_given: getState().tickets.messageRating,
})
.get('/api/tickets')
.then(({ data }) => {
if (!data.isLoggedIn) {
dispatch({
Expand All @@ -30,45 +56,92 @@ export const postTicket = () => (dispatch, getState) =>
}
else {
dispatch({
type: types.POST_TICKET,
payload: data,
type: types.GET_TICKETS,
payload: data.activeTickets || [],
})
}
}
})
}

export const getTickets = () => dispatch =>

export const postTicket = () => (dispatch, getState) => {
axios
.get('/api/tickets')
.post("/api/tickets", {
mentee_id: getState().user.userId,
message: getState().tickets.messageInput,
status: "active",
snaps_given: getState().tickets.messageRating,
topic: getState().tickets.topic,
})
.then(({ data }) => {
if (!data.isLoggedIn) {
dispatch({
type: types.USER_LOGOUT,
payload: data
});
} else {
dispatch({
type: types.POST_TICKET,

payload: data,
})
}
else {
})
}

export const deleteTicket = id => (dispatch, getState) => {
axios
.put("/api/tickets/delete", {
ticketId: id,
status: "deleted"
})
.then(({ data }) => {
if (!data.isLoggedIn) {
dispatch({
type: types.GET_TICKETS,
payload: data.activeTickets || [],
type: types.USER_LOGOUT,
payload: data
});
} else {
dispatch({
type: types.DELETE_TICKET,
payload: id,
})
}
}
})
}

export const updateMessage = event => ({
type: types.UPDATE_MESSAGE,
payload: event.target.value,
});

export const updateRating = event => ({
type: types.UPDATE_RATING,
payload: event.target.value,
});
export const resolveTicket = id => (dispatch, getState) => {
axios
.put('/api/tickets/resolved', {
messageId : id,
status: 'resolved',
messageRating: getState().tickets.resolveModal.finalSnaps,
feedback: getState().tickets.resolveModal.feedback,
})
.then(({data}) => {
if(!data.isLoggedIn) {
dispatch({
type: types.USER_LOGOUT,
payload: data,
})
}
else {
dispatch({
type: types.RESOLVE_TICKET,
payload: id,
})
}
})
}

export const deleteTicket = id => (dispatch, getState) =>

export const acceptTicket = id => (dispatch, getState) => {
axios
.put('/api/tickets/delete', {
.put('/api/tickets/accept', {
ticketId: id,
status: 'deleted',
status: 'pending',
mentorId: getState().user.userId
})
.then(({ data }) => {
if (!data.isLoggedIn) {
Expand All @@ -79,31 +152,38 @@ export const deleteTicket = id => (dispatch, getState) =>
}
else {
dispatch({
type: types.DELETE_TICKET,
payload: id,
type: types.ACCEPT_TICKET,
payload: {
id,
mentorId: getState().user.userId,
}
})
}
}
})
};

export const resolveTicket = id => ({
type: types.RESOLVE_TICKET,
payload: id,
})

export const acceptTicket = id => ({
type: types.ACCEPT_TICKET,
payload: id,
})

export const cancelAccept = id => ({
type: types.CANCEL_ACCEPT,
payload: id,
})

// export const acceptTicket = event => (dispatch, getState) => {
// event.preventDefault();
// dispatch({
// type: types.ACCEPT_TICKET,
// payload: ticket,
// })
// }
export const cancelAccept = id => (dispatch, getState) => {
axios
.put('/api/tickets/accept', {
ticketId: id,
status: 'active',
mentorId: getState().user.userId
})
.then(({ data }) => {
if (!data.isLoggedIn) {
dispatch({
type: types.USER_LOGOUT,
payload: data,
})
} else {
dispatch({
type: types.CANCEL_ACCEPT,
payload: {
ticketId: id,
status: 'active',
mentorId: null
}
})
}
})
};
Loading