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-1761: Updated UDW design #271

Merged
merged 2 commits into from
Jan 31, 2022
Merged
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
4 changes: 2 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"tabWidth": 4,
"semi": true,
"bracketSpacing": true,
"jsxBracketSameLine": true,
"jsxBracketSameLine": false,
"arrowParens": "always",
"singleQuote": true,
"trailingComma": "es5"
"trailingComma": "all"
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
<note>key: copy.title</note>
</trans-unit>
<trans-unit id="a7d7c06aff739180272f50e51f2100e7b5d9cfbf" resname="create_content.create">
<source>Create</source>
<target state="new">Create</target>
<source>Create new</source>
<target state="new">Create new</target>
<note>key: create_content.create</note>
</trans-unit>
<trans-unit id="23fa7d97ea65916659849b0ed9b1e148df62fd08" resname="create_content.label">
Expand Down Expand Up @@ -331,6 +331,11 @@
<target state="new">Date</target>
<note>key: sorting.date.label</note>
</trans-unit>
<trans-unit id="e1b82af5205b4a015ab41b8cb2dc25b1da231c49" resname="sorting.date.selected_label">
<source>Sort by date</source>
<target state="new">Sort by date</target>
<note>key: sorting.date.selected_label</note>
</trans-unit>
<trans-unit id="7e978afd229113429d273612c01318f09e3f3e5e" resname="sorting.grid.view">
<source>Grid view</source>
<target state="new">Grid view</target>
Expand All @@ -341,11 +346,21 @@
<target state="new">Name A-Z</target>
<note>key: sorting.name.asc.label</note>
</trans-unit>
<trans-unit id="6c71d76f0da0637f44eac88dd809c31bb715b4f0" resname="sorting.name.asc.selected_label">
<source>Sort by name A-Z</source>
<target state="new">Sort by name A-Z</target>
<note>key: sorting.name.asc.selected_label</note>
</trans-unit>
<trans-unit id="e0373d48c538c2f5ae4a1d735763336ad2f2ed3f" resname="sorting.name.desc.label">
<source>Name Z-A</source>
<target state="new">Name Z-A</target>
<note>key: sorting.name.desc.label</note>
</trans-unit>
<trans-unit id="072c390dc9ab7ae7099b664732b67c3fae44cf3e" resname="sorting.name.desc.selected_label">
<source>Sort by name Z-A</source>
<target state="new">Sort by name Z-A</target>
<note>key: sorting.name.desc.selected_label</note>
</trans-unit>
<trans-unit id="27c00b5da502fe6afe6b76e59ddeb951bbbf2c6f" resname="sorting.panels.view">
<source>Panels view</source>
<target state="new">Panels view</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ const ContentCreateButton = ({ isDisabled }) => {

if (!selectedLocation && loadedLocationsMap.length) {
selectedLocation = loadedLocationsMap[loadedLocationsMap.length - 1].subitems.find(
(subitem) => subitem.location.id === markedLocationId
(subitem) => subitem.location.id === markedLocationId,
);
}

const contentTypeInfo = contentTypesMap[selectedLocation?.location?.ContentInfo.Content.ContentType._href];
const contentTypeInfo = contentTypesMap[(selectedLocation?.location?.ContentInfo.Content.ContentType._href)];
const isAllowedLocation = selectedLocation && (!allowedLocations || allowedLocations.includes(selectedLocation.parentLocationId));
const hasAccess =
!selectedLocation ||
Expand All @@ -53,9 +53,9 @@ const ContentCreateButton = ({ isDisabled }) => {
className="c-content-create-button__btn btn ibexa-btn ibexa-btn--dark"
disabled={isDisabled || !hasAccess || !isAllowedLocation || isLimitReached || !isContainer}
onClick={toggleContentCreateVisibility}
data-tooltip-container-selector=".c-top-menu"
title={createLabel}>
<Icon name="create" extraClasses="ibexa-icon--small" /> {createLabel}
>
<Icon name="create" extraClasses="ibexa-icon--small" />
<span className="ibexa-btn__label">{createLabel}</span>
</button>
</div>
);
Expand All @@ -78,7 +78,7 @@ ibexa.addConfig(
component: ContentCreateButton,
},
],
true
true,
);

export default ContentCreateButton;
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const SimpleDropdown = ({ options, selectedOption, onOptionClick, isDisabled })
return (
<div className={dropdownClass} ref={containerRef}>
<div className="c-udw-simple-dropdown__selected" onClick={toggleExpanded}>
<span>{selectedOption.label}</span>
<span>{selectedOption.selectedLabel ?? selectedOption.label}</span>
{getCaretIcon()}
</div>
<div className="c-udw-simple-dropdown__items">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,26 @@ const ContentMetaPreview = () => {
window.location.href = window.Routing.generate(
'ibexa.content.view',
{ contentId: location.ContentInfo.Content._id, locationId: location.id },
true
true,
);
};
const renderActions = () => {
const previewLabel = Translator.trans(/*@Desc("Preview")*/ 'meta_preview.preview', {}, 'universal_discovery_widget');
const editLabel = Translator.trans(/*@Desc("Edit")*/ 'meta_preview.edit', {}, 'universal_discovery_widget');
const bookmarksAddLabel = Translator.trans(/*@Desc("Add to bookmarks")*/ 'meta_preview.bookmarks_add', {}, 'universal_discovery_widget');
const bookmarksRemoveLabel = Translator.trans(/*@Desc("Remove from bookmarks")*/ 'meta_preview.bookrmarks_remove', {}, 'universal_discovery_widget');
const bookmarksAddLabel = Translator.trans(
/*@Desc("Add to bookmarks")*/ 'meta_preview.bookmarks_add',
{},
'universal_discovery_widget',
);
const bookmarksRemoveLabel = Translator.trans(
/*@Desc("Remove from bookmarks")*/ 'meta_preview.bookrmarks_remove',
{},
'universal_discovery_widget',
);

const previewButton = allowRedirects ? (
<div className="c-content-meta-preview__action-item">
<button
className="c-content-meta-preview__preview-button btn ibexa-btn ibexa-btn--ghost"
onClick={previewContent}
>
<button className="c-content-meta-preview__preview-button btn ibexa-btn ibexa-btn--ghost" onClick={previewContent}>
<Icon name="view" extraClasses="ibexa-icon--small" />
{previewLabel}
</button>
Expand All @@ -75,12 +80,7 @@ const ContentMetaPreview = () => {
<div className="c-content-meta-preview__actions">
{previewButton}
<div className="c-content-meta-preview__action-item">
<ContentEditButton
location={location}
version={version}
isDisabled={!hasAccess}
label={editLabel}
/>
<ContentEditButton location={location} version={version} isDisabled={!hasAccess} label={editLabel} />
</div>
<div className="c-content-meta-preview__action-item">
<button
Expand Down Expand Up @@ -114,11 +114,15 @@ const ContentMetaPreview = () => {
<div className="c-content-meta-preview__details">
<div className="c-content-meta-preview__details-item">
<div className="c-content-meta-preview__details-item-row">{lastModifiedLabel}</div>
<div className="c-content-meta-preview__details-item-row">{formatShortDateTime(new Date(location.ContentInfo.Content.lastModificationDate))}</div>
<div className="c-content-meta-preview__details-item-row">
{formatShortDateTime(new Date(location.ContentInfo.Content.lastModificationDate))}
</div>
</div>
<div className="c-content-meta-preview__details-item">
<div className="c-content-meta-preview__details-item-row">{creationDateLabel}</div>
<div className="c-content-meta-preview__details-item-row">{formatShortDateTime(new Date(location.ContentInfo.Content.publishedDate))}</div>
<div className="c-content-meta-preview__details-item-row">
{formatShortDateTime(new Date(location.ContentInfo.Content.publishedDate))}
</div>
</div>
<div className="c-content-meta-preview__details-item">
<div className="c-content-meta-preview__details-item-row">{translationsLabel}</div>
Expand Down
Loading