@griddo/ax 11.6.4-rc.0 → 11.6.4-rc.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@griddo/ax",
3
3
  "description": "Griddo Author Experience",
4
- "version": "11.6.4-rc.0",
4
+ "version": "11.6.4-rc.1",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
@@ -223,5 +223,5 @@
223
223
  "publishConfig": {
224
224
  "access": "public"
225
225
  },
226
- "gitHead": "dd3ade3a44df6c4f8af9401839546a5b510b6de6"
226
+ "gitHead": "0d987fe049e3d4561dae0aa1cb5356ef1d6878cf"
227
227
  }
@@ -39,19 +39,26 @@ const TableHeader = (props: IProps): JSX.Element => {
39
39
 
40
40
  const CategoryColumns =
41
41
  isGlobalPages &&
42
- categoryColumns.map(
43
- (col) =>
42
+ categoryColumns.map((col) => {
43
+ return (
44
44
  activeColumns.includes(col.key) && (
45
- <S.HeaderWrapper key={col.key}>
46
- <CategoryFilter
47
- filterItems={filterItems}
48
- structuredData={col}
49
- value={filterValues.categories}
50
- siteID={siteID}
51
- />
52
- </S.HeaderWrapper>
45
+ <React.Fragment key={col.key}>
46
+ {col.type === "AsyncCheckGroup" ? (
47
+ <S.HeaderWrapper>
48
+ <CategoryFilter
49
+ filterItems={filterItems}
50
+ structuredData={col}
51
+ value={filterValues.categories}
52
+ siteID={siteID}
53
+ />
54
+ </S.HeaderWrapper>
55
+ ) : (
56
+ <S.ColumnHeader>{col.title}</S.ColumnHeader>
57
+ )}
58
+ </React.Fragment>
53
59
  )
54
- );
60
+ );
61
+ });
55
62
 
56
63
  return (
57
64
  <S.TableHeader isScrolling={isScrolling}>
@@ -74,6 +74,11 @@ const HeaderWrapper = styled.div`
74
74
  position: relative;
75
75
  `;
76
76
 
77
+ const ColumnHeader = styled(Header)`
78
+ flex: 0 0 150px;
79
+ justify-content: center;
80
+ `;
81
+
77
82
  export {
78
83
  TableHeader,
79
84
  CheckHeader,
@@ -87,4 +92,5 @@ export {
87
92
  HeaderWrapper,
88
93
  GlobalMark,
89
94
  TypeHeader,
95
+ ColumnHeader,
90
96
  };
@@ -5,7 +5,17 @@ import { useTheme } from "styled-components";
5
5
 
6
6
  import { useAdaptiveText, useModal, usePermission } from "@ax/hooks";
7
7
  import { getHumanLastModifiedDate, getScheduleFormatDate, getTemplateDisplayName, slugify } from "@ax/helpers";
8
- import { IPage, ISite, ISavePageParams, ICheck, IColumn, IPageLanguage, IDataPack, ILanguage } from "@ax/types";
8
+ import {
9
+ IPage,
10
+ ISite,
11
+ ISavePageParams,
12
+ ICheck,
13
+ IColumn,
14
+ IPageLanguage,
15
+ IDataPack,
16
+ ILanguage,
17
+ ISchemaField,
18
+ } from "@ax/types";
9
19
  import { pageStatus, ISetCurrentPageIDAction } from "@ax/containers/PageEditor/interfaces";
10
20
  import {
11
21
  CheckField,
@@ -478,8 +488,21 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
478
488
 
479
489
  const secondaryDeleteModalAction = { title: "Cancel", onClick: toggleDeleteModal };
480
490
 
481
- const CategoryColumns = categoryColumns.map((col: any) => {
491
+ const CategoryColumns = categoryColumns.map((col) => {
492
+ if (!activeColumns.includes(col.key)) {
493
+ return <></>;
494
+ }
495
+
482
496
  const type: any = structuredDataContent && structuredDataContent[col.key];
497
+
498
+ if (typeof type === "string") {
499
+ return (
500
+ <S.ColumnCell key={col.key} onClick={goToPage}>
501
+ {type}
502
+ </S.ColumnCell>
503
+ );
504
+ }
505
+
483
506
  const categories: string[] = !type
484
507
  ? []
485
508
  : Array.isArray(type)
@@ -487,14 +510,12 @@ const PageItem = (props: IPageItemProps): JSX.Element => {
487
510
  : [type.label || type.title];
488
511
 
489
512
  return (
490
- activeColumns.includes(col.key) && (
491
- <CategoryCell
492
- key={col.key}
493
- categories={categories}
494
- categoryColors={categoryColors}
495
- addCategoryColors={addCategoryColors}
496
- />
497
- )
513
+ <CategoryCell
514
+ key={col.key}
515
+ categories={categories}
516
+ categoryColors={categoryColors}
517
+ addCategoryColors={addCategoryColors}
518
+ />
498
519
  );
499
520
  });
500
521
 
@@ -689,7 +710,7 @@ interface IPageItemProps {
689
710
  activatedTemplates: any[];
690
711
  toggleToast(): void;
691
712
  setRemovedPage(pageID: number): void;
692
- categoryColumns: any[];
713
+ categoryColumns: ISchemaField[];
693
714
  columns: IColumn[];
694
715
  categoryColors: any;
695
716
  addCategoryColors(cats: string[]): void;
@@ -194,6 +194,12 @@ const ModalContent = styled.div`
194
194
  padding: ${(p) => p.theme.spacing.m};
195
195
  `;
196
196
 
197
+ const ColumnCell = styled(Cell)`
198
+ flex: 0 0 150px;
199
+ position: relative;
200
+ align-items: center;
201
+ `;
202
+
197
203
  export {
198
204
  CheckCell,
199
205
  NameCell,
@@ -218,4 +224,5 @@ export {
218
224
  GlobalCell,
219
225
  Mark,
220
226
  Home,
227
+ ColumnCell,
221
228
  };
@@ -44,9 +44,15 @@ const TableHeader = (props: IProps): JSX.Element => {
44
44
  categoryColumns.map(
45
45
  (col) =>
46
46
  activeColumns.includes(col.key) && (
47
- <S.HeaderWrapper key={col.key}>
48
- <CategoryFilter filterItems={filterItems} value={filterCategories} structuredData={col} siteID={null} />
49
- </S.HeaderWrapper>
47
+ <React.Fragment key={col.key}>
48
+ {col.type === "AsyncCheckGroup" ? (
49
+ <S.HeaderWrapper key={col.key}>
50
+ <CategoryFilter filterItems={filterItems} value={filterCategories} structuredData={col} siteID={null} />
51
+ </S.HeaderWrapper>
52
+ ) : (
53
+ <S.ColumnHeader>{col.title}</S.ColumnHeader>
54
+ )}
55
+ </React.Fragment>
50
56
  )
51
57
  );
52
58
 
@@ -64,6 +64,11 @@ const HeaderWrapper = styled.div`
64
64
  position: relative;
65
65
  `;
66
66
 
67
+ const ColumnHeader = styled(Header)`
68
+ flex: 0 0 150px;
69
+ justify-content: center;
70
+ `;
71
+
67
72
  export {
68
73
  TableHeader,
69
74
  CheckHeader,
@@ -77,4 +82,5 @@ export {
77
82
  HeaderWrapper,
78
83
  SeoHeader,
79
84
  TypeHeader,
85
+ ColumnHeader,
80
86
  };
@@ -2,7 +2,16 @@ import React, { useRef, useState } from "react";
2
2
  import { connect } from "react-redux";
3
3
  import { useTheme } from "styled-components";
4
4
 
5
- import { ICheck, IAvailableSites, ISavePageParams, ILanguage, IPageLanguage, IPage, IColumn } from "@ax/types";
5
+ import {
6
+ ICheck,
7
+ IAvailableSites,
8
+ ISavePageParams,
9
+ ILanguage,
10
+ IPageLanguage,
11
+ IPage,
12
+ IColumn,
13
+ ISchemaField,
14
+ } from "@ax/types";
6
15
  import { getHumanLastModifiedDate, getScheduleFormatDate, getStructuredDataTitle, trimText } from "@ax/helpers";
7
16
  import { appActions } from "@ax/containers/App";
8
17
  import { pageStatus, ISetCurrentPageIDAction } from "@ax/containers/PageEditor/interfaces";
@@ -357,8 +366,21 @@ const GlobalPageItem = (props: IGlobalPageItemProps): JSX.Element => {
357
366
 
358
367
  const mainUnpublishAction = { title: "Ok", onClick: toggleUnpublishModal };
359
368
 
360
- const CategoryColumns = categoryColumns.map((col: any) => {
369
+ const CategoryColumns = categoryColumns.map((col) => {
370
+ if (!activeColumns.includes(col.key)) {
371
+ return <></>;
372
+ }
373
+
361
374
  const type: any = structuredDataContent && structuredDataContent[col.key];
375
+
376
+ if (typeof type === "string") {
377
+ return (
378
+ <S.ColumnCell key={col.key} onClick={_handleClick}>
379
+ {type}
380
+ </S.ColumnCell>
381
+ );
382
+ }
383
+
362
384
  const categories: string[] = !type
363
385
  ? []
364
386
  : Array.isArray(type)
@@ -366,14 +388,12 @@ const GlobalPageItem = (props: IGlobalPageItemProps): JSX.Element => {
366
388
  : [type.label || type.title];
367
389
 
368
390
  return (
369
- activeColumns.includes(col.key) && (
370
- <CategoryCell
371
- key={col.key}
372
- categories={categories}
373
- categoryColors={categoryColors}
374
- addCategoryColors={addCategoryColors}
375
- />
376
- )
391
+ <CategoryCell
392
+ key={col.key}
393
+ categories={categories}
394
+ categoryColors={categoryColors}
395
+ addCategoryColors={addCategoryColors}
396
+ />
377
397
  );
378
398
  });
379
399
 
@@ -487,7 +507,7 @@ interface IGlobalPageItemProps {
487
507
  toggleToast(): void;
488
508
  setDeletedItem(item: number | number[] | null): void;
489
509
  deleteBulk(ids: number[]): Promise<boolean>;
490
- categoryColumns: any[];
510
+ categoryColumns: ISchemaField[];
491
511
  columns: IColumn[];
492
512
  categoryColors: any;
493
513
  addCategoryColors(cats: string[]): void;
@@ -163,6 +163,12 @@ const ModalContent = styled.div`
163
163
  }
164
164
  `;
165
165
 
166
+ const ColumnCell = styled(Cell)`
167
+ flex: 0 0 150px;
168
+ position: relative;
169
+ align-items: center;
170
+ `;
171
+
166
172
  export {
167
173
  CheckCell,
168
174
  NameCell,
@@ -185,4 +191,5 @@ export {
185
191
  ModalContent,
186
192
  Title,
187
193
  Slug,
194
+ ColumnCell,
188
195
  };
@@ -211,8 +211,21 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
211
211
  });
212
212
  }
213
213
 
214
- const CategoryColumns = categoryColumns.map((col: any) => {
214
+ const CategoryColumns = categoryColumns.map((col) => {
215
+ if (!activeColumns.includes(col.key)) {
216
+ return <></>;
217
+ }
218
+
215
219
  const type: any = structuredData && structuredData.content && structuredData.content[col.key];
220
+
221
+ if (typeof type === "string") {
222
+ return (
223
+ <S.ColumnCell key={col.key} onClick={_handleClick}>
224
+ {type}
225
+ </S.ColumnCell>
226
+ );
227
+ }
228
+
216
229
  const categories: string[] = !type
217
230
  ? []
218
231
  : Array.isArray(type)
@@ -220,14 +233,12 @@ const StructuredDataItem = (props: IStructuredDataItemProps): JSX.Element => {
220
233
  : [type.label || type.title];
221
234
 
222
235
  return (
223
- activeColumns.includes(col.key) && (
224
- <CategoryCell
225
- key={col.key}
226
- categories={categories}
227
- categoryColors={categoryColors}
228
- addCategoryColors={addCategoryColors}
229
- />
230
- )
236
+ <CategoryCell
237
+ key={col.key}
238
+ categories={categories}
239
+ categoryColors={categoryColors}
240
+ addCategoryColors={addCategoryColors}
241
+ />
231
242
  );
232
243
  });
233
244
 
@@ -92,6 +92,12 @@ const FlagsWrapper = styled.div`
92
92
  }
93
93
  `;
94
94
 
95
+ const ColumnCell = styled(Cell)`
96
+ flex: 0 0 150px;
97
+ position: relative;
98
+ align-items: center;
99
+ `;
100
+
95
101
  export {
96
102
  CheckCell,
97
103
  NameCell,
@@ -104,4 +110,5 @@ export {
104
110
  StructuredDataRow,
105
111
  FlagsWrapper,
106
112
  Title,
113
+ ColumnCell,
107
114
  };