-
Notifications
You must be signed in to change notification settings - Fork 6
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
Event API integration complete #145
Conversation
Still event edit page left, probably the trickiest one of them all. Other than that not sure if there is anything else that uses event services (if there are then we can refactor with the new event api functions). Just set up the user api functions file, have not done any integration for user api.
Deploy preview for hkn-ucsd-portal-dev ready! Built with commit f514af9 |
}; | ||
|
||
const eventHosts = hosts.map(host => host.id); | ||
const eventType = type || 'Event'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably better here to just type || null then handle null in tags
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
width: '536px', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh oh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see what I can do with that. For now I'll worry about all the logic and functionality stuff first, then I'll move on to making it look relatively nicer once I'm done with that
Deploy preview for hknucsd-portal-dev ready! Built with commit 6567769 |
Yeah - I think you’re right, we can get functionality then css after demo :)
… On Sep 1, 2020, at 11:08 AM, Thai ***@***.***> wrote:
@thaigillespie commented on this pull request.
In src/pages/EventDetailsPage/components/EventDetails/styles.js <#145 (comment)>:
> @@ -4,33 +4,24 @@ const styles = () => ({
flexDirection: 'column',
alignItems: 'center',
},
- container: {
- backgroundColor: 'white',
+ eventDetailsCard: {
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ width: '536px',
I'll see what I can do with that. For now I'll worry about all the logic and functionality stuff first, then I'll move on to making it look relatively nicer once I'm done with that
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub <#145 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AH25RGLWSJYBEWLLKXO26SDSDU2B7ANCNFSM4QSADDTA>.
|
@@ -48,7 +49,7 @@ | |||
"build": "react-app-rewired build", | |||
"test": "react-app-rewired test --passWithNoTests", | |||
"cypress": "npx cypress run", | |||
"lint": "eslint --fix './src/**/*.{js,ts,tsx}'", | |||
"lint": "eslint --fix ./src/**/*.{js,ts,tsx}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why'd you remove the '? afaik the glob pattern wasn't working without it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm run lint didn't run for me with the ' on : (
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to remove the ' for the command to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i had to add ' for the command to work -_______________________-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thaigillespie can you retest this with wsl? ' should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'll test it again later. ' didn't work in windows but should work in wsl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good - thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! just some small things
src/services/ApiUsers.ts
Outdated
return userApi.userControllerGetMultipleUsers(queryParams); | ||
} | ||
|
||
export function processMultipleUsers( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what this function does, could you explain why we need this? maybe I'm just not following the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly since getMultipleUsers returns a Promise with a union type, I had to make it so that the returned array is only of one of the two types from the union type, or else I couldn't use .map(). Of course, that was before changes made to what we receive as a response if we wanted to have officer names. I will have to either rewrite this in another PR. As of now, think of it as a function that extracts the users
array from the returned response of type MultipleAppUserResponse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok - can you call it either getUsernames from response or add a TODO? ideally having an issue would be nice too :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah getUsernames is fine. I'll be making minor fixes/changes to backend tonight as well so this function hopefully will be cleaned up by tonight or tmr.
src/services/ApiUsers.ts
Outdated
@@ -0,0 +1,97 @@ | |||
import { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thoughts on just calling this a User service or AppUser service? that way naming lines up with backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use user in the frontend but appuser in the backend so I'm not sure if UserService or AppUserService is better...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it to UserService (and ApiEvents to EventService) for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense yeah - naming is hard
src/services/ApiUsers.ts
Outdated
const { users } = multipleUserResponse; | ||
const userKeys = Object.keys(users[0]); | ||
|
||
if (users.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think if users.length == 0 then it'll have crashed on line 46 already
@@ -1,40 +0,0 @@ | |||
import React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think there's value in keeping form_chip..._input.js files around for historical purposes - they'd look pretty nice in our storybook as well :) what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine. I just removed them bc I thought we weren't gonna use them anymore but hey no harm in keeping them. I didn't use them in my integration code but maybe someone else in the future will have a need for it.
COMPLETE: 'complete', | ||
}; | ||
|
||
export default EVENT_STATUS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think for these enums we'd be able to leverage code gen
see this for an example
* Got a lot of event api integration done, but not all. Still event edit page left, probably the trickiest one of them all. Other than that not sure if there is anything else that uses event services (if there are then we can refactor with the new event api functions). Just set up the user api functions file, have not done any integration for user api. * Added autocompletion component * Finished with integration for event edit page. * Added changes to address review of PR #145. * Removed duplicate config to turn off import/prefer-default-export. * Just for deploy preview.
* Got a lot of event api integration done, but not all. Still event edit page left, probably the trickiest one of them all. Other than that not sure if there is anything else that uses event services (if there are then we can refactor with the new event api functions). Just set up the user api functions file, have not done any integration for user api. * Added autocompletion component * Finished with integration for event edit page. * Added changes to address review of PR #145. * Removed duplicate config to turn off import/prefer-default-export. * Just for deploy preview. Rebase modal_factor's commits onto master
Still event edit page left, probably the trickiest one of them all.
Other than that not sure if there is anything else that uses event
services (if there are then we can refactor with the new event api
functions).
Just set up the user api functions file, have not done any integration
for user api.