Skip to content

Commit

Permalink
after CR
Browse files Browse the repository at this point in the history
  • Loading branch information
tischsoic committed Dec 5, 2024
1 parent 3a0bd10 commit d13fcb7
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import 'universal-discovery/mixins/collapsible-arrow';
@import 'universal-discovery/mixins/filters-panel';
@import 'universal-discovery/mixins/filters-row';
@import 'universal-discovery/mixins/selected.items.panel.item';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,7 @@
border-width: calculateRem(1px) 0;
box-shadow: calculateRem(4px) calculateRem(22px) calculateRem(47px) 0 rgba($ibexa-color-info, 0.05);

&::before,
&::after {
content: '';
position: absolute;
z-index: 1;
top: 50%;
width: calculateRem(6px);
height: calculateRem(1px);
background: $ibexa-color-dark;
}

&::before {
transform: rotate(225deg);
right: calculateRem(12px);
}

&::after {
transform: rotate(-225deg);
right: calculateRem(16px);
}
@include collapsible-arrow;
}

&__content {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@mixin collapsible-arrow {
&::before,
&::after {
content: '';
position: absolute;
z-index: 1;
top: 50%;
width: calculateRem(6px);
height: calculateRem(1px);
background: $ibexa-color-dark;
}

&::before {
transform: rotate(225deg);
right: calculateRem(12px);
}

&::after {
transform: rotate(-225deg);
right: calculateRem(16px);
}
}

@mixin collapsible-arrow-collapsed-state {
&::before {
transform: rotate(135deg);
}

&::after {
transform: rotate(-135deg);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,7 @@
box-shadow: none;
border-bottom-color: transparent;

&:before {
transform: rotate(135deg);
}

&:after {
transform: rotate(-135deg);
}
@include collapsible-arrow-collapsed-state;
}

&__collapsible-content {
Expand All @@ -71,26 +65,7 @@
border-width: calculateRem(1px) 0;
box-shadow: calculateRem(4px) calculateRem(22px) calculateRem(47px) 0 rgba($ibexa-color-info, 0.05);

&::before,
&::after {
content: '';
position: absolute;
z-index: 1;
top: 50%;
width: calculateRem(6px);
height: calculateRem(1px);
background: $ibexa-color-dark;
}

&::before {
transform: rotate(225deg);
right: calculateRem(12px);
}

&::after {
transform: rotate(-225deg);
right: calculateRem(16px);
}
@include collapsible-arrow;
}

&__collapsible-content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ const FiltersPanel = ({ children, isApplyButtonEnabled, makeSearch, clearFilters
};

FiltersPanel.propTypes = {
children: PropTypes.node.isRequired,
children: PropTypes.node,
isApplyButtonEnabled: PropTypes.bool.isRequired,
makeSearch: PropTypes.func.isRequired,
clearFilters: PropTypes.func.isRequired,
};

FiltersPanel.defaultProps = {
children: null,
};

export default FiltersPanel;
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ const FiltersRow = ({ children, title, extraClasses }) => {

FiltersRow.propTypes = {
children: PropTypes.node.isRequired,
extraClasses: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
extraClasses: PropTypes.string,
};

FiltersRow.defaultProps = {
extraClasses: '',
}

export default FiltersRow;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useEffect, useMemo, useRef } from 'react';
import React, { useContext, useMemo, useRef } from 'react';

import {
parse as parseTooltip,
Expand Down Expand Up @@ -36,12 +36,14 @@ const SelectedItemsPanelItem = ({ item, thumbnailData, name, description }) => {
});
}, []);

useEffect(() => {
parseTooltip(refSelectedLocationsItem.current);
}, []);

return (
<div className="c-selected-items-panel-item" ref={refSelectedLocationsItem}>
<div
className="c-selected-items-panel-item"
ref={(node) => {
refSelectedLocationsItem.current = node;
parseTooltip(node);
}}
>
<div className="c-selected-items-panel-item__image-wrapper">
<Thumbnail thumbnailData={thumbnailData} iconExtraClasses="ibexa-icon--small" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ const SelectedItemsPanel = () => {
{selectedItems.map((selectedItem) => {
const ItemComponent = itemsComponentsMap[selectedItem.type].component;

return ItemComponent && <ItemComponent key={`${selectedItem.type}-${selectedItem.id}`} item={selectedItem} />;
if (!ItemComponent) {
throw new Error(`SelectedItemsPanel: component for ${selectedItem.type} not provided in configuration.`);
}

return <ItemComponent key={`${selectedItem.type}-${selectedItem.id}`} item={selectedItem} />;
})}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useEffect, useMemo, useRef } from 'react';
import React, { useContext, useMemo, useRef } from 'react';
import PropTypes from 'prop-types';

import {
Expand Down Expand Up @@ -38,12 +38,14 @@ const SelectedLocationsItem = ({ location, permissions }) => {
const version = location.ContentInfo.Content.CurrentVersion.Version;
const thumbnailData = version ? version.Thumbnail : {};

useEffect(() => {
parseTooltip(refSelectedLocationsItem.current);
}, []);

return (
<div className="c-selected-locations-item" ref={refSelectedLocationsItem}>
<div
className="c-selected-locations-item"
ref={(node) => {
refSelectedLocationsItem.current = node;
parseTooltip(node);
}}
>
<div className="c-selected-locations-item__image-wrapper">
<Thumbnail thumbnailData={thumbnailData} iconExtraClasses="ibexa-icon--small" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const SortSwitcher = ({ isDisabled, disabledConfig }) => {
setSorting(option.sortClause);
setSortOrder(option.sortOrder);
};

const disabledParams = {};

if (isDisabled && disabledConfig) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const usePaginableFetch = ({ itemsPerPage, extraFetchParams }, fetchFunct

useEffect(() => {
dispatch({ type: FETCH_START });

const offset = state.pageIndex * itemsPerPage;
const { abortController } = fetchFunction({ ...restInfo, limit: itemsPerPage, offset, ...extraFetchParams }, (data) =>
dispatch({ type: FETCH_END, data }),
Expand Down

0 comments on commit d13fcb7

Please sign in to comment.