From 74ecd830959ab6e226afee85444fae17a54d5f64 Mon Sep 17 00:00:00 2001 From: Lino H <64465748+LinoH5@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:47:47 +0200 Subject: [PATCH] remove pictures from show-more for location and date, unfold TagOverview (#633) * remove pictures from show-more for location and date, unfold TagOverview * fix tests --- .../bp-gallery/cypress/e2e/show-more.cy.ts | 12 ---- .../src/components/common/TagOverview.tsx | 3 + .../src/components/views/search/TagList.tsx | 5 +- .../views/show-more/ShowMoreView.tsx | 62 ++++++++++--------- .../views/show-more/ShowMoreViewHeader.tsx | 1 + 5 files changed, 40 insertions(+), 43 deletions(-) diff --git a/projects/bp-gallery/cypress/e2e/show-more.cy.ts b/projects/bp-gallery/cypress/e2e/show-more.cy.ts index 571262b1b..2020403db 100644 --- a/projects/bp-gallery/cypress/e2e/show-more.cy.ts +++ b/projects/bp-gallery/cypress/e2e/show-more.cy.ts @@ -148,12 +148,6 @@ describe('Global Show More View', () => { targetText ); }); - - // check for images in show more view - cy.contains('Mehr als 100 Bilder'); - for (const id of [2, 3, 4, 5]) { - cy.get(`.picture-grid .row #picture-preview-for-${id}`).should('exist'); - } }); it('shows show more view for single decade "70er"', () => { @@ -181,12 +175,6 @@ describe('Global Show More View', () => { `VERIFIZIERTER TESTORT ${num}` ); } - - // check for images in show more view - cy.contains('Mehr als 100 Bilder'); - for (const id of [2, 3, 4, 5]) { - cy.get(`.picture-grid .row #picture-preview-for-${id}`).should('exist'); - } }); it('shows show more for single location "Verifizierter Testort 3"', () => { diff --git a/projects/bp-gallery/src/components/common/TagOverview.tsx b/projects/bp-gallery/src/components/common/TagOverview.tsx index 0a40c7ba6..c297a97c6 100644 --- a/projects/bp-gallery/src/components/common/TagOverview.tsx +++ b/projects/bp-gallery/src/components/common/TagOverview.tsx @@ -27,6 +27,7 @@ interface TagOverviewProps { queryParams?: LocationTagFiltersInput | PersonTagFiltersInput | KeywordTagFiltersInput; thumbnailQueryParams?: PictureFiltersInput; archiveId?: string; + allowFold?: boolean; } const TagOverview = ({ @@ -37,6 +38,7 @@ const TagOverview = ({ queryParams, thumbnailQueryParams, archiveId, + allowFold, }: TagOverviewProps) => { const { t } = useTranslation(); const ref = useRef(null); @@ -114,6 +116,7 @@ const TagOverview = ({ currentItemAmount={rows ? rowLength * rows : undefined} queryParams={queryParams} thumbnailQueryParams={thumbnailQueryParams} + allowFold={allowFold} /> ) : ( { const { visit, location } = useVisit(); const { t } = useTranslation(); @@ -73,7 +75,8 @@ const TagList = ({ ); const isFoldable = Boolean( - flattenedTags && + allowFold && + flattenedTags && elementsPerRow && flattenedTags.length > MAX_ROWS_WITHOUT_FOLDING * elementsPerRow && !currentItemAmount diff --git a/projects/bp-gallery/src/components/views/show-more/ShowMoreView.tsx b/projects/bp-gallery/src/components/views/show-more/ShowMoreView.tsx index 78dc63530..5cb552508 100644 --- a/projects/bp-gallery/src/components/views/show-more/ShowMoreView.tsx +++ b/projects/bp-gallery/src/components/views/show-more/ShowMoreView.tsx @@ -82,36 +82,38 @@ const ShowMoreView = ({ flattenedTags={flattenedTags} /> - + {((categoryType !== 'location' && categoryType !== 'date') || categoryId) && ( + + )} ); diff --git a/projects/bp-gallery/src/components/views/show-more/ShowMoreViewHeader.tsx b/projects/bp-gallery/src/components/views/show-more/ShowMoreViewHeader.tsx index 6b9aab089..e74e73859 100644 --- a/projects/bp-gallery/src/components/views/show-more/ShowMoreViewHeader.tsx +++ b/projects/bp-gallery/src/components/views/show-more/ShowMoreViewHeader.tsx @@ -76,6 +76,7 @@ const ShowMoreViewHeader = ({ type={categoryType as TagType} queryParams={getCategoryQueryParams(archiveId)} archiveId={archiveId} + allowFold={false} /> );