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

Release - 2022-05-19 #2126

Merged
merged 53 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9e7b587
add new ui tests for cid searching (#2073)
asnaith Apr 5, 2022
4892472
Prevent drag when rename (#2067)
tanmoyAtb Apr 5, 2022
5b84894
Cancel any action and remove any toast on logout (#2075)
Tbaut Apr 6, 2022
a1e41ae
UI layout adjustments and sticky bulk actions (#2074)
tanmoyAtb Apr 10, 2022
2b7b71c
Enable shared folder update button to close the modal (#2080)
Tbaut Apr 11, 2022
2164732
style and remove hotjar (#2081)
Tbaut Apr 11, 2022
6b8639a
Add ui test for blocked uploading when storage exceeded (#2072)
asnaith Apr 12, 2022
a94d245
set default bucket filesystem (#2086)
FSM1 Apr 14, 2022
e4392cf
Prevent multiple file/folder renames [storage] (#2101)
tanmoyAtb Apr 19, 2022
9e5ff4e
modal fixes (#2090)
tanmoyAtb Apr 19, 2022
8f2fc0f
fix double slash (#2106)
Tbaut Apr 22, 2022
c35aa5a
DnD on storage (#2084)
tanmoyAtb Apr 25, 2022
325820a
CIDs paging [storage] (#1889)
tanmoyAtb Apr 25, 2022
2a8857d
user can navigate to privacy policy done
juans-chainsafe May 2, 2022
c0b6b56
user can navigate to terms & conditions
juans-chainsafe May 2, 2022
15ac409
Pipeline for executing Storage on demand ui tests (#2113)
juans-chainsafe May 3, 2022
c7c2ac0
Upload files sequentially by path (#2108)
Tbaut May 3, 2022
548b68f
Rename with extension [Storage] (#2107)
tanmoyAtb May 3, 2022
868655e
navigate to chainsafe.io from "learn more ..." testcase DONE
juans-chainsafe May 3, 2022
2c3d9bc
CRLF to LF
juans-chainsafe May 3, 2022
32fa347
update data-cy from button to link
juans-chainsafe May 3, 2022
f683669
update data-cy from button to link in authenticationPage
juans-chainsafe May 3, 2022
4889a82
update elements name in authenticationPage from button to link
juans-chainsafe May 3, 2022
fdb3ab2
Merge branch 'dev' into mnt/add-landing-page-tests-2114
asnaith May 3, 2022
82741b1
Merge pull request #2115 from ChainSafe/mnt/add-landing-page-tests-2114
juans-chainsafe May 4, 2022
f616b26
landing storage test cases done
juans-chainsafe May 5, 2022
05cf1a1
remove unnecesary data-cy
juans-chainsafe May 5, 2022
e074f00
signout test case desktop and mobile in storage
juans-chainsafe May 6, 2022
58cdd65
Merge pull request #2122 from ChainSafe/mnt/add-sign-out-test-storage…
juans-chainsafe May 10, 2022
565e624
Merge branch 'dev' into mnt/add-landing-page-tests-storage-2116
tanmoyAtb May 10, 2022
e6f59b6
Merge pull request #2119 from ChainSafe/mnt/add-landing-page-tests-st…
juans-chainsafe May 10, 2022
0ae6827
Improve bucket upload ui tests (#2117)
asnaith May 10, 2022
4e9802a
shift key functionality for selections (#2109)
tanmoyAtb May 12, 2022
65aa54d
view file information via modal test done
juans-chainsafe May 13, 2022
87663a6
fix copy to clipboard was failing some times
juans-chainsafe May 13, 2022
5990c02
breadcrumbs dropdown length fixed (#2120)
tanmoyAtb May 13, 2022
76e2b73
remove "navigate to block survey" test case because doesn't exists an…
juans-chainsafe May 13, 2022
3840cd8
change click center to right in cidLabel
juans-chainsafe May 13, 2022
ef4b427
change click to double click, the problem is that not always is copyi…
juans-chainsafe May 13, 2022
807e184
Merge branch 'dev' into mnt/add-view-file-information-modal-test-2124
Tbaut May 13, 2022
2acb7c6
grant clipboard read permissions
juans-chainsafe May 13, 2022
9e5f1f3
Merge branch 'mnt/add-view-file-information-modal-test-2124' of githu…
juans-chainsafe May 13, 2022
d48e0a5
move grant clipboard permissions to support/index.ts
juans-chainsafe May 13, 2022
6674852
add gran clipboard permissions in storage + identation in files
juans-chainsafe May 16, 2022
ec6c2c4
remove blank lines
juans-chainsafe May 16, 2022
d548001
fix types (#2131)
FSM1 May 16, 2022
7c8275b
ident
juans-chainsafe May 16, 2022
3e766f8
Merge branch 'dev' into mnt/add-view-file-information-modal-test-2124
asnaith May 16, 2022
2128de0
Extend timout of header label for better reliability (#2129)
asnaith May 16, 2022
15c3de3
Merge branch 'dev' into mnt/add-view-file-information-modal-test-2124
asnaith May 16, 2022
443c575
Merge pull request #2130 from ChainSafe/mnt/add-view-file-information…
juans-chainsafe May 17, 2022
bde12d0
Upload notification (#2138)
FSM1 May 19, 2022
6ec1fe1
Bin view crumbs (#2135)
tanmoyAtb May 19, 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
61 changes: 61 additions & 0 deletions .github/workflows/test-storage-on-demand.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Cypress tests - Storage (On Demand)
on: [workflow_dispatch]
jobs:
cypress-run:
runs-on: ubuntu-latest
container: cypress/browsers:node14.17.0-chrome91-ff89
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: actions/cache@v2
id: yarn-build-cache
with:
path: |
**/node_modules
~/.cache/Cypress
**/build
key: ${{ runner.os }}-node_modules-build-storage-${{ hashFiles('./yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-build-

# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@v2
env:
REACT_APP_BLOCKNATIVE_ID: ${{ secrets.GH_REACT_APP_BLOCKNATIVE_ID }}
REACT_APP_FILES_VERIFIER_NAME: ${{ secrets.GH_REACT_APP_FILES_VERIFIER_NAME }}
REACT_APP_FILES_UUID_VERIFIER_NAME: 'chainsafe-uuid-testnet'
REACT_APP_TEST: 'true'
DEBUG: '@cypress/github-action'
with:
start: yarn start:storage-ui
# wait for 10min for the server to be ready
wait-on: 'npx wait-on --timeout 600000 http://localhost:3000'
# custom test command to run
command: yarn test:ci:storage-ui
# store the screenshots if the tests fail
- name: Store screenshots
uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots
path: packages/storage-ui/cypress/screenshots
# store the videos if the tests fail
# - name: Store videos
# uses: actions/upload-artifact@v1
# if: failure()
# with:
# name: cypress-videos
# path: packages/storage-ui/cypress/videos

- name: Slack Notification
uses: rtCamp/action-slack-notify@v2.2.0
env:
SLACK_TITLE: 'Storage UI Test Suite On-Demand Result:'
SLACK_MESSAGE: ${{ job.status }}
SLACK_COLOR: ${{ job.status }}
MSG_MINIMAL: actions url
SLACK_WEBHOOK: ${{ secrets.SLACK_UI_WEBHOOK }}
SLACK_FOOTER: 'Test run ${{ github.run_number }} was executed on branch: ${{ github.ref }}'
5 changes: 1 addition & 4 deletions packages/common-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
"@material-ui/styles": ">4.0.0",
"formik": "^2.2.5",
"react": ">16.8.0",
"react-dom": ">16.8.0",
"react-toast-notifications": ">2.4.0"
"react-dom": ">16.8.0"
},
"devDependencies": {
"@babel/core": "^7.12.10",
Expand All @@ -56,15 +55,13 @@
"@svgr/webpack": "^5.5.0",
"@types/react-blockies": "^1.4.0",
"@types/react-router-dom": "^5.1.6",
"@types/react-toast-notifications": "^2.4.0",
"babel-loader": "8.1.0",
"fork-ts-checker-webpack-plugin": "^6.0.5",
"formik": "^2.2.5",
"react": "16.14.0",
"react-blockies": "^1.4.1",
"react-dom": "16.14.0",
"react-router-dom": "^5.2.0",
"react-toast-notifications": "^2.4.0",
"rollup": "2.34.2",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^3.1.8",
Expand Down
1 change: 0 additions & 1 deletion packages/common-components/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export default {
"react-dom",
"@material-ui/styles",
"formik",
"react-toast-notifications",
"@chainsafe/common-theme"
]
}
4 changes: 4 additions & 0 deletions packages/common-components/src/Breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ const useStyles = makeStyles(
menuTitle: {
padding: `0px ${constants.generalUnit * 1.5}px 0px ${constants.generalUnit * 0.5}px`
},
menuOptions: {
zIndex: zIndex?.layer1
},
menuIcon: {
width: 12,
height: 12,
Expand Down Expand Up @@ -158,6 +161,7 @@ const Breadcrumb = ({
animation="rotate"
classNames={{
item: classes.menuItem,
options: classes.menuOptions,
title: classes.menuTitle,
icon: classes.menuIcon,
titleText: classes.menuTitleText
Expand Down
8 changes: 7 additions & 1 deletion packages/common-components/src/FileInput/FileInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,17 @@ const FileInput = ({
)}
{(meta.error || errors.length > 0) && (
<ul className={classNames?.error}>
<li className={classes.error}>{meta.error}</li>
<li
data-testid={`meta-error-message-${testId}`}
className={classes.error}
>
{meta.error}
</li>
{errors.map((error, i) => (
<li
key={i}
className={classes.error}
data-testid={`error-message-${testId}`}
>
{error}
</li>
Expand Down
2 changes: 1 addition & 1 deletion packages/common-components/src/Icons/svgs/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/common-components/src/Icons/svgs/arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/common-components/src/Icons/svgs/caret-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions packages/common-components/src/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import React from "react"
import { createStyles, makeStyles } from "@chainsafe/common-theme"
import { CaretLeftIcon, CaretRightIcon } from "../Icons"
import { ITheme } from "@chainsafe/common-theme"
import { Button } from "../Button"
import { Typography } from "../Typography"

const useStyles = makeStyles(({ constants, palette }: ITheme) => {
return createStyles({
root: {
display: "flex",
alignItems: "center",
margin: `${constants.generalUnit}px 0`
},
nextButton: {
marginLeft: constants.generalUnit * 1.5
},
previousButton: {
marginRight: constants.generalUnit * 1.5
},
icons: {
fill: palette.additional["gray"][9]
}
})
})

export interface IPaginationProps {
pageNo?: number
totalPages?: number
onNextClick?: () => void
onPreviousClick?: () => void
loadingNext?: boolean
loadingPrevious?: boolean
showPageNumbers?: boolean
isNextDisabled?: boolean
isPreviousDisabled?: boolean
}

const Pagination: React.FC<IPaginationProps> = ({
pageNo,
totalPages,
onNextClick,
onPreviousClick,
loadingNext,
loadingPrevious,
showPageNumbers,
isNextDisabled,
isPreviousDisabled
}) => {
const classes = useStyles()

return (
<div className={classes.root}>
<Button
variant="outline"
loading={loadingPrevious}
onClick={onPreviousClick}
size="medium"
disabled={isPreviousDisabled || (showPageNumbers && !!pageNo && pageNo <= 1)}
className={classes.previousButton}
>
<CaretLeftIcon className={classes.icons} />
</Button>
{!!showPageNumbers && pageNo &&
<Typography
component="p"
variant="body1"
>
{`Page ${pageNo} ${totalPages ? `of ${totalPages}` : "" }`}
</Typography>
}
<Button
variant="outline"
loading={loadingNext}
size="medium"
disabled={isNextDisabled || (showPageNumbers && pageNo === totalPages)}
onClick={onNextClick}
className={classes.nextButton}
>
<CaretRightIcon className={classes.icons} />
</Button>
</div>
)
}

export default Pagination
1 change: 1 addition & 0 deletions packages/common-components/src/Pagination/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Pagination, IPaginationProps } from "./Pagination"
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ interface IFormikRadioInputProps extends React.HTMLProps<HTMLInputElement> {
name: string
label?: string
id: string
testId: string
}

const FormikRadioInput: React.FC<IFormikRadioInputProps> = ({
name,
onChange,
id,
label,
testId,
...props
}) => {
const [field, meta, helpers] = useField<string>(name)
Expand All @@ -32,6 +34,7 @@ const FormikRadioInput: React.FC<IFormikRadioInputProps> = ({
value={id}
checked={field.value === id}
label={label}
testId={testId}
/>
)
}
Expand Down
19 changes: 14 additions & 5 deletions packages/common-components/src/Toasts/ToastContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,11 @@ interface ToastContext {
addToast: (toastParams: ToastParams) => string
updateToast: (toastId: string, toastParams: ToastParams, startDismissal?: boolean) => void
removeToast: (toastId: string) => void
removeAllToasts: () => void
toasts: Toast[]
}

const ToastContext = React.createContext<ToastContext | undefined>(
undefined
)
const ToastContext = React.createContext<ToastContext | undefined>(undefined)

const ToastProvider = ({
children,
Expand All @@ -111,6 +110,16 @@ const ToastProvider = ({
setToastQueue(toasts.current)
}, [toasts])

const removeAllToasts = useCallback(() => {
// cancel any pending progress such as upload/downloads etc..
toasts.current.forEach((toast) => {
toast.onProgressCancel && toast.onProgressCancel()
})

toasts.current = []
setToastQueue(toasts.current)
}, [toasts])

const addToast = useCallback((toastParams: ToastParams) => {
const id = uuidv4()
toasts.current = [
Expand Down Expand Up @@ -159,6 +168,7 @@ const ToastProvider = ({
addToast,
updateToast,
removeToast,
removeAllToasts,
toasts: toastQueue
}}
>
Expand All @@ -184,8 +194,7 @@ const ToastProvider = ({
))}
</div>
)
))
}
))}
{children}
</ToastContext.Provider>
)
Expand Down
1 change: 1 addition & 0 deletions packages/common-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export * from "./Icons"
export * from "./Modal"
export * from "./NumberInput"
export * from "./MenuDropdown"
export * from "./Pagination"
export * from "./Paper"
export * from "./ProgressBar"
export * from "./RadioInput"
Expand Down
23 changes: 23 additions & 0 deletions packages/common-components/src/stories/Pagination.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from "react"
import { withKnobs, boolean, number } from "@storybook/addon-knobs"
import { Pagination } from "../Pagination"

export default {
title: "Pagination",
component: Pagination,
decorators: [withKnobs]
}

export const PaginationDemo = (): React.ReactNode => {
return (
<Pagination
showPageNumbers={boolean("Show page numbers", true)}
pageNo={number("page number", 1)}
totalPages={number("total pages", 5)}
isNextDisabled={boolean("next disabled", false)}
isPreviousDisabled={boolean("previous disabled", false)}
loadingNext={boolean("next loading", false)}
loadingPrevious={boolean("previous loading", false)}
/>
)
}
1 change: 0 additions & 1 deletion packages/files-ui/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ REACT_APP_API_URL=https://stage-api.chainsafe.io/api/v1
REACT_APP_STRIPE_PK=
REACT_APP_SENTRY_DSN_URL=
REACT_APP_SENTRY_ENV=development
REACT_APP_HOTJAR_ID=
# Get your ID on Blocknative: https://explorer.blocknative.com/account
REACT_APP_BLOCKNATIVE_ID=
REACT_APP_GOOGLE_CLIENT_ID=939164021653-lb5eiquuatf877em98bpi8v360p5vcs4.apps.googleusercontent.com
Expand Down
9 changes: 6 additions & 3 deletions packages/files-ui/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,18 @@ Cypress.Commands.add(
}
)

Cypress.Commands.add("safeClick", { prevSubject: "element" }, ($element?: JQuery<HTMLElement>) => {
Cypress.Commands.add("safeClick", { prevSubject: "element" }, ($element, _, expectDisable = false) => {
const click = ($el: JQuery<HTMLElement>) => $el.trigger("click")

return cy
.wrap($element)
.should("be.visible")
.should("be.enabled")
.pipe(click)
.should($el => expect($el).to.not.be.visible)
.should($el => expectDisable
? expect($el).to.be.disabled
: expect($el).to.not.be.visible
)
})

Cypress.Commands.add("iframeLoaded", { prevSubject: "element" }, ($iframe?: JQuery<HTMLElement>): any => {
Expand Down Expand Up @@ -235,7 +238,7 @@ declare global {
* https://github.com/cypress-io/cypress/issues/7306
*
*/
safeClick: ($element?: JQuery<HTMLElement>) => Chainable
safeClick: ($element?: JQuery<HTMLElement>, expectDisable?: boolean) => Chainable

/**
* Clear a bucket.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export const authenticationPage = {
showMoreButton: () => cy.get("div.svelte-q1527 > .bn-onboard-custom"),
detectedWallet: () => cy.get(":nth-child(3) > .bn-onboard-custom > span.svelte-1799bj2"),
web3SignInButton: () => cy.get("[data-cy=button-sign-in-with-web3]"),
privacyPolicyLink: () => cy.get("[data-cy=link-privacy-policy]"),
termsAndConditionsLink: () => cy.get("[data-cy=link-terms-and-conditions]"),
learnMoreAboutChainsafeLink: () => cy.get("[data-cy=link-learn-more-about-chainsafe]"),

// sign in section elements
loginPasswordButton: () => cy.get("[data-cy=button-login-password]", { timeout: 20000 }),
Expand Down
Loading