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

React Frontend #205

Merged
merged 25 commits into from
Sep 27, 2023
Merged

React Frontend #205

merged 25 commits into from
Sep 27, 2023

Conversation

kaitj
Copy link
Collaborator

@kaitj kaitj commented May 18, 2023

Proposed changes

Change to switch some of the frontend from pure HTML/CSS/JS to React+Typescript. Relatively minor changes here (primarily to the navbar and footer), but will be beneficial in the long run for building out an admin UI. Also fixes some visual discrepancies on the page.

One thing that needs to be checked / tested is the login/logout functionality since this was moved from Jinja (Flask) to React. Will also need to slightly change the deployment.

Types of changes

What types of changes does your code introduce? Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionalitiy)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you are unsure about any of the choices, don't hesitate to ask!

  • Changes have been tested to ensure that fix is effective or that a feature works.
  • Changes pass the unit tests
  • Code has been run through black with the -l 79 flag.
  • I have included necessary documentation or comments (as necessary)
  • Any dependent changes have been merged and published

Notes

All PRs will undergo the unit testing before being reviewed. You may be requested to explain or make additional changes before the PR is accepted.

PR template was adopted from appium

@kaitj kaitj added the maintenance Pull requests that maintain the repo label May 18, 2023
@kaitj kaitj self-assigned this May 23, 2023
@kaitj kaitj requested a review from tkkuehn May 23, 2023 21:26
Copy link
Collaborator

@tkkuehn tkkuehn left a comment

Choose a reason for hiding this comment

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

Biggest comment: I'm having trouble getting this to run (with docker-compose up --build).

Generally for this (admittedly wonky) setup, I think we'll want to check in afidsvalidator-react/dist/index.js so I can just clone and get it up and running. (Although we could build in the Dockerfile theoretically...). Anyway after building I get the console error:

Uncaught ReferenceError: currentUser is not defined
    oi NavBar.tsx:67
    <anonymous> index.ts:4
    <anonymous> index.js:46
NavBar.tsx:67:12

I'd also install eslint, eslint-plugin-react, and prettier, and add them to the CI. I'll send you an example .eslintrc to get you going (but feel free to make any changes you'd like).

Once you've taken a stab at this stuff, I'll take another look.

@kaitj kaitj requested a review from tkkuehn May 31, 2023 19:24
- user auth
  - pass current_user.is_authenticated from backend to frontend bool
    param for navbar
- linters
  - added eslint and typescript plugins
  - set up linters
  - add scripts for linting and formatting
- performed linting on existing files
Copy link
Collaborator

@tkkuehn tkkuehn left a comment

Choose a reason for hiding this comment

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

All the react and templating stuff looks good to me, but I'd actually like to check in the dist subdirectory of afidsvalidator-react to make sure building from the github repository works properly

@kaitj kaitj mentioned this pull request Sep 26, 2023
@kaitj kaitj requested a review from tkkuehn September 26, 2023 19:18
@kaitj kaitj merged commit 7dac1ca into afids:master Sep 27, 2023
8 checks passed
@kaitj kaitj deleted the react branch September 27, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Pull requests that maintain the repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants