Skip to content
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

IBX-380: Cannot deselect the subtree in Admin -> Roles #1757

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
event.preventDefault();

const config = JSON.parse(event.currentTarget.dataset.udwConfig);
const { inputSelector } = event.currentTarget.dataset;
const selectedLocations = doc.querySelector(inputSelector).value;
const selectedLocationsIds = selectedLocations ? selectedLocations.split(',') : [];

ReactDOM.render(
React.createElement(eZ.modules.UniversalDiscovery, {
onConfirm: selectSubtreeConfirm.bind(this),
onCancel: closeUDW,
multiple: true,
selectedLocations: selectedLocationsIds,
...config,
}),
udwContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

{% block form %}
{{ form_start(form) }}

<section>
<div class="card ez-card ez-card--light">
<div class="ez-card__header ez-card__header--secondary">
Expand Down Expand Up @@ -112,7 +111,12 @@
{{ form_widget(form.limitation_type.location, {'label': 'limitation_type.subtree'|trans|desc('Subtree'), 'attr': {'class': 'ez-limitations__radio ez-input ez-input--radio', 'data-disable-selector': '#role_assignment_create_locations_select_content'}, 'label_attr': {'class': 'ez-limitations__label radio-inline'}}) }}
{{ form_widget(form.locations) }}
<div class="ez-limitations__item-subtree">
<button id="role_assignment_create_locations_select_content" data-udw-config="{{ ez_udw_config('multiple', {}) }}" class="btn btn-secondary ez-btn--select-subtree"{% if not form.limitation_type.location.vars.checked %} disabled{% endif %}>
<button
id="role_assignment_create_locations_select_content"
data-input-selector="#{{ form.locations.vars.id }}"
data-udw-config="{{ ez_udw_config('multiple', {}) }}"
class="btn btn-secondary ez-btn--select-subtree"{% if not form.limitation_type.location.vars.checked %} disabled{% endif %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if is outside of the classes, shouldn't be in the next line?

>
<svg class="ez-icon ez-icon--select-subtree ez-icon--medium ez-icon--light">
<use xlink:href="{{ ez_icon_path('relations') }}"></use>
</svg>
Expand Down