1701// @ts-expect-error ST-2949_21702part => part.root === true && part.uid == window.tCatalogInitialStorepartUid[recid]1703);1704// TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551)1705// @ts-expect-error ST-2949_11706var getСurrentPart = options.parts?.storePartsShowLevel === 'subs' && !isAllPart;1707// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)1708// @ts-expect-error ST-2949_21709var parts;1710if (getСurrentPart) {1711// TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046)
// @ts-expect-error ST-2949_5 if (/* ST-1754 для открытия на всех */ isNewPartsUsed(rec)) { // Добавляет текущий раздел в начало как root без subparts. // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 var currentPart = obj.parts?.[0] ? Object.assign({}, obj.parts[0]) : null; if (currentPart) { currentPart.root = true; // Помечаем, что это не настоящий корневой раздел, а текущий раздел на его месте currentPart.isCurrentPartAsRoot = true; delete currentPart.subparts; } parts = currentPart ? // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 [currentPart].concat(obj.parts?.[0]?.subparts || []) : // @ts-expect-error ST-2949_1 obj.parts?.[0]?.subparts; } else { // @ts-expect-error ST-2949_1 parts = obj.parts?.[0]?.subparts; } } else { // @ts-expect-error ST-2949_1 parts = obj.parts; } // Добавляем проверку для отрисовки навигации по разделам: // - parts должен быть массивом и содержать хотя бы один элемент: // - - для вывода "Всех разделов" в parts имеем список разделов и мы выводим навигацию если есть хотябы 1 элемент // - - для вывода "Подразделов текущего раздела" в parts имеем список подразделов и выводим навигацию если есть хотябы 1 элемент // - навигация по разделам не должна быть уже на странице (js-catalog-parts-switcher) // - не не должна быть включенной настройка скрытия разделов (hideStoreParts) if ( Array.isArray(parts) && parts.length > 0 && // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 !rec.querySelector('.js-catalog-parts-switcher') && !options.hideStoreParts ) { // @ts-expect-error ST-2949_1 window.tCatalogParts[recid] = parts; var onLoadFilters = function () { t_catalog_onFuncLoad('t_catalog_addStoreParts', function () { // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) // @ts-expect-error ST-2949_2 t_catalog_addStoreParts(recid, options, parts); // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592) // @ts-expect-error ST-2949_4 t_catalog_setActiveStorePart(recid); // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 if (options?.breadcrumbs?.hasBreadcrumbs) { t_catalog_breadcrumbs__update(recid, options); } }); }; t_catalog__loadTildaCatalogFilters().then(() => onLoadFilters()); } // Определяем UID раздела "Все" // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 const isStorePartsShowTopLevel = options.parts && options.parts.storePartsShowLevel === 'top'; // @ts-expect-error ST-2949_1 window.tCatalogAllStorepartUid[recid] = isStorePartsShowTopLevel ? window.tCatalogParts?.[recid]?.find(part => part.root)?.uid?.toString() : // @ts-expect-error ST-2949_1 window.tCatalogInitialStorepartUid[recid]; // add filters // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 if (!window.tCatalogFilters) { // @ts-expect-error ST-2949_1 window.tCatalogFilters = {}; } // @ts-expect-error ST-2949_1 if (obj.filters) { // @ts-expect-error ST-2949_1 window.tCatalogFilters[recid] = obj.filters; } // @ts-expect-error ST-2949_1 var data = window.tCatalogFilters[recid]; // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) // @ts-expect-error ST-2949_5