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

feat: APP-201 buy credits flow step 1 #2408

Merged
merged 146 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
f0e3fe2
feat: add US flag icon
Jul 8, 2024
6998510
feat: add CurrencyFlag component and story
Jul 9, 2024
14f9d4e
feat: add Muli font to Tailwind
Jul 10, 2024
41c2401
fix: update tailwind.css with .bg-transparent due to preflight issue
Jul 10, 2024
7907287
feat: Add USD currency symbol to DenomIcon component
Jul 10, 2024
a4a3df5
feat: Add EditButtonIcon component and story
Jul 10, 2024
7a4b7dc
chore: migrate from jest to vitest
Jul 10, 2024
69b1e7a
fix: update import path to fix test
Jul 10, 2024
aea320b
feat: add SupCurrencyAndAmount component and test
Jul 10, 2024
ab93c55
feat: add ariaLabel prop to EditButtonIcon component
Jul 10, 2024
0f87721
fix: update import
Jul 10, 2024
cd125ec
feat: Add OrderSummaryCard component and related files
Jul 10, 2024
9cf6ea3
fix: vite-cjs-node-api-deprecated error
Jul 12, 2024
7d2c888
feat: add title attribute to EditButtonIcon component
Jul 12, 2024
c8dfe22
fix: update file extension to fix vite-cjs-node-api-deprecated
Jul 12, 2024
52cc100
feat: remove jest and add vitest/globals
Jul 12, 2024
9ccef35
refactor: use css grid
Jul 12, 2024
9f67a02
refactor: implement Intl.NumberFormat
Jul 12, 2024
c6e628b
feat: add EditableInput component, stories and test
Jul 12, 2024
8be1e45
fix: move EditableInput stories to storybook Inputs/
Jul 12, 2024
f846420
chore: add @testing-library/jest-dom and canvas deps
Jul 16, 2024
f5aa7a7
chore: update @testing-library/jest-dom to vitest version
Jul 16, 2024
7da0351
feat: add white color to tailwind color palette
Jul 16, 2024
1eba4ae
refactor: remove CurrencyFlag and create DenomIconWithCurrency
Jul 16, 2024
fd6fc65
feat: add USDC and USD in DenomIcon component
Jul 16, 2024
80c06bd
refactor: remove unused currency module
Jul 16, 2024
0742070
feat: add CreditCardIcon and CryptoIcon to icons
Jul 16, 2024
6d3cf67
feat: add support for className to InfoTooltipWithIcon component
Jul 16, 2024
2779f4e
refactor: update OrderSummaryCard to use DenomIconWithCurrency component
Jul 16, 2024
e684cf5
feat: add LeafIcon
Jul 17, 2024
a30cfaa
feat: add new Title component
Jul 17, 2024
1ffcbb5
refactor: update TextButton hover color to fix contrast issue on hover
Jul 17, 2024
7c310e8
feat: add placement option to InfoTooltipWithIcon component
Jul 18, 2024
89367b4
feat: add SetMaxButton component, test and stories
Jul 18, 2024
db9e049
refactor: update denoms to use consistent namings
Jul 18, 2024
8771f2d
feat: Update OrderSummaryCard to display payment details
Jul 18, 2024
386d8ca
refactor: update DenomIconWithCurrency to use consistent currency nam…
Jul 18, 2024
e2bcfa5
feat: add type attribute to SetMaxButton component
Jul 22, 2024
4f3b1e5
fix: error import in storybook
Jul 22, 2024
e047af1
feat: add USDCAXL_DENOM to DenomIcon component
Jul 22, 2024
e3e5b09
feat: add onChange prop to Radio component
Jul 22, 2024
4021f1b
refactor: add PrefinanceTag component and its stories
Jul 22, 2024
4178506
refactor: add testUtils module for setting up react hook form context
Jul 22, 2024
daef304
feat: add components support and story to InfoCard
Jul 22, 2024
de56c93
feat: add CustomSelect component, stories and tests
Jul 22, 2024
e353362
feat: add prefinance project support to OrderSummaryCard component
Jul 22, 2024
853e33d
feat: add CreditsAmount component and its related files, tests and st…
Jul 22, 2024
ef7ff15
feat: add BuyCreditsForm component and its related files, tests and s…
Jul 22, 2024
a43c306
fix: import path
Jul 22, 2024
27263ee
refactor: update PrefinanceTag component classNames
Aug 1, 2024
ed6c732
fix: error in CI build
Aug 1, 2024
eb56047
refactor: use tailwind classes instead of MUI sx
Aug 1, 2024
0c24503
refactor: move font weight from Title to BuyCreditsForm and CreditsAm…
Aug 1, 2024
00809d9
refactor: remove --white from Tailwind config
Aug 1, 2024
241b9f7
refactor: update PrefinanceTag component classNames
Aug 1, 2024
d3c5841
feat: Add onClickEditCard prop to OrderSummaryCard component
Aug 1, 2024
8774f09
refactor: use Title component for the heading
Aug 1, 2024
e8609b2
fix: update import path for Title component
Aug 1, 2024
6787d7b
fix: update OrderSummaryCard component styling
Aug 1, 2024
7a9bdd4
fix: issue with small dollar sign superscript
Aug 1, 2024
982817a
fix: SupCurrencyAndAmount stories
Aug 1, 2024
ee3b7ba
refactor: Update DenomIconWithCurrency component to use Body comp
Aug 1, 2024
2c3cecf
fix: revert TextButton hover color change
Aug 1, 2024
3dbb243
refactor: use cn utility function for classNam in EditButtonIcon
Aug 1, 2024
3b58490
fix: SupCurrencyAndAmount test
Aug 1, 2024
ede1218
refactor: Rename BuyCreditForm to ChooseCreditForm
Aug 1, 2024
35ad777
fix: styling issues
Aug 1, 2024
30f17e5
refactor: display currency type next to credits available
Aug 1, 2024
acabd83
fix: ChooseCreditsForm styling with rounded corners
Aug 1, 2024
56c652c
refactor: update ChooseCreditsForm to use react-hook-form's useWatch …
Aug 1, 2024
ff16d48
fix: move ChooseCreditForm and CreditsAmount to web-marketplace
Aug 1, 2024
820a1f0
chore: install vitest in web-marketplace
Aug 1, 2024
fd1c31c
refactor: merge vite.config.ts into vite.config.mts
Aug 1, 2024
d13f4b9
chore: add @testing-library/jest-dom to tsconfig.json types
Aug 1, 2024
184eeea
refactor: skip tests and fix dependency error in rdf.test.ts
Aug 5, 2024
94fe8f5
refactor: remove unused dependencies and test files
Aug 5, 2024
4f5a06d
chore: update web-marketplace scripts in package.json to use vitest
Aug 5, 2024
60e9b16
refactor: remove web-auth workspace
Aug 5, 2024
c775a99
chore: clean up jest and configure vitest globals
Aug 5, 2024
e52d840
chore: disable lingui/no-unlocalized-strings rule for test files
Aug 5, 2024
60acbfc
chore: remove @vitest/ui dependency
Aug 5, 2024
78fee0f
chore: update testing section in README file
Aug 5, 2024
ff43604
fix: buffer is not defined in storybook
Aug 5, 2024
2b83072
fix: buffer is not defined in storybook marketplace config
Aug 5, 2024
1eb41af
fix: revert buffer is not defined in storybook changes
Aug 5, 2024
06da1d5
fix: make Buffer available in browser env
Aug 5, 2024
5ab7ca0
chore: update ChooseCreditsForm schema import naming convention
Aug 5, 2024
686b21a
refactor: update PrefinanceTag styles in ProjectCard and ProjectMedia
Aug 6, 2024
bee0734
feat: add ProjectCard with prefinancing details
Aug 6, 2024
69088db
refactor: update test-utils to support Lingui
Aug 6, 2024
414de45
fix: update stories location
Aug 7, 2024
ce4aba0
fix: update styles and use Title component
Aug 7, 2024
d0de5c6
chore: update .eslintrc.js to exclude stories files from lingui
Aug 7, 2024
e8c9059
fix: style updates
Aug 7, 2024
0b25c5e
refactor: move cryptoOptions to constants file + use Title component
Aug 7, 2024
b8f307c
fix: typo in CurrencyInput file name
Aug 7, 2024
ad7d0ee
fix: typo
Aug 7, 2024
9216a46
refactor: replace InfoTooltipWithIcon QuestionMarkTooltip in DenomIco…
Aug 7, 2024
26ac9a8
fix: error with crypto currencies in SupCurrencyAndAmount component
Aug 7, 2024
488483d
refactor: clean up lingui
Aug 7, 2024
bfe3f7d
refactor: add OrderSummaryCard components for row header, image, and …
Aug 7, 2024
fc0d845
fix: failing test in DenomIconWithCurrency
Aug 7, 2024
e84cba1
refactor: update ChooseCreditsForm to use Card component and test update
Aug 7, 2024
a5e7895
refactor: remove unneeded state
Aug 7, 2024
3312d06
refactor: update PrefinanceTag styling in OrderSummaryCard.Image
Aug 7, 2024
dad646c
refactor: move constants to constants file
Aug 7, 2024
1adf617
refactor: update test-utils.tsx to use CombinedProviders for custom r…
Aug 7, 2024
279b2d6
refactor: update CreditsAmount tests to use CustomRender
Aug 7, 2024
7e074f2
feat: add link to view batch
Aug 7, 2024
432f343
feat: styling updates
Aug 7, 2024
4c2c8d3
refactor: ChooseCreditsForm into smaller components
Aug 7, 2024
2a88713
feat: styling updates
Aug 7, 2024
ba78a8b
refactor: update test-utils imports to use web-components directory
Aug 8, 2024
d3443c0
refactor: remove unused export
Aug 8, 2024
85a83d6
refactor: available credits in ChooseCreditsForm
Aug 8, 2024
f5ecd9e
refactor: update ChooseCreditsForm tests and stories
Aug 8, 2024
b839abb
fix: pass missing props to CreditsAmount stories
Aug 8, 2024
fec5085
refactor: update CreditsAmount stories location
Aug 8, 2024
a1f5960
fix: revert lingui config back
Aug 8, 2024
fb14020
refactor: remove unneeded css classes
Aug 8, 2024
3665d68
chore: update README file with testing instructions
Aug 8, 2024
c19aab6
refactor: have separated test-utils in web-components and web-marketp…
Aug 8, 2024
e5cd627
refactor: update web-component tests to get render method from '@test…
Aug 8, 2024
5608c51
refactor: update ChooseCreditsForm form to pass retiring as boolean
Aug 8, 2024
8fc9221
refactor: update AdvanceSettings component to get the form register f…
Aug 8, 2024
6f03b08
fix: ts error in CreditsAmount stories
Aug 8, 2024
734d313
fix: merge error
Aug 27, 2024
e840ee9
refactor: update choose amount functionality + tests
Aug 28, 2024
1327226
feat: handle buy credits form errors + refactor
Sep 2, 2024
1ef3f0d
refactor: format spendingCap error message
Sep 2, 2024
3f498b4
feat: add lingui messages
Sep 2, 2024
8af8781
fix: failing tests
Sep 2, 2024
8eaef11
fix: lingui errors
Sep 2, 2024
ea2e624
chore: update lingui catalogs
Sep 2, 2024
bc73188
chore: update @netlify/plugin-nextjs to version 5.7.0
Sep 2, 2024
f16b151
fix: move constants to web-marketplace
Sep 3, 2024
234c0ef
chore: update .po files
Sep 3, 2024
7aca7b7
refactor: update CurrencyInput and CreditsInput use of type attribute…
Sep 3, 2024
a265543
fix: file name typo
Sep 3, 2024
cf1355e
refactor: add StorybookI18nProvider
Sep 3, 2024
20a4b76
fix: denom icon misalignment
Sep 4, 2024
7733784
feat: sync credit vintage credits with form credits availability + ch…
Sep 9, 2024
60cb48b
chore: update .po files
Sep 9, 2024
0a62eb0
fix: CreditsAmount tests
Sep 9, 2024
31c1260
fix: CreditsAmount Story + move getVintageCredits to utils
Sep 9, 2024
81a9183
chore: update .po files
Sep 11, 2024
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
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,17 @@ module.exports = {
'import/no-anonymous-default-export': 'off',
},
},
{
files: [
'*.test.ts',
'*.spec.ts',
'*.test.tsx',
'*.spec.tsx',
'*.stories.tsx',
],
rules: {
'lingui/no-unlocalized-strings': 'off',
blushi marked this conversation as resolved.
Show resolved Hide resolved
},
},
],
};
37 changes: 16 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ The website for the [Regen Network](https://regen.network) decentralized infrast
- [GraphQL Type generation](#graphql-type-generation)
- [Storybook](#storybook)
- [Website](#website)
- [Deploying the Custom Login form to Auth0](#deploying-the-custom-login-form-to-auth0)
- [Testing](#testing)
- [Code style](#code-style)
- [i18n](#i18n)
Expand All @@ -34,7 +33,6 @@ This project uses [bun](https://bun.sh/) with [bun workspaces](https://bun.sh/do
- `web-marketplace`: Registry React application
- `web-components`: React components and [material-ui](https://material-ui.com/) custom theme
- `web-storybook`: [Storybook](https://storybook.js.org/) config
- `web-auth`: React application used for Auth0 Custom Universal Login

[Lerna](https://github.com/lerna/lerna) is also used to bump packages versions and push new releases.

Expand Down Expand Up @@ -62,7 +60,6 @@ bun install

Set variables in `.env` files in `web-marketplace/` and `web-storybook/` folders based on provided `.env.example` files.

For `web-auth`, follow these [setup instructions](web-auth/README.md#setup).

## Development

Expand Down Expand Up @@ -136,31 +133,29 @@ bun run build-storybook
bun run build-www
```

### Deploying the Custom Login form to Auth0
## Testing

Please, follow [these instructions](web-auth/README.md#setup) and then:
#### - Running tests
We are using [Vitest](https://vitest.dev/) as a test runner.

1. Run `bun run build-auth` command.
2. Copy the code from `./build/index.html`.
3. Paste it into the Universal Login HTML form from [Auth dashboard](https://manage.auth0.com/dashboard/us/regen-network-registry/login_page) and save.
Tests can be run in the terminal with the following commands from the project root:

This could be automated in the future.
* To run `web-marketplace` tests
```sh
bun run test-marketplace
```

## Testing
* To run `web-components` tests
```sh
bun run test-components
```
In both cases the test runner is launched in the interactive watch mode.

```sh
bun run test
```
#### - Writing tests
When writing test in `web-marketplace` remember to import the methods from`'web-marketplace/test/test-utils'`, specially the `render` method, as it is a custom render that wraps components with the necessary providers.

Launches the test runner in the interactive watch mode.
[Jest](https://jestjs.io/) is used as test runner.
In `web-components`, methods should be imported directly from `'@testing-library/*'`

We're using [StoryShots](https://storybook.js.org/docs/testing/structural-testing/#using-storyshots) for snapshots testing.
Update web-components snapshots:

```sh
bun run test-update-snapshot
```

## Code style

Expand Down
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"web-marketplace",
"web-components",
"web-storybook",
"web-auth",
"web-www"
]
}
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,21 @@
"web-marketplace",
"web-components",
"web-storybook",
"web-auth",
"web-www"
],
"scripts": {
"build": "bun run --cwd web-marketplace build",
"build-www": "bun run --cwd web-www build",
"build-components": "bun run --cwd web-components build",
"build-storybook": "bun run --cwd web-storybook build-storybook",
"build-auth": "bun run --cwd web-auth build",
"clean": "find . -iname 'node_modules' -maxdepth 2 | xargs rm -rf",
"format": "bun run --cwd web-components format & bun run --cwd web-marketplace format & bun run --cwd web-www format",
"lint": "bun run --cwd web-components lint & bun run --cwd web-marketplace lint & bun run --cwd web-www lint",
"format-and-fix": "bun run --cwd web-components format-and-fix & bun run --cwd web-marketplace format-and-fix & bun run --cwd web-www format-and-fix",
"storybook": "bun run --cwd web-storybook storybook",
"test": "bun run --cwd web-marketplace test-no-watch",
"test-marketplace": "bun run --cwd web-marketplace test",
"test-components": "bun run --cwd web-components test",
"start": "bun run --cwd web-marketplace start",
"start-auth": "bun run --cwd web-auth start",
"watch": "bun run --cwd web-components watch",
"test-update-snapshot": "bun run --cwd web-marketplace test-update-snapshot",
"bump": "lerna version --no-push --conventional-commits",
Expand All @@ -46,7 +43,6 @@
"@graphql-codegen/typescript-operations": "^1.18.0",
"@graphql-codegen/typescript-react-apollo": "2.2.4",
"@types/css-mediaquery": "^0.1.1",
"@types/jest": "27.0.3",
"@types/node": "13.1.1",
"babel-loader": "8.1.0",
"css-mediaquery": "0.1.2",
Expand All @@ -59,13 +55,13 @@
"prettier": "2.4.1",
"shx": "^0.3.2",
"storybook": "^7.3.2",
"typescript": "^5.2.2"
"typescript": "^5.2.2",
"unplugin-auto-import": "^0.18.2"
},
"resolutions": {
"eslint": "^8.42.0",
"formik-mui": "^5.0.0-alpha.0",
"formik": "2.2.9",
"@types/jest": "^29.0.0",
"@types/react": "^18.0.23",
"@types/react-dom": "^18.0.7",
"babel-eslint": "^10.1.0",
Expand Down
1 change: 1 addition & 0 deletions tailwind.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
theme: {
fontFamily: {
sans: ['"Lato"', '-apple-system', 'sans-serif'],
muli: ['"Muli"', '-apple-system', 'sans-serif'],
},
colors: {
// Make sure these guidelines are followed when adding new colors: https://tailwindcss.com/docs/customizing-colors#using-css-variables
Expand Down
6 changes: 6 additions & 0 deletions tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
--purple-300: 128 142 171;
--purple-200: 187 195 210;
--purple-100: 221 225 233;

}

.dark {
Expand Down Expand Up @@ -86,4 +87,9 @@
--purple-200: 128 142 171;
--purple-100: 86 104 143;
}

.bg-transparent {
background-color: transparent;
}

}
7 changes: 0 additions & 7 deletions web-auth/.env.example

This file was deleted.

5 changes: 0 additions & 5 deletions web-auth/.eslintrc.js

This file was deleted.

23 changes: 0 additions & 23 deletions web-auth/.gitignore

This file was deleted.

88 changes: 0 additions & 88 deletions web-auth/CHANGELOG.md

This file was deleted.

32 changes: 0 additions & 32 deletions web-auth/README.md

This file was deleted.

14 changes: 0 additions & 14 deletions web-auth/gulpfile.js

This file was deleted.

Loading