Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading