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

Refactored modals to using TS and simplified code for modals. #160

Closed
wants to merge 29 commits into from

Conversation

thai-truong
Copy link
Collaborator

Also added a story for modals to storybook.

@thai-truong thai-truong added the enhancement New feature or request label Sep 10, 2020
@thai-truong thai-truong requested a review from a team September 10, 2020 20:04
@thai-truong thai-truong self-assigned this Sep 10, 2020
@netlify
Copy link

netlify bot commented Sep 10, 2020

Deploy preview for hknucsd-portal-dev ready!

Built with commit 20913ae

https://deploy-preview-160--hknucsd-portal-dev.netlify.app

@thai-truong thai-truong linked an issue Sep 12, 2020 that may be closed by this pull request
Copy link
Collaborator

@godwinpang godwinpang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry this is kinda long haha

src/components/modals/base/BaseModal.tsx Outdated Show resolved Hide resolved
src/components/modals/base/ButtonWithModal.tsx Outdated Show resolved Hide resolved
src/components/modals/ButtonWithModal.tsx Outdated Show resolved Hide resolved
src/components/modals/ModalWithActionButtons.tsx Outdated Show resolved Hide resolved
src/components/modals/ModalWithActionButtons.tsx Outdated Show resolved Hide resolved
src/components/modals/index.tsx Outdated Show resolved Hide resolved
src/components/modals/index.tsx Outdated Show resolved Hide resolved
src/components/modals/index.tsx Outdated Show resolved Hide resolved
thai-truong and others added 23 commits September 20, 2020 15:07
* Made changes so auth on openapi schema works.

Now requests that require BE to check token will be sent with
Bearer JWT from FE as a token.

* Made changes based on review on PR #143

* Okay actual changes reflecting review on PR #143.
* Add autochanged tsconfig.

* Make signup page responsive.

* Drop minWidth on dropdowns to prevent overflow.
* Make document body fill viewport.

* Add PublicPageLayout component with story.

* Update pages to use public page layout.

Not even going to think about touching SignUpPage

* Add spacing so content is not squished on mobile.
* 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.
We should change this to be loaded from an env_var soon.
* Add Card component with story.

* Replace card usage throughout codebase. (EventDetails is messed up.)

* Add prop passthrough to Card.

* Fix EventDetails component.

* Add title prop to card.

* Refactor usage of CardHeader.

* Change Card export syntax.
… backend. (#153)

* Added email verification to signup workflow, integrated auth api from backend.

Now frontend just needs to call createNewUser() from
src/services/AuthService to start the signup workflow, then finishes it
off with email verif. being handled in frontend.

* Added try catch for calls to a firebase service in signup's handleSubmit.

* Fixed duplicate imports in SignUpPage.
* Add card with vertical tabs.

* Add border, grid, remove ripple.
* Install react-router types.

* Migrate EventDetailsPage to useParam hook + typescript.

* Migrate EventSignInForm to useParam hook + typescript.

* Migrate EventRsvpPage to useParam hook + typescript.

* Migrate EventEditPage to useParam hook + typescript.

* Migrate ProfilePages to hooks + useParams hook.

* Add yup typing.

* Add @types to dependencies instead of devDep.

@types should be in dev dep to prevent build size bloat, but somehow
netlify builds fail when @types are not deps.

* Modify CardProps to take in className.

* Change pages to use new Card component.

* Make className optional for cards.
* Add react-router-dom types.

* Changes App + contexts to ts.

* Add types for react-router-dom.

* Fix prop typing.
* Tsconfig changes again : (

* Added create event button, page and form.
)

* Took out most usages of process.env and replaced with config file.

Except for src/ServiceWorker.js and ./cypress/plugins because I don't
think it's a super good idea to change anything in those.

* Made changes based on review+discussions from PR #161.
…s role (#164)

* UserContextValues's userRole in App now uses backend api to get user's role.

It used to get the roles from firebase custom claims.

* Add fixes.

* Remove unused function.

Co-authored-by: gypang <[email protected]>
* Tsconfig changes again : (

* Fixed merge issue

* Create Event now works properly and as intended.

After creating an event, the browser redirects to the newly created
event's EventDetails page.

Note that fbURL and canvaURL both have to either be empty or filled
out with a proper URL string, otherwise a status code 400 will be
sent from the backend server.

* Added url validation to create event form's schema's fbURL + canvaURL.

* Changed process.env in src/index.js to using config.
* Put an alert for successful sign up.

* Retrigger GH checks on PR #169.
…#168)

* Added automatic rsvp + sign in buttons for affiliates.

* Merged master into rsvp_signin_buttons.
* Add autochanged tsconfig.

* Make signup page responsive.

* Drop minWidth on dropdowns to prevent overflow.

Rebase commits from modal_refactor onto master
* 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
* Add Card component with story.

* Replace card usage throughout codebase. (EventDetails is messed up.)

* Add prop passthrough to Card.

* Fix EventDetails component.

* Add title prop to card.

* Refactor usage of CardHeader.

* Change Card export syntax.

Rebase the commits from modal_refactor to master for modal_refactor's PR
… backend. (#153)

* Added email verification to signup workflow, integrated auth api from backend.

Now frontend just needs to call createNewUser() from
src/services/AuthService to start the signup workflow, then finishes it
off with email verif. being handled in frontend.

* Added try catch for calls to a firebase service in signup's handleSubmit.

* Fixed duplicate imports in SignUpPage.

Rebase modal_refactor's 3 commits onto master (in progress)
godwinpang and others added 6 commits October 3, 2020 11:43
* Install react-router types.

* Migrate EventDetailsPage to useParam hook + typescript.

* Migrate EventSignInForm to useParam hook + typescript.

* Migrate EventRsvpPage to useParam hook + typescript.

* Migrate EventEditPage to useParam hook + typescript.

* Migrate ProfilePages to hooks + useParams hook.

* Add yup typing.

* Add @types to dependencies instead of devDep.

@types should be in dev dep to prevent build size bloat, but somehow
netlify builds fail when @types are not deps.

* Modify CardProps to take in className.

* Change pages to use new Card component.

* Make className optional for cards.

Rebase the commits of modal_refactor to master (in progress)
* Tsconfig changes again : (

* Added create event button, page and form.

Rebase modal_refactor's commits onto master branch (in progress)
* Tsconfig changes again : (

* Fixed merge issue

* Create Event now works properly and as intended.

After creating an event, the browser redirects to the newly created
event's EventDetails page.

Note that fbURL and canvaURL both have to either be empty or filled
out with a proper URL string, otherwise a status code 400 will be
sent from the backend server.

* Added url validation to create event form's schema's fbURL + canvaURL.

* Changed process.env in src/index.js to using config.
Also added a story for modals to storybook.
This is so that ButtonWithModal is strictly a Button component + a
Modal component used as a black box (which is ModalWithActionButtons in
this case). ModalWithActionButtons now handles rendering all the action
buttons for a BaseModal.
@thai-truong
Copy link
Collaborator Author

Since master is now base branch for this PR, I'm gonna close this and open a new PR

@thai-truong thai-truong closed this Oct 3, 2020
thai-truong pushed a commit that referenced this pull request Oct 19, 2020
Resolve merge conflicts for third cherry-pick from modal_refactor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor modals component
2 participants