From ffcd3d636c1f3f198aa1dc1a75b5e0e0e2287850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Fri, 13 Sep 2024 09:09:25 +0100 Subject: [PATCH] feat: Add internal portal wrapper to search cards (#3666) --- api.planx.uk/package.json | 2 +- api.planx.uk/pnpm-lock.yaml | 8 +- e2e/tests/api-driven/package.json | 2 +- e2e/tests/api-driven/pnpm-lock.yaml | 8 +- e2e/tests/ui-driven/package.json | 2 +- e2e/tests/ui-driven/pnpm-lock.yaml | 8 +- editor.planx.uk/package.json | 2 +- editor.planx.uk/pnpm-lock.yaml | 11 +- editor.planx.uk/src/@planx/components/ui.tsx | 3 +- .../components/Flow/components/Portal.tsx | 7 +- .../Sidebar/Search/SearchResultCard/index.tsx | 114 +++++++++++------- 11 files changed, 101 insertions(+), 66 deletions(-) diff --git a/api.planx.uk/package.json b/api.planx.uk/package.json index 4cf6a0bfaa..cf59ad7d0f 100644 --- a/api.planx.uk/package.json +++ b/api.planx.uk/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@airbrake/node": "^2.1.8", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#2dccab9", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#bea2192", "@types/isomorphic-fetch": "^0.0.36", "adm-zip": "^0.5.10", "aws-sdk": "^2.1467.0", diff --git a/api.planx.uk/pnpm-lock.yaml b/api.planx.uk/pnpm-lock.yaml index 2a5384ddbe..71459ce07a 100644 --- a/api.planx.uk/pnpm-lock.yaml +++ b/api.planx.uk/pnpm-lock.yaml @@ -14,8 +14,8 @@ dependencies: specifier: ^2.1.8 version: 2.1.8 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#2dccab9 - version: github.com/theopensystemslab/planx-core/2dccab9 + specifier: git+https://github.com/theopensystemslab/planx-core#bea2192 + version: github.com/theopensystemslab/planx-core/bea2192 '@types/isomorphic-fetch': specifier: ^0.0.36 version: 0.0.36 @@ -6137,8 +6137,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/2dccab9: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/2dccab9} + github.com/theopensystemslab/planx-core/bea2192: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/bea2192} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/e2e/tests/api-driven/package.json b/e2e/tests/api-driven/package.json index 46faa94364..73118cf07b 100644 --- a/e2e/tests/api-driven/package.json +++ b/e2e/tests/api-driven/package.json @@ -7,7 +7,7 @@ "packageManager": "pnpm@8.6.6", "dependencies": { "@cucumber/cucumber": "^9.3.0", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#2dccab9", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#bea2192", "axios": "^1.7.4", "dotenv": "^16.3.1", "dotenv-expand": "^10.0.0", diff --git a/e2e/tests/api-driven/pnpm-lock.yaml b/e2e/tests/api-driven/pnpm-lock.yaml index c42a318f09..2a64be1400 100644 --- a/e2e/tests/api-driven/pnpm-lock.yaml +++ b/e2e/tests/api-driven/pnpm-lock.yaml @@ -9,8 +9,8 @@ dependencies: specifier: ^9.3.0 version: 9.3.0 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#2dccab9 - version: github.com/theopensystemslab/planx-core/2dccab9 + specifier: git+https://github.com/theopensystemslab/planx-core#bea2192 + version: github.com/theopensystemslab/planx-core/bea2192 axios: specifier: ^1.7.4 version: 1.7.4 @@ -2932,8 +2932,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/2dccab9: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/2dccab9} + github.com/theopensystemslab/planx-core/bea2192: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/bea2192} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/e2e/tests/ui-driven/package.json b/e2e/tests/ui-driven/package.json index b2ea1a5873..a337e13060 100644 --- a/e2e/tests/ui-driven/package.json +++ b/e2e/tests/ui-driven/package.json @@ -8,7 +8,7 @@ "postinstall": "./install-dependencies.sh" }, "dependencies": { - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#2dccab9", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#bea2192", "axios": "^1.7.4", "dotenv": "^16.3.1", "eslint": "^8.56.0", diff --git a/e2e/tests/ui-driven/pnpm-lock.yaml b/e2e/tests/ui-driven/pnpm-lock.yaml index 95f14be8bd..17fbb73582 100644 --- a/e2e/tests/ui-driven/pnpm-lock.yaml +++ b/e2e/tests/ui-driven/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#2dccab9 - version: github.com/theopensystemslab/planx-core/2dccab9 + specifier: git+https://github.com/theopensystemslab/planx-core#bea2192 + version: github.com/theopensystemslab/planx-core/bea2192 axios: specifier: ^1.7.4 version: 1.7.4 @@ -2674,8 +2674,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/2dccab9: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/2dccab9} + github.com/theopensystemslab/planx-core/bea2192: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/bea2192} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/editor.planx.uk/package.json b/editor.planx.uk/package.json index 4d678b10ca..9d83a1a725 100644 --- a/editor.planx.uk/package.json +++ b/editor.planx.uk/package.json @@ -15,7 +15,7 @@ "@mui/material": "^5.15.10", "@mui/utils": "^5.15.11", "@opensystemslab/map": "1.0.0-alpha.3", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#2dccab9", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#bea2192", "@tiptap/core": "^2.4.0", "@tiptap/extension-bold": "^2.0.3", "@tiptap/extension-bubble-menu": "^2.1.13", diff --git a/editor.planx.uk/pnpm-lock.yaml b/editor.planx.uk/pnpm-lock.yaml index 72398bb1f1..151b3d3a3b 100644 --- a/editor.planx.uk/pnpm-lock.yaml +++ b/editor.planx.uk/pnpm-lock.yaml @@ -47,8 +47,8 @@ dependencies: specifier: 1.0.0-alpha.3 version: 1.0.0-alpha.3 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#2dccab9 - version: github.com/theopensystemslab/planx-core/2dccab9(@types/react@18.2.45) + specifier: git+https://github.com/theopensystemslab/planx-core#bea2192 + version: github.com/theopensystemslab/planx-core/bea2192(@types/react@18.2.45) '@tiptap/core': specifier: ^2.4.0 version: 2.4.0(@tiptap/pm@2.0.3) @@ -21061,7 +21061,6 @@ packages: /workbox-google-analytics@6.6.0: resolution: {integrity: sha512-p4DJa6OldXWd6M9zRl0H6vB9lkrmqYFkRQ2xEiNdBFp9U0LhsGO7hsBscVEyH9H2/3eZZt8c97NB2FD9U2NJ+Q==} - deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained dependencies: workbox-background-sync: 6.6.0 workbox-core: 6.6.0 @@ -21361,9 +21360,9 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - github.com/theopensystemslab/planx-core/2dccab9(@types/react@18.2.45): - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/2dccab9} - id: github.com/theopensystemslab/planx-core/2dccab9 + github.com/theopensystemslab/planx-core/bea2192(@types/react@18.2.45): + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/bea2192} + id: github.com/theopensystemslab/planx-core/bea2192 name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/editor.planx.uk/src/@planx/components/ui.tsx b/editor.planx.uk/src/@planx/components/ui.tsx index 1ea5486a9d..e67538ad8a 100644 --- a/editor.planx.uk/src/@planx/components/ui.tsx +++ b/editor.planx.uk/src/@planx/components/ui.tsx @@ -6,6 +6,7 @@ import CloudUpload from "@mui/icons-material/CloudUpload"; import ContactPage from "@mui/icons-material/ContactPage"; import CopyAll from "@mui/icons-material/CopyAll"; import Create from "@mui/icons-material/Create"; +import DoorFrontOutlined from "@mui/icons-material/DoorFrontOutlined"; import Event from "@mui/icons-material/Event"; import FilterAltOutlined from "@mui/icons-material/FilterAltOutlined"; import FunctionsIcon from "@mui/icons-material/Functions"; @@ -74,7 +75,7 @@ export const ICONS: { [TYPES.Filter]: FilterAltOutlined, [TYPES.FindProperty]: SearchOutlined, [TYPES.Flow]: undefined, - [TYPES.InternalPortal]: undefined, + [TYPES.InternalPortal]: DoorFrontOutlined, [TYPES.List]: ListAlt, [TYPES.MapAndLabel]: ShapeLine, [TYPES.Notice]: ReportProblemOutlined, diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Portal.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Portal.tsx index c0de58e814..ab03c56bf7 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Portal.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Flow/components/Portal.tsx @@ -1,6 +1,7 @@ import { useQuery } from "@apollo/client"; -import DoorFrontOutlined from "@mui/icons-material/DoorFrontOutlined"; import MoreVert from "@mui/icons-material/MoreVert"; +import { ComponentType } from "@opensystemslab/planx-core/types"; +import { ICONS } from "@planx/components/ui"; import classNames from "classnames"; import gql from "graphql-tag"; import { useStore } from "pages/FlowEditor/lib/store"; @@ -125,6 +126,8 @@ const InternalPortal: React.FC = (props) => { copyNode(props.id); }; + const Icon = ICONS[ComponentType.InternalPortal]; + return ( <>