From 8a5b91e40c253f29fa2887f0d45b7541732b26b6 Mon Sep 17 00:00:00 2001 From: Marlo Longley Date: Mon, 6 Jan 2025 14:27:13 -0500 Subject: [PATCH 1/3] Change required type for panels to Object --- src/components/WindowSideBarButtons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/WindowSideBarButtons.js b/src/components/WindowSideBarButtons.js index 7bf1ab3f09..72639f1abf 100644 --- a/src/components/WindowSideBarButtons.js +++ b/src/components/WindowSideBarButtons.js @@ -171,7 +171,7 @@ WindowSideBarButtons.propTypes = { hasCurrentLayers: PropTypes.bool, hasSearchResults: PropTypes.bool, hasSearchService: PropTypes.bool, - panels: PropTypes.arrayOf(PropTypes.bool), + panels: PropTypes.objectOf(PropTypes.bool), PluginComponents: PropTypes.array, // eslint-disable-line react/forbid-prop-types sideBarPanel: PropTypes.string, }; From 713460384d62c08c3704136881ea8360ca0d0f9e Mon Sep 17 00:00:00 2001 From: Marlo Longley Date: Mon, 6 Jan 2025 14:28:15 -0500 Subject: [PATCH 2/3] Remove required props in favor of conditional for IIIF auth --- src/components/IIIFAuthentication.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/IIIFAuthentication.js b/src/components/IIIFAuthentication.js index b680592cb5..8535070dc8 100644 --- a/src/components/IIIFAuthentication.js +++ b/src/components/IIIFAuthentication.js @@ -8,7 +8,7 @@ import WindowAuthenticationBar from '../containers/WindowAuthenticationBar'; * Opens a new window for click */ export function IIIFAuthentication({ - accessTokenServiceId, authServiceId, confirm = undefined, description = undefined, + accessTokenServiceId = undefined, authServiceId = undefined, confirm = undefined, description = undefined, failureDescription = undefined, failureHeader = undefined, features = 'centerscreen', handleAuthInteraction, header = undefined, isInteractive = true, label = undefined, logoutConfirm = undefined, logoutServiceId = undefined, openWindow = window.open, @@ -16,6 +16,9 @@ export function IIIFAuthentication({ status = null, windowId, }) { const { t } = useTranslation(); + + if (!accessTokenServiceId || !authServiceId) return null; + /** */ const onReceiveAccessTokenMessage = (payload) => { resolveAccessTokenRequest(authServiceId, accessTokenServiceId, payload); @@ -95,8 +98,6 @@ export function IIIFAuthentication({ ); }; - if (!authServiceId) return null; - if (status === null) return renderLogin(); if (status === 'cookie') return renderLoggingInCookie(); if (status === 'token') return renderLoggingInToken(); @@ -107,8 +108,8 @@ export function IIIFAuthentication({ } IIIFAuthentication.propTypes = { - accessTokenServiceId: PropTypes.string.isRequired, - authServiceId: PropTypes.string.isRequired, + accessTokenServiceId: PropTypes.string, + authServiceId: PropTypes.string, confirm: PropTypes.string, description: PropTypes.string, failureDescription: PropTypes.string, From 1b4c943603f25aa38de452f712fd1ea81adb69b4 Mon Sep 17 00:00:00 2001 From: Marlo Longley Date: Tue, 7 Jan 2025 13:36:19 -0500 Subject: [PATCH 3/3] Remove requirement for maxWidth and maxHeight props --- src/components/IIIFThumbnail.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/IIIFThumbnail.js b/src/components/IIIFThumbnail.js index 2feea6651a..ee56d2f287 100644 --- a/src/components/IIIFThumbnail.js +++ b/src/components/IIIFThumbnail.js @@ -23,7 +23,7 @@ const Image = styled('img', { name: 'IIIFThumbnail', slot: 'image' })(() => ({ */ const LazyLoadedImage = ({ border = false, placeholder, style = {}, thumbnail = null, - resource, maxHeight, maxWidth, thumbnailsConfig = {}, ...props + resource, maxHeight = null, maxWidth = null, thumbnailsConfig = {}, ...props }) => { const { ref, inView } = useInView(); const [loaded, setLoaded] = useState(false); @@ -117,8 +117,8 @@ const LazyLoadedImage = ({ LazyLoadedImage.propTypes = { border: PropTypes.bool, - maxHeight: PropTypes.number.isRequired, - maxWidth: PropTypes.number.isRequired, + maxHeight: PropTypes.number, + maxWidth: PropTypes.number, placeholder: PropTypes.string.isRequired, resource: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types style: PropTypes.object, // eslint-disable-line react/forbid-prop-types