-
Notifications
You must be signed in to change notification settings - Fork 0
Adds Theme Overview content block #363
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
Open
bertyhell
wants to merge
6
commits into
release/v6.0.0
Choose a base branch
from
feature/ARC-3814-theme-overview
base: release/v6.0.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4b746c4
feat(ARC-3814): theme overview block
bertyhell be0e3f4
feat(ARC-3814): basic styling fixes
bertyhell 71119ac
feat(ARC-3814): add theme tiles layout
bertyhell d3758e5
feat(ARC-3814): add colored bg behind the theme group titles
bertyhell c270145
feat(ARC-3814): add shapes in theme group title bg
bertyhell d716d59
feat(ARC-3814): move theme group section to separate component
bertyhell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -255,3 +255,7 @@ schema.graphql | |
| /.husky | ||
|
|
||
| api/.claude/ | ||
|
|
||
|
|
||
| ui/.claude/worktrees/ | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
...es/content-page/components/blocks/BlockOverviewThemes/BlockOverviewThemes.editorconfig.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| import { AvoCoreContentPickerType } from '@viaa/avo2-types'; | ||
| import { BLOCK_FIELD_DEFAULTS, BLOCK_STATE_DEFAULTS, TEXT_FIELD } from '~content-blocks/defaults'; | ||
| import { GET_FULL_HEADING_TYPE_OPTIONS } from '~modules/content-page/const/get-heading-type-options'; | ||
| import { | ||
| type ContentBlockConfig, | ||
| ContentBlockEditor, | ||
| ContentBlockType, | ||
| type DefaultContentBlockState, | ||
| } from '~modules/content-page/types/content-block.types'; | ||
| import { tText } from '~shared/helpers/translation-functions'; | ||
| import { validateRequiredValue } from '~shared/helpers/validation'; | ||
| import { HET_ARCHIEF } from '~shared/types'; | ||
|
|
||
| const INITIAL_OVERVIEW_THEMES_THEME_STATE = () => ({ | ||
| label: '', | ||
| type: AvoCoreContentPickerType.IE_OBJECT_THEME, | ||
| value: '', | ||
| }); | ||
|
|
||
| const INITIAL_OVERVIEW_THEMES_GROUP_STATE = () => ({ | ||
| title: '', | ||
| titleType: 'h2', | ||
| themes: [INITIAL_OVERVIEW_THEMES_THEME_STATE()], | ||
| }); | ||
|
|
||
| // `components.state` for a repeatable block must be an array: the editor pushes/splices entries | ||
| // into it directly (see content-edit.reducer.ts), and `ContentBlockRenderer` passes it straight | ||
| // through as the `elements` prop. | ||
| export const INITIAL_OVERVIEW_THEMES_COMPONENTS_STATE = () => [INITIAL_OVERVIEW_THEMES_GROUP_STATE()]; | ||
|
|
||
| export const INITIAL_OVERVIEW_THEMES_BLOCK_STATE = (): DefaultContentBlockState => | ||
| BLOCK_STATE_DEFAULTS(); | ||
|
|
||
| export const OVERVIEW_THEMES_BLOCK_CONFIG = (position = 0): ContentBlockConfig => ({ | ||
| position, | ||
| name: tText('modules/content-page/const/get-content-block-type-options___overzicht-themas', {}, [ | ||
| HET_ARCHIEF, | ||
| ]), | ||
| type: ContentBlockType.OverviewThemes, | ||
| components: { | ||
| name: tText( | ||
| 'modules/content-page/components/blocks/block-overview-themes/block-overview-themes___themagroep', | ||
| {}, | ||
| [HET_ARCHIEF] | ||
| ), | ||
| limits: { | ||
| min: 1, | ||
| }, | ||
| state: INITIAL_OVERVIEW_THEMES_COMPONENTS_STATE(), | ||
| fields: { | ||
| title: TEXT_FIELD( | ||
| { | ||
| label: tText( | ||
| 'modules/content-page/components/blocks/block-overview-themes/block-overview-themes___titel', | ||
| {}, | ||
| [HET_ARCHIEF] | ||
| ), | ||
| }, | ||
| tText( | ||
| 'modules/content-page/components/blocks/block-overview-themes/block-overview-themes___titel-is-verplicht', | ||
| {}, | ||
| [HET_ARCHIEF] | ||
| ) | ||
| ), | ||
| titleType: { | ||
| label: tText( | ||
| 'modules/content-page/components/blocks/block-overview-themes/block-overview-themes___titel-type', | ||
| {}, | ||
| [HET_ARCHIEF] | ||
| ), | ||
| editorType: ContentBlockEditor.Select, | ||
| editorProps: { | ||
| options: GET_FULL_HEADING_TYPE_OPTIONS(), | ||
| }, | ||
| validator: (value: string) => | ||
| validateRequiredValue( | ||
| value, | ||
| tText( | ||
| 'modules/content-page/components/blocks/block-overview-themes/block-overview-themes___titel-type-is-verplicht', | ||
| {}, | ||
| [HET_ARCHIEF] | ||
| ) | ||
| ), | ||
| }, | ||
| themes: { | ||
| label: tText( | ||
| 'modules/content-page/components/blocks/block-overview-themes/block-overview-themes___thema', | ||
| {}, | ||
| [HET_ARCHIEF] | ||
| ), | ||
| editorType: ContentBlockEditor.ContentPicker, | ||
| editorProps: { | ||
| allowedTypes: [AvoCoreContentPickerType.IE_OBJECT_THEME], | ||
| hideTypeDropdown: true, | ||
| hideTargetSwitch: true, | ||
| }, | ||
| repeat: { | ||
| defaultState: INITIAL_OVERVIEW_THEMES_THEME_STATE(), | ||
| addButtonLabel: tText( | ||
| 'modules/content-page/components/blocks/block-overview-themes/block-overview-themes___voeg-thema-toe', | ||
| {}, | ||
| [HET_ARCHIEF] | ||
| ), | ||
| deleteButtonLabel: tText( | ||
| 'modules/content-page/components/blocks/block-overview-themes/block-overview-themes___verwijder-thema', | ||
| {}, | ||
| [HET_ARCHIEF] | ||
| ), | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| block: { | ||
| state: INITIAL_OVERVIEW_THEMES_BLOCK_STATE(), | ||
| fields: { | ||
| ...BLOCK_FIELD_DEFAULTS(), | ||
| }, | ||
| }, | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is er een reden waarom deze werd toegevoegd? Gaat dit niet plots verwacht gedrag breken?