From 6210242c9e20b7650f51fd1ae529f90e5e99273d Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 29 Nov 2024 16:34:33 +0100 Subject: [PATCH 1/3] fix(explore): chunked files This includes latest ipld-explorer-components with fix from https://github.com/ipfs/ipld-explorer-components/issues/462 also bumped kubo and caniuse and non-breaking audit suggestions --- package-lock.json | 82 +++++++++++++++++++++++------------------------ package.json | 4 +-- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd68ec2c7..c28dea85e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "ipfs-css": "^1.4.0", "ipfs-geoip": "^9.1.0", "ipfs-provider": "^2.1.0", - "ipld-explorer-components": "^8.1.0", + "ipld-explorer-components": "^8.1.2", "is-ipfs": "^8.0.1", "istextorbinary": "^6.0.0", "it-all": "^1.0.5", @@ -135,7 +135,7 @@ "ipfsd-ctl": "^14.1.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "kubo": "^0.30.0", + "kubo": "^0.32.1", "npm-run-all": "^4.1.5", "nyc": "^15.1.0", "os-browserify": "^0.3.0", @@ -17891,6 +17891,16 @@ "@types/json-schema": "*" } }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "license": "MIT", + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, "node_modules/@types/esm": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/@types/esm/-/esm-3.2.2.tgz", @@ -27681,9 +27691,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001676", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001676.tgz", - "integrity": "sha512-Qz6zwGCiPghQXGJvgQAem79esjitvJ+CxSbSQkW9H/UX5hg8XM88d4lp2W+MEQ81j+Hip58Il+jGVdazk1z9cw==", + "version": "1.0.30001684", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001684.tgz", + "integrity": "sha512-G1LRwLIQjBQoyq0ZJGqGIJUXzJ8irpbjHLpVRXDvBEScFJ9b17sgK6vlx0GAJFE21okD7zXl08rRRUfq6HdoEQ==", "funding": [ { "type": "opencollective", @@ -27697,8 +27707,7 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ], - "license": "CC-BY-4.0" + ] }, "node_modules/capital-case": { "version": "1.0.4", @@ -30034,9 +30043,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -41688,9 +41697,9 @@ } }, "node_modules/ipld-explorer-components": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/ipld-explorer-components/-/ipld-explorer-components-8.1.0.tgz", - "integrity": "sha512-NtpIX1zFTol/IZUVlWQPc9RNGpBKZv4dxTMW3HUiEkshg134noA8cLYTA+ntaxQShlYZKcAZxZSZDIvwMQN1bQ==", + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/ipld-explorer-components/-/ipld-explorer-components-8.1.2.tgz", + "integrity": "sha512-dCUMTw/z28GGrrW3QkwD3inQ5Mg+BGJjGvfh9m/QSAibsHV3vBJuBb7Q1qp/BsvnktbCfLMgM8Km+K+F9E8tPQ==", "license": "Apache-2.0 OR MIT", "dependencies": { "@helia/block-brokers": "^4.0.0", @@ -47697,9 +47706,9 @@ } }, "node_modules/kubo": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/kubo/-/kubo-0.30.0.tgz", - "integrity": "sha512-wrHaNtlyn59SQmkIiXSP3VAwebqImNkCuhTDJ70lSDXr3Rd9av8s2YzYblSHShtiEC5ylC0pofwDNPP8+F2yiw==", + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/kubo/-/kubo-0.32.1.tgz", + "integrity": "sha512-vXTprOeWACNpU86ldCBSBMRgq4MahLIr/YBn6DBb0SvHHVe4ZD8Djma6ncfVmxzrWxEiIMq9XOxJcQ27UOZ6kw==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -53521,9 +53530,9 @@ "license": "MIT" }, "node_modules/npm-run-all/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", "dev": true, "license": "MIT", "dependencies": { @@ -57889,9 +57898,9 @@ } }, "node_modules/patch-package/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", "dev": true, "license": "MIT", "dependencies": { @@ -66805,9 +66814,9 @@ } }, "node_modules/sane/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", "dev": true, "license": "MIT", "dependencies": { @@ -74118,18 +74127,18 @@ } }, "node_modules/webpack": { - "version": "5.95.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", - "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", + "version": "5.96.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.96.1.tgz", + "integrity": "sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA==", "license": "MIT", "dependencies": { - "@types/estree": "^1.0.5", + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.7.1", - "acorn-import-attributes": "^1.9.5", - "browserslist": "^4.21.10", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", @@ -74550,15 +74559,6 @@ "node": ">=0.4.0" } }, - "node_modules/webpack/node_modules/acorn-import-attributes": { - "version": "1.9.5", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", - "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", - "license": "MIT", - "peerDependencies": { - "acorn": "^8" - } - }, "node_modules/webpack/node_modules/schema-utils": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", diff --git a/package.json b/package.json index 6a721e48b..d5195c0cf 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "ipfs-css": "^1.4.0", "ipfs-geoip": "^9.1.0", "ipfs-provider": "^2.1.0", - "ipld-explorer-components": "^8.1.0", + "ipld-explorer-components": "^8.1.2", "is-ipfs": "^8.0.1", "istextorbinary": "^6.0.0", "it-all": "^1.0.5", @@ -165,7 +165,7 @@ "ipfsd-ctl": "^14.1.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "kubo": "^0.30.0", + "kubo": "^0.32.1", "npm-run-all": "^4.1.5", "nyc": "^15.1.0", "os-browserify": "^0.3.0", From 8f3c8ec570d1cb81d8833ad905d7ace5a40cc03b Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 29 Nov 2024 21:32:09 +0100 Subject: [PATCH 2/3] fix(files): Inspect via context menu Closes #2306 --- src/files/FilesPage.js | 2 +- test/e2e/files.test.js | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/files/FilesPage.js b/src/files/FilesPage.js index 1692ec486..d9a837330 100644 --- a/src/files/FilesPage.js +++ b/src/files/FilesPage.js @@ -73,7 +73,7 @@ const FilesPage = ({ } const onAddByPath = (path, name) => doFilesAddPath(files.path, path, name) - const onInspect = (cid) => doUpdateHash(`/explore/ipfs/${cid}`) + const onInspect = (cid) => doUpdateHash(`/explore/${cid}`) const showModal = (modal, files = null) => setModals({ show: modal, files }) const hideModal = () => setModals({}) const handleContextMenu = (ev, clickType, file, pos) => { diff --git a/test/e2e/files.test.js b/test/e2e/files.test.js index b2566a550..0f1346466 100644 --- a/test/e2e/files.test.js +++ b/test/e2e/files.test.js @@ -1,10 +1,11 @@ import { test } from './setup/coverage.js' +import { expect } from '@playwright/test' import { fixtureData } from './fixtures/index.js' import all from 'it-all' import filesize from 'filesize' import * as kuboRpcModule from 'kubo-rpc-client' -test.describe('Files screen', () => { +test.describe.serial('Files screen', () => { test.beforeEach(async ({ page }) => { await page.goto('/#/files') }) @@ -62,4 +63,38 @@ test.describe('Files screen', () => { await page.waitForSelector(`text=${human(file.size)}`) } }) + + test('should have active Context menu that allows Inspection of the DAG', async ({ page }) => { + // dedicated test file to make this isolated from the rest + const testFilename = 'explorer-context-menu-test.txt' + const testCid = 'bafkqaddjnzzxazldoqwxizltoq' + + // first: create a test file + const button = 'button[id="import-button"]' + await page.waitForSelector(button, { state: 'visible' }) + await page.click(button) + await page.waitForSelector('#add-by-path', { state: 'visible' }) + page.click('button[id="add-by-path"]') + await page.waitForSelector('div[role="dialog"] input[name="name"]') + await page.fill('div[role="dialog"] input[name="path"]', `/ipfs/${testCid}`) + await page.fill('div[role="dialog"] input[name="name"]', testFilename) + await page.keyboard.press('Enter') + // expect file with matching filename to be added to the file list + await page.waitForSelector(`.File:has-text("${testFilename}")`) + + // open context menu + const cbutton = `button[aria-label="View more options for ${testFilename}"]` + await page.waitForSelector(cbutton, { state: 'visible' }) + await page.click(cbutton, { force: true }) + await page.waitForSelector('text=Inspect', { state: 'visible' }) + + // click on Inspect option + await page.waitForSelector('text=Inspect', { state: 'visible' }) + await page.locator('button:has-text("Inspect"):enabled').click({ force: true }) + + // confirm Explore screen was opened with correct CID + await page.waitForURL(`/#/explore/${testCid}`) + await page.waitForSelector('text="CID info"') + }) + }) From 56114fca51280c9383d3ef10bd303a750d002b02 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 29 Nov 2024 21:37:06 +0100 Subject: [PATCH 3/3] chore: eslint --- test/e2e/files.test.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/e2e/files.test.js b/test/e2e/files.test.js index 0f1346466..9ea7c9fbc 100644 --- a/test/e2e/files.test.js +++ b/test/e2e/files.test.js @@ -1,11 +1,10 @@ import { test } from './setup/coverage.js' -import { expect } from '@playwright/test' import { fixtureData } from './fixtures/index.js' import all from 'it-all' import filesize from 'filesize' import * as kuboRpcModule from 'kubo-rpc-client' -test.describe.serial('Files screen', () => { +test.describe('Files screen', () => { test.beforeEach(async ({ page }) => { await page.goto('/#/files') }) @@ -96,5 +95,4 @@ test.describe.serial('Files screen', () => { await page.waitForURL(`/#/explore/${testCid}`) await page.waitForSelector('text="CID info"') }) - })