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

New sharing design #1927

Merged
merged 27 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
7 changes: 7 additions & 0 deletions packages/common-components/src/Icons/icons/Link.icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as React from "react"
import createSvgIcon from "../createSvgIcon"
import { ReactComponent as LinkSvg } from "../svgs/link.svg"

export { LinkSvg }

export default createSvgIcon(<LinkSvg />)
1 change: 1 addition & 0 deletions packages/common-components/src/Icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export { default as MastercardCardIcon, MastercardCardSvg } from "./icons/Master
export { default as MoonIcon, MoonSvg } from "./icons/Moon.icon"
export { default as MoonStarIcon, MoonStarSvg } from "./icons/MoonStar.icon"
export { default as MoreIcon, MoreSvg } from "./icons/More.icon"
export { default as LinkIcon, LinkSvg } from "./icons/Link.icon"
export { default as LockIcon, LockSvg } from "./icons/Lock.icon"
export { default as KeyIcon, KeySvg } from "./icons/Key.icon"
export { default as PaperclipIcon, PaperclipSvg } from "./icons/Paperclip.icon"
Expand Down
5 changes: 5 additions & 0 deletions packages/common-components/src/Icons/svgs/link.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/files-ui/cypress/fixtures/loginData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const testPrivateKey = "0x4fd9a44c051834e28a919096f154e3f805f58d8f2d90a1ab9a29b0b46a6ac363"
export const testAddress = "0xDa1f70D176E0F7F16f2a3bB509cD37Bd36aFD902"
export const testAccountPassword = "correct horse"
export const localHost = "http://localhost:3000"
export const localHost = "https://files-ui-stage-pr-1927.onrender.com"
FSM1 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ export const createEditSharedFolderModal = {
createButton: () => cy.get("[data-cy=button-create-shared-folder]", { timeout: 10000 }),
editPermissionInput: () => cy.get("[data-cy=input-edit-permission]"),
folderNameInput: () => cy.get("[data-cy=input-shared-folder-name]"),
tagViewPermissionUser: () => cy.get("[data-cy=tag-view-permission-user]"),
tagEditPermissionUser: () => cy.get("[data-cy=tag-edit-permission-user]"),
updateButton: () => cy.get("[data-cy=button-update-shared-folder]", { timeout: 10000 }),
viewOnlyPermissionInput: () => cy.get("[data-cy=input-view-permission"),

userLookupResult: () => cy.get("[data-cy=user-lookup-result]", { timeout: 10000 }),
// link sharing related elements
shareLink: () => cy.get("[data-cy=link-share]"),
activeShareLink: () => cy.get("[data-cy=link-active-share]"),
labelPermissionType: () => cy.get("[data-cy=label-permission-type]"),
copyLinkButton: () => cy.get("[data-cy=button-copy-link]"),
linkKebabMenu: () => cy.get("[data-testid=icon-link-kebab]"),
deleteLinkMenuOption: () => cy.get("[data-cy=menu-delete-active-link]"),
permissionTypeDropdown: () => cy.get("[data-testid=dropdown-title-permission]"),
linkPermissionDropdown: () => cy.get("[data-testid=dropdown-title-link-permission-dropdown]"),
FSM1 marked this conversation as resolved.
Show resolved Hide resolved
viewOnlyDropdownOption: () => cy.get("[data-cy=menu-read]"),
canEditDropdownOption: () => cy.get("[data-cy=menu-write]"),
createLinkButton: () => cy.get("[data-cy=button-create-link]")
Expand Down
3 changes: 2 additions & 1 deletion packages/files-ui/cypress/tests/file-sharing-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ describe("File Sharing", () => {
sharedPage.createSharedFolderButton().click()
createEditSharedFolderModal.body().should("be.visible")
createEditSharedFolderModal.folderNameInput().type(sharedFolderName)
createEditSharedFolderModal.editPermissionInput().type(validUsername).type("{enter}")
createEditSharedFolderModal.editPermissionInput().type(validUsername)
createEditSharedFolderModal.userLookupResult().should("exist").click()
createEditSharedFolderModal.createButton().safeClick()
createEditSharedFolderModal.body().should("not.exist")
sharedPage.sharedFolderItemRow().should("have.length", 1)
Expand Down
8 changes: 4 additions & 4 deletions packages/files-ui/cypress/tests/link-sharing-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ describe("Link Sharing", () => {
createEditSharedFolderModal.labelPermissionType().should("not.exist")
createEditSharedFolderModal.copyLinkButton().should("not.exist")
createEditSharedFolderModal.linkKebabMenu().should("not.exist")
createEditSharedFolderModal.permissionTypeDropdown().should("be.visible")
createEditSharedFolderModal.linkPermissionDropdown().should("be.visible")
createEditSharedFolderModal.createLinkButton().should("be.visible")

// ensure "view-only" and "can-edit" options are present
createEditSharedFolderModal.permissionTypeDropdown().click()
createEditSharedFolderModal.linkPermissionDropdown().click()
createEditSharedFolderModal.viewOnlyDropdownOption()
.scrollIntoView()
.should("be.visible")
Expand All @@ -53,7 +53,7 @@ describe("Link Sharing", () => {
createEditSharedFolderModal.copyLinkButton().should("have.length", 1)

// ensure only the can-edit option is present if a "view-only" link exists
createEditSharedFolderModal.permissionTypeDropdown().click()
createEditSharedFolderModal.linkPermissionDropdown().click()
createEditSharedFolderModal.viewOnlyDropdownOption().should("not.exist")
createEditSharedFolderModal.canEditDropdownOption()
.scrollIntoView()
Expand All @@ -67,7 +67,7 @@ describe("Link Sharing", () => {
createEditSharedFolderModal.copyLinkButton().should("have.length", 2)

// ensure create button and drop down are not shown if links exist
createEditSharedFolderModal.permissionTypeDropdown().should("not.exist")
createEditSharedFolderModal.linkPermissionDropdown().should("not.exist")
createEditSharedFolderModal.createLinkButton().should("not.exist")

// delete one of the links
Expand Down
Loading