Skip to content

feat: Add priority to jahiaComponent#213

Merged
baptistegrimaud merged 3 commits intomainfrom
feature-add-priority-for-components
Mar 26, 2025
Merged

feat: Add priority to jahiaComponent#213
baptistegrimaud merged 3 commits intomainfrom
feature-add-priority-for-components

Conversation

@baptistegrimaud
Copy link
Copy Markdown
Contributor

@baptistegrimaud baptistegrimaud commented Mar 26, 2025

Description

Add a new priority parameter when defining components (both views and templates) to decide which component should be used when rendering a given view/template, in case several components match a given resource.
The parameter is optional and its default value is 0. It can be set to a negative or a positive number.
The component with the highest priority has precedence over the other components.

NB: the identifiers of the registered components now include the priority, only if the priority is different from the default value (0), to remain backward compatible with JS modules that might have been deployed with a prior version of Javascript Modules Engine.

Checklist

Source code

  • I've shared and documented any breaking change
  • I've reviewed and updated the jahia-depends

Tests

  • I've provided Unit and/or Integration Tests
  • I've updated the parent issue with required manual validations

Tip

Documentation to guide the reviews: How to do a code review

@baptistegrimaud baptistegrimaud marked this pull request as ready for review March 26, 2025 08:09
@baptistegrimaud baptistegrimaud requested a review from a team as a code owner March 26, 2025 08:09
@baptistegrimaud baptistegrimaud force-pushed the feature-add-priority-for-components branch from ebf86b4 to 197cebe Compare March 26, 2025 08:14
@baptistegrimaud baptistegrimaud force-pushed the feature-add-priority-for-components branch from 1366f32 to 6408ae3 Compare March 26, 2025 15:55
@baptistegrimaud baptistegrimaud enabled auto-merge (squash) March 26, 2025 15:56
@baptistegrimaud baptistegrimaud merged commit 231d4a3 into main Mar 26, 2025
8 checks passed
@baptistegrimaud baptistegrimaud deleted the feature-add-priority-for-components branch March 26, 2025 16:27
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.

Add priority to jahiaComponent definition to break a tie between several matching templates/views

3 participants