From 5ac2933fbf8a6e75e28bb1050dfed14ead61b9f4 Mon Sep 17 00:00:00 2001 From: Shlok Amin Date: Thu, 17 Oct 2024 13:16:50 -0400 Subject: [PATCH 01/22] fix(labware-library): make labware creator accessible via external links (#16480) Fixes https://opentrons.atlassian.net/browse/RESC-339 --- labware-library/Makefile | 1 - labware-library/create/index.html | 16 +++++ .../cypress/e2e/labware-creator/create.cy.js | 2 +- .../e2e/labware-creator/customTubeRack.cy.js | 2 +- .../e2e/labware-creator/fileImport.cy.js | 2 +- .../e2e/labware-creator/reservoir.cy.js | 2 +- .../cypress/e2e/labware-creator/tipRack.cy.js | 2 +- .../e2e/labware-creator/tubesBlock.cy.js | 4 +- .../e2e/labware-creator/tubesRack.cy.js | 6 +- .../e2e/labware-creator/wellPlate.cy.js | 2 +- labware-library/renderStatic.js | 62 ------------------- .../LabwareList/CustomLabwareCard.tsx | 3 +- .../components/LabwareList/LabwareCard.tsx | 3 +- .../src/components/Nav/Breadcrumbs.tsx | 3 +- .../src/components/Sidebar/LabwareGuide.tsx | 6 +- .../website-navigation/SubdomainNav.tsx | 3 +- labware-library/src/filters.tsx | 3 +- labware-library/src/index.tsx | 11 ++-- .../labware-creator/components/IntroCopy.tsx | 5 +- labware-library/src/public-path.ts | 14 ----- labware-library/vite.config.mts | 7 +++ 21 files changed, 46 insertions(+), 113 deletions(-) create mode 100644 labware-library/create/index.html delete mode 100644 labware-library/renderStatic.js delete mode 100644 labware-library/src/public-path.ts diff --git a/labware-library/Makefile b/labware-library/Makefile index 2ccca5f45a8..a074edd4092 100644 --- a/labware-library/Makefile +++ b/labware-library/Makefile @@ -25,7 +25,6 @@ clean: dist: export NODE_ENV := production dist: vite build - node ./renderStatic.js # development assets server .PHONY: dev diff --git a/labware-library/create/index.html b/labware-library/create/index.html new file mode 100644 index 00000000000..84c7c4cb7d3 --- /dev/null +++ b/labware-library/create/index.html @@ -0,0 +1,16 @@ + + + + + + Redirecting to Labware Creator + + + +

Redirecting to Labware Creator...

+ + \ No newline at end of file diff --git a/labware-library/cypress/e2e/labware-creator/create.cy.js b/labware-library/cypress/e2e/labware-creator/create.cy.js index b81026d003a..299a3444a86 100644 --- a/labware-library/cypress/e2e/labware-creator/create.cy.js +++ b/labware-library/cypress/e2e/labware-creator/create.cy.js @@ -4,7 +4,7 @@ context('The Labware Creator Landing Page', () => { beforeEach(() => { - cy.visit('/create') + cy.visit('/#/create') cy.viewport('macbook-15') }) diff --git a/labware-library/cypress/e2e/labware-creator/customTubeRack.cy.js b/labware-library/cypress/e2e/labware-creator/customTubeRack.cy.js index f3c195030be..319e7f4ea81 100644 --- a/labware-library/cypress/e2e/labware-creator/customTubeRack.cy.js +++ b/labware-library/cypress/e2e/labware-creator/customTubeRack.cy.js @@ -6,7 +6,7 @@ const expectedExportFixture = context('Tubes and Rack', () => { before(() => { - cy.visit('/create') + cy.visit('/#/create') cy.viewport('macbook-15') }) diff --git a/labware-library/cypress/e2e/labware-creator/fileImport.cy.js b/labware-library/cypress/e2e/labware-creator/fileImport.cy.js index 408e6fc1ea2..e0fc480107f 100644 --- a/labware-library/cypress/e2e/labware-creator/fileImport.cy.js +++ b/labware-library/cypress/e2e/labware-creator/fileImport.cy.js @@ -4,7 +4,7 @@ const importedLabwareFile = 'TestLabwareDefinition.json' describe('File Import', () => { before(() => { - cy.visit('/create') + cy.visit('/#/create') cy.viewport('macbook-15') }) diff --git a/labware-library/cypress/e2e/labware-creator/reservoir.cy.js b/labware-library/cypress/e2e/labware-creator/reservoir.cy.js index c88044d1678..75197208859 100644 --- a/labware-library/cypress/e2e/labware-creator/reservoir.cy.js +++ b/labware-library/cypress/e2e/labware-creator/reservoir.cy.js @@ -4,7 +4,7 @@ context('Reservoirs', () => { before(() => { - cy.visit('/create') + cy.visit('/#/create') cy.viewport('macbook-15') }) diff --git a/labware-library/cypress/e2e/labware-creator/tipRack.cy.js b/labware-library/cypress/e2e/labware-creator/tipRack.cy.js index 4d633ffd5f6..e69e3dd7285 100644 --- a/labware-library/cypress/e2e/labware-creator/tipRack.cy.js +++ b/labware-library/cypress/e2e/labware-creator/tipRack.cy.js @@ -5,7 +5,7 @@ const expectedExportFixture = '../fixtures/generic_1_tiprack_20ul.json' describe('Create a Tip Rack', () => { before(() => { - cy.visit('/create') + cy.visit('/#/create') cy.viewport('macbook-15') }) it('Should create a tip rack', () => { diff --git a/labware-library/cypress/e2e/labware-creator/tubesBlock.cy.js b/labware-library/cypress/e2e/labware-creator/tubesBlock.cy.js index b891aedafd2..66ea8d0dedc 100644 --- a/labware-library/cypress/e2e/labware-creator/tubesBlock.cy.js +++ b/labware-library/cypress/e2e/labware-creator/tubesBlock.cy.js @@ -4,7 +4,7 @@ context('Tubes and Block', () => { beforeEach(() => { - cy.visit('/create') + cy.visit('/#/create') cy.viewport('macbook-15') cy.get('label') @@ -445,7 +445,7 @@ context('Tubes and Block', () => { }) it('tests the whole form and file export', () => { - cy.visit('/create') + cy.visit('/#/create') cy.viewport('macbook-15') cy.get('label') .contains('What type of labware are you creating?') diff --git a/labware-library/cypress/e2e/labware-creator/tubesRack.cy.js b/labware-library/cypress/e2e/labware-creator/tubesRack.cy.js index 738124ee2e8..4214f215dc0 100644 --- a/labware-library/cypress/e2e/labware-creator/tubesRack.cy.js +++ b/labware-library/cypress/e2e/labware-creator/tubesRack.cy.js @@ -5,7 +5,7 @@ context('Tubes and Rack', () => { describe('Six tubes', () => { before(() => { - cy.visit('/create') + cy.visit('/#/create') cy.viewport('macbook-15') cy.get('label') .contains('What type of labware are you creating?') @@ -137,7 +137,7 @@ context('Tubes and Rack', () => { describe('Fifteen tubes', () => { before(() => { - cy.visit('/create') + cy.visit('/#/create') cy.viewport('macbook-15') cy.get('label') @@ -268,7 +268,7 @@ context('Tubes and Rack', () => { describe('Twentyfour tubes', () => { before(() => { - cy.visit('/create') + cy.visit('/#/create') cy.viewport('macbook-15') cy.get('label') diff --git a/labware-library/cypress/e2e/labware-creator/wellPlate.cy.js b/labware-library/cypress/e2e/labware-creator/wellPlate.cy.js index d586f8040b6..5b27cfcfd72 100644 --- a/labware-library/cypress/e2e/labware-creator/wellPlate.cy.js +++ b/labware-library/cypress/e2e/labware-creator/wellPlate.cy.js @@ -8,7 +8,7 @@ context('Well Plates', () => { before(() => { - cy.visit('/create') + cy.visit('/#/create') cy.viewport('macbook-15') }) diff --git a/labware-library/renderStatic.js b/labware-library/renderStatic.js deleted file mode 100644 index b3fa4262d3c..00000000000 --- a/labware-library/renderStatic.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict' -// Use react-snap to crawl from the specified URL paths and prerender HTML for those pages. -// Since paths to JS/CSS assets are relative to webpack publicPath, and not relative to -// the location of the page being prerendered, those src/href paths need to be prefixed with -// the correct number of `../`'s to reference the project root. -// -// For example, the output of react-snap for a page at http://localhost:PORT/path/to/page/ -// will have a