Skip to content

Commit

Permalink
remove pictures from show-more for location and date, unfold TagOverv…
Browse files Browse the repository at this point in the history
…iew (#633)

* remove pictures from show-more for location and date, unfold TagOverview

* fix tests
  • Loading branch information
LinoH5 authored Aug 22, 2023
1 parent f258784 commit 74ecd83
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 43 deletions.
12 changes: 0 additions & 12 deletions projects/bp-gallery/cypress/e2e/show-more.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"', () => {
Expand Down Expand Up @@ -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"', () => {
Expand Down
3 changes: 3 additions & 0 deletions projects/bp-gallery/src/components/common/TagOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface TagOverviewProps {
queryParams?: LocationTagFiltersInput | PersonTagFiltersInput | KeywordTagFiltersInput;
thumbnailQueryParams?: PictureFiltersInput;
archiveId?: string;
allowFold?: boolean;
}

const TagOverview = ({
Expand All @@ -37,6 +38,7 @@ const TagOverview = ({
queryParams,
thumbnailQueryParams,
archiveId,
allowFold,
}: TagOverviewProps) => {
const { t } = useTranslation();
const ref = useRef<HTMLDivElement | null>(null);
Expand Down Expand Up @@ -114,6 +116,7 @@ const TagOverview = ({
currentItemAmount={rows ? rowLength * rows : undefined}
queryParams={queryParams}
thumbnailQueryParams={thumbnailQueryParams}
allowFold={allowFold}
/>
) : (
<DecadesList
Expand Down
5 changes: 4 additions & 1 deletion projects/bp-gallery/src/components/views/search/TagList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const TagList = ({
currentItemAmount,
queryParams,
thumbnailQueryParams,
allowFold = true,
}: {
type: TagType;
scroll?: boolean;
Expand All @@ -38,6 +39,7 @@ const TagList = ({
currentItemAmount?: number;
queryParams?: LocationTagFiltersInput | PersonTagFiltersInput | KeywordTagFiltersInput;
thumbnailQueryParams?: PictureFiltersInput;
allowFold?: boolean;
}) => {
const { visit, location } = useVisit();
const { t } = useTranslation();
Expand Down Expand Up @@ -73,7 +75,8 @@ const TagList = ({
);

const isFoldable = Boolean(
flattenedTags &&
allowFold &&
flattenedTags &&
elementsPerRow &&
flattenedTags.length > MAX_ROWS_WITHOUT_FOLDING * elementsPerRow &&
!currentItemAmount
Expand Down
62 changes: 32 additions & 30 deletions projects/bp-gallery/src/components/views/show-more/ShowMoreView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,36 +82,38 @@ const ShowMoreView = ({
flattenedTags={flattenedTags}
/>
<ShowStats>
<PictureScrollGrid
queryParams={getPictureQueryParams(
categoryType,
categoryId,
archiveId,
collectionsInfo
)}
sortBy={
categoryType !== 'pictures' && categoryId
? ['time_range_tag.start:asc']
: categoryType === 'most-liked'
? ['likes:desc']
: ['createdAt:desc']
}
hashbase={'show-more'}
extraAdornments={showcaseAdornment ? [showcaseAdornment] : []}
bulkOperations={[
removeFromCollection,
linkToCollection,
moveToCollection,
createSequence,
bulkEdit,
...(exhibitionId ? [addToExhibition] : []),
]}
maxNumPictures={
categoryType === 'latest' || categoryType === 'most-liked' ? 500 : undefined
}
textFilter={null}
fetchPolicy='cache-and-network'
/>
{((categoryType !== 'location' && categoryType !== 'date') || categoryId) && (
<PictureScrollGrid
queryParams={getPictureQueryParams(
categoryType,
categoryId,
archiveId,
collectionsInfo
)}
sortBy={
categoryType !== 'pictures' && categoryId
? ['time_range_tag.start:asc']
: categoryType === 'most-liked'
? ['likes:desc']
: ['createdAt:desc']
}
hashbase={'show-more'}
extraAdornments={showcaseAdornment ? [showcaseAdornment] : []}
bulkOperations={[
removeFromCollection,
linkToCollection,
moveToCollection,
createSequence,
bulkEdit,
...(exhibitionId ? [addToExhibition] : []),
]}
maxNumPictures={
categoryType === 'latest' || categoryType === 'most-liked' ? 500 : undefined
}
textFilter={null}
fetchPolicy='cache-and-network'
/>
)}
</ShowStats>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const ShowMoreViewHeader = ({
type={categoryType as TagType}
queryParams={getCategoryQueryParams(archiveId)}
archiveId={archiveId}
allowFold={false}
/>
</div>
);
Expand Down

0 comments on commit 74ecd83

Please sign in to comment.