Skip to content

Commit

Permalink
React query (#146)
Browse files Browse the repository at this point in the history
* task/TUI-91 - react query login hook (#100)

* install react-query

* tapis-hooks useLogin hook

* Error decoding in helper function

* Add tapis-provider to component testing utils

* eslint

* Cache token in cookies

* Comments

* Refactor helpers and useTapisConfig

* Use React.PropsWithChildren

* Sidebar uses accessToken from useTapisConfig hook

* Dashboard reads access token

* Use query instead of explicit context as the source of truth for the access token.

* CRA port with git history preserved

* fix linting/tests

* Rename tests folders to _tests

* task/TUI-102 - react query systems (#109)

* Add systems list hook

* tapis-ui systems uses hook

* Systems list retrieval via hook

* Implement logout

* Fix tests

* Fix ListSection auth detection

* Removed unused queryHelper props

* Update comments

* Fix tests

* Template type check

* API helper proposal (#111)

* API helper proposal

* login uses new helpers

* remove unnecessary type definitions

* Nullable jwt

* Update src/tapis-ui/src/components/systems/SystemList/SystemList.tsx

Co-authored-by: Jake Rosenberg <[email protected]>

* Refactor useList to useSystemsList

* Revert "Refactor useList to useSystemsList"

This reverts commit 90308c3.

Co-authored-by: Jake Rosenberg <[email protected]>

* task/TUI-112 - realign directories (#113)

* Refactor src directory

* Refactor _tests

* Fix eslint issues

* Move defaultProps to inline values

* Delete extra fixtures

* task/TUI-104 -- apps list react query (#119)

* apps list in tapis-hooks and AppsListing

* Fix unit tests

* Dashboard uses apps listing

* Add query keys

* Code quality changes

* task/TUI-105 -- jobs list react query (#120)

* Jobs listing hook

* Dashboard uses useList tapis-hooks/jobs

* Job details hooks and ui

* query keys

* Code quality changes

* task/TUI-103 -- Files Listing hooks (#121)

* Files Listing hooks

* Concatenation utility

* Fix unit tests

* Simplified concatResults function

* streamline concatResults and remove need for type coercion

Co-authored-by: Jarosenb <[email protected]>

* Query keys for systems

* task/TUI-106 - react query jobs submission (#125)

* Add useSubmit hook

* JobsLauncher component uses tapis-hooks/jobs/useSubmit

* Update comments

* React query usemutation proposal (#127)

* Propose better parameters for usemutation functions

* query keys

* Try to use appVersion and appId as parameters for hook

* fix appId key

* JobsLauncher component explicitly accepts required parameters for launch

* Update src/tapis-hooks/jobs/useSubmit.ts

Co-authored-by: Jake Rosenberg <[email protected]>

Co-authored-by: Jake Rosenberg <[email protected]>

* Simplify job param syntax

Co-authored-by: Jake Rosenberg <[email protected]>

* Login hook simplified

* task/TUI-122 - remove tapis-redux (#130)

* Login hook simplified

* Remove tapis-redux

* Remove redux packages

* Remove redux from _common components

* task/TUI-126-- react query mutations (#129)

* Login hook simplified

* Convert logout from route to clickable UI element

* Simplify logout component

* task/TUI-131 - react query refetch (#132)

* Login hook simplified

* Add default params to listing operations

* tapis-ui components accept params for lists

* Remove manual refresh capabilities

* move authentication logic into a ProtectedRoute component (#133)

* Implement routing within sections. (#135)

* Implement routing within sections.

* Remove unused methods/imports

* fix tests

* destructure route props and move JobLauncherWrapper into tapis-app

* Task/t UI 137  react query mutation params (#138)

* Login hook simplified

* Consistently have useMutation hook functions use parameter lists instead of objects

* Remove onsuccess and onerror callbacks

* Task/TUI-140 react query getnextpageparam refactor (#141)

* Login hook simplified

* Refactor tapisNextPageParam utility function

* indentation

* Update src/tapis-hooks/utils/infiniteQuery.ts

Co-authored-by: Jake Rosenberg <[email protected]>

* Inline generic type for tapisNextPageParams

* spacing

Co-authored-by: Jake Rosenberg <[email protected]>

* abstract sidebar nav into a single component (#136)

* abstract sidebar nav into a single component

* move navbar to tapis-ui

* task/TUI-123 - wrapper components (#142)

* AppsListing refactored to AppsNav, uses QueryWrapper

* Remove unnecessary explicit typing

* List components refactored into navs

* SubmitWrapper component

* QueryWrappers for job details and file listings (#144)

* Abstract out a universal <Layout/> component (#145)

* abstract out a universal <Layout/> component

* more semantic names for section wrappers

* fix border layout

* fix file listing height

* add prettier check to the linter (#147)

* add prettier check to the linter

* run prettier --fix on codebase

* Update src/tapis-app/Sections/Jobs/Jobs.tsx

Co-authored-by: Keith G Strmiska <[email protected]>

* Update src/tapis-app/Sections/Dashboard/Dashboard.tsx

Co-authored-by: Keith G Strmiska <[email protected]>

* Update src/tapis-api/systems/list.ts

Co-authored-by: Keith G Strmiska <[email protected]>

* Update src/tapis-api/files/list.ts

Co-authored-by: Keith G Strmiska <[email protected]>

Co-authored-by: Jake Rosenberg <[email protected]>
Co-authored-by: Keith G Strmiska <[email protected]>
  • Loading branch information
3 people authored Sep 1, 2021
1 parent fd7ddf0 commit 5c4457e
Show file tree
Hide file tree
Showing 409 changed files with 7,768 additions and 15,448 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
coverage
build
webpack.*.js
webpack.*.js
*.test.js
59 changes: 0 additions & 59 deletions .eslintrc

This file was deleted.

13 changes: 7 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
## Overview: ##
## Overview:

## Related Github Issues: ##
## Related Github Issues:

* [TUI-1234](https://github.com/tapis-project/tapis-ui/issues/1234)
- [TUI-1234](https://github.com/tapis-project/tapis-ui/issues/1234)

## Summary of Changes: ##
## Summary of Changes:

## Testing Steps:

## Testing Steps: ##
1.

## UI Photos:

## Notes: ##
## Notes:
86 changes: 43 additions & 43 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,57 @@ name: CI
# Controls when the action will run. Triggers the workflow on pushes to main or on pull request events
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ '**' ]
branches: ['**']

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Client_Side_Unit_Tests:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1
with:
node-version: 14.x

- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm ci
run: |
npm ci
- name: Client Side Unit Tests
run: |
npm run test
# - name: Upload coverage to Codecov
# run: bash <(curl -s https://codecov.io/bash) -Z -t ${{ secrets.CODECOV_TOKEN }} -cF javascript
- uses: actions/checkout@v2
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1
with:
node-version: 14.x

- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm ci
run: |
npm ci
- name: Client Side Unit Tests
run: |
npm run test
# - name: Upload coverage to Codecov
# run: bash <(curl -s https://codecov.io/bash) -Z -t ${{ secrets.CODECOV_TOKEN }} -cF javascript

Client_Side_Linting:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1
with:
node-version: 14.x

- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm ci
run: |
npm ci
- name: Client Side Linting
run: |
npm run lint
- uses: actions/checkout@v2
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1
with:
node-version: 14.x

- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm ci
run: |
npm ci
- name: Client Side Linting
run: |
npm run lint
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
coverage
build
webpack.*.js
*.test.js
26 changes: 16 additions & 10 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ module.exports = {

// PROPERTY
// Disallow unknown properties.
'property-no-unknown': [ true, {
ignoreProperties: ['composes']
}],
'property-no-unknown': [
true,
{
ignoreProperties: ['composes'],
},
],

// KEYFRAME DECLARATION
// Disallow !important within keyframe declarations.
Expand Down Expand Up @@ -74,7 +77,9 @@ module.exports = {

// AT-RULE
// Disallow unknown at-rules.
'at-rule-no-unknown': [ true, {
'at-rule-no-unknown': [
true,
{
ignoreAtRules: [
// SASS at-rules
// SEE: https://sass-lang.com/documentation/at-rules
Expand All @@ -92,8 +97,9 @@ module.exports = {
'each',
'for',
'while',
]
} ],
],
},
],

// COMMENT
// Disallow empty comments.
Expand All @@ -106,7 +112,7 @@ module.exports = {
// 'no-duplicate-at-import-rules': null,
// Disallow duplicate selectors within a stylesheet.
'no-duplicate-selectors': null, // TODO: Uncomment to enable this after CSS Modules is heavily used
// (duplicate selectors can help separate contexts)
// (duplicate selectors can help separate contexts)
// Disallow empty sources.
// 'no-empty-source': null,
// Disallow extra semicolons (Autofixable).
Expand Down Expand Up @@ -282,7 +288,7 @@ module.exports = {

// Specify lowercase or uppercase for hex colors (Autofixable).
'color-hex-case': null, // TODO: Uncomment later, to reduce scope of changes
// (defaults to 2, because of extended ruleset)
// (defaults to 2, because of extended ruleset)
// Specify short or long notation for hex colors (Autofixable).
'color-hex-length': 'long',

Expand Down Expand Up @@ -503,7 +509,7 @@ module.exports = {
// GENERAL / SHEET
// Specify indentation (Autofixable).
indentation: null, // TODO: Uncomment later, to reduce scope of changes
// (defaults to 2, because of extended ruleset)
// (defaults to 2, because of extended ruleset)
// Specify unix or windows linebreaks (Autofixable).
// linebreaks: null,
// Limit the number of adjacent empty lines (Autofixable).
Expand All @@ -518,5 +524,5 @@ module.exports = {
// 'no-empty-first-line': true,
// Require or disallow Unicode BOM.
// 'unicode-bom': null
}
},
};
61 changes: 26 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,46 @@
# `tapis-ui`
# Getting Started with Create React App

This project is a React-Redux based web client for [`https://tapis.io`](https://tapis.io).
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Requirements
## Available Scripts

- node.js stable
In the project directory, you can run:

## Installing and Running
### `npm start`

First install node dependencies in the base directory:
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

```bash
npm install
```
The page will reload if you make edits.\
You will also see any lint errors in the console.

Next, start a development server with:
### `npm test`

```bash
npm run dev
```
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.

You can then browse to you [`https://localhost:3000`](https://localhost:3000) to view the application.
Due to a self-signed certificate being used for the dev server, you will receive a security warning.
### `npm run build`

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

All of the project sources are in the [`./src`](./src) directory. There are three major components:
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

- [`tapis-redux`](./src/tapis-redux): Redux state management and service for accessing `tapis.io`
- [`tapis-ui`](./src/tapis-ui): UI components for interacting `tapis.io` services
- [`tapis-app`](./src/tapis-app): A sample web application built on `tapis-ui` and `tapis-redux` components
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

Each component is structured so that they can eventually be published as separate npm packages. They each have:
### `npm run eject`

- `src` directory
- `__tests__` directory for unit tests for those components
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

In addition, all fixtures are available in [`./fixtures/`](./fixtures)
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.

## Testing, Linting and Pipelines
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 may run unit tests with
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.

```bash
npm run test
```
## Learn More

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

```bash
npm run lint
```

On pull request, these will be run via Github actions.
To learn React, check out the [React documentation](https://reactjs.org/).
29 changes: 0 additions & 29 deletions babel.config.json

This file was deleted.

Loading

0 comments on commit 5c4457e

Please sign in to comment.