Skip to content

Commit

Permalink
merge latest 'origin/dev' into 'epic/files-billing' (#1588)
Browse files Browse the repository at this point in the history
* Release latest to Stage (#988)

* Add French translation and set the language selection (#978)

* should be almost set

* dropdown styling

* done with translation

* nits here and there

* Apply suggestions from code review

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* missing translations

* add locale with dayjs

* lingui extract

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
Co-authored-by: GitHub Actions <actions@github.com>

* Fix design nits (#987)

* setup warning

* colors

* icon

* buttons

* dropdown menu 14

* images

* nits

* title too big and switch buttons order

* Apply suggestions from code review

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* update link closes #849

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
Co-authored-by: Michael Yankelev <myankelev@gmail.com>

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: GitHub Actions <actions@github.com>

* fix link (#1025)

* create buckets for new users

* remove depraecated files call

* [Storage] Copy cid functionality (#1437)

* Copy features added, overflow issue still present

* Swapped to button

* lingui extract

* Updated button

* lingui extract

* Apply suggestions from code review

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Fixed size

* lingui extract

* minmax

* lingui extract

* revert unrelated changes

* lingui extract

* Apply suggestions from code review

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com>
Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
Co-authored-by: Thibaut Sardan <github@thib.top>

* [STORAGE] Rename file in bucket (#1471)

* formik submit not firing

* fix mobile

* lingui extract

* Update packages/storage-ui/src/Components/Modules/FileSystemItem/FileSystemTableItem.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* make eslint :)

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* 10min timeout for everyone (#1472)

* Translated using Weblate (French) (#1478)

Currently translated at 100.0% (262 of 262 strings)

Translation: ChainSafe Files/Chainsafe Files user interface
Translate-URL: https://hosted.weblate.org/projects/chainsafe-files/chainsafe-files-user-interface/fr/

Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>

* add ui tests for search (#1479)

* bump cypress to v8.3.1 (#1480)

* Sharing feature explainer (#1477)

* refactor modal

* steps logic

* image centered

* lingui extract

* lingui extract

* typo

* refactor with hook, change icon, ad to share menu

* nits

* fix storage building

Co-authored-by: GitHub Actions <actions@github.com>

* Adding multi selects on mobile view with long press (#1470)

* using long press

* dragg preview problems

* typos

* events almost ready

* resets

* long press options

* long press updates

* formats

* dark mode colors

* added hover with breakpoints

* lingui extract

* Apply suggestions from code review

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* curly spacing

* borders

* clicks proper placement

* reverted linting

* removed preview on mobile

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* bump to 1.18.5 (#1493)

* [Files] - New survey - Discord link and tiny fix (#1487)

* a nice mix of things

* lingui extract

Co-authored-by: GitHub Actions <actions@github.com>

* Translations update from Weblate (#1496)

* Translated using Weblate (French)

Currently translated at 100.0% (266 of 266 strings)

Translation: ChainSafe Files/Chainsafe Files user interface
Translate-URL: https://hosted.weblate.org/projects/chainsafe-files/chainsafe-files-user-interface/fr/

* Translated using Weblate (German)

Currently translated at 73.3% (195 of 266 strings)

Translation: ChainSafe Files/Chainsafe Files user interface
Translate-URL: https://hosted.weblate.org/projects/chainsafe-files/chainsafe-files-user-interface/de/

Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>

* update axios (#1498)

* Added docs link (#1497)

* Added doc link

* lingui extract

Co-authored-by: GitHub Actions <actions@github.com>

* upgrade (#1501)

* Published (#1503)

Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com>

* Add ui tests for file preview (#1489)

* Toasts refactor (#1495)

* Toast content ready

* toast animations

* toasts before relative positioning

* component ready, start integration

* normal notifications ready

* downloads ready

* toasts ready

* toasts inn storage

* Toasts refactor okk

* lingui extract

* minor changes

* Update packages/common-components/src/index.ts

Co-authored-by: Ryan Noble <ryanjnoble@gmail.com>

* translates

* post merge updates

* translates update

* progress and overrides

* updates in lock file

* updates ready

* lingui extract

* removing dark theme from storage and gaming

* Update packages/common-components/src/Toasts/types.ts

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/common-components/src/Toasts/ToastContext.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/common-components/src/Toasts/ToastContext.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/files-ui/src/Contexts/FilesContext.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/common-components/src/stories/Toasts.stories.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/common-components/src/stories/Toasts.stories.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/files-ui/src/Contexts/FilesContext.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/files-ui/src/Contexts/FilesContext.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* toasts types

* missed type updates

* update element identifier for toast

* Update packages/common-components/src/stories/Toasts.stories.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/common-components/src/Toasts/ToastContent.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/common-components/src/Toasts/ToastContext.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/common-components/src/Toasts/ToastContext.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* download error messages

* Update packages/common-components/src/Toasts/types.ts

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/files-ui/src/Components/Modules/FileBrowsers/CSFFileBrowser.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/files-ui/src/Components/Modules/FileBrowsers/SharedFileBrowser.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* lingui extract

* Update packages/files-ui/src/App.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* storybooks update

* using usref (#1513)

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Ryan Noble <ryanjnoble@gmail.com>
Co-authored-by: Michael Yankelev <myankelev@gmail.com>
Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
Co-authored-by: Andrew Snaith <andrew@chainsafe.io>
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Progress cancellations (#1500)

* Toast content ready

* toast animations

* toasts before relative positioning

* component ready, start integration

* normal notifications ready

* downloads ready

* toasts ready

* toasts inn storage

* Toasts refactor okk

* lingui extract

* minor changes

* Update packages/common-components/src/index.ts

Co-authored-by: Ryan Noble <ryanjnoble@gmail.com>

* translates

* post merge updates

* translates update

* progress and overrides

* updates in lock file

* updates ready

* lingui extract

* removing dark theme from storage and gaming

* Update packages/common-components/src/Toasts/types.ts

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/common-components/src/Toasts/ToastContext.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/common-components/src/Toasts/ToastContext.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/files-ui/src/Contexts/FilesContext.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/common-components/src/stories/Toasts.stories.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/common-components/src/stories/Toasts.stories.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/files-ui/src/Contexts/FilesContext.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Update packages/files-ui/src/Contexts/FilesContext.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* toasts types

* missed type updates

* uploads ready

* uploads ready

* lingui extract

* update element identifier for toast

* cancel source tokens

* toasts added

* Update packages/common-components/src/stories/Toasts.stories.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/common-components/src/Toasts/ToastContent.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/common-components/src/Toasts/ToastContext.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/common-components/src/Toasts/ToastContext.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* download error messages

* Update packages/common-components/src/Toasts/types.ts

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/files-ui/src/Components/Modules/FileBrowsers/CSFFileBrowser.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/files-ui/src/Components/Modules/FileBrowsers/SharedFileBrowser.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* lingui extract

* resolved errors and lints

* Update packages/files-ui/src/Contexts/FilesContext.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/files-ui/src/Contexts/FilesContext.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/files-ui/src/Contexts/FilesContext.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/files-ui/src/Contexts/FilesContext.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/files-ui/src/Contexts/FilesContext.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* added closabble states

* lingui extract

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Ryan Noble <ryanjnoble@gmail.com>
Co-authored-by: Michael Yankelev <myankelev@gmail.com>
Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
Co-authored-by: Andrew Snaith <andrew@chainsafe.io>
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* survey banner on safari fix (#1512)

* banner fix

* Update packages/files-ui/src/Components/SurveyBanner.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* fix what I broke (#1518)

Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com>

* Change the survey to a call for a user interview (#1517)

* change fore a user interview call

* lingui extract

* Apply suggestions from code review

Co-authored-by: Andrew Snaith <asnaith@users.noreply.github.com>

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Andrew Snaith <asnaith@users.noreply.github.com>

* bump cypress to v8.4 (#1521)

* Translations update from Weblate (#1522)

* Translated using Weblate (French)

Currently translated at 100.0% (271 of 271 strings)

Translation: ChainSafe Files/Chainsafe Files user interface
Translate-URL: https://hosted.weblate.org/projects/chainsafe-files/chainsafe-files-user-interface/fr/

* Translated using Weblate (German)

Currently translated at 71.9% (195 of 271 strings)

Translation: ChainSafe Files/Chainsafe Files user interface
Translate-URL: https://hosted.weblate.org/projects/chainsafe-files/chainsafe-files-user-interface/de/

Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>

* Adjusting login screen sizes. (#1519)

* login screen sizes

* check for instanceof Error

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: Thibaut Sardan <github@thib.top>

* Gaming Dashboard overhaul (#1504)

* Updating the dashboard api

* Reflected functionality

* lingui extract

* CS favicon

* Update packages/gaming-ui/src/Components/Modules/ApiKeys.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Update packages/gaming-ui/src/Components/Pages/LoginPage.tsx

Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com>

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Thibaut Sardan <github@thib.top>
Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com>

* bulk recover operation (#1526)

* recovers working

* removed consoles

* Add new ui tests for illogical folder and file move errors (#1520)

* Add tests for illogical folder move attempts

* Add new check to spec file

* Finalize changes to spec file

* Removed string checking following PR feedback

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Posthog Analytics Integration (#1514)

* added posthog integration

* Banner logic working correctly

* handle uninitialized posthog

* fix lint

* extract messages

* lingui extract

* resolve warning

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: Michael Yankelev <myankelev@gmail.com>
Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* Translated using Weblate (French) (#1528)

Currently translated at 100.0% (272 of 272 strings)

Translation: ChainSafe Files/Chainsafe Files user interface
Translate-URL: https://hosted.weblate.org/projects/chainsafe-files/chainsafe-files-user-interface/fr/

Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>

* [Files] - Share to home or other shared folder (#1527)

* share to home or other shared folder

* small changes for a better UX

* lingui extract

* lingui extract

* Update packages/files-ui/src/Components/Modules/FileBrowsers/ShareModal.tsx

Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com>

* fix console warnings

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com>

* Folder uploads  (#1515)

* add basic folder upload

* wire up folder uploads for modal

* Rename Modal

* fix types

* remove types

* lingui extract

* fix lint

* add source attribution

* lingui extract

* incorporate feedback

* lingui extract

* fix lint

* Fix casing

* Rename component for consistency

* lingui extract

* clean up types

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: Ryan Noble <ryanjnoble@gmail.com>

* Translated using Weblate (French) (#1532)

Currently translated at 100.0% (276 of 276 strings)

Translation: ChainSafe Files/Chainsafe Files user interface
Translate-URL: https://hosted.weblate.org/projects/chainsafe-files/chainsafe-files-user-interface/fr/

Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>

* Don't track before opt-in (#1531)

* dont track users before they opt-in

* nits and remove log, calls are still fires

* default to not track

* lingui extract

* with init check

* Update packages/files-ui/src/Contexts/PosthogContext.tsx

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* lingui extract

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>

* [Files] - Show current bucket decryption key (#1534)

* show current bucket decryption key

* lingui extract

Co-authored-by: GitHub Actions <actions@github.com>

* [Files] - Get admin public key from the api (#1485)

* bump

* use api client

* merge dev

* lingui extract

* support several keys

* wih scroll because pub/decryption key are long

Co-authored-by: GitHub Actions <actions@github.com>

* Add lint rules for test debug commands (#1535)

* prevent double opening (#1538)

* Add test coverage for storage summary adjustments (#1536)

* Translated using Weblate (French) (#1540)

Currently translated at 100.0% (278 of 278 strings)

Translation: ChainSafe Files/Chainsafe Files user interface
Translate-URL: https://hosted.weblate.org/projects/chainsafe-files/chainsafe-files-user-interface/fr/

Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>

* Better colors for dark mode select and tagsinput components (#1550)

* better colors for dark mode

* lingui extract

* fix typo

Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
Co-authored-by: GitHub Actions <actions@github.com>

* Filter out current bucket (#1548)

* filter out current bucket

* Update packages/files-ui/src/Components/Modules/FileBrowsers/ShareModal.tsx

* fix color (#1555)

* Fix user lookup spamming the api, and throwing (#1553)

* oh yeaah

* lingui extract

* lingui extract

* Apply suggestions from code review

* lingui extract

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com>

* Upgrade Torus dependencies (#1549)

* [wip] update dependencies

* Revert "[wip] update dependencies"

This reverts commit 04b593b.

* update torus dependencies

* fix storage test

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* reset fields for shared folders (#1577)

* reset forms and fix a couple error types (#1578)

* Translations update from Weblate (#1557)

* Translated using Weblate (French)

Currently translated at 100.0% (281 of 281 strings)

Translation: ChainSafe Files/Chainsafe Files user interface
Translate-URL: https://hosted.weblate.org/projects/chainsafe-files/chainsafe-files-user-interface/fr/

* Translated using Weblate (German)

Currently translated at 69.7% (196 of 281 strings)

Translation: ChainSafe Files/Chainsafe Files user interface
Translate-URL: https://hosted.weblate.org/projects/chainsafe-files/chainsafe-files-user-interface/de/

Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>

* hide when ther's no menu item (#1576)

* Add "maintenance" label to weblate PRs automatically (#1581)

* Upgrade api client and fix issue with shared folder renaming (#1582)

* upgrade api client and fix issue

* Update packages/files-ui/src/Contexts/FilesContext.tsx

* lingui extract

Co-authored-by: GitHub Actions <actions@github.com>

* revert bad merge

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Shiva <82167447+RamidiShiva@users.noreply.github.com>
Co-authored-by: Cindy Chau <47398578+sweetpea22@users.noreply.github.com>
Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com>
Co-authored-by: Andrew Snaith <asnaith@users.noreply.github.com>
Co-authored-by: Thibaut Sardan <github@thib.top>
Co-authored-by: Priom Chowdhury <priom@chainsafe.io>
Co-authored-by: Ryan Noble <ryanjnoble@gmail.com>
Co-authored-by: Weblate (bot) <hosted@weblate.org>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Andrew Snaith <andrew@chainsafe.io>
  • Loading branch information
13 people authored Sep 27, 2021
1 parent 0339e57 commit 3f275ce
Show file tree
Hide file tree
Showing 82 changed files with 1,897 additions and 1,042 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"jsx": true // Allows for the parsing of JSX
}
},
"plugins": ["@typescript-eslint", "cypress", "ternary"],
"plugins": ["@typescript-eslint", "cypress", "no-only-tests", "ternary"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
Expand All @@ -24,6 +24,7 @@
},
"rules": {
"comma-spacing": ["error", { "before": false, "after": true }],
"cypress/no-pause": "error",
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "double"],
Expand All @@ -46,6 +47,7 @@
"space-infix-ops": "error",
"no-trailing-spaces": ["error", { "ignoreComments": true }],
"comma-dangle": ["error", "never"],
"no-only-tests/no-only-tests": "error",
"object-curly-spacing": ["error", "always"],
"space-in-parens": ["error", "never"],
"ternary/no-unreachable": "off",
Expand Down
2 changes: 1 addition & 1 deletion .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"Type: Feature": ['feature/*', 'feat/*']
"Type: Bug Fix": fix/*
"Type: Maintenance": ['chore/*', 'mnt/*']
"Type: Maintenance": ['chore/*', 'mnt/*', 'weblate*']
2 changes: 1 addition & 1 deletion .github/workflows/test-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
cypress-run:
runs-on: ubuntu-latest
container: cypress/browsers:node14.16.0-chrome90-ff88
container: cypress/browsers:node14.17.0-chrome91-ff89
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"chalk": "^4.1.0",
"eslint": "^6.8.0",
"eslint-plugin-cypress": "^2.11.3",
"eslint-plugin-no-only-tests": "^2.6.0",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-ternary": "^1.0.4",
Expand Down
12 changes: 8 additions & 4 deletions packages/common-components/src/CheckboxInput/CheckboxInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ const useStyles = makeStyles(
})
)

interface ICheckboxProps
extends Omit<React.HTMLProps<HTMLInputElement>, "value" | "label"> {
interface ICheckboxProps extends Omit<React.HTMLProps<HTMLInputElement>, "value" | "label"> {
className?: string
label?: string | ReactNode
error?: string
value: boolean
indeterminate?: boolean
onChange(event: FormEvent<HTMLInputElement>): void
onChange: (event: FormEvent<HTMLInputElement>) => void
testId?: string
}

const CheckboxInput: React.FC<ICheckboxProps> = ({
Expand All @@ -117,6 +117,7 @@ const CheckboxInput: React.FC<ICheckboxProps> = ({
indeterminate = false,
value,
error,
testId,
...props
}) => {
const classes = useStyles(props)
Expand All @@ -126,7 +127,10 @@ const CheckboxInput: React.FC<ICheckboxProps> = ({
}

return (
<label className={clsx(classes.root, className)}>
<label
className={clsx(classes.root, className)}
data-testid={`checkbox-${testId}`}
>
<input
type="checkbox"
{...props}
Expand Down
22 changes: 13 additions & 9 deletions packages/common-components/src/FileInput/FileInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ const useStyles = makeStyles(({ constants, palette, overrides }: ITheme) =>
})
)

interface FileWithPath extends File {
path?: string
}

interface IFileInputProps extends DropzoneOptions {
className?: string
variant?: "dropzone" | "filepicker"
Expand Down Expand Up @@ -137,21 +141,22 @@ const FileInput = ({
const classes = useStyles()
const [previews, setPreviews] = useState<any[]>([])
const [errors, setErrors] = useState<any[]>([])
const [{ value }, meta, helpers] = useField(name)
const [{ value }, meta, helpers] = useField<Array<FileWithPath>>(name)

useEffect(() => {
onFileNumberChange && onFileNumberChange(value.length)
}, [onFileNumberChange, value.length])

const onDrop = useCallback(
async (acceptedFiles: File[], fileRejections: FileRejection[]) => {
async (acceptedFiles: Array<FileWithPath>, fileRejections: FileRejection[]) => {
const filtered = acceptedFiles.filter((file) =>
maxFileSize ? file.size <= maxFileSize : true
)

setErrors([])
if (showPreviews) {
setPreviews(
filtered.map((file: any) =>
filtered.map((file) =>
Object.assign(file, {
preview: URL.createObjectURL(file)
})
Expand Down Expand Up @@ -188,7 +193,7 @@ const FileInput = ({
})

const removeItem = (i: number) => {
const items = value as any[]
const items = value
items.splice(i, 1)
helpers.setValue(items)
}
Expand Down Expand Up @@ -220,12 +225,12 @@ const FileInput = ({
>
<ScrollbarWrapper className={clsx("scrollbar")}>
<ul>
{value.map((file: any, i: any) => (
{value.map((file: any, i: number) => (
<li
className={clsx(classes.item, classNames?.item)}
key={i}
>
<span className={classes.itemText}>{file.name}</span>
<span className={classes.itemText}>{file.path}</span>
<Button
testId="remove-from-file-list"
className={clsx(classes.crossIcon, classNames?.closeIcon)}
Expand All @@ -246,9 +251,9 @@ const FileInput = ({
)
) : (
<>
{value.value?.length === 0
{value?.length === 0
? "No files selected"
: `${value.value?.length} file(s) selected`}
: `${value?.length} file(s) selected`}
<Button
onClick={open}
size="small"
Expand All @@ -260,7 +265,6 @@ const FileInput = ({
{value?.length > 0 && (
<div
className={clsx(classes.addFiles, classNames?.addFiles)}
onClick={open}
>
<PlusIcon
fontSize="small"
Expand Down
42 changes: 21 additions & 21 deletions packages/common-components/src/SelectInput/SelectInput.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import React, { CSSProperties, ReactNode } from "react"
import {
makeStyles,
createStyles,
ITheme,
useTheme
} from "@chainsafe/common-theme"
import { makeStyles, createStyles, ITheme, useTheme } from "@chainsafe/common-theme"
import clsx from "clsx"
import Select, { Styles } from "react-select"
import { Typography } from "../Typography"
Expand Down Expand Up @@ -62,7 +57,7 @@ interface ISelectInputProps {
styles?: Partial<Styles>
}

const SelectInput: React.FC<ISelectInputProps> = ({
const SelectInput = ({
className,
size = "medium",
disabled = false,
Expand All @@ -77,7 +72,7 @@ const SelectInput: React.FC<ISelectInputProps> = ({
name,
isClearable = false,
styles
}) => {
}: ISelectInputProps) => {
const classes = useStyles()
const { palette, animation, typography, overrides }: ITheme = useTheme()
const handleChange = (value: any) => {
Expand Down Expand Up @@ -105,9 +100,9 @@ const SelectInput: React.FC<ISelectInputProps> = ({
// ...overrides?.SelectInput?.indicatorsContainer
// }, state) : overrides?.SelectInput?.indicatorsContainer)
// }),
const selectOverides: Partial<Styles> = {}
const selectOverrides: Partial<Styles> = {}
overrideKeys.map(key => {
selectOverides[key] = (provided: CSSProperties, state: any): CSSProperties => ({
selectOverrides[key] = (provided: CSSProperties, state: any): CSSProperties => ({
...(
styles && styles[key]
? styles[key]({
Expand All @@ -121,7 +116,8 @@ const SelectInput: React.FC<ISelectInputProps> = ({
)
})
})
selectOverides.container = (provided, state) => ({

selectOverrides.container = (provided, state) => ({
...provided,
outline: "none",
border: `1px solid ${palette.additional["gray"][5]}`,
Expand All @@ -145,7 +141,7 @@ const SelectInput: React.FC<ISelectInputProps> = ({
)
})

selectOverides.control = (provided, state) => ({
selectOverrides.control = (provided, state) => ({
...provided,
outline: "none",
border: "none",
Expand All @@ -163,7 +159,7 @@ const SelectInput: React.FC<ISelectInputProps> = ({
)
})

selectOverides.menu = (provided, state) => ({
selectOverrides.menu = (provided, state) => ({
...provided,
marginTop: 2,
marginBottom: 0,
Expand All @@ -180,7 +176,7 @@ const SelectInput: React.FC<ISelectInputProps> = ({
)
})

selectOverides.dropdownIndicator = (provided, state) => ({
selectOverrides.dropdownIndicator = (provided, state) => ({
...provided,
transform: state.selectProps.menuIsOpen && "rotate(180deg)",
transitionProperty: "transform",
Expand All @@ -198,7 +194,7 @@ const SelectInput: React.FC<ISelectInputProps> = ({
)
})

selectOverides.singleValue = (provided, state) => ({
selectOverrides.singleValue = (provided, state) => ({
...provided,
...typography.body2,
color: !state.isDisabled
Expand All @@ -217,7 +213,7 @@ const SelectInput: React.FC<ISelectInputProps> = ({
)
})

selectOverides.placeholder = (provided, state) => ({
selectOverrides.placeholder = (provided, state) => ({
...provided,
color: !state.isDisabled
? palette.additional["gray"][8]
Expand All @@ -235,7 +231,7 @@ const SelectInput: React.FC<ISelectInputProps> = ({
)
})

selectOverides.option = (provided, state) => ({
selectOverrides.option = (provided, state) => ({
...provided,
...typography.body2,
backgroundColor: state.isSelected && palette.additional["gray"][3],
Expand All @@ -257,7 +253,7 @@ const SelectInput: React.FC<ISelectInputProps> = ({
)
})

selectOverides.valueContainer = (provided, state) => ({
selectOverrides.valueContainer = (provided, state) => ({
...provided,
...typography.body2,
paddingTop: 0,
Expand All @@ -275,7 +271,7 @@ const SelectInput: React.FC<ISelectInputProps> = ({
)
})

selectOverides.indicatorsContainer = (provided, state) => ({
selectOverrides.indicatorsContainer = (provided, state) => ({
...provided,
"& > div": {
paddingTop: 0,
Expand Down Expand Up @@ -314,12 +310,16 @@ const SelectInput: React.FC<ISelectInputProps> = ({
value={selectValue}
isMulti={isMulti}
name={name}
styles={selectOverides}
styles={selectOverrides}
theme={(selectTheme) => ({
...selectTheme,
spacing: {
...selectTheme.spacing,
controlHeight: size === "large" ? 40 : size === "medium" ? 32 : 24
controlHeight: size === "large"
? 40
: size === "medium"
? 32
: 24
}
})}
/>
Expand Down
20 changes: 14 additions & 6 deletions packages/common-components/src/TagsInput/TagsInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
makeStyles,
createStyles,
ITheme,
useTheme
useTheme,
debounce
} from "@chainsafe/common-theme"
import clsx from "clsx"
import AsyncSelect from "react-select/async"
Expand Down Expand Up @@ -63,6 +64,8 @@ interface ITagsInputProps {
fetchTags: (searchValue: string) => Promise<Array<ITagOption>>
onChange: (value: ValueType<ITagOption, true>, action: ActionMeta<ITagOption>) => void
styles?: Partial<Styles>
loadingMessage?: string
noOptionsMessage? : string
}

const TagsInput = ({
Expand All @@ -75,7 +78,9 @@ const TagsInput = ({
fetchTags,
disabled = false,
onChange,
styles
styles,
loadingMessage = "Loading...",
noOptionsMessage = "No options found."
}: ITagsInputProps) => {
const classes = useStyles()

Expand Down Expand Up @@ -111,6 +116,10 @@ const TagsInput = ({
})
})

const loadOptions = debounce((inputText, callback) => {
fetchTags(inputText).then((options) => callback(options))
}, 300)

return (
<label className={clsx(classes.root, className)}>
{label && label.length > 0 && (
Expand All @@ -127,18 +136,17 @@ const TagsInput = ({
isMulti
cacheOptions={false}
value={value}
loadOptions={fetchTags}
onInputChange={(inputVal) => fetchTags(inputVal)}
loadOptions={loadOptions}
isClearable={false}
getOptionLabel={(option) => option.label}
getOptionValue={(option) => option.value}
onChange={onChange}
openMenuOnClick={false}
openMenuOnFocus={false}
placeholder={placeholder}
isDisabled={disabled}
components={{ DropdownIndicator:() => null, IndicatorSeparator:() => null }}
styles={selectOverides as Partial<Styles>}
loadingMessage={() => loadingMessage}
noOptionsMessage={() => noOptionsMessage}
/>
{caption && (
<Typography
Expand Down
5 changes: 1 addition & 4 deletions packages/common-components/src/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,7 @@ const useStyles = makeStyles(
export type InputState = "normal" | "warning" | "success" | "error"

export interface ITextInputProps
extends Omit<
React.HTMLProps<HTMLInputElement>,
"onChange" | "label" | "size" | "value"
> {
extends Omit<React.HTMLProps<HTMLInputElement>, "onChange" | "label" | "size" | "value"> {
className?: string
label?: string
labelClassName?: string
Expand Down
2 changes: 2 additions & 0 deletions packages/files-ui/cypress/support/page-objects/binPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export const binPage = {
// bin page specific file browser elements
recoverSelectedButton: () => cy.get("[data-testId=button-recover-selected-file]"),
deleteSelectedButton: () => cy.get("[data-testId=button-delete-selected-file]"),
permanentDeleteSuccessToast: () => cy.get("[data-testId=toast-deletion-success]", { timeout: 10000 }),
selectAllCheckbox: () => cy.get("[data-testId=checkbox-select-all]"),

// kebab menu elements
recoverMenuOption: () => cy.get("[data-cy=menu-recover]"),
Expand Down
Loading

0 comments on commit 3f275ce

Please sign in to comment.