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

URO-77: Add status badge, polish documentation. #214

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 26 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# UI Refresh Test Repo
# UI for KBase

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app) (`npx create-react-app ui-refresh-test --template typescript`). It also includes the following:
![build and push status](https://github.com/kbase/ui/actions/workflows/build_and_push.yml/badge.svg)

This project manages the User Interface (UI) for KBase tools, not including the
narrative interface or documentation site [kbase.us](https://kbase.us).

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app)
using the command `npx create-react-app ui-refresh-test --template typescript`.

It also includes the following:

- Redux (`@reduxjs/toolkit`) for state management
- `react-router-dom` for routing
Expand All @@ -9,62 +17,59 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo
- npm linting scripts (`lint`, `lint:fix`, `lint:strict`)
- `husky` to enable a `lint:strict` precommit hook
- `.nvmrc` specifying the node version
- Very small example app implementation with mock login
- `.editorconfig` for cross-editor config defaults. See
[editorconfig.org](https://editorconfig.org) for compatability
- Storybook (`npm run storybook`) for dev docs, style examples, and component
examples.


## Architectural Decision Records

An architecture decision record (ADR) is a document that captures an important
architecture decision made along with its context and consequences. They track
major decisions that change the course of the project. You can find the ADRs
for this project in [`docs/adrs`](docs/adrs).


## Getting Started

First clone the repo into your working directory:
First clone the repository into your working directory:

```
```sh
git clone [email protected]:kbase/ui.git
```

Install the dependencies:

```
```sh
npm install
```

Start the app:

```
```sh
npm start
```

### Troubleshooting

- Ensure that your node version matches the version specified in `.nvmrc`.
We recommend using `nvm` to manage your node versions.
Run `nvm install` to install and use the node version from `.nvmrc`.
We recommend using [`nvm`](https://github.com/nvm-sh/nvm) to manage your node
versions. Run `nvm install` to install and use the node version from `.nvmrc`.
- If you receive the following error message after running `npm start`:
`Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.`
then you may need to set the following environment variable: `DANGEROUSLY_DISABLE_HOST_CHECK=true`
- If you are using a Mac with an M1 or M2 chip, you may run into an
then you may need to set the following environment variable:
`DANGEROUSLY_DISABLE_HOST_CHECK=true`
- If you are using a Mac with an M1 or M2 chip, you may run into an
error caused by `canvas` and `node-gyp` after running `npm install`.
- First, make sure your global python version (`python --version`)

- First, make sure your global python version (`python --version`)
is under 3.12.
- If the install step still isn't working, try to install node-canvas
from source by following the Installation: Mac OS X, HomeBrew steps below
- If the install step still isn't working, try to install node-canvas
from source by following the Installation: Mac OS X, HomeBrew steps below
or on [this page](https://github.com/Automattic/node-canvas/wiki/Installation:-Mac-OS-X).

- `brew install pkg-config cairo pango libpng jpeg giflib librsvg`
- This python aspect of this issue may become obsolete once
the `node-gyp` peer dependency is able to upgrade to v10+.

- `brew install pkg-config cairo pango libpng jpeg giflib librsvg`
- This python aspect of this issue may become obsolete once
the `node-gyp` peer dependency is able to upgrade to v10+.

## Available Scripts

Expand Down Expand Up @@ -109,28 +114,3 @@ errors/warnings and is used as a pre-commit hook.
Opens storybook locally. Builds and watches `*.stories.[tsx|mdx]` files and
launches a local storybook server. The storybook contains component examples
and other dev documentation.

### `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/).
6 changes: 3 additions & 3 deletions docs/adrs/0000-ADR-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Truss (DU project) ADRs [^1]
## Consequences <!-- Summary of the decision -->

Adds a file to the repo, but allows easy discovery. Makes updating the template
straightfoward if needed. However, this may need to be revisted if multiple
straightforward if needed. However, this may need to be revisited if multiple
repos are create for the project, as that might require duplicating the
template, or changing where ADRs are stored.

Expand All @@ -47,15 +47,15 @@ template, or changing where ADRs are stored.

### Send an email describing how to make an ADR to everyone

- `+` Everyone is notifed
- `+` Everyone is notified
- `-` Not discoverable after initial email
- `-` Hard to update easily, might lose track of who to email
- `-` Silly

### Send an email describing how to make an ADR to everyone

- `+` May work better if there are many repos related to the project
- `-` Not particulary discoverable
- `-` Not particularly discoverable

## References <!-- List any relevant resources about the ADR, consider using footnotes as below where useful -->

Expand Down
6 changes: 3 additions & 3 deletions docs/adrs/0001-CRA-and-general-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Accepted

- Create React App (CRA)
- Manual React Setup
- Other react bootstraping solutions
- Other react bootstrapping solutions

## Decision Outcome <!-- Summary of the decision -->

Expand All @@ -36,7 +36,7 @@ template will be used, and redux added post-hoc.
## Consequences <!-- Summary of the decision -->

Using CRA allows fast initial setup, but adds some "magic" to the repo. We felt
this was a good tradeoff for initial development. CRA also offers `eject`[^1]
this was a good trade-off for initial development. CRA also offers `eject`[^1]
which allows for it to be removed as a dependency (though doing so also removes
many of its benefits, such as not maintaining the webpack config). There is
also a large dev community for CRA.
Expand All @@ -56,7 +56,7 @@ also a large dev community for CRA.
- `+` Almost completely customizable
- `-` Complicated configurations and decisions around bundling, css loading,
etc. Best practices unclear.
- `-` Would be KBase-specific, and perhaps even repo-specfic, adding to
- `-` Would be KBase-specific, and perhaps even repo-specific, adding to
required onboarding.

### Other react app-bootstrapping solutions
Expand Down
8 changes: 4 additions & 4 deletions docs/adrs/0003-forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ best suited for our purposes.

## Status <!-- Status of this ADR -->

Draft
Accepted

## Alternatives Considered <!-- Short list of considered alternatives, should include the chosen path -->

Expand Down Expand Up @@ -51,15 +51,15 @@ of our needs).
- `+` Basic API is concise (when using HTML elements)
- `+` Good documentation
- `?` Validation features preference validation library `Yup`
- `-` Requires a signifigant amout of boilerplate when using custom input
- `-` Requires a significant amount of boilerplate when using custom input
components not designed without Formik in mind (e.g. if we used a date-picker
component from a library)
- `-` Straightforward use of custom input components requires modifying the
component being used in the form, rather than wrapping it
- `-` More complicated features (e.g. custom validation) require lots of
boilerplate.
- `-` Introduces react (anti?) pattern we don't use elswhere ([Function as Child
Components][])
- `-` Introduces react (anti?) pattern we don't use elsewhere
([Function as Child Components][])

### React Hook Form (8kB)

Expand Down
2 changes: 1 addition & 1 deletion docs/adrs/0005-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ inside cells. This ADR explains the decision to use the headless

## Status <!-- Status of this ADR -->

N/A
Accepted

## Alternatives Considered <!-- Short list of considered alternatives, should include the chosen path -->

Expand Down
3 changes: 1 addition & 2 deletions docs/adrs/0006-Component-Library.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ component.
- `+` Lots of useful, convenient components
- `+` Styling is all handled in CSS sheets with namespaced class names for the
blueprint component classes
- `-` Low levels of configuartion (hard to match our existing styles)
- `-` Low levels of configuration (hard to match our existing styles)
- `-` No planned mobile/ small-screen support

### [U.S. Web Design System (USWDS)](https://designsystem.digital.gov/)
Expand Down Expand Up @@ -81,4 +81,3 @@ component.
inline styles
- `+` Comes with many styles out of the box
- `-` Style configuration is in JS, not SCSS
[DU Project ADR Example](https://github.com/kbase/narrative/blob/44aaa558ec3c8c061777983531884a7ce7d9ad78/docs/adrs/0001-git-workflow.md)
4 changes: 2 additions & 2 deletions src/features/collections/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Collections

The collections feature supports the collections service (as of writing, hosted
at: https://kbase.us/services/collections/docs).
The collections feature supports the
[collections service](https://kbase.us/services/collections/docs).

The purpose of this README is to contain notes useful to developers, which may
not be easily grokked from the code.
Expand Down
Loading