ARC-3792 object grid (without repeat blocks migration) - #380
Conversation
| // 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; |
There was a problem hiding this comment.
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
| 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 | ||
| ); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
veelvouden van $g-spacer-unit alsook de font mixins gebruiken. Of is het hier geen sofiaPro?
| 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; | ||
| } |
There was a problem hiding this comment.
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
| const [fixedObjects, objects] = await Promise.all([ | ||
| getFixedObjects(fixedItems), | ||
| searchQuery ? searchIeObjects(apiSearchQueryParams) : Promise.resolve([]), | ||
| ]); |
There was a problem hiding this comment.
Kan je die niet in 1 call samen doen en dan mappn naar de ids? Kwestie van maar 1 api call uit te sturen?
There was a problem hiding this comment.
Misschien dat deze beter verhuist naar de shared?
| const TYPE_ICON_NAME: Partial<Record<ObjectsGridItemType, IconNameType>> = { | ||
| [ObjectsGridItemType.Video]: 'video', | ||
| [ObjectsGridItemType.Audio]: 'audio', | ||
| [ObjectsGridItemType.Newspaper]: 'newspaper', | ||
| }; |
There was a problem hiding this comment.
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 }; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
Wat met de speciale gevallen zoals meemoo logo of zwart-wit?
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


ObjectsGridcontent block, allowing users to display a dynamic grid of media objects:clientSearchUrlToApiSearchUrlconfiguration service.