@griddo/ax 11.2.6-rc.0 → 11.2.6

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.2.6-rc.0",
4
+ "version": "11.2.6",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Carlos Torres <carlos.torres@secuoyas.com>",
@@ -225,5 +225,5 @@
225
225
  "publishConfig": {
226
226
  "access": "public"
227
227
  },
228
- "gitHead": "4141f9ba443b688911c9bdfc718134355648b467"
228
+ "gitHead": "26934c501923afc606ad39bd2bbcd4c77b565d59"
229
229
  }
@@ -39,7 +39,7 @@ const ContentFilters = (props: IProps): JSX.Element => {
39
39
  const type = typeFilters[0].value;
40
40
  const filters = getFilters(dynamicValues);
41
41
 
42
- const handleClick = (value: string, fromPage = false, firstTemplate: string | null = null) => {
42
+ const handleClickData = (value: string, fromPage = false, firstTemplate: string | null = null) => {
43
43
  const hasTemplate = fromPage && firstTemplate;
44
44
 
45
45
  resetFilter();
@@ -54,15 +54,9 @@ const ContentFilters = (props: IProps): JSX.Element => {
54
54
 
55
55
  const handleClickBase = (value: string) => {
56
56
  resetFilter();
57
-
58
- let filter = value;
59
- if (value === "unique") {
60
- filter = "unique-pages";
61
- setFilter("type", [{ value, label: value }]);
62
- }
63
-
64
- setContentFilter(filter);
65
- setSelectedStructuredData(filter, "site");
57
+ setFilter("type", [{ value, label: value }]);
58
+ setContentFilter(value);
59
+ setSelectedStructuredData(value, "site");
66
60
  };
67
61
 
68
62
  return (
@@ -72,6 +66,9 @@ const ContentFilters = (props: IProps): JSX.Element => {
72
66
  const isSelected = type === "all" ? filter.value === current : filter.value === type;
73
67
  const selectedClass = isSelected ? "selected" : "";
74
68
 
69
+ const handleClick = (value: string, fromPage = false, firstTemplate: string | null = null) =>
70
+ filter.value === "unique" ? handleClickBase(value) : handleClickData(value, fromPage, firstTemplate);
71
+
75
72
  return (
76
73
  <React.Fragment key={filter.value}>
77
74
  {!filter.items ? (
@@ -15,7 +15,15 @@ const getDynamicFilters = (values: IStructuredData[]): IDynamicFilter[] =>
15
15
  const getFilters = (dynamicValues: IStructuredData[]): IContentFilter[] => {
16
16
  const filters: IContentFilter[] = [
17
17
  { label: "All Content", value: "unique-pages" },
18
- { label: "Base Pages", value: "unique" },
18
+ {
19
+ label: "Base Pages",
20
+ value: "unique",
21
+ items: [
22
+ { label: "Base Templates", value: "basic", editable: true },
23
+ { label: "List Pages", value: "list", editable: true },
24
+ { label: "Static Pages", value: "static", editable: true },
25
+ ],
26
+ },
19
27
  ];
20
28
 
21
29
  const pageTypes = dynamicValues.filter((value) => value.fromPage);
@@ -167,8 +167,9 @@ const Content = (props: IProps): JSX.Element => {
167
167
 
168
168
  const currentFilter = getCurrentFilter(structuredData, filter);
169
169
  const checkFromPage = currentFilter ? currentFilter.fromPage : undefined;
170
- const isStructuredData = filter !== "unique-pages" && !checkFromPage;
171
- const isGlobalPages = filter !== "unique-pages" && checkFromPage;
170
+ const baseFilters = ["unique-pages", "basic", "list", "static"];
171
+ const isStructuredData = !baseFilters.includes(filter) && !checkFromPage;
172
+ const isGlobalPages = !baseFilters.includes(filter) && checkFromPage;
172
173
  const isDataEditable = !isStructuredData || (currentStructuredData && currentStructuredData.editable);
173
174
  const isDataPrivate = currentStructuredData?.private || false;
174
175
  const isDataExportable = currentStructuredData?.exportable || false;
@@ -273,7 +274,7 @@ const Content = (props: IProps): JSX.Element => {
273
274
  }, [filter, currentSiteInfo, isStructuredData, page, currentSearch]);
274
275
 
275
276
  const getPages = async (params: any, filterQuery?: any) => {
276
- const isStructuredDataPage = filter !== "unique-pages";
277
+ const isStructuredDataPage = !baseFilters.includes(filter);
277
278
  const pageFilter = isStructuredDataPage ? filter : undefined;
278
279
  await getSitePages(params, pageFilter, filterQuery);
279
280
  };
@@ -331,7 +332,7 @@ const Content = (props: IProps): JSX.Element => {
331
332
 
332
333
  useEffect(() => {
333
334
  if (!isLoading) {
334
- const isContentType = filter !== "unique-pages";
335
+ const isContentType = !baseFilters.includes(filter);
335
336
  const emptyState: IEmptyStateProps = {};
336
337
  const { liveStatus, translated, type } = filterValues;
337
338
  const isSearching =
@@ -824,7 +825,7 @@ const Content = (props: IProps): JSX.Element => {
824
825
  message: "1 Page copied to another Site",
825
826
  };
826
827
 
827
- const addNewAction = filter === "unique-pages" || isGlobalPages ? toggleNewModal : addNewData;
828
+ const addNewAction = baseFilters.includes(filter) || isGlobalPages ? toggleNewModal : addNewData;
828
829
 
829
830
  const rightButtonProps = isAllowedToCreatePages
830
831
  ? {
@@ -1090,8 +1090,8 @@ export interface IContentFilter {
1090
1090
  export interface IDynamicFilter {
1091
1091
  label: string;
1092
1092
  value: string;
1093
- fromPage: boolean;
1094
- firstTemplate: string | null;
1093
+ fromPage?: boolean;
1094
+ firstTemplate?: string | null;
1095
1095
  editable?: boolean;
1096
1096
  isPrivate?: boolean;
1097
1097
  }