-
Notifications
You must be signed in to change notification settings - Fork 56
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
EZP-29848: Make existing AdminUI tabs extendable by allowing template path and parameters change #728
Conversation
'attr': { 'class': 'ez-toggle-btn-state', 'data-toggle-button-id': '#delete-translations-' ~ form_version_remove_archived.remove.vars.id } | ||
}) }} | ||
{% include '@ezdesign/parts/table_header.html.twig' with { headerText: 'tab.versions.archived_versions'|trans()|desc('Archived versions'), tools: tab.table_header_tools(form_version_remove_archived) } %} | ||
{% block table_wrapper_archived %} | ||
{% if archived_versions is not empty %} |
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.
Review note - this if
statement is always true
because it has been already checked a few lines above thus else
block is never reached.
{% if published_versions is not empty %} | ||
{{ include('@ezdesign/content/tab/versions/table.html.twig', { 'versions': published_versions }) }} | ||
{% else %} |
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.
Review note: Same as below.
18f2ce8
to
7628ef0
Compare
/** | ||
* @param string $tabIdentifier | ||
*/ | ||
public function setTabIdentifier(string $tabIdentifier): void |
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.
Should we change a tab identifier after creation?
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.
Good catch, no we should not.
/** | ||
* Is dispatched on tabs extending EventDispatchingAbstractTab. | ||
* | ||
* Allows to manipulate template path and parameters before rendering by Twig. |
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.
If we allow changing the identifier than the comment should be changed.
7628ef0
to
fb52fa5
Compare
Note for QA: we only need sanities here. cc @micszo |
EventDispatchingAbstractTab
which dispatchesTabEvents::ON_RENDER
event before rendering tab. This gives a flexibility of changing template and accessing parameters to modify them.TODO
EventDispatchingAbstractTab
in other tabs after validating idea on code review