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-9274: Context menu does not show up in 'Location' folder #1404

Open
wants to merge 2 commits into
base: 4.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
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');
}
}
Loading