Skip to content

Commit

Permalink
Added Bookmarsk to Image Picker
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Aug 23, 2024
1 parent bab28a8 commit d013818
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 122 deletions.
9 changes: 9 additions & 0 deletions src/bundle/Resources/config/universal_discovery_widget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ system:
browse:
items_per_page: 50
priority: 30
image_picker_tabs_config:
image_picker:
id: 'image_picker'
priority: 40
hidden: false
image_picker_bookmarks:
id: 'image_picker_bookmarks'
priority: 50
hidden: false

# These inherit _default configuration
create:
Expand Down
1 change: 1 addition & 0 deletions src/bundle/Resources/public/scss/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@import 'mixins/containers';
@import 'mixins/drag-and-drop';
@import 'mixins/spinner';
@import 'mixins/tab-selector';

@mixin datetime-field() {
&.is-invalid {
Expand Down
43 changes: 43 additions & 0 deletions src/bundle/Resources/public/scss/mixins/_tab-selector.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@mixin tab-selector {
&__item {
height: calculateRem(48px);
width: calculateRem(48px);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border-radius: $ibexa-border-radius;
margin: calculateRem(12px) calculateRem(8px) calculateRem(24px);
position: relative;

.ibexa-icon {
fill: $ibexa-color-black;
}

&--selected {
background-color: $ibexa-color-light-400;

.ibexa-icon {
fill: $ibexa-color-black;
}
}

&:not(:first-of-type) {
&:before {
content: '';
position: absolute;
top: calculateRem(-12px);
left: calculateRem(12px);
height: calculateRem(1.5px);
width: calculateRem(24px);
background-color: $ibexa-color-dark-200;
}
}

&:hover {
.ibexa-icon {
fill: $ibexa-color-primary;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
.c-tab-selector {
&__item {
height: calculateRem(48px);
width: calculateRem(48px);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border-radius: $ibexa-border-radius;
margin: calculateRem(12px) calculateRem(8px) calculateRem(24px);
position: relative;

.ibexa-icon {
fill: $ibexa-color-black;
}

&--selected {
background-color: $ibexa-color-light-400;

.ibexa-icon {
fill: $ibexa-color-black;
}
}

&:not(:first-of-type) {
&:before {
content: '';
position: absolute;
top: calculateRem(-12px);
left: calculateRem(12px);
height: calculateRem(1.5px);
width: calculateRem(24px);
background-color: $ibexa-color-dark-200;
}
}

&:hover {
.ibexa-icon {
fill: $ibexa-color-primary;
}
}
}
@include tab-selector();
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const useSearchByQueryFetch = () => {
filters = {},
fullTextCriterion = null,
contentNameCriterion = null,
isBookmarked = null,
) => {
const handleFetch = (response) => {
dispatchLoadedLocationsAction({ type: 'CLEAR_LOCATIONS' });
Expand Down Expand Up @@ -75,6 +76,10 @@ export const useSearchByQueryFetch = () => {
query.SubtreeCriterion = subtreePathString;
}

if (isBookmarked) {
query.IsBookmarkedCriterion = isBookmarked;
}

const isImageCriterionDataEmpty = !imageCriterionData || Object.keys(imageCriterionData).length === 0;

if (!isImageCriterionDataEmpty) {
Expand Down
Loading

0 comments on commit d013818

Please sign in to comment.