From db3535b69830f0b86dc47d76e9c544494e550ddb Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Sat, 23 Aug 2025 22:39:09 +0200 Subject: [PATCH] added external profile url --- app/src/pages/MapContainer.tsx | 10 +++++++--- app/vite.config.ts | 2 +- .../Subcomponents/ItemPopupComponents/PopupButton.tsx | 4 +++- lib/src/types/Item.d.ts | 1 + lib/src/types/ItemType.d.ts | 1 + 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/src/pages/MapContainer.tsx b/app/src/pages/MapContainer.tsx index 9818286e..0d6bb54b 100644 --- a/app/src/pages/MapContainer.tsx +++ b/app/src/pages/MapContainer.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unnecessary-condition */ /* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ + /* eslint-disable import/no-relative-parent-imports */ /* eslint-disable array-callback-return */ /* eslint-disable new-cap */ @@ -47,7 +47,7 @@ function MapContainer({ layers, map }: { layers: LayerProps[]; map: any }) { setApis((current) => [ ...current, { - id: layer.id!, + id: layer.id, api: new itemsApi('items', layer.id, undefined, { _or: [ { @@ -115,7 +115,11 @@ function MapContainer({ layers, map }: { layers: LayerProps[]; map: any }) { {layer.itemType.show_start_end && } {layer.itemType.show_profile_button && ( - + )} {layer.itemType.show_text && } diff --git a/app/vite.config.ts b/app/vite.config.ts index 2be6ed48..a5dec8e8 100644 --- a/app/vite.config.ts +++ b/app/vite.config.ts @@ -11,7 +11,7 @@ const __dirname = path.dirname(new URL(import.meta.url).pathname) export default defineConfig({ server: { host: true, - port: 5174, + port: 5175, /** * https: { * key: fs.readFileSync(path.resolve(__dirname, 'localhost-key.pem')), diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupButton.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupButton.tsx index 119262b5..134d98ab 100644 --- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupButton.tsx +++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/PopupButton.tsx @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-unnecessary-condition */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ +import { get } from 'radash' import { Link } from 'react-router-dom' import { useGetItemTags } from '#components/Map/hooks/useTags' @@ -22,9 +23,10 @@ export const PopupButton = ({ }) => { const params = new URLSearchParams(window.location.search) const getItemTags = useGetItemTags() + const parameter = get(item, parameterField ?? 'id') return ( - +