Skip to content

Commit 5861812

Browse files
dew326lserwatka
authored andcommitted
EZP-30524: Rewrite Universal Discovery Widget (#241)
* EZP-30530: Create a base for the new UDW * EZP-30525: Convert Browse Tab as a standalone ReactJS module * EZP-30526: Convert Search Tab as a standalone ReactJS module (#204) * EZP-30825: Convert Bookmarks Tab as a standalone ReactJS module (#205) * EZP-30527: Convert Create Tab as a standalone ReactJS module (#206) * EZP-30840: Use dedicated endpoints for fetching data (#218) * EZP-31043: As an Editor, I want to have breadcrumbs in grid view (#220) * EZP-30980: As an Editor, I want Create Tab to be permission aware (#223) * EZP-31065: As a Developer, I want UDW to be configurable (#226) * EZP-31151: Resizing column does not display name of content item * EZP-31153: Collapsed column displays the name of the parent * EZP-31152: Content meta preview should display language name * EZP-31147: Improve design of UDW's header * EZP-31146: Align content type icons in UDW * EZP-31145: Set font-size for content items in UDW's panels * EZP-31142: Bookmark's button in UDW's content meta preview should keep its position * EZP-31144: Improve content item title view when in UDW's grid view * EZP-31196: As a Developer, I want to set alredy selected locations in UDW (#232) * EZP-31085: As a Developer, I want ContentMetaPreview to be overridable (#233) * EZP-31032: As an Editor, I want to edit content directly from UDW (#235) * EZP-31032: As an Editor, I want to edit content directly from UDW * EZP-31215: Remove old UDW and deprecated code (#237) * EZP-31215: Remove old UDW and deprecated code * EZP-31214: As a Developer, I want UDW to be fully translatable (#239) * EZP-31244: As an Editor, I want to create content on the fly from the Dashboard (#240) * fixed confirm locations * renamed tab component to avoid conflict with form builder * fixed content select in search filters * fixed css class name
1 parent fe16223 commit 5861812

File tree

118 files changed

+4126
-5508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+4126
-5508
lines changed

.eslintrc.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"plugins": ["react", "prettier"],
2+
"plugins": ["react", "prettier", "react-hooks"],
33
"extends": ["prettier", "prettier/react", "eslint:recommended", "plugin:react/recommended"],
44
"env": {
55
"browser": true,
@@ -33,6 +33,10 @@
3333
"no-extra-boolean-cast": "off",
3434
"react/jsx-uses-react": "error",
3535
"react/jsx-uses-vars": "error",
36-
"jsx-quotes": ["error", "prefer-double"]
36+
"react/require-default-props": "warn",
37+
"jsx-quotes": ["error", "prefer-double"],
38+
"react-hooks/rules-of-hooks": "error",
39+
"react-hooks/exhaustive-deps": "warn",
40+
"react/no-unused-prop-types": "warn"
3741
}
3842
}

Resources/encore/ez.config.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
const path = require('path');
22

33
module.exports = (Encore) => {
4-
Encore.addEntry('ezplatform-admin-ui-modules-udw-js', [
5-
path.resolve(__dirname, '../../src/modules/universal-discovery/universal.discovery.module.js'),
6-
])
7-
.addEntry('ezplatform-admin-ui-modules-mfu-js', [
8-
path.resolve(__dirname, '../../src/modules/multi-file-upload/multi.file.upload.module.js'),
9-
])
10-
.addEntry('ezplatform-admin-ui-modules-subitems-js', [path.resolve(__dirname, '../../src/modules/sub-items/sub.items.module.js')])
11-
.addEntry('ezplatform-admin-ui-modules-content-tree-js', [
12-
path.resolve(__dirname, '../../src/modules/content-tree/content.tree.module.js'),
13-
]);
4+
Encore.addEntry('ezplatform-admin-ui-modules-udw-js', [
5+
path.resolve(__dirname, '../../src/modules/universal-discovery/universal.discovery.module.js'),
6+
])
7+
.addEntry('ezplatform-admin-ui-modules-udw-tabs-js', [
8+
path.resolve(__dirname, '../../src/modules/universal-discovery/browse.tab.module.js'),
9+
path.resolve(__dirname, '../../src/modules/universal-discovery/bookmarks.tab.module.js'),
10+
path.resolve(__dirname, '../../src/modules/universal-discovery/search.tab.module.js'),
11+
path.resolve(__dirname, '../../src/modules/universal-discovery/content.create.tab.module.js'),
12+
path.resolve(__dirname, '../../src/modules/universal-discovery/content.meta.preview.module.js'),
13+
])
14+
.addEntry('ezplatform-admin-ui-modules-mfu-js', [
15+
path.resolve(__dirname, '../../src/modules/multi-file-upload/multi.file.upload.module.js'),
16+
])
17+
.addEntry('ezplatform-admin-ui-modules-subitems-js', [path.resolve(__dirname, '../../src/modules/sub-items/sub.items.module.js')])
18+
.addEntry('ezplatform-admin-ui-modules-content-tree-js', [
19+
path.resolve(__dirname, '../../src/modules/content-tree/content.tree.module.js'),
20+
]);
1421
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
@import 'common/popup';
22
@import 'common/tooltip.popup';
3+
@import 'common/thumbnail';
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
@import 'universal-discovery/select.content.button';
2-
@import 'universal-discovery/bookmarks';
3-
@import 'universal-discovery/content.creator';
4-
@import 'universal-discovery/content.meta.preview';
5-
@import 'universal-discovery/content.table.pagination';
6-
@import 'universal-discovery/content.table.item';
7-
@import 'universal-discovery/content.table.header';
8-
@import 'universal-discovery/content.table';
9-
@import 'universal-discovery/choose.content.type';
10-
@import 'universal-discovery/choose.language';
11-
@import 'universal-discovery/create';
12-
@import 'universal-discovery/finder.tree.leaf';
13-
@import 'universal-discovery/finder.tree.branch';
1+
@import 'universal-discovery/main';
2+
@import 'universal-discovery/tab';
3+
@import 'universal-discovery/top.menu';
4+
@import 'universal-discovery/content.create';
5+
@import 'universal-discovery/content.create.widget';
6+
@import 'universal-discovery/content.create.button';
7+
@import 'universal-discovery/sort.switcher';
8+
@import 'universal-discovery/view.switcher';
9+
@import 'universal-discovery/menu.button';
10+
@import 'universal-discovery/tab.selector';
1411
@import 'universal-discovery/finder';
12+
@import 'universal-discovery/finder.branch';
13+
@import 'universal-discovery/finder.leaf';
14+
@import 'universal-discovery/content.meta.preview';
15+
@import 'universal-discovery/selected.locations';
16+
@import 'universal-discovery/selected.locations.item';
17+
@import 'universal-discovery/grid';
18+
@import 'universal-discovery/grid.item';
19+
@import 'universal-discovery/breadcrumbs';
1520
@import 'universal-discovery/search';
16-
@import 'universal-discovery/selected.content.item';
17-
@import 'universal-discovery/selected.content.popup';
18-
@import 'universal-discovery/selected.content';
19-
@import 'universal-discovery/panel.bookmarks';
20-
@import 'universal-discovery/panel.create';
21-
@import 'universal-discovery/panel.finder';
22-
@import 'universal-discovery/panel.search';
23-
@import 'universal-discovery/panel.tab.content';
24-
@import 'universal-discovery/tab.nav.item';
25-
@import 'universal-discovery/main';
21+
@import 'universal-discovery/content.table';
22+
@import 'universal-discovery/content.table.item';
23+
@import 'universal-discovery/toggle.selection.button';
24+
@import 'universal-discovery/filters';
25+
@import 'universal-discovery/bookmarks.list';
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.c-thumbnail {
2+
position: relative;
3+
4+
&__icon-wrapper {
5+
position: absolute;
6+
top: 0;
7+
left: 0;
8+
width: calculateRem(30px);
9+
height: calculateRem(30px);
10+
background: $ez-white;
11+
display: flex;
12+
align-items: center;
13+
justify-content: center;
14+
}
15+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.c-bookmarks-list {
2+
width: calculateRem(215px);
3+
background-color: $ez-ground-base-medium;
4+
overflow: auto;
5+
flex-shrink: 0;
6+
7+
&__item {
8+
cursor: pointer;
9+
display: flex;
10+
align-items: center;
11+
padding: calculateRem(2px) calculateRem(5px);
12+
13+
&--not-selectable {
14+
background-color: $ez-ground-base-dark;
15+
cursor: not-allowed;
16+
}
17+
18+
&--marked {
19+
background-color: $ez-color-base-medium;
20+
color: $ez-white;
21+
22+
.ez-icon {
23+
fill: $ez-white;
24+
}
25+
}
26+
}
27+
28+
&__item-name {
29+
white-space: nowrap;
30+
overflow: hidden;
31+
text-overflow: ellipsis;
32+
width: calculateRem(185px);
33+
margin-left: calculateRem(5px);
34+
}
35+
36+
&__spinner-wrapper {
37+
display: flex;
38+
justify-content: center;
39+
align-items: center;
40+
}
41+
}

Resources/public/scss/modules/universal-discovery/_bookmarks.scss

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
.c-breadcrumbs {
2+
display: flex;
3+
align-items: center;
4+
padding: 0 calculateRem(16px);
5+
height: calculateRem(30px);
6+
7+
&__hidden-list-wrapper {
8+
margin-right: 8px;
9+
position: relative;
10+
}
11+
12+
&__hidden-list {
13+
display: none;
14+
15+
&--visible {
16+
position: absolute;
17+
top: 100%;
18+
left: 0;
19+
z-index: 1;
20+
margin-bottom: 0;
21+
padding-left: 0;
22+
display: block;
23+
list-style: none;
24+
background-color: $ez-white;
25+
box-shadow: 0 calculateRem(4px) calculateRem(6px) 0 rgba(135, 135, 135, 0.35);
26+
color: $ez-color-hyperlink;
27+
padding: calculateRem(16px);
28+
}
29+
}
30+
31+
&__hidden-list-item {
32+
padding: calculateRem(4px) 0;
33+
white-space: nowrap;
34+
max-width: calculateRem(500px);
35+
text-overflow: ellipsis;
36+
overflow: hidden;
37+
cursor: pointer;
38+
}
39+
40+
&__hidden-list-toggler {
41+
height: calculateRem(20px);
42+
width: calculateRem(26px);
43+
border: calculateRem(1px) solid $ez-color-base-medium;
44+
border-radius: calculateRem(2px);
45+
display: flex;
46+
padding: 0;
47+
justify-content: center;
48+
align-items: center;
49+
50+
.ez-icon {
51+
transform: rotate(90deg);
52+
transform-origin: center center;
53+
fill: $ez-color-base-medium;
54+
}
55+
56+
&--active {
57+
background-color: $ez-color-base-medium;
58+
59+
.ez-icon {
60+
fill: $ez-white;
61+
}
62+
}
63+
}
64+
65+
&__list-wrapper {
66+
width: calc(100% - #{calculateRem(34px)});
67+
}
68+
69+
&__list {
70+
display: flex;
71+
list-style: none;
72+
padding: 0;
73+
margin-bottom: 0;
74+
}
75+
76+
&__list-item-text {
77+
text-overflow: ellipsis;
78+
overflow: hidden;
79+
white-space: nowrap;
80+
cursor: pointer;
81+
color: $ez-color-hyperlink;
82+
}
83+
84+
&__list-item {
85+
max-width: calc(100% / 3);
86+
display: flex;
87+
88+
&--last {
89+
.c-breadcrumbs__list-item-text {
90+
cursor: not-allowed;
91+
color: $ez-color-base-medium;
92+
}
93+
}
94+
}
95+
96+
&__list-item-separator {
97+
margin: 0 calculateRem(8px);
98+
}
99+
}

Resources/public/scss/modules/universal-discovery/_choose.content.type.scss

Lines changed: 0 additions & 62 deletions
This file was deleted.

Resources/public/scss/modules/universal-discovery/_choose.language.scss

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)