-
Notifications
You must be signed in to change notification settings - Fork 81
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
Rafiki Admin UI feature #969
Merged
Merged
Changes from 3 commits
Commits
Show all changes
108 commits
Select commit
Hold shift + click to select a range
f37d451
feat: first commit for the Rafiki Admin UI feature
JoblersTune be62ed9
fix: node-sass version 8 is compatible with Node version 19. Removing…
JoblersTune d35737a
fix: introducing automatic type generation and using Apollo client to…
JoblersTune 3966cff
fix: using existing generated types file in Rafiki backend
JoblersTune 2101251
fix: introducing automatic type generation and using Apollo client to…
JoblersTune d306579
fix: added automatic type generation and using Apollo client to view/…
JoblersTune 60ae1f1
fix: consolidated unneccessary component files back into the their ro…
JoblersTune 78a3c1d
fix: refactoring files to get rid of nested routing
JoblersTune 221cd2a
fix: using CodeGen to generate a type file in the admin UI project
JoblersTune fa6a252
fix: formatting date in the loader rather than on the frontend
JoblersTune 641ba23
fix: progress on fixing the update peer form
JoblersTune 64345ea
fix: using same node version in admin UI as the rest of the repo
JoblersTune 45a6cf0
fix: removed the generated types from the .gitignore file
JoblersTune d906b07
fix: downgraded node-sass dependency
JoblersTune 7e0e17b
fix: creating a single instance of Apollo Client
JoblersTune 42c4d3e
fix: removed unused setting when intantialising the inMemoryCache
JoblersTune 43fe330
chore: resolved merge conflicts with main
JoblersTune a3b2f22
fix: upgraded update page UI
JoblersTune 24cf70c
fix: if ID is incorrect on update forms then the tooltip should disap…
JoblersTune baeef57
fix: removed input border and tooltip from fixed update form elements
JoblersTune ba896ab
chore: added a favicon suggestion
JoblersTune 4ff8184
fix: refactoring error messages handling
JoblersTune 6342f9f
fix: re-adding lost CodeGen file updates
JoblersTune 521ad6e
fix: added dropdown asset selection field to peer update form
JoblersTune 2fbf838
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa 9c804c4
feat(admin): start migrating to tailwind
raducristianpopa 1c42187
feat(admin): add button component
raducristianpopa 1fa3d3d
new dashboard layout
raducristianpopa 2abf7d5
feat(admin): add/update components & icons
raducristianpopa 699d375
chore: update codegen for admin
raducristianpopa 761c9aa
feat(admin): add services
raducristianpopa 5e2e6d8
chore: update config files and README
raducristianpopa 01066fc
chore(admin): remove scss files
raducristianpopa 8ea4647
feat(admin): update routes
raducristianpopa f828c35
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa f599f9a
chore: formatting
raducristianpopa 80fe566
fix(admin): fix field errors
raducristianpopa 6b64a2c
feat(admin): address error handling feedback
raducristianpopa afd5b1e
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa b0d40ae
feat(admin): small changes
raducristianpopa 9c38ac1
feat(admin): add view peer page
raducristianpopa d993c48
chore(wallet): remove `tiny-invariant` and validation func
raducristianpopa 8498215
chore: pagination fix
raducristianpopa aade1fc
feat(admin): add peer update page
raducristianpopa 56a0ccc
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa f5fdb53
chore: linting
raducristianpopa 411a6b3
feat(admin): finish peer update page
raducristianpopa 4250128
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa 2044f2f
feat(admin): update error and catch boundaries
raducristianpopa 8939109
feat(admin): add asset update page
raducristianpopa 80ba3e3
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa 9271af2
chore: update scalar types for admin
raducristianpopa 033eef8
fix(admin): fix serialization issues
raducristianpopa 4185348
fix(admin): disable pagination buttons
raducristianpopa 77107b6
feat(admin): update validations
raducristianpopa 003a8c5
feat(admin): add create asset page
raducristianpopa b9022a3
fix(admin): fix `bigint` JSON serialization
raducristianpopa eb620ab
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa fc6c3a8
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa f544af2
feat(admin): include generated operation files
raducristianpopa 5248e8a
feat(admin): add peer deletion option
raducristianpopa 700f3b5
chore(admin): remove unused imports
raducristianpopa 9a7346e
chore: fix `.eslintignore`
raducristianpopa 3554298
feat(admin): add mobile menu
raducristianpopa 68ddeaf
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa 400e27b
feat(admin): add assets dropdown
raducristianpopa 320803d
feat(admin): add table empty state
raducristianpopa 50703f5
feat(admin): fix padding
raducristianpopa 0494e40
feat(admin): align elements
raducristianpopa d952c70
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa 8a6ed1b
chore: bump remix version
raducristianpopa 3bfe56f
chore: generate operation types in the same file
raducristianpopa 5c69d4b
feat: refactor api calls
raducristianpopa 96bedfa
fix: typescript-eslint error
raducristianpopa efc5d7c
chore: global gitignore file
raducristianpopa 071cad1
chore: add readme for styles
raducristianpopa a061c24
chore: remove dead code
raducristianpopa 316c5cd
fix: use conventional error codes
raducristianpopa e6b0042
refactor: move icons into a single file
raducristianpopa 6dfac32
refactor: components structure
raducristianpopa 791eb70
chore: update README
raducristianpopa 20dc823
chore: update prettierignore
raducristianpopa b978bd0
feat: create next/previous page urls in loader
raducristianpopa 9da68f4
chore: update README
raducristianpopa b7d5c6b
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa 66b4e1a
chore: move rafiki admin to `frontend` package
raducristianpopa 9624d0b
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa be5ecc3
chore: update codegen documents
raducristianpopa 37e0d15
chore: remove frontend reference from root tsconfig
raducristianpopa 6be6bca
chore: address comments
raducristianpopa ae909da
chore: remove apollo from global namespace
raducristianpopa 2f93dcb
chore: add ci check for frontend (build only)
raducristianpopa 6bba354
chore: add rafiki admin to localenv
raducristianpopa 63dfdd2
chore: update localenv README and diagram
raducristianpopa 16edf30
chore: update `frontend` readme and apollo uri
raducristianpopa 7e2f993
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa 25feefb
chore: add apollo back to global namespace
raducristianpopa 21c5102
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa bd81ff0
chore: generate
raducristianpopa 34e518e
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa c9c8dc7
chore: typos
raducristianpopa b79f708
chore: update localenv diagram and readme
raducristianpopa d510cdd
chore: generate graphql types
raducristianpopa 6b50006
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa 5e489bd
chore: fix compose files
raducristianpopa a5f0613
fix: typo in diagram
raducristianpopa f032793
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa e894b57
Merge branch 'main' into sj-rafiki-admin-ui
raducristianpopa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
env: | ||
browser: true | ||
es2021: true | ||
node: true | ||
extends: | ||
- '@remix-run/eslint-config' | ||
- '@remix-run/eslint-config/node' | ||
- 'eslint:recommended' | ||
- 'plugin:react/recommended' | ||
- 'plugin:@typescript-eslint/recommended' | ||
- 'prettier' | ||
root: true | ||
parser: '@typescript-eslint/parser' | ||
parserOptions: | ||
ecmaFeatures: | ||
jsx: true | ||
ecmaVersion: 2020 | ||
sourceType: module | ||
plugins: | ||
- react | ||
- '@typescript-eslint' | ||
rules: | ||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }] | ||
'react/jsx-uses-react': 'off' | ||
'react/react-in-jsx-scope': 'off' | ||
'@typescript-eslint/quotes': ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: true }] | ||
settings: | ||
react: | ||
version: "detect" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
|
||
/.cache | ||
/build | ||
/public/build | ||
app/styles/dist | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Rafiki Admin UI | ||
|
||
## Development | ||
|
||
This project assumes that you have a local Rafiki backend instance up and running. See the Environment Setup and Local Development sections in the main [README](../../README.md). | ||
|
||
This project is using Node version 19. | ||
|
||
To start the project in development mode: | ||
|
||
```sh | ||
npm run dev | ||
``` | ||
|
||
This starts your app in development mode, rebuilding assets on file changes. You can access your app on [http://localhost:3005](http://localhost:3005). | ||
|
||
|
||
Currently you need to also manually build your CSS assets: | ||
```sh | ||
npm run scss | ||
``` | ||
|
||
To format and lint code: | ||
```sh | ||
npm run format | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import styles from '../styles/dist/DisplayItem.css' | ||
import { useLoaderData } from '@remix-run/react' | ||
|
||
function DisplayAsset() { | ||
const { asset } = useLoaderData() | ||
JoblersTune marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return ( | ||
<table> | ||
<tbody> | ||
<tr> | ||
<th>ID</th> | ||
<td>{asset.id}</td> | ||
</tr> | ||
<tr> | ||
<th>Code</th> | ||
<td>{asset.code}</td> | ||
</tr> | ||
<tr> | ||
<th>Scale</th> | ||
<td>{asset.scale}</td> | ||
</tr> | ||
<tr> | ||
<th>Withdrawl threshold</th> | ||
<td> | ||
{asset.withdrawalThreshold ? asset.withdrawalThreshold : 'null'} | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Created at</th> | ||
<td>{new Date(asset.createdAt).toLocaleString()}</td> | ||
JoblersTune marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</tr> | ||
</tbody> | ||
</table> | ||
) | ||
} | ||
|
||
export default DisplayAsset | ||
|
||
export function links() { | ||
return [{ rel: 'stylesheet', href: styles }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import styles from '../styles/dist/DisplayItems.css' | ||
import { Link } from '@remix-run/react' | ||
import * as R from 'ramda' | ||
|
||
function DisplayAssets({ assets }) { | ||
return ( | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Asset ID</th> | ||
<th>Code</th> | ||
<th>Scale</th> | ||
<th>Withdrawl threshold</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{assets.length | ||
? assets.map((asset) => ( | ||
<tr key={R.path(['node', 'id'], asset)}> | ||
<td> | ||
<Link to={R.path(['node', 'id'], asset)}> | ||
{R.path(['node', 'id'], asset)} | ||
</Link> | ||
</td> | ||
<td>{R.path(['node', 'code'], asset)}</td> | ||
<td>{R.path(['node', 'scale'], asset)}</td> | ||
<td> | ||
{R.path(['node', 'withdrawalThreshold'], asset) | ||
? R.path(['node', 'withdrawalThreshold'], asset) | ||
: 'null'} | ||
JoblersTune marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</td> | ||
</tr> | ||
)) | ||
: ''} | ||
</tbody> | ||
</table> | ||
) | ||
} | ||
|
||
export default DisplayAssets | ||
|
||
export function links() { | ||
return [{ rel: 'stylesheet', href: styles }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@import '../styles/_variables'; | ||
|
||
table { | ||
font-family: arial, sans-serif; | ||
border-collapse: collapse; | ||
width: 100%; | ||
} | ||
|
||
thead { | ||
background-color: $admin-panel-background; | ||
} | ||
|
||
td, | ||
th { | ||
border: none; | ||
text-align: left; | ||
padding: 8px; | ||
} | ||
|
||
tr:nth-child(odd) { | ||
background-color: $admin-panel-background; | ||
} | ||
|
||
ul { | ||
margin: 0; | ||
list-style-type: none; | ||
list-style: none; | ||
|
||
li { | ||
padding-top: 8px; | ||
padding-bottom: 8px; | ||
} | ||
} | ||
|
||
ul.values { | ||
padding-inline-start: 0; | ||
} | ||
|
||
th, | ||
td { | ||
a:link, | ||
a:visited, | ||
a:active, | ||
a:hover { | ||
text-decoration: none; | ||
color: $black; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@import '../styles/_variables'; | ||
|
||
table { | ||
font-family: arial, sans-serif; | ||
border-collapse: collapse; | ||
width: 100%; | ||
} | ||
|
||
thead { | ||
background-color: $admin-panel-background; | ||
} | ||
|
||
td, | ||
th { | ||
border: 1px solid $admin-panel-background; | ||
text-align: left; | ||
padding: 8px; | ||
} | ||
|
||
tr { | ||
a:link, | ||
a:visited, | ||
a:active, | ||
a:hover { | ||
text-decoration: none; | ||
color: $black; | ||
} | ||
} | ||
|
||
tr:nth-child(even) { | ||
background-color: $admin-panel-background; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import styles from '../styles/dist/DisplayItem.css' | ||
import { useLoaderData, Link } from '@remix-run/react' | ||
|
||
function DisplayPeers() { | ||
const { peer } = useLoaderData() | ||
|
||
return ( | ||
<table> | ||
<tbody> | ||
<tr> | ||
<th>ID</th> | ||
<td>{peer.id}</td> | ||
</tr> | ||
<tr> | ||
<th>Static ILP address</th> | ||
<td>{peer.staticIlpAddress}</td> | ||
</tr> | ||
<tr> | ||
<th> | ||
<Link to={'/assets/' + peer.asset.id}> | ||
Asset | ||
<ul> | ||
<li>Code</li> | ||
<li>Scale</li> | ||
</ul> | ||
</Link> | ||
</th> | ||
<td> | ||
<Link to={'/assets/' + peer.asset.id}> | ||
<br></br> | ||
<ul className='values'> | ||
<li>{peer.asset.code}</li> | ||
<li>{peer.asset.scale}</li> | ||
</ul> | ||
</Link> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>Outgoing endpoint</th> | ||
<td>{peer.http.outgoing.endpoint}</td> | ||
</tr> | ||
<tr> | ||
<th>Created at</th> | ||
<td>{new Date(peer.createdAt).toLocaleString()}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
) | ||
} | ||
|
||
export default DisplayPeers | ||
|
||
export function links() { | ||
return [{ rel: 'stylesheet', href: styles }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import styles from '../styles/dist/DisplayItems.css' | ||
import { Link } from '@remix-run/react' | ||
import * as R from 'ramda' | ||
|
||
function DisplayPeers({ peers }) { | ||
return ( | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Peer ID</th> | ||
<th>Static ILP address</th> | ||
<th>Asset code</th> | ||
<th>Asset scale</th> | ||
<th>Outgoing endpoint</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{peers.length | ||
? peers.map((peer) => ( | ||
<tr key={R.path(['node', 'id'], peer)}> | ||
<td> | ||
<Link to={R.path(['node', 'id'], peer)}> | ||
{R.path(['node', 'id'], peer)} | ||
</Link> | ||
</td> | ||
<td>{R.path(['node', 'staticIlpAddress'], peer)}</td> | ||
<td>{R.path(['node', 'asset', 'code'], peer)}</td> | ||
<td>{R.path(['node', 'asset', 'scale'], peer)}</td> | ||
<td> | ||
{R.path(['node', 'http', 'outgoing', 'endpoint'], peer)} | ||
</td> | ||
</tr> | ||
)) | ||
: ''} | ||
</tbody> | ||
</table> | ||
) | ||
} | ||
|
||
export default DisplayPeers | ||
|
||
export function links() { | ||
return [{ rel: 'stylesheet', href: styles }] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably make all your components typescript files so that you can type your props.