Skip to content

ARC-3792 object grid (without repeat blocks migration) - #380

Open
bertyhell wants to merge 13 commits into
release/v6.0.0from
feature/ARC-3792-objects-grid-block-2
Open

ARC-3792 object grid (without repeat blocks migration)#380
bertyhell wants to merge 13 commits into
release/v6.0.0from
feature/ARC-3792-objects-grid-block-2

Conversation

@bertyhell

@bertyhell bertyhell commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

jira ticket:
https://meemoo.atlassian.net/browse/ARC-3792

oude pr (met repeat block migration code)
#362

example page:
http://localhost:3200/admin/content-paginas/af27aac8-40e9-4503-bf91-34892f49fc12

Adds the new ObjectsGrid content block, allowing users to display a dynamic grid of media objects:
2026-07-20_11-56-08
2026-07-20_11-55-58

  • Configurable with an optional title, a HetArchief.be search URL, and up to three fixed (pinned) media objects.
  • Displays a responsive grid that adjusts column count, tile height, and intelligently packs fixed objects with dynamic random results from the search query.
  • Integrates with the search API by converting client-side search URLs into API request bodies via a new clientSearchUrlToApiSearchUrl configuration service.
  • Includes comprehensive styling to handle different media types (video, audio, newspaper, image) and provide a polished user experience.

// block) into an ie-objects search API request body. Lives in the config so the client's
// own url-filter-mapping logic (used by its search page) can be reused here, without the
// admin-core needing to depend on the client package.
clientSearchUrlToApiSearchUrl: (searchQuery: string) => IeObjectsSearchBody;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ik vermoed dat je dit weer gaat moeten enablen in de client ook. Die PR was reeds gemerged, maar kon niet builden met die logica erin. Dus die method is in de client in commentaar gezet:
https://github.com/viaacode/hetarchief-client/blob/337147ef288338079be3929d37b73947dd562506/src/modules/admin/wrappers/admin-core-config.tsx#L221

Comment on lines +80 to +92
display: flex;
align-items: center;
justify-content: center;
background-color: colors.$color-gray-900;

// Fixed waveform look for audio, which has no thumbnail.
background-image: repeating-linear-gradient(
90deg,
colors.$color-gray-400 0,
colors.$color-gray-400 2px,
transparent 2px,
transparent 8px
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dat zijn die nieuwe waveforms? Daar hebben we een apart ticket voor. Ik zou voorstellen de nieuwe volledig in een aparte component te steken zodat we die kunnen hergebruiken. Enerzijds met een vaste achtergrondkleur, anderzijds met de optie de achtergrondkleur te randomizen. Al zou ik prefereren dat we dat allemaal in dat aparte ticket steken en voor nu de oude audiowave gebruiken

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

veelvouden van $g-spacer-unit alsook de font mixins gebruiken. Of is het hier geen sofiaPro?

Comment on lines +31 to +45
switch ((format || '').toLowerCase()) {
case 'video':
case 'film':
return ObjectsGridItemType.Video;
case 'audio':
return ObjectsGridItemType.Audio;
case 'newspaper':
case 'krant':
return ObjectsGridItemType.Newspaper;
case 'image':
case 'photo':
return ObjectsGridItemType.Image;
default:
return undefined;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dat gaan we best in een util steken want dat steekt inmiddels al op een aantal plaatsen.
Blijkbaar bestaat er al een mapToMediaType en ook de thema reels hebben deels hier al logica voor

Comment on lines +128 to +131
const [fixedObjects, objects] = await Promise.all([
getFixedObjects(fixedItems),
searchQuery ? searchIeObjects(apiSearchQueryParams) : Promise.resolve([]),
]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kan je die niet in 1 call samen doen en dan mappn naar de ids? Kwestie van maar 1 api call uit te sturen?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misschien dat deze beter verhuist naar de shared?

Comment on lines +36 to +40
const TYPE_ICON_NAME: Partial<Record<ObjectsGridItemType, IconNameType>> = {
[ObjectsGridItemType.Video]: 'video',
[ObjectsGridItemType.Audio]: 'audio',
[ObjectsGridItemType.Newspaper]: 'newspaper',
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Er zit iets analoogs in de thema reels
We gaan dit dan best in een shared util steken

return 2;
};

type OrderedTile = { item: ObjectsGridItem; isFixed: boolean };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hoort dit niet beter thuis buiten de component?

const visibleRows = packTilesIntoRows(tiles, columns);

const lastRow = visibleRows[visibleRows.length - 1];
const lastRowUsedColumns = lastRow?.reduce((sum, tile) => sum + (tile.isFixed ? 2 : 1), 0) ?? 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ik mis hier iets van comments bij, want als ik dit zou moeten aanpassen dan snap ik hier niets van 😆

return (
<section
className={clsx('c-block-objects-grid', className)}
style={backgroundColor ? { backgroundColor } : undefined}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wat met de speciale gevallen zoals meemoo logo of zwart-wit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants