-
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
Added create event button, page and form #162
Conversation
Deploy preview for hknucsd-portal-dev ready! Built with commit 0f2d063 |
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.
couple things - let's merge in, make some issues and clean stuff up after demo
@@ -4,7 +4,7 @@ import { BaseAutocomplete } from '../base'; | |||
|
|||
import { getMultipleUsers, getUserNames } from '@Services/UserService'; | |||
|
|||
type OfficerNameData = { | |||
export type OfficerNameData = { |
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.
should later standardize type vs interface for props - nbd though
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 probably be switching to using interface instead of type, since interface is more common in our codebase.
@@ -46,3 +46,7 @@ export const OfficerNameAutocomplete = (props: OfficerAutocompleteProp) => { | |||
/> | |||
); | |||
}; | |||
|
|||
OfficerNameAutocomplete.defaultProps = { |
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.
can drop defaultProps with line 20
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.
Weird enough, eslint gave me an error for not having defaultProps even tho I already set a default value lmao...
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.
You know any way of fixing that? Idk why it's happening lol. Worst case scenario I might have to turn that off by line
@@ -23,4 +23,8 @@ const EventStatusDropdownField = (props: EventStatusFieldProp) => { | |||
); | |||
}; | |||
|
|||
EventStatusDropdownField.defaultProps = { |
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.
again can drop defaultProps given line 13
@@ -23,4 +23,8 @@ const EventTypeDropdownField = (props: EventTypeFieldProp) => { | |||
); | |||
}; | |||
|
|||
EventTypeDropdownField.defaultProps = { |
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.
see above
handleSubmit(values, setSubmitting); | ||
}} | ||
> | ||
{({ submitForm, isSubmitting }) => ( |
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.
later extract out form into component to be reused - we should aim to extract out components sooner than later
* This is for conditional rendering of component(s) at /events endpoint based on | ||
* the endpoint's query parameters | ||
*/ | ||
function QueriedEventPage(): JSX.Element { |
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 shouldn't have a separate page for this - we should be switching on params in '/events' instead
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.
What do you mean switching on params in '/events'? You mean do it at the App level?? Route's path prop doesn't recognize query params
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.
page level, /events and /events?x=true is the same page
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 but we don't have a page on /events yet, the Get Involved/Events page is 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.
wait what's the calendar under? I think it would make sense to put it as events
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.
It's currently under /calendar
* Tsconfig changes again : ( * Added create event button, page and form.
* Tsconfig changes again : ( * Added create event button, page and form. Rebase modal_refactor's commits onto master branch (in progress)
Also added a QueriedEventPage to handle conditional rendering via query params on /events endpoint.