From 4c88f09fbf3f5e18708fc6f1b1cea7416b8dbc7d Mon Sep 17 00:00:00 2001 From: Michael Yankelev <12774278+FSM1@users.noreply.github.com> Date: Tue, 28 Sep 2021 21:46:41 +0200 Subject: [PATCH] Release to PROD - 1.1.1 (#1594) * [Files] - Show current bucket decryption key (#1534) * show current bucket decryption key * lingui extract Co-authored-by: GitHub Actions * [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 * 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 * 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 * 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 Co-authored-by: Tanmoy Basak Anjan * Upgrade Torus dependencies (#1549) * [wip] update dependencies * Revert "[wip] update dependencies" This reverts commit 04b593bbbe5f8c4c5d6e220c744aae88c2cd95e4. * 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 * 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 * run lint --fix (#1585) * Gaming dashboard - API keys as cards (#1575) * Dashboard cards done * lingui extract * extra padding * Apply suggestions from code review Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> * lingui extract * Feedback * Removed link * Apply suggestions from code review * Made warning bigger * lingui extract Co-authored-by: GitHub Actions Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com> * New navigations buttons (#1574) * wip * lingui extract * center and add posthog * Update .eslintrc.json * Add team feature fake door (#1587) * wip * modal and tracking * use data-posthog instead Co-authored-by: GitHub Actions * fix tertiary buttons (#1592) * Posthog identify user on login (#1590) * identify user on login * fix effect deps Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> Co-authored-by: GitHub Actions Co-authored-by: Andrew Snaith Co-authored-by: Weblate (bot) Co-authored-by: J. Lavoie Co-authored-by: Tanmoy Basak Anjan Co-authored-by: Ryan Noble --- .eslintrc.json | 6 +- .github/pr-labeler.yml | 2 +- .github/workflows/test-storage.yml | 2 +- package.json | 1 + .../common-components/src/Button/Button.tsx | 26 +- .../src/CheckboxInput/CheckboxInput.tsx | 12 +- .../src/FileInput/FileInput.tsx | 1 - .../common-components/src/Icons/types.d.ts | 2 +- .../src/MenuDropdown/MenuDropdown.tsx | 12 +- .../src/SelectInput/SelectInput.tsx | 42 +- .../src/TagsInput/TagsInput.tsx | 20 +- .../src/TextInput/TextInput.tsx | 5 +- .../src/Typography/Typography.tsx | 24 +- packages/common-components/src/index.ts | 1 + .../src/stories/Button.stories.tsx | 2 +- .../src/stories/Typography.stories.tsx | 22 +- .../src/Create/CreateBreakpoints.ts | 26 +- .../common-theme/src/Defaults/ThemeConfig.ts | 2 +- .../common-theme/src/Hooks/useDoubleClick.ts | 12 +- packages/common-theme/src/Overrides/Button.ts | 6 + .../cypress/support/page-objects/binPage.ts | 2 + .../cypress/support/page-objects/homePage.ts | 2 + .../support/page-objects/navigationMenu.ts | 2 +- .../cypress/tests/file-management-spec.ts | 68 +- .../cypress/tests/main-navigation-spec.ts | 5 - packages/files-ui/package.json | 10 +- .../src/Components/Elements/MnemonicForm.tsx | 4 +- .../src/Components/Elements/PasswordForm.tsx | 1 + .../Elements/ShareTransferRequestModal.tsx | 2 +- .../src/Components/Elements/SharedUsers.tsx | 7 +- .../src/Components/Elements/TeamModal.tsx | 77 ++ .../files-ui/src/Components/FilesRoutes.tsx | 3 +- .../src/Components/Layouts/AppHeader.tsx | 51 +- .../src/Components/Layouts/AppNav.tsx | 78 +- .../Modules/FileBrowsers/BinFileBrowser.tsx | 3 +- .../Modules/FileBrowsers/CSFFileBrowser.tsx | 3 +- .../FileBrowsers/CreateFolderModal.tsx | 19 +- .../CreateOrEditSharedFolderModal.tsx | 52 +- .../Modules/FileBrowsers/FileInfoModal.tsx | 5 +- .../Modules/FileBrowsers/ReportFileModal.tsx | 74 +- .../Modules/FileBrowsers/ShareModal.tsx | 23 +- .../FileBrowsers/SharedFileBrowser.tsx | 62 +- .../FileBrowsers/hooks/useLookupUser.tsx | 13 +- .../FileSystemItem/FileSystemGridItem.tsx | 14 +- .../FileSystemItem/FileSystemTableItem.tsx | 14 +- .../Modules/FileBrowsers/views/FilesList.tsx | 57 +- .../Modules/LoginModule/InitializeAccount.tsx | 26 +- .../Modules/LoginModule/PasswordlessEmail.tsx | 1 + .../Components/Modules/Settings/Profile.tsx | 2 +- .../Modules/Settings/PurchasePlan/index.tsx | 1 + .../src/Components/SharingExplainerModal.tsx | 104 +- .../files-ui/src/Components/SurveyBanner.tsx | 2 +- .../files-ui/src/Contexts/FilesApiContext.tsx | 2 +- .../files-ui/src/Contexts/FilesContext.tsx | 101 +- .../files-ui/src/Contexts/PosthogContext.tsx | 23 +- .../src/Contexts/ThresholdKeyContext.tsx | 58 +- .../files-ui/src/Contexts/UserContext.tsx | 8 +- packages/files-ui/src/Themes/Constants.ts | 5 +- packages/files-ui/src/Themes/DarkTheme.ts | 58 +- packages/files-ui/src/Themes/LightTheme.ts | 3 + packages/files-ui/src/UI-components/Menu.tsx | 20 +- packages/files-ui/src/Utils/MimeMatcher.ts | 60 +- .../files-ui/src/Utils/contentTypeGuesser.ts | 38 +- packages/files-ui/src/locales/de/messages.po | 31 +- packages/files-ui/src/locales/en/messages.po | 27 +- packages/files-ui/src/locales/es/messages.po | 27 +- packages/files-ui/src/locales/fr/messages.po | 35 +- packages/files-ui/src/locales/no/messages.po | 27 +- packages/gaming-ui/package.json | 4 +- .../src/Components/Elements/ApiKeyCard.tsx | 86 ++ .../src/Components/Elements/SecretField.tsx | 2 +- .../gaming-ui/src/Components/GamingRoutes.tsx | 4 +- .../src/Components/Layouts/AppNav.tsx | 35 +- .../{ApiKeys.tsx => DashboardModule.tsx} | 221 ++--- .../src/Components/Pages/DashboardPage.tsx | 21 +- .../src/Components/Pages/SettingsPage.tsx | 22 +- .../src/Contexts/GamingApiContext.tsx | 62 +- packages/gaming-ui/src/Themes/Constants.ts | 2 +- packages/gaming-ui/src/locales/en/messages.po | 31 +- packages/storage-ui/package.json | 4 +- .../src/Components/Elements/CidRow.tsx | 2 +- .../src/Components/Elements/SecretField.tsx | 4 +- .../src/Components/Modules/ApiKeys.tsx | 2 +- .../CreateFolderModal/CreateFolderModal.tsx | 19 +- .../Modules/FilesList/FilesList.tsx | 38 +- .../src/Components/Modules/SurveyBanner.tsx | 2 +- .../UploadFileModal/UploadFileModal.tsx | 2 +- .../src/Components/Pages/CidsPage.tsx | 16 +- .../src/Contexts/FileOperationsReducers.tsx | 172 ++-- .../src/Contexts/StorageApiContext.tsx | 62 +- packages/storage-ui/src/Themes/Constants.ts | 2 +- packages/storage-ui/src/Utils/MimeMatcher.ts | 60 +- .../src/Utils/contentTypeGuesser.ts | 36 +- yarn.lock | 905 +++++++++--------- 94 files changed, 1840 insertions(+), 1512 deletions(-) create mode 100644 packages/files-ui/src/Components/Elements/TeamModal.tsx create mode 100644 packages/gaming-ui/src/Components/Elements/ApiKeyCard.tsx rename packages/gaming-ui/src/Components/Modules/{ApiKeys.tsx => DashboardModule.tsx} (52%) diff --git a/.eslintrc.json b/.eslintrc.json index 274e73d453..d046b33919 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -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", @@ -24,7 +24,8 @@ }, "rules": { "comma-spacing": ["error", { "before": false, "after": true }], - "indent": ["error", 2], + "cypress/no-pause": "error", + "@typescript-eslint/indent": ["error", 2], "linebreak-style": ["error", "unix"], "quotes": ["error", "double"], "semi": ["error", "never"], @@ -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", diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml index d4e1e9790d..0d8b387518 100644 --- a/.github/pr-labeler.yml +++ b/.github/pr-labeler.yml @@ -1,3 +1,3 @@ "Type: Feature": ['feature/*', 'feat/*'] "Type: Bug Fix": fix/* -"Type: Maintenance": ['chore/*', 'mnt/*'] +"Type: Maintenance": ['chore/*', 'mnt/*', 'weblate*'] diff --git a/.github/workflows/test-storage.yml b/.github/workflows/test-storage.yml index 7fe3b2dc50..f03c0dc27e 100644 --- a/.github/workflows/test-storage.yml +++ b/.github/workflows/test-storage.yml @@ -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 diff --git a/package.json b/package.json index b70fe61bd4..a62f07950c 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/common-components/src/Button/Button.tsx b/packages/common-components/src/Button/Button.tsx index 3717ec36d4..0900773aaf 100644 --- a/packages/common-components/src/Button/Button.tsx +++ b/packages/common-components/src/Button/Button.tsx @@ -7,7 +7,6 @@ import { Typography } from "../Typography" const useStyles = makeStyles( ({ constants, typography, animation, palette, overrides }: ITheme) => createStyles({ - // JSS in CSS goes here root: { ...typography.button, borderRadius: `${constants.generalUnit / 4}px`, @@ -110,6 +109,29 @@ const useStyles = makeStyles( }, ...overrides?.Button?.variants?.secondary?.root }, + tertiary: { + backgroundColor: palette.additional["gray"][3], + color: palette.common.black.main, + "& svg": { + fill: palette.common.white.main + }, + "&:hover": { + backgroundColor: palette.primary.main, + color: palette.common.white.main, + ...overrides?.Button?.variants?.tertiary?.hover + }, + "&:focus": { + backgroundColor: palette.primary.main, + color: palette.common.white.main, + ...overrides?.Button?.variants?.tertiary?.focus + }, + "&:active": { + backgroundColor: palette.primary.main, + color: palette.common.white.main, + ...overrides?.Button?.variants?.tertiary?.active + }, + ...overrides?.Button?.variants?.tertiary?.root + }, outline: { color: palette.additional["gray"][8], backgroundColor: palette.common?.white.main, @@ -271,7 +293,7 @@ interface IButtonProps extends Omit { className?: string children?: ReactNode | ReactNode[] fullsize?: boolean - variant?: "link" | "primary" | "secondary" | "outline" | "dashed" | "danger" + variant?: "link" | "primary" | "secondary" |"tertiary" | "outline" | "dashed" | "danger" iconButton?: boolean size?: "large" | "medium" | "small" type?: "button" | "submit" | "reset" diff --git a/packages/common-components/src/CheckboxInput/CheckboxInput.tsx b/packages/common-components/src/CheckboxInput/CheckboxInput.tsx index 94260664ed..7d508154fa 100644 --- a/packages/common-components/src/CheckboxInput/CheckboxInput.tsx +++ b/packages/common-components/src/CheckboxInput/CheckboxInput.tsx @@ -99,14 +99,14 @@ const useStyles = makeStyles( }) ) -interface ICheckboxProps - extends Omit, "value" | "label"> { +interface ICheckboxProps extends Omit, "value" | "label"> { className?: string label?: string | ReactNode error?: string value: boolean indeterminate?: boolean - onChange(event: FormEvent): void + onChange: (event: FormEvent) => void + testId?: string } const CheckboxInput: React.FC = ({ @@ -117,6 +117,7 @@ const CheckboxInput: React.FC = ({ indeterminate = false, value, error, + testId, ...props }) => { const classes = useStyles(props) @@ -126,7 +127,10 @@ const CheckboxInput: React.FC = ({ } return ( -