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-5854: Unified cookies names #917

Merged
merged 2 commits into from
Sep 28, 2023
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
6 changes: 3 additions & 3 deletions src/bundle/Resources/public/js/scripts/sidebar/main.menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
}
};
const setWidthOfSecondLevelMenu = () => {
const secondLevelMenuWidth = ibexa.helpers.cookies.getCookie('second_menu_width');
const secondLevelMenuWidth = ibexa.helpers.cookies.getCookie('ibexa_menu-secondary-width');
const isSecondLevelMenuHidden = secondLevelMenuNode.classList.contains('ibexa-main-menu__navbar--hidden');

if (!secondLevelMenuWidth || isSecondLevelMenuHidden) {
Expand All @@ -81,7 +81,7 @@
const isSecondLevelMenuCollapsed = secondLevelMenuNode.classList.contains('ibexa-main-menu__navbar--collapsed');
const newMenuWidth = isSecondLevelMenuCollapsed ? SECOND_LEVEL_EXPANDED_WIDTH : SECOND_LEVEL_COLLAPSED_WIDTH;

ibexa.helpers.cookies.setBackOfficeCookie('second_menu_width', newMenuWidth);
ibexa.helpers.cookies.setBackOfficeCookie('ibexa_menu-secondary-width', newMenuWidth);
setWidthOfSecondLevelMenu();
};
const parsePopup = (button) => {
Expand Down Expand Up @@ -131,7 +131,7 @@
const resizeValue = secondMenuLevelCurrentWidth + (clientX - resizeStartPositionX);
const newMenuWidth = resizeValue > SECOND_LEVEL_MANUAL_RESIZE_MIN_WIDTH ? resizeValue : SECOND_LEVEL_COLLAPSED_WIDTH;

ibexa.helpers.cookies.setBackOfficeCookie('second_menu_width', newMenuWidth);
ibexa.helpers.cookies.setBackOfficeCookie('ibexa_menu-secondary-width', newMenuWidth);
setWidthOfSecondLevelMenu();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{% block body_class %}ibexa-content-view{% endblock %}

{% block content_tree %}
{% set container_width_cookie = 'ibexa-tb-ibexa-content-tree-%d-container-width'|format(ibexa_admin_ui_config.user.user.id) %}
{% set container_width_cookie = 'ibexa-tb_ibexa-content-tree_%d_container-width'|format(ibexa_admin_ui_config.user.user.id) %}
{% set content_tree_width = app.request.cookies.get(container_width_cookie) %}
{% set content_tree_width_style = 'width: %dpx;'|format(content_tree_width) %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% trans_default_domain 'adaptive_filters' %}

{% if filters_id is defined %}
{% set expanded_info_cookie_name = 'ibexa_adaptive_filters-is_expanded-' ~ filters_id %}
{% set expanded_info_cookie_name = 'ibexa-af_is-expanded_' ~ filters_id|replace({'_': '-'}) %}
{% endif %}

{% set is_expanded_cookie = expanded_info_cookie_name is defined and app.request.cookies.get(expanded_info_cookie_name) == 'true' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block root %}
{% set resizer_width = 10 %}
{% set second_level_manual_resize_min_width = 80 %}
{% set second_level_menu_width = app.request.cookies.get('second_menu_width') %}
{% set second_level_menu_width = app.request.cookies.get('ibexa_menu-secondary-width') %}
{% set second_menu_width_style = '' %}
{% set second_menu_list_width_style = '' %}
{% set extra_class = 'ibexa-main-menu__navbar--hidden' %}
Expand Down