Skip to content

Introduces Objects Grid content block and block repetition mechanism migration - #362

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

Introduces Objects Grid content block and block repetition mechanism migration#362
bertyhell wants to merge 9 commits into
release/v6.0.0from
feature/ARC-3792-objects-grid-block

Conversation

@bertyhell

@bertyhell bertyhell commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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

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.

This pull request also initiates the migration of content blocks to a new, more robust repetition mechanism (from A to B):

  • The BlockButtons component is refactored to use a fieldGroup for its repeatable elements, improving the content editor's configuration flexibility.
  • Implements a lazy data migration strategy that automatically upgrades legacy array-based content block data to the new object-with-elements format on load, ensuring backward compatibility.
  • Updates the content page editor's paste functionality to rehydrate and automatically migrate pasted blocks to the current configuration standard.

@bertyhell
bertyhell requested a review from reunefe July 20, 2026 10:08
Base automatically changed from feature/ARC-3779-validate-element-repeat-fields to release/v6.0.0 July 28, 2026 08:51
Comment on lines 87 to 91
const componentState = Array.isArray(rawComponentState)
? rawComponentState
? configExpectsArray
? rawComponentState // block not yet migrated -> keep shape A untouched
: { ...cleanConfig.components.state, elements: rawComponentState } // legacy A data, config is now B -> migrate
: { ...cleanConfig.components.state, ...rawComponentState };

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 moet toegeven dat ik dit behoorlijk onleesbaar vind 😅

Comment on lines +135 to +141
const configExpectsArray = Array.isArray(cleanConfig.components.state);
const componentState = Array.isArray(rawComponentState)
? configExpectsArray
? rawComponentState // block still on A → untouched
: { ...cleanConfig.components.state, elements: rawComponentState } // legacy A data, config now B → migrate
: { ...cleanConfig.components.state, ...rawComponentState };
```

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 gebeurd er met blokken die gemigreerd werden omdat we dit lokaal hebben draaien, maar de logica om dit te renderen nog niet op QAS? ZIjn er dan blokken die hierdoor corrupt worden?

display: grid;
grid-template-columns: repeat(var(--c-objects-grid-columns), minmax(0, 1fr));
grid-auto-rows: var(--c-objects-grid-row-height);
gap: 1.6rem;

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 variables.$g-spacer-unit

Comment on lines +24 to +27
color: colors.$color-gray-1000;
font-family: SofiaPro, sans-serif;
font-size: 2.4rem;
font-weight: 800;

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.

We gaan dit in mixins moeten steken voor consistentie

.c-block-objects-grid__tile-image {
width: 100%;
height: 100%;
object-fit: cover;

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.

Dit is correct? Ik vraag het vooral omdat sommige video's zoals die van het Vlaams parlement wat vreemd ogen 🙈

Comment on lines +62 to +65
&:focus-visible {
outline: 2px solid colors.$color-ocean-green;
outline-offset: 2px;
}

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.

Mixin enerzijds. Anderzijds lijkt deze ook absoluut in je voorbeeld niet door te komen 🙈

display: flex;
align-items: flex-start;
gap: 0.8rem;
height: 9.6rem;

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.

Is een vaste hoogte hier echt aan te raden? want dan heb je alsnog soms redelijk witruimte als de titel bv maar op 1 lijn komt. Kunnen we het niet doen zoals bij de carousel dat de afbeelding dan iets lager komt zodat het zinvol is?

Comment on lines +199 to +201
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

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.

Dit gaan we best ook in een mixin steken

Comment on lines +78 to +82
const MAX_ROWS_FOR_COLUMNS: Record<number, number> = {
4: 4, // desktop
3: 3, // tablet
2: 2, // mobile
};

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.

Klopt dit wel? Ik vind dit niet terug in de FA of het design

Comment on lines +275 to +279
{tText(
'modules/content-page/components/blocks/block-objects-grid/block-objects-grid___toon-alle',
undefined,
[HET_ARCHIEF]
)}

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.

Waarom is dit geen button? Nu wijkt dit enorm af van het design als rechthoek ipv de standaard knop 🤔

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