Skip to content

Commit

Permalink
ALW: folders managements
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Jun 6, 2024
1 parent 32c7fc8 commit 669f85a
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/bundle/Resources/public/img/icons/about.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/bundle/Resources/public/img/icons/approved.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/bundle/Resources/public/img/icons/notice.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const getContentTypeByIdentifier = (contentTypeIdentifier) => {
}

return contentTypesDataMap[contentTypeIdentifier];
}
};

const getContentTypeIconUrlByHref = (contentTypeHref) => {
if (!contentTypesDataMapByHref) {
Expand Down Expand Up @@ -109,4 +109,12 @@ const getContentTypeDataByHref = (contentTypeHref) => {
return contentTypesDataMapByHref[contentTypeHref];
};

export { getContentTypeIconUrl, getContentTypeName, getContentTypeByIdentifier, getContentTypeIconUrlByHref, getContentTypeDataByHref, getContentTypeNameByHref };
export {
createContentTypeDataMapByHref,
getContentTypeIconUrl,
getContentTypeName,
getContentTypeByIdentifier,
getContentTypeIconUrlByHref,
getContentTypeDataByHref,
getContentTypeNameByHref,
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { document: doc } = window;
import { getRootDOMElement } from './context.helper';

const NOTIFICATION_INFO_LABEL = 'info';
const NOTIFICATION_SUCCESS_LABEL = 'success';
Expand All @@ -16,9 +16,10 @@ const NOTIFICATION_ERROR_LABEL = 'error';
* @param {Object} detail.rawPlaceholdersMap
*/
const showNotification = (detail) => {
const rootDOMElement = getRootDOMElement();
const event = new CustomEvent('ibexa-notify', { detail });

doc.body.dispatchEvent(event);
rootDOMElement.dispatchEvent(event);
};

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const handleRequest = (response) => {
console.log('Handle request:', response);
if (!response.ok) {
throw Error(response.statusText);
}
Expand Down
1 change: 1 addition & 0 deletions src/bundle/Resources/public/scss/mixins/_modals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
cursor: pointer;
opacity: 1;
border: none;
background: transparent;

.ibexa-icon {
margin: 0;
Expand Down
4 changes: 4 additions & 0 deletions src/bundle/ui-dev/src/modules/common/icon/inculdedIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';

import About from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/about.svg';
import AboutInfo from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/about-info.svg';
import Approved from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/approved.svg';
import Article from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/article.svg';
import Back from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/back.svg';
import Blog from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/blog.svg';
Expand All @@ -22,6 +23,7 @@ import Form from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/form.svg
import Gallery from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/gallery.svg';
import Image from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/image.svg';
import LandingPage from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/landing_page.svg';
import Notice from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/notice.svg';
import Options from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/options.svg';
import Place from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/place.svg';
import Product from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/product.svg';
Expand All @@ -41,6 +43,7 @@ import Warning from '@ibexa-admin-ui/src/bundle/Resources/public/img/icons/warni
const iconsMap = {
about: About,
'about-info': AboutInfo,
approved: Approved,
article: Article,
back: Back,
blog: Blog,
Expand All @@ -60,6 +63,7 @@ const iconsMap = {
gallery: Gallery,
image: Image,
landing_page: LandingPage,
notice: Notice,
options: Options,
place: Place,
product: Product,
Expand Down
17 changes: 11 additions & 6 deletions src/bundle/ui-dev/src/modules/common/popup/popup.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import PropTypes from 'prop-types';
import Icon from '../icon/icon';

import { createCssClassNames } from '@ibexa-admin-ui/src/bundle/ui-dev/src/modules/common/helpers/css.class.names';
import { getTranslator, getBootstrap } from '@ibexa-admin-ui/src/bundle/Resources/public/js/scripts/helpers/context.helper';
import {
getTranslator,
getBootstrap,
getRootDOMElement,
} from '@ibexa-admin-ui/src/bundle/Resources/public/js/scripts/helpers/context.helper';

const CLASS_NON_SCROLLABLE = 'ibexa-non-scrollable';
const CLASS_MODAL_OPEN = 'modal-open';
Expand Down Expand Up @@ -32,13 +36,14 @@ const Popup = ({
extraClasses,
showTooltip,
}) => {
const rootDOMElement = getRootDOMElement();
const modalRef = useRef(null);
const Translator = getTranslator();
const bootstrap = getBootstrap();

useEffect(() => {
document.body.classList.toggle(CLASS_MODAL_OPEN, isVisible);
document.body.classList.toggle(CLASS_NON_SCROLLABLE, isVisible);
rootDOMElement.classList.toggle(CLASS_MODAL_OPEN, isVisible);
rootDOMElement.classList.toggle(CLASS_NON_SCROLLABLE, isVisible);

if (isVisible) {
showPopup();
Expand All @@ -58,7 +63,7 @@ const Popup = ({
const closeBtnLabel = Translator.trans(/*@Desc("Close")*/ 'popup.close.label', {}, 'ibexa_universal_discovery_widget');
const hidePopup = () => {
bootstrap.Modal.getOrCreateInstance(modalRef.current).hide();
document.body.classList.remove(CLASS_MODAL_OPEN, CLASS_NON_SCROLLABLE);
rootDOMElement.classList.remove(CLASS_MODAL_OPEN, CLASS_NON_SCROLLABLE);
};
const showPopup = () => {
const bootstrapModal = bootstrap.Modal.getOrCreateInstance(modalRef.current, {
Expand Down Expand Up @@ -97,14 +102,14 @@ const Popup = ({
<div className={`modal-dialog c-popup__dialog ${MODAL_SIZE_CLASS[size]}`} role="dialog">
<div className="modal-content c-popup__content">
{noHeader
? renderCloseBtn
? renderCloseBtn()
: title && (
<div className="modal-header c-popup__header">
<h3 className="modal-title c-popup__headline" title={showTooltip ? title : null}>
<span className="c-popup__title">{title}</span>
{subtitle && <span className="c-popup__subtitle">{subtitle}</span>}
</h3>
{renderCloseBtn}
{renderCloseBtn()}
</div>
)}
<div className="modal-body c-popup__body">{children}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export default class UploadPopupModule extends Component {
super(props);

this.refTooltip = React.createRef();
this.rootNode = getRootDOMElement();
this.rootDOMElement = getRootDOMElement();
}

componentDidMount() {
this.rootNode.classList.add(CLASS_SCROLL_DISABLED);
this.rootDOMElement.classList.add(CLASS_SCROLL_DISABLED);
parseTooltips(this.refTooltip.current);
}

Expand Down

0 comments on commit 669f85a

Please sign in to comment.