Skip to content

Commit

Permalink
Merge pull request #376 from USEPA/develop
Browse files Browse the repository at this point in the history
Sync staging with develop
  • Loading branch information
courtneymyers authored Dec 12, 2023
2 parents 4c28b85 + 13ea5a8 commit 843e95e
Show file tree
Hide file tree
Showing 54 changed files with 8,155 additions and 38,076 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ jobs:

- name: Build front-end files and move to server
run: |
PUBLIC_URL="$SERVER_URL" \
REACT_APP_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
REACT_APP_CLOUD_SPACE="$CLOUD_SPACE" \
REACT_APP_FORMIO_BASE_URL="$FORMIO_BASE_URL" \
REACT_APP_FORMIO_PROJECT_NAME="$FORMIO_PROJECT_NAME" \
VITE_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
VITE_CLOUD_SPACE="$CLOUD_SPACE" \
VITE_FORMIO_BASE_URL="$FORMIO_BASE_URL" \
VITE_FORMIO_PROJECT_NAME="$FORMIO_PROJECT_NAME" \
npm run build
rm ../server/app/public/index.html
cd build
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ jobs:

- name: Build front-end files and move to server
run: |
PUBLIC_URL="$SERVER_URL" \
REACT_APP_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
REACT_APP_CLOUD_SPACE="$CLOUD_SPACE" \
REACT_APP_FORMIO_BASE_URL="$FORMIO_BASE_URL" \
REACT_APP_FORMIO_PROJECT_NAME="$FORMIO_PROJECT_NAME" \
VITE_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
VITE_CLOUD_SPACE="$CLOUD_SPACE" \
VITE_FORMIO_BASE_URL="$FORMIO_BASE_URL" \
VITE_FORMIO_PROJECT_NAME="$FORMIO_PROJECT_NAME" \
npm run build
rm ../server/app/public/index.html
cd build
Expand Down
8 changes: 4 additions & 4 deletions app/client/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NOTE: For local development, set `REACT_APP_FORMIO_BASE_URL` and
# `REACT_APP_FORMIO_PROJECT_NAME` to the same values used in the server app's
# NOTE: For local development, set `VITE_FORMIO_BASE_URL` and
# `VITE_FORMIO_PROJECT_NAME` to the same values used in the server app's
# `FORMIO_BASE_URL` and `FORMIO_PROJECT_NAME` env variables. When deployed, a
# GitHub Actions Workflow does this in the "build" npm script.
REACT_APP_FORMIO_BASE_URL=
REACT_APP_FORMIO_PROJECT_NAME=
VITE_FORMIO_BASE_URL=
VITE_FORMIO_PROJECT_NAME=
26 changes: 26 additions & 0 deletions app/client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
root: true,
env: {
browser: true,
es2020: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
"no-extra-boolean-cast": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true }, // allow export const foo = 4
],
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_" }, // ignore unused args starting with _
],
},
};
57 changes: 19 additions & 38 deletions app/client/README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,27 @@
# Getting Started with Create React App
# React + TypeScript + Vite

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

## Available Scripts
Currently, two official plugins are available:

In the project directory, you can run:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

### `npm start`
## Expanding the ESLint configuration

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

The page will reload if you make edits.\
You will also see any lint errors in the console.
- Configure the top-level `parserOptions` property like this:

### `npm test`
```js
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
```

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
60 changes: 21 additions & 39 deletions app/client/public/index.html → app/client/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="U.S. EPA Clean School Bus Data Collection System"
/>
<meta name="description" content="U.S. EPA CSB Rebate Forms Application" />
<meta property="DC.creator" content="US EPA" />
<meta
property="DC.description"
content="U.S. EPA Clean School Bus Data Collection System"
content="U.S. EPA CSB Rebate Forms Application"
/>
<meta property="DC.date.created" content="2022-03-01" />
<meta property="DC.date.modified" content="2022-03-01" />
Expand All @@ -20,21 +17,15 @@
property="DC.Subject.epachannel"
content="Learn the Issues, Science &amp; Technology"
/>
<meta
property="DC.title"
content="Clean School Bus Data Collection System"
/>
<meta property="DC.title" content="CSB Rebate Forms Application" />
<meta property="DC.type" content="Data and Tools" />
<meta property="og:site_name" content="US EPA" />
<meta property="og:type" content="website" />
<meta property="og:url" content="%PUBLIC_URL%/" />
<meta
property="og:title"
content="Clean School Bus Data Collection System | US EPA"
/>
<meta property="og:url" content="/" />
<meta property="og:title" content="CSB Rebate Forms Application | US EPA" />
<meta
property="og:description"
content="U.S. EPA Clean School Bus Data Collection System"
content="U.S. EPA CSB Rebate Forms Application"
/>
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
Expand All @@ -43,19 +34,19 @@
<meta name="twitter:card" content="summary_large_image" />
<meta
name="twitter:description"
content="U.S. EPA Clean School Bus Data Collection System"
content="U.S. EPA CSB Rebate Forms Application"
/>
<meta
name="twitter:title"
content="Clean School Bus Data Collection System | US EPA"
content="CSB Rebate Forms Application | US EPA"
/>
<meta name="twitter:url" content="%PUBLIC_URL%/" />
<meta name="twitter:url" content="/" />
<meta name="twitter:image:height" content="600" />
<meta name="twitter:image:width" content="1200" />
<meta name="msapplication-TileColor" content="#005ea2" />
<meta name="theme-color" content="#005ea2" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="canonical" href="%PUBLIC_URL%/" />
<link rel="manifest" href="/manifest.json" />
<link rel="canonical" href="/" />
<link
rel="apple-touch-icon-precomposed"
sizes="196x196"
Expand Down Expand Up @@ -129,7 +120,7 @@
media="all"
href="https://www.epa.gov/themes/epa_theme/css/styles.css"
/>
<title>Clean School Bus Data Collection System | US EPA</title>
<title>CSB Rebate Forms Application | US EPA</title>
<script>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
Expand Down Expand Up @@ -331,7 +322,7 @@
<button class="usa-nav__close" aria-label="Close">
<svg class="icon icon--nav-close" aria-hidden="true" role="img">
<title>Primary navigation</title>
<use href="%PUBLIC_URL%/img/sprite.artifact.svg#close" />
<use href="/img/sprite.artifact.svg#close" />
</svg>
</button>

Expand Down Expand Up @@ -395,6 +386,7 @@
<article class="article">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</article>
</div>

Expand Down Expand Up @@ -640,9 +632,7 @@ <h2>Follow.</h2>
href="https://www.facebook.com/EPA"
>
<svg class="icon icon--social" aria-hidden="true">
<use
href="%PUBLIC_URL%/img/sprite.artifact.svg#facebook-square"
/>
<use href="/img/sprite.artifact.svg#facebook-square" />
</svg>
</a>
</li>
Expand All @@ -653,9 +643,7 @@ <h2>Follow.</h2>
href="https://twitter.com/epa"
>
<svg class="icon icon--social" aria-hidden="true">
<use
href="%PUBLIC_URL%/img/sprite.artifact.svg#twitter-square"
/>
<use href="/img/sprite.artifact.svg#twitter-square" />
</svg>
</a>
</li>
Expand All @@ -666,9 +654,7 @@ <h2>Follow.</h2>
href="https://www.youtube.com/user/USEPAgov"
>
<svg class="icon icon--social" aria-hidden="true">
<use
href="%PUBLIC_URL%/img/sprite.artifact.svg#youtube-square"
/>
<use href="/img/sprite.artifact.svg#youtube-square" />
</svg>
</a>
</li>
Expand All @@ -679,9 +665,7 @@ <h2>Follow.</h2>
href="https://www.flickr.com/photos/usepagov"
>
<svg class="icon icon--social" aria-hidden="true">
<use
href="%PUBLIC_URL%/img/sprite.artifact.svg#flickr-square"
/>
<use href="/img/sprite.artifact.svg#flickr-square" />
</svg>
</a>
</li>
Expand All @@ -692,9 +676,7 @@ <h2>Follow.</h2>
href="https://www.instagram.com/epagov"
>
<svg class="icon icon--social" aria-hidden="true">
<use
href="%PUBLIC_URL%/img/sprite.artifact.svg#instagram-square"
/>
<use href="/img/sprite.artifact.svg#instagram-square" />
</svg>
</a>
</li>
Expand All @@ -706,7 +688,7 @@ <h2>Follow.</h2>

<a href="#top" class="back-to-top" title="Back to top">
<svg class="back-to-top__icon" role="img" aria-label="Back to top">
<use href="%PUBLIC_URL%/img/sprite.artifact.svg#arrow" />
<use href="/img/sprite.artifact.svg#arrow" />
</svg>
</a>

Expand Down
Loading

0 comments on commit 843e95e

Please sign in to comment.