Skip to content

Commit

Permalink
IBX-9274: Context menu does not show up in 'Location' folder (#1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti authored Jan 24, 2025
1 parent b0b6c98 commit c513b2c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
23 changes: 17 additions & 6 deletions src/bundle/Resources/public/scss/ui/modules/common/_spinner.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
@use 'sass:list';

.c-spinner {
@include spinner(calculateRem(26px), calculateRem(3px), $ibexa-color-primary);
$color-variants: (
'--primary': $ibexa-color-primary,
'--light': $ibexa-color-white,
);

&--small {
@include spinner(calculateRem(16px), calculateRem(2px), $ibexa-color-primary);
}
$size-variants: (
'--small': calculateRem(16px) calculateRem(2px),
'--medium': calculateRem(26px) calculateRem(3px),
'--large': calculateRem(86px) calculateRem(6px),
);

&--large {
@include spinner(calculateRem(86px), calculateRem(6px), $ibexa-color-primary);
@each $size-modifier, $sizes in $size-variants {
@each $color-modifier, $color in $color-variants {
&#{$size-modifier}.c-spinner#{$color-modifier} {
@include spinner(list.nth($sizes, 1), list.nth($sizes, 2), $color);
}
}
}
}
10 changes: 9 additions & 1 deletion src/bundle/ui-dev/src/modules/common/spinner/spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,29 @@ export const SIZES = {
LARGE: 'large',
};

const Spinner = ({ size }) => {
export const COLOR_VARIANTS = {
PRIMARY: 'primary',
LIGHT: 'light',
};

const Spinner = ({ size, colorVariant }) => {
const className = createCssClassNames({
'c-spinner': true,
[`c-spinner--${size}`]: true,
[`c-spinner--${colorVariant}`]: true,
});

return <div className={className} />;
};

Spinner.propTypes = {
size: PropTypes.oneOf(Object.values(SIZES)),
colorVariant: PropTypes.oneOf(Object.values(COLOR_VARIANTS)),
};

Spinner.defaultProps = {
size: SIZES.MEDIUM,
colorVariant: COLOR_VARIANTS.PRIMARY,
};

export default Spinner;
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,18 @@ final class LocationListDataVisitor extends AbstractLocationDataVisitor
public function visit(Visitor $visitor, Generator $generator, $data): void
{
$generator->startObjectElement('LocationList');
$generator->startList('locations');

foreach ($data->getLocationList() as $locationList) {
$generator->startList('locations');

$generator->startHashElement('locationWithPermissions');

$this->buildLocationNode($locationList['location'], $generator, $visitor);
$this->buildPermissionNode($locationList['permissions'], $generator);

$generator->endHashElement('locationWithPermissions');

$generator->endList('locations');
}

$generator->endList('locations');
$generator->endObjectElement('LocationList');
}
}

0 comments on commit c513b2c

Please sign in to comment.