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

merge latest 'origin/dev' into 'epic/files-billing' #1588

Merged
merged 71 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
d633abe
Merge pull request #868 from ChainSafe/dev
FSM1 Apr 2, 2021
0392f31
Merge pull request #908 from ChainSafe/dev
FSM1 Apr 12, 2021
ef657f1
Merge pull request #964 from ChainSafe/dev
FSM1 Apr 22, 2021
c60b181
Merge pull request #983 from ChainSafe/dev
FSM1 Apr 26, 2021
4e362c8
Release latest to Stage (#988)
FSM1 Apr 27, 2021
9d7d8b1
Merge pull request #989 from ChainSafe/stage
FSM1 Apr 27, 2021
00dcb17
Merge pull request #996 from ChainSafe/dev
FSM1 Apr 27, 2021
d3fb1b1
Merge pull request #997 from ChainSafe/stage
FSM1 Apr 27, 2021
c9d65e3
Merge pull request #1009 from ChainSafe/dev
FSM1 May 7, 2021
75bbbd0
fix link (#1025)
FSM1 May 11, 2021
530b582
Merge pull request #1059 from ChainSafe/dev
FSM1 May 31, 2021
eb98743
create buckets for new users
FSM1 Jun 7, 2021
f4b1bb3
Merge pull request #1098 from ChainSafe/hotfix/create-new-user-file-s…
FSM1 Jun 7, 2021
e95ca71
Release latest to PROD (#1135)
FSM1 Jun 15, 2021
e3675be
remove depraecated files call
FSM1 Jun 15, 2021
ae88827
Merge pull request #1138 from ChainSafe/hotfix/remove-deprecated-file…
FSM1 Jun 15, 2021
fa99c60
Merge pull request #1387 from ChainSafe/dev
FSM1 Aug 2, 2021
b082dfc
Merge pull request #1435 from ChainSafe/dev
FSM1 Aug 12, 2021
1cff622
[Storage] Copy cid functionality (#1437)
RyRy79261 Aug 25, 2021
3e0ee70
[STORAGE] Rename file in bucket (#1471)
FSM1 Aug 25, 2021
58839c7
10min timeout for everyone (#1472)
Tbaut Aug 25, 2021
55251ae
Translated using Weblate (French) (#1478)
weblate Aug 30, 2021
03fc54a
add ui tests for search (#1479)
asnaith Aug 31, 2021
997e7d4
bump cypress to v8.3.1 (#1480)
asnaith Aug 31, 2021
161d0cd
Sharing feature explainer (#1477)
Tbaut Sep 2, 2021
8625789
Adding multi selects on mobile view with long press (#1470)
tanmoyAtb Sep 3, 2021
afbd421
bump to 1.18.5 (#1493)
Tbaut Sep 3, 2021
038228c
[Files] - New survey - Discord link and tiny fix (#1487)
Tbaut Sep 3, 2021
57f0feb
Translations update from Weblate (#1496)
weblate Sep 6, 2021
a56307b
update axios (#1498)
FSM1 Sep 6, 2021
fa325f5
Added docs link (#1497)
RyRy79261 Sep 7, 2021
2faecb6
upgrade (#1501)
Tbaut Sep 8, 2021
0852760
Published (#1503)
RyRy79261 Sep 13, 2021
4e2d70a
Add ui tests for file preview (#1489)
asnaith Sep 13, 2021
b70fdfa
Toasts refactor (#1495)
tanmoyAtb Sep 13, 2021
0fecdd8
Progress cancellations (#1500)
tanmoyAtb Sep 13, 2021
7d2c756
survey banner on safari fix (#1512)
tanmoyAtb Sep 13, 2021
0c731ad
fix what I broke (#1518)
Tbaut Sep 14, 2021
4732c0a
Change the survey to a call for a user interview (#1517)
Tbaut Sep 14, 2021
5ecfcce
bump cypress to v8.4 (#1521)
asnaith Sep 14, 2021
f376f59
Translations update from Weblate (#1522)
weblate Sep 14, 2021
3498d32
Adjusting login screen sizes. (#1519)
tanmoyAtb Sep 14, 2021
280b03e
Gaming Dashboard overhaul (#1504)
RyRy79261 Sep 14, 2021
4c5163e
bulk recover operation (#1526)
tanmoyAtb Sep 16, 2021
8634d7f
Add new ui tests for illogical folder and file move errors (#1520)
asnaith Sep 16, 2021
89b9632
Posthog Analytics Integration (#1514)
priom Sep 16, 2021
4c3c7d3
Translated using Weblate (French) (#1528)
weblate Sep 16, 2021
669e3a2
[Files] - Share to home or other shared folder (#1527)
Tbaut Sep 16, 2021
0e454aa
Folder uploads (#1515)
FSM1 Sep 16, 2021
22ed6e9
Translated using Weblate (French) (#1532)
weblate Sep 16, 2021
bdcd6a9
Don't track before opt-in (#1531)
Tbaut Sep 17, 2021
01999cd
Merge branch 'prod' into dev
FSM1 Sep 17, 2021
e071c9a
[Files] - Show current bucket decryption key (#1534)
Tbaut Sep 17, 2021
59bbe6c
[Files] - Get admin public key from the api (#1485)
Tbaut Sep 17, 2021
0356544
Add lint rules for test debug commands (#1535)
asnaith Sep 20, 2021
9a2c948
prevent double opening (#1538)
Tbaut Sep 20, 2021
84b195f
Add test coverage for storage summary adjustments (#1536)
asnaith Sep 20, 2021
4b936f4
Translated using Weblate (French) (#1540)
weblate Sep 21, 2021
36eefa5
Better colors for dark mode select and tagsinput components (#1550)
Tbaut Sep 21, 2021
736b881
Filter out current bucket (#1548)
Tbaut Sep 21, 2021
4919583
fix color (#1555)
Tbaut Sep 22, 2021
c92477b
Fix user lookup spamming the api, and throwing (#1553)
Tbaut Sep 22, 2021
af43f49
Upgrade Torus dependencies (#1549)
FSM1 Sep 22, 2021
22c59bc
reset fields for shared folders (#1577)
Tbaut Sep 24, 2021
5b34d21
reset forms and fix a couple error types (#1578)
Tbaut Sep 24, 2021
eed9c86
Translations update from Weblate (#1557)
weblate Sep 24, 2021
705cc71
hide when ther's no menu item (#1576)
Tbaut Sep 25, 2021
69093a6
Add "maintenance" label to weblate PRs automatically (#1581)
Tbaut Sep 25, 2021
b47bd17
Upgrade api client and fix issue with shared folder renaming (#1582)
Tbaut Sep 27, 2021
ec1c260
Merge remote-tracking branch 'origin/dev' into mnt/merge-latest-'orig…
FSM1 Sep 27, 2021
2067e0c
revert bad merge
FSM1 Sep 27, 2021
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
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