diff --git a/CHANGELOG b/CHANGELOG index 257286238cd011071efdf9245b3198d6ea64141b..52071d512097f1957a207502fa468eb985d4233f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ minerva-front (18.0.7) stable; urgency=medium * Bug fix: export to image did not include overlays (#326) + * Bug fix: missing logos added (#329) -- Piotr Gawron <piotr.gawron@uni.lu> Wed, 11 Dec 2024 13:00:00 +0200 diff --git a/package-lock.json b/package-lock.json index 095755a0ce24cb37dcab4f11d2e44f77c1c55dcc..95f24b71f0c3f09769d4a7ee77c0d414281ef51a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "react-redux": "8.1.3", "sonner": "1.4.3", "tailwind-merge": "1.14.0", - "tailwindcss": "3.3.3", + "tailwindcss": "3.4.13", "ts-deepmerge": "6.2.0", "use-debounce": "9.0.4", "uuid": "9.0.1", @@ -13020,19 +13020,19 @@ } }, "node_modules/tailwindcss": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz", - "integrity": "sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==", + "version": "3.4.13", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.13.tgz", + "integrity": "sha512-KqjHOJKogOUt5Bs752ykCeiwvi0fKVkr5oqsFNt/8px/tA8scFPIlkygsf6jXrfCqGHz7VflA6+yytWuM+XhFw==", "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", "chokidar": "^3.5.3", "didyoumean": "^1.2.2", "dlv": "^1.1.3", - "fast-glob": "^3.2.12", + "fast-glob": "^3.3.0", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.18.2", + "jiti": "^1.21.0", "lilconfig": "^2.1.0", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", @@ -23497,19 +23497,19 @@ "integrity": "sha512-3mFKyCo/MBcgyOTlrY8T7odzZFx+w+qKSMAmdFzRvqBfLlSigU6TZnlFHK0lkMwj9Bj8OYU+9yW9lmGuS0QEnQ==" }, "tailwindcss": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz", - "integrity": "sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==", + "version": "3.4.13", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.13.tgz", + "integrity": "sha512-KqjHOJKogOUt5Bs752ykCeiwvi0fKVkr5oqsFNt/8px/tA8scFPIlkygsf6jXrfCqGHz7VflA6+yytWuM+XhFw==", "requires": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", "chokidar": "^3.5.3", "didyoumean": "^1.2.2", "dlv": "^1.1.3", - "fast-glob": "^3.2.12", + "fast-glob": "^3.3.0", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.18.2", + "jiti": "^1.21.0", "lilconfig": "^2.1.0", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", diff --git a/package.json b/package.json index 01cbb2f8ec4d291eb0b10649c12f4cd8edbd1a43..9255d88b67d7001f9cf2b666f3a63e5a3377b822 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "react-redux": "8.1.3", "sonner": "1.4.3", "tailwind-merge": "1.14.0", - "tailwindcss": "3.3.3", + "tailwindcss": "3.4.13", "ts-deepmerge": "6.2.0", "use-debounce": "9.0.4", "uuid": "9.0.1", diff --git a/src/components/Map/Map.component.tsx b/src/components/Map/Map.component.tsx index 72d18ebf86457d7f39ad4298f86ed6a3adea8395..033ebd2f1c402a05f77104f836ffb3cd36a6aa4d 100644 --- a/src/components/Map/Map.component.tsx +++ b/src/components/Map/Map.component.tsx @@ -1,8 +1,9 @@ import { Drawer } from '@/components/Map/Drawer'; import { Legend } from '@/components/Map/Legend'; +import { MapAdditionalLogos } from '@/components/Map/MapAdditionalLogos'; +import { MapViewer } from '@/components/Map/MapViewer'; import { MapAdditionalActions } from './MapAdditionalActions'; import { MapAdditionalOptions } from './MapAdditionalOptions'; -import { MapViewer } from './MapViewer/MapViewer.component'; import { PluginsDrawer } from './PluginsDrawer'; export const Map = (): JSX.Element => ( @@ -16,5 +17,6 @@ export const Map = (): JSX.Element => ( <MapViewer /> <Legend /> <MapAdditionalActions /> + <MapAdditionalLogos /> </div> ); diff --git a/src/components/Map/MapAdditionalLogos/MapAdditionalLogos.component.tsx b/src/components/Map/MapAdditionalLogos/MapAdditionalLogos.component.tsx new file mode 100644 index 0000000000000000000000000000000000000000..51b29d2d5f3dac64aef4aa2e60c09e9ec7cb67c8 --- /dev/null +++ b/src/components/Map/MapAdditionalLogos/MapAdditionalLogos.component.tsx @@ -0,0 +1,51 @@ +/* eslint-disable @next/next/no-img-element */ +import { twMerge } from 'tailwind-merge'; +import { + leftLogoImgValSelector, + leftLogoLinkValSelector, + leftLogoTextValSelector, + rightLogoImgValSelector, + rightLogoLinkValSelector, + rightLogoTextValSelector, +} from '@/redux/configuration/configuration.selectors'; +import { useAppSelector } from '@/redux/hooks/useAppSelector'; +import { LinkButton } from '@/shared/LinkButton'; + +export const MapAdditionalLogos = (): JSX.Element => { + const leftLink = useAppSelector(leftLogoLinkValSelector); + const leftText = useAppSelector(leftLogoTextValSelector); + const leftImage = useAppSelector(leftLogoImgValSelector); + + const rightLink = useAppSelector(rightLogoLinkValSelector); + const rightText = useAppSelector(rightLogoTextValSelector); + const rightImage = useAppSelector(rightLogoImgValSelector); + + return ( + <div className={twMerge('absolute bottom-6 left-[102px] grid grid-cols-2 gap-4')}> + {leftLink && ( + <LinkButton + type="button" + className="flex h-auto max-h-20 w-auto max-w-20 cursor-pointer items-center justify-center border-0 bg-gray-200 bg-opacity-20 hover:bg-gray-300 hover:bg-opacity-30" + data-testid="location-button" + title={leftText} + href={leftLink} + target="_blank" + > + <img alt={leftText} src={leftImage} /> + </LinkButton> + )} + {rightLink && ( + <LinkButton + type="button" + className="flex h-auto max-h-20 w-auto max-w-20 cursor-pointer items-center justify-center border-0 bg-gray-200 bg-opacity-20 hover:bg-gray-300 hover:bg-opacity-30" + data-testid="location-button" + title={rightText} + href={rightLink} + target="_blank" + > + <img alt={rightText} src={rightImage} /> + </LinkButton> + )} + </div> + ); +}; diff --git a/src/components/Map/MapAdditionalLogos/index.ts b/src/components/Map/MapAdditionalLogos/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..6ea9ee3139424b623b6496569f9727fa6b41e124 --- /dev/null +++ b/src/components/Map/MapAdditionalLogos/index.ts @@ -0,0 +1 @@ +export { MapAdditionalLogos } from './MapAdditionalLogos.component'; diff --git a/src/redux/configuration/configuration.constants.ts b/src/redux/configuration/configuration.constants.ts index 032c5e0b8ac380663f285a5a651914757cf015ab..25ff1216b5a4f8f5b115c56a3bc8dc4b455b4de6 100644 --- a/src/redux/configuration/configuration.constants.ts +++ b/src/redux/configuration/configuration.constants.ts @@ -7,6 +7,12 @@ export const SEARCH_DISTANCE_NAME_ID = 'SEARCH_DISTANCE'; export const REQUEST_ACCOUNT_EMAIL = 'REQUEST_ACCOUNT_EMAIL'; export const TERMS_OF_SERVICE_ID = 'TERMS_OF_USE'; export const COOKIE_POLICY_URL = 'COOKIE_POLICY_URL'; +export const LEFT_LOGO_IMG = 'LEFT_LOGO_IMG'; +export const LEFT_LOGO_LINK = 'LEFT_LOGO_LINK'; +export const LEFT_LOGO_TEXT = 'LEFT_LOGO_TEXT'; +export const RIGHT_LOGO_IMG = 'RIGHT_LOGO_IMG'; +export const RIGHT_LOGO_LINK = 'RIGHT_LOGO_LINK'; +export const RIGHT_LOGO_TEXT = 'RIGHT_LOGO_TEXT'; export const LEGEND_FILE_NAMES_IDS = [ 'LEGEND_FILE_1', diff --git a/src/redux/configuration/configuration.selectors.ts b/src/redux/configuration/configuration.selectors.ts index 01a9eb4c2d3437da7a252dc310d1353b020b490a..8677cadba6dc53baf30c37b98a4f0487948560d3 100644 --- a/src/redux/configuration/configuration.selectors.ts +++ b/src/redux/configuration/configuration.selectors.ts @@ -20,6 +20,12 @@ import { REQUEST_ACCOUNT_EMAIL, TERMS_OF_SERVICE_ID, COOKIE_POLICY_URL, + LEFT_LOGO_IMG, + LEFT_LOGO_LINK, + LEFT_LOGO_TEXT, + RIGHT_LOGO_IMG, + RIGHT_LOGO_LINK, + RIGHT_LOGO_TEXT, } from './configuration.constants'; import { ConfigurationHandlersIds, ConfigurationImageHandlersIds } from './configuration.types'; @@ -151,3 +157,29 @@ export const loadingConfigurationMainSelector = createSelector( configurationSelector, state => state?.main?.loading, ); + +export const leftLogoImgValSelector = createSelector( + configurationOptionsSelector, + state => configurationAdapterSelectors.selectById(state, LEFT_LOGO_IMG)?.value, +); +export const leftLogoLinkValSelector = createSelector( + configurationOptionsSelector, + state => configurationAdapterSelectors.selectById(state, LEFT_LOGO_LINK)?.value, +); +export const leftLogoTextValSelector = createSelector( + configurationOptionsSelector, + state => configurationAdapterSelectors.selectById(state, LEFT_LOGO_TEXT)?.value, +); + +export const rightLogoImgValSelector = createSelector( + configurationOptionsSelector, + state => configurationAdapterSelectors.selectById(state, RIGHT_LOGO_IMG)?.value, +); +export const rightLogoLinkValSelector = createSelector( + configurationOptionsSelector, + state => configurationAdapterSelectors.selectById(state, RIGHT_LOGO_LINK)?.value, +); +export const rightLogoTextValSelector = createSelector( + configurationOptionsSelector, + state => configurationAdapterSelectors.selectById(state, RIGHT_LOGO_TEXT)?.value, +);