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

[explorer] adds Preview Cards #1155

Merged
merged 31 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
89f54e4
moves tests from apb-explorer-addresses
apburnie Mar 28, 2022
9be6dfc
when address has no objects, see error message
apburnie Mar 28, 2022
539511e
Preview Cards for Addresses owning Objects
apburnie Mar 28, 2022
c6fad35
converts tests into true end-to-end tests
apburnie Mar 29, 2022
dc6c83d
Preview Cards for objects owning objects
apburnie Mar 29, 2022
109a5b5
connects preview cards to Geniteam API
apburnie Mar 29, 2022
e82a5a6
removes border from first element of OwnedObjects
apburnie Mar 30, 2022
df196dc
adds ownsAllAddress mock example
apburnie Mar 30, 2022
849ac2a
adds First/Back/Next/Last Navigation
apburnie Mar 30, 2022
1e7f9ca
creates navigation tests
apburnie Mar 30, 2022
78788b2
creates SVGs for next and back
apburnie Mar 30, 2022
1700379
stylize navigation
apburnie Mar 30, 2022
684f80f
prevents unnecessary addition of page when exact division
apburnie Mar 30, 2022
1cde27e
tidyup and changes to enable GitHub checks
apburnie Mar 31, 2022
a84f355
removes Page 0 references and adds version number to preview
apburnie Mar 31, 2022
700bc18
fail state removed when display changed
apburnie Mar 31, 2022
40dad3e
refactors tests
apburnie Mar 31, 2022
7f8ebf1
improves Object Results image display
apburnie Mar 31, 2022
70761ae
improves image waiting style
apburnie Mar 31, 2022
b58fb65
resolves label / ownedobject collision
apburnie Mar 31, 2022
99cce51
updates README
apburnie Apr 4, 2022
7f027c8
further updates to README
apburnie Apr 5, 2022
0f67213
changes Owned Object API fetching component label
apburnie Apr 7, 2022
3bc4e0b
relabels internetapi directory api
apburnie Apr 7, 2022
6bba4d4
relabels InternetAPI API throughout components
apburnie Apr 7, 2022
cbde79c
increased number of results from 4 per page to 12 per page and update…
apburnie Apr 7, 2022
672b515
enables use of generic types with SuiObject and ObjectInfoResponse
apburnie Apr 7, 2022
e76a399
reduce preview card height
apburnie Apr 7, 2022
d51544d
switches to 3 items per row
apburnie Apr 7, 2022
a4c1283
tidies up after rebase
apburnie Apr 14, 2022
c4461fc
updates README
apburnie Apr 14, 2022
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
21 changes: 10 additions & 11 deletions explorer/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,35 @@ When running most of the below yarn commands, the SuiExplorer Client will extrac

If the environment variable `REACT_APP_DATA` is set to `static`, then the SuiExplorer will instead pull data from a local, static JSON dataset that can be found at `./src/utils/static/mock_data.json`.

For example, suppose we wish to locally run the website using the static JSON dataset and not the API, then we would run the following:
For example, suppose we wish to locally run the website using the static JSON dataset and not the API, then we could run the following:

```bash
REACT_APP_DATA=static yarn start
```

Note that the command `yarn test` is the exception. Here the SuiExplorer will instead use the static JSON dataset. The tests have been written to specifically check the UI and not the API connection.
Note that the commands `yarn test` and `yarn start:static` are the exceptions. Here the SuiExplorer will instead use the static JSON dataset. The tests have been written to specifically check the UI and not the API connection and so use the static JSON dataset.

## Yarn Commands and what they do

### `yarn start`

Runs the app in the development mode.
Runs the app as connected to the API at https://demo-rpc.sui.io.

Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

### `yarn start:dev`
### `yarn start:static`

Same as `yarn start` but runs `prettier:fix:watch` to format the files.
Runs the app as connected to the static JSON dataset with `REACT_APP_DATA` set to `static`.

Open http://localhost:8080 to view it in the browser.

The page will reload when edits are made. You can run `yarn start` and `yarn start:static` at the same time because they use different ports.

### `yarn test`

Launches the test runner in the interactive watch mode.
This runs a series of end-to-end browser tests using the website as connected to the static JSON dataset. This command is run by the GitHub checks. The tests must pass before merging a branch into main.

### `yarn build`

Expand All @@ -60,11 +64,6 @@ Run linting check (prettier/eslint/stylelint).

Run linting check but also try to fix any issues.

### `yarn prettier:fix:watch`

Run prettier in watch mode and format any file that changes. (Also runs prettier once in the beginning for all the files)\
It can be useful during development to format automatically all the files that change.

## Deployment

For guidance on deployment, plese see here: https://create-react-app.dev/docs/deployment/
Expand Down
6 changes: 6 additions & 0 deletions explorer/client/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

module.exports = {
preset: 'jest-puppeteer',
};
7 changes: 6 additions & 1 deletion explorer/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.4.0",
"@types/jest-environment-puppeteer": "^5.0.0",
"@types/node": "^16.11.24",
"@types/puppeteer": "^5.4.5",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"autoprefixer": "^10.4.2",
"concurrently": "^7.0.0",
"eslint-config-prettier": "^8.3.0",
"jest-puppeteer": "^6.1.0",
"onchange": "^7.1.0",
"postcss": "^8.4.6",
"prettier": "2.5.1",
"react-scripts": "5.0.1",
"puppeteer": "^13.5.1",
"stylelint": "^14.5.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^25.0.0",
Expand All @@ -36,8 +40,9 @@
},
"scripts": {
"start": "react-scripts start",
"start:static": "REACT_APP_DATA=static PORT=8080 react-scripts start",
"test": "npx start-server-and-test 'npm run start:static' 8080 'react-scripts test --detectOpenHandles --watchAll=false'",
"build": "react-scripts build",
"test": "REACT_APP_DATA=static react-scripts test",
"eslint:check": "eslint --max-warnings=0 .eslintrc.js \"./src/**/*.{js,jsx,ts,tsx}\"",
"eslint:fix": "yarn eslint:check --fix",
"prettier:check": "prettier -c --ignore-unknown .",
Expand Down
184 changes: 0 additions & 184 deletions explorer/client/src/__tests__/App.test.tsx

This file was deleted.

Loading