-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge dev into epic/files-billing (#1491)
* [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> Co-authored-by: Ryan Noble <ryanjnoble@gmail.com> Co-authored-by: GitHub Actions <actions@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: Weblate (bot) <hosted@weblate.org> Co-authored-by: J. Lavoie <j.lavoie@net-c.ca> Co-authored-by: Andrew Snaith <asnaith@users.noreply.github.com>
- Loading branch information
1 parent
0795b57
commit a440bda
Showing
54 changed files
with
835 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { useOnClickOutside } from "./useOnClickOutside" | ||
import { useMediaQuery } from "./useMediaQuery" | ||
import { useDoubleClick } from "./useDoubleClick" | ||
import { useLongPress, LongPressEvents } from "./useLongPress" | ||
|
||
export { useOnClickOutside, useMediaQuery, useDoubleClick } | ||
export { useOnClickOutside, useMediaQuery, useDoubleClick, useLongPress, LongPressEvents } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { useCallback, useRef, useState } from "react" | ||
|
||
export interface LongPressEvents { | ||
onMouseDown: (e: React.MouseEvent) => void | ||
onTouchStart: (e: React.TouchEvent) => void | ||
onMouseUp: (e: React.MouseEvent) => void | ||
onMouseLeave: (e: React.MouseEvent) => void | ||
onTouchEnd: (e: React.TouchEvent) => void | ||
} | ||
|
||
export const useLongPress = ( | ||
onLongPress: ((e?: React.MouseEvent) => void) | null, | ||
onClick: ((e?: React.MouseEvent) => void) | null, | ||
delay = 300 | ||
): LongPressEvents => { | ||
const [longPressTriggered, setLongPressTriggered] = useState(false) | ||
const timeout: any = useRef() | ||
const target: any = useRef() | ||
|
||
const start = useCallback( | ||
(event: any) => { | ||
if (event.target) { | ||
event.target.addEventListener("touchend", preventDefault, { | ||
passive: false | ||
}) | ||
target.current = event.target | ||
} | ||
timeout.current = setTimeout(() => { | ||
onLongPress && onLongPress(event) | ||
setLongPressTriggered(true) | ||
}, delay) | ||
|
||
}, [onLongPress, delay] | ||
) | ||
|
||
const clear = useCallback( | ||
(shouldTriggerClick = true) => { | ||
timeout.current && clearTimeout(timeout.current) | ||
shouldTriggerClick && !longPressTriggered && onClick && onClick() | ||
setLongPressTriggered(false) | ||
if (target.current) { | ||
target.current.removeEventListener("touchend", preventDefault) | ||
} | ||
}, [onClick, longPressTriggered] | ||
) | ||
|
||
return { | ||
onMouseDown: (e: React.MouseEvent) => start(e), | ||
onTouchStart: (e: React.TouchEvent) => start(e), | ||
onMouseUp: (e: React.MouseEvent) => clear(e), | ||
onMouseLeave: () => clear(false), | ||
onTouchEnd: (e: React.TouchEvent) => clear(e) | ||
} | ||
} | ||
|
||
const isTouchEvent = (event: any) => { | ||
return "touches" in event | ||
} | ||
|
||
const preventDefault = (event: any) => { | ||
if (!isTouchEvent(event)) return | ||
|
||
if (event.touches.length < 2 && event.preventDefault) { | ||
event.preventDefault() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export const folderName = "Testing" | ||
export const folderName = "Group" | ||
export const folderPath = `/${folderName}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
import { basePage } from "./basePage" | ||
import { fileBrowser } from "./fileBrowser" | ||
|
||
export const binPage = { | ||
...basePage, | ||
...fileBrowser, | ||
|
||
// main file browser elements (bin view only) | ||
// bin page specific file browser elements | ||
recoverSelectedButton: () => cy.get("[data-testId=button-recover-selected-file]"), | ||
deleteSelectedButton: () => cy.get("[data-testId=button-delete-selected-file]"), | ||
|
||
// file browser row elements | ||
fileItemRow: () => cy.get("[data-cy=file-item-row]", { timeout: 20000 }), | ||
fileItemName: () => cy.get("[data-cy=file-item-name]"), | ||
fileItemKebabButton: () => cy.get("[data-testid=menu-title-fileDropdown]"), | ||
|
||
// menu elements (bin view only) | ||
// kebab menu elements | ||
recoverMenuOption: () => cy.get("[data-cy=menu-recover]"), | ||
deleteMenuOption: () => cy.get("[data-cy=menu-delete]") | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/files-ui/cypress/support/page-objects/fileBrowser.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const fileBrowser = { | ||
fileItemKebabButton: () => cy.get("[data-testid=menu-title-fileDropdown]"), | ||
fileItemName: () => cy.get("[data-cy=file-item-name]"), | ||
fileItemRow: () => cy.get("[data-cy=file-item-row]", { timeout: 20000 }), | ||
fileTable: () => cy.get("[data-testid=table-home]"), | ||
folderBreadcrumb: () => cy.get("[data-cy=navigation-folder-breadcrumb]"), | ||
noDataStateInfo: () => cy.get("[data-cy=data-state-no-files]") | ||
} |
Oops, something went wrong.