@orangelogic/orange-dam-content-browser-sdk 2.1.21 → 2.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CBSDKdemo.html +2 -2
- package/gab_extension/GAB.html +2 -2
- package/package.json +1 -1
- package/src/components/ControlBar/ControlBar.cy.tsx +55 -27
- package/src/components/ControlBar/ControlBar.tsx +180 -207
- package/src/components/ControlBar/Facet/Facet.cy.tsx +175 -24
- package/src/components/ControlBar/Facet/Facet.tsx +27 -13
- package/src/consts/data.ts +2 -0
- package/src/page/Home/Home.tsx +103 -79
- package/src/store/assets/assets.api.ts +30 -8
- package/src/store/search/search.api.ts +51 -68
- package/src/types/search.ts +14 -5
package/CBSDKdemo.html
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
|
|
8
8
|
|
|
9
|
-
<script src="https://downloads.orangelogic.com/ContentBrowserSDK/v2.1.
|
|
9
|
+
<script src="https://downloads.orangelogic.com/ContentBrowserSDK/v2.1.23/OrangeDAMContentBrowserSDK.min.js"></script>
|
|
10
10
|
<link rel="stylesheet" type="text/css"
|
|
11
|
-
href="https://downloads.orangelogic.com/ContentBrowserSDK/v2.1.
|
|
11
|
+
href="https://downloads.orangelogic.com/ContentBrowserSDK/v2.1.23/OrangeDAMContentBrowserSDK.min.css">
|
|
12
12
|
|
|
13
13
|
<style>
|
|
14
14
|
* {
|
package/gab_extension/GAB.html
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
<head>
|
|
5
5
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap">
|
|
6
|
-
<script src="https://downloads.orangelogic.com/Cortex/AssetBrowser/v2.1.
|
|
6
|
+
<script src="https://downloads.orangelogic.com/Cortex/AssetBrowser/v2.1.23/OrangeDamAssetBrowser.min.js"></script>
|
|
7
7
|
<link rel="stylesheet" type="text/css"
|
|
8
|
-
href="https://downloads.orangelogic.com/Cortex/AssetBrowser/v2.1.
|
|
8
|
+
href="https://downloads.orangelogic.com/Cortex/AssetBrowser/v2.1.23/OrangeDamAssetBrowser.min.css">
|
|
9
9
|
<style>
|
|
10
10
|
#orangelogic-GAB-browser-wrapper {
|
|
11
11
|
min-width: 382px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="cypress" />
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Facet, GridView, SortDirection } from '@/types/search';
|
|
4
4
|
import ControlBar from './ControlBar';
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
|
|
@@ -19,40 +19,70 @@ const ControlBarWrapper = () => {
|
|
|
19
19
|
|
|
20
20
|
const [isSeeThrough, setIsSeeThrough] = useState(false);
|
|
21
21
|
const [view, setView] = useState(GridView.Medium);
|
|
22
|
-
const [appliedFilter, setAppliedFilter] = useState<
|
|
22
|
+
const [appliedFilter, setAppliedFilter] = useState<Record<string, string[]>>(defaultFiltes);
|
|
23
23
|
const [sortOrder, setSortOrder] = useState('date created');
|
|
24
24
|
const [sortDirection, setSortDirection] = useState(SortDirection.Descending);
|
|
25
|
-
const [facets, setFacets] = useState<
|
|
26
|
-
|
|
27
|
-
'
|
|
28
|
-
|
|
25
|
+
const [facets, setFacets] = useState<Facet[] | undefined>([
|
|
26
|
+
{
|
|
27
|
+
'facetDetails': {
|
|
28
|
+
'displayName': 'Types',
|
|
29
|
+
'facetFieldName': 'Types',
|
|
30
|
+
},
|
|
31
|
+
'values': [
|
|
32
|
+
{
|
|
33
|
+
'displayValue': 'images',
|
|
34
|
+
'value': 'images',
|
|
35
|
+
'count': 50,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
'displayValue': 'others',
|
|
39
|
+
'value': 'others',
|
|
40
|
+
'count': 9,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
'displayValue': 'videos',
|
|
44
|
+
'value': 'videos',
|
|
45
|
+
'count': 5,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
'displayValue': '3d assets',
|
|
49
|
+
'value': '3d assets',
|
|
50
|
+
'count': 4,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
'displayValue': 'audio',
|
|
54
|
+
'value': 'audio',
|
|
55
|
+
'count': 3,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
'displayValue': 'image',
|
|
59
|
+
'value': 'image',
|
|
60
|
+
'count': 1,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
'displayValue': 'images>>image 1s',
|
|
64
|
+
'value': 'images>>image 1s',
|
|
65
|
+
'count': 1,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
'displayValue': 'images>>image 2s',
|
|
69
|
+
'value': 'images>>image 2s',
|
|
70
|
+
'count': 1,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
29
73
|
},
|
|
30
|
-
|
|
31
|
-
'Published': 7,
|
|
32
|
-
'Pending': 3,
|
|
33
|
-
},
|
|
34
|
-
extension: {
|
|
35
|
-
'.png': 3,
|
|
36
|
-
'.gif': 2,
|
|
37
|
-
'.jpg': 2,
|
|
38
|
-
'.jpeg': 2,
|
|
39
|
-
},
|
|
40
|
-
type: {
|
|
41
|
-
'Images': 7,
|
|
42
|
-
'Videos': 3,
|
|
43
|
-
},
|
|
44
|
-
});
|
|
74
|
+
]);
|
|
45
75
|
|
|
46
76
|
const onSettingChange = (
|
|
47
77
|
setting: string,
|
|
48
|
-
value: GridView | SortDirection |
|
|
78
|
+
value: GridView | SortDirection | Record<string, string[]> | string | boolean | string[],
|
|
49
79
|
) => {
|
|
50
80
|
if (setting === 'view') {
|
|
51
81
|
setView(value as GridView);
|
|
52
82
|
} else if (setting === 'isSeeThrough') {
|
|
53
83
|
setIsSeeThrough(value as boolean);
|
|
54
84
|
} else if (setting === 'filter') {
|
|
55
|
-
setAppliedFilter(value as
|
|
85
|
+
setAppliedFilter(value as Record<string, string[]>);
|
|
56
86
|
} else if (setting === 'sortOrder') {
|
|
57
87
|
setSortOrder(value as string);
|
|
58
88
|
} else if (setting === 'sortDirection') {
|
|
@@ -65,17 +95,17 @@ const ControlBarWrapper = () => {
|
|
|
65
95
|
return (
|
|
66
96
|
<div>
|
|
67
97
|
<ControlBar
|
|
98
|
+
availableFacets={[]}
|
|
68
99
|
allowSorting={true}
|
|
69
100
|
currentCount={10}
|
|
70
101
|
loading={false}
|
|
71
|
-
extensions={appliedFilter.extensions}
|
|
72
102
|
facets={facets}
|
|
73
103
|
isMobile={false}
|
|
74
104
|
isSeeThrough={isSeeThrough}
|
|
75
|
-
mediaTypes={appliedFilter.mediaTypes}
|
|
76
105
|
onSearchChange={onSearchChange}
|
|
77
106
|
onSettingChange={onSettingChange}
|
|
78
107
|
searchValue=""
|
|
108
|
+
selectedFacets={appliedFilter}
|
|
79
109
|
sortDirection={sortDirection}
|
|
80
110
|
sortOrder={sortOrder}
|
|
81
111
|
sortOrders={{
|
|
@@ -211,10 +241,8 @@ const ControlBarWrapper = () => {
|
|
|
211
241
|
},
|
|
212
242
|
],
|
|
213
243
|
}}
|
|
214
|
-
statuses={appliedFilter.statuses}
|
|
215
244
|
totalCount={200}
|
|
216
245
|
view={view}
|
|
217
|
-
visibilityClasses={appliedFilter.visibilityClasses}
|
|
218
246
|
/>
|
|
219
247
|
{searchText && <span data-cy="search-text">{searchText}</span>}
|
|
220
248
|
<span data-cy="isSeeThrough">{isSeeThrough ? 'See Through On' : 'See Through Off'}</span>
|