diff --git a/geonode_mapstore_client/client/js/components/MediaViewer/Media.jsx b/geonode_mapstore_client/client/js/components/MediaViewer/Media.jsx index 028a279135..13c7ec99ce 100644 --- a/geonode_mapstore_client/client/js/components/MediaViewer/Media.jsx +++ b/geonode_mapstore_client/client/js/components/MediaViewer/Media.jsx @@ -26,7 +26,8 @@ const loaderComponent = () =>
{ +export const MetaTags = ({siteName, title, content, logo, contentURL = window.location.href}) => { return ( - {siteName} + {title} - + @@ -13,7 +13,7 @@ export const MetaTags = ({siteName, content, logo, contentURL = window.location - + ); diff --git a/geonode_mapstore_client/client/js/components/MetaTags/__tests__/Meta-test.jsx b/geonode_mapstore_client/client/js/components/MetaTags/__tests__/Meta-test.jsx index 2030a84711..7c17f1976e 100644 --- a/geonode_mapstore_client/client/js/components/MetaTags/__tests__/Meta-test.jsx +++ b/geonode_mapstore_client/client/js/components/MetaTags/__tests__/Meta-test.jsx @@ -18,6 +18,7 @@ describe('MetaTags', () => { it('should render by default', () => { render(, document.getElementById("container")); @@ -29,6 +30,10 @@ describe('MetaTags', () => { expect(tag.content).toEqual("Test Site"); } + if (tag.property === "title") { + expect(tag.content).toEqual("Test Title"); + } + if (tag.name === "decription" || tag.name === "twitter:description") { expect(tag.content).toEqual("Test Content"); } diff --git a/geonode_mapstore_client/client/js/components/RootStyle/RootStyle.jsx b/geonode_mapstore_client/client/js/components/RootStyle/RootStyle.jsx index e5974c6ca3..ac31da158a 100644 --- a/geonode_mapstore_client/client/js/components/RootStyle/RootStyle.jsx +++ b/geonode_mapstore_client/client/js/components/RootStyle/RootStyle.jsx @@ -26,7 +26,7 @@ function buttonTheme(style, name) { includeFallbackColors: true }).toHexString(); - const borderColor = style.borderColor || tinycolor(bg).darken(8).toString(); + const borderColor = style.borderColor || bg; const focusColor = style.focusColor || color; const focusBg = style.focusBg || tinycolor(bg).darken(10).toString(); const focusBorderColor = style.focusBorderColor || tinycolor(bg).darken(25).toString(); @@ -81,6 +81,9 @@ function RootStyle({ bodyShade, placeholder, disabled, + info, + success, + warning, danger, primary, link, @@ -91,17 +94,30 @@ function RootStyle({ badge, footer, buttonDefault, - buttonPrimary + buttonPrimary, + buttonInfo, + buttonSuccess, + buttonWarning, + buttonDanger } = theme; - const color = themeColor && tinycolor.mostReadable(themeColor, ['#ffffff', '#000000'], { + + const bg = primary?.value || themeColor; + const color = primary?.contrast || bg && tinycolor.mostReadable(bg, ['#ffffff', '#000000'], { includeFallbackColors: true }).toHexString(); + + const btnPrimary = (bg || buttonPrimary) && { + ...(bg && { bg }), + ...(color && { color }), + ...buttonPrimary + }; + return { - ...(themeColor && { + ...(bg && { '--gn-primary-contrast': color, - '--gn-primary': themeColor, - '--gn-loader-primary-color': themeColor, - '--gn-loader-primary-fade-color': tinycolor(themeColor).setAlpha(0.2).toString(), + '--gn-primary': bg, + '--gn-loader-primary-color': bg, + '--gn-loader-primary-fade-color': tinycolor(bg).setAlpha(0.2).toString(), '--gn-loader-primary-contrast-color': color, '--gn-loader-primary-contrast-fade-color': tinycolor(color).setAlpha(0.2).toString() }), @@ -124,14 +140,26 @@ function RootStyle({ '--gn-disabled-color': disabled.color || '#acacac', '--gn-disabled-bg': disabled.bg || '#fcfcfc' }), - ...(danger && { - '--gn-danger-contrast': danger.contrast || '#ffffff', - '--gn-danger': danger.value || '#D0021B' - }), ...(primary && { '--gn-primary-contrast': primary.contrast || '#ffffff', '--gn-primary': primary.value || '#397AAB' }), + ...(info && { + '--gn-info-contrast': info.contrast || '#ffffff', + '--gn-info': info.value || '#639fcc' + }), + ...(success && { + '--gn-success-contrast': success.contrast || '#ffffff', + '--gn-success': success.value || '#58cf80' + }), + ...(warning && { + '--gn-warning-contrast': warning.contrast || '#ffffff', + '--gn-warning': warning.value || '#ebbc35' + }), + ...(danger && { + '--gn-danger-contrast': danger.contrast || '#ffffff', + '--gn-danger': danger.value || '#bb4940' + }), ...(link && { '--gn-link-color': link.color || '#397AAB', '--gn-link-hover-color': link.hoverColor || '#1b4d74' @@ -166,11 +194,12 @@ function RootStyle({ '--gn-footer-link-hover-color': footer.link.hoverColor || '#1b4d74' }) }), - ...buttonDefault?.bg && buttonTheme(buttonDefault), - ...(buttonPrimary?.bg || themeColor || primary?.bg) && buttonTheme({ - bg: themeColor || primary?.bg, - ...buttonPrimary - }, 'primary') + ...(buttonDefault?.bg && buttonTheme(buttonDefault)), + ...(buttonInfo?.bg && buttonTheme(buttonInfo, 'info')), + ...(buttonSuccess?.bg && buttonTheme(buttonSuccess, 'success')), + ...(buttonWarning?.bg && buttonTheme(buttonWarning, 'warning')), + ...(buttonDanger?.bg && buttonTheme(buttonDanger, 'danger')), + ...(btnPrimary?.bg && buttonTheme(btnPrimary, 'primary')) }; } return {}; diff --git a/geonode_mapstore_client/client/js/components/Spinner/Spinner.jsx b/geonode_mapstore_client/client/js/components/Spinner/Spinner.jsx index d98e216b9a..d4e0d85426 100644 --- a/geonode_mapstore_client/client/js/components/Spinner/Spinner.jsx +++ b/geonode_mapstore_client/client/js/components/Spinner/Spinner.jsx @@ -22,7 +22,7 @@ function Spinner({
diff --git a/geonode_mapstore_client/client/js/components/home/DetailsPanel.jsx b/geonode_mapstore_client/client/js/components/home/DetailsPanel.jsx index 47a3d95257..0bd9481ae7 100644 --- a/geonode_mapstore_client/client/js/components/home/DetailsPanel.jsx +++ b/geonode_mapstore_client/client/js/components/home/DetailsPanel.jsx @@ -178,7 +178,7 @@ function DetailsPanel({ }}>
- {embedUrl + {embedUrl && !editThumbnail ?