@fibery/views 1.1.15 → 1.1.16
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/lib/views.js +48 -11
- package/package.json +1 -1
package/lib/views.js
CHANGED
|
@@ -300,6 +300,9 @@ const visitView$5 = (view, visitor) => immutableUpdate__default["default"](view,
|
|
|
300
300
|
$apply: items => items.map(item => {
|
|
301
301
|
const fromType = ___default["default"].get(item, ["query", "q/from"]);
|
|
302
302
|
return fromType ? immutableUpdate__default["default"](item, {
|
|
303
|
+
coverExpression: {
|
|
304
|
+
$apply: coverExpression => coverExpression ? visitor.visitExpression(fromType, coverExpression) : coverExpression
|
|
305
|
+
},
|
|
303
306
|
xExpression: {
|
|
304
307
|
$apply: xExpression => xExpression ? visitor.visitExpression(fromType, xExpression) : xExpression
|
|
305
308
|
},
|
|
@@ -406,13 +409,13 @@ const deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView = (schema, v
|
|
|
406
409
|
const fixUserSelectedUnitsInBoardView = (schema, view) => {
|
|
407
410
|
return visitView$5(view, fixUserSelectedUnitsViewVisitor(schema));
|
|
408
411
|
};
|
|
409
|
-
const fixContextExpressionWithBrokenPath$
|
|
412
|
+
const fixContextExpressionWithBrokenPath$7 = (schema, view, defaultContextExpression) => visitView$5(view, {
|
|
410
413
|
visitQueryExpression: query => query,
|
|
411
414
|
visitExpression: (fromType, expression) => expression,
|
|
412
415
|
visitEnums: enums => enums,
|
|
413
416
|
visitContextExpression: (fromType, expression) => resetContextExpressionIfBroken(schema, fromType, expression, defaultContextExpression)
|
|
414
417
|
});
|
|
415
|
-
const collectGarbage$
|
|
418
|
+
const collectGarbage$7 = view => {
|
|
416
419
|
return visitView$5(view, {
|
|
417
420
|
visitQueryExpression: queryExpression => queryExpression,
|
|
418
421
|
visitExpression: (fromType, expression) => expression,
|
|
@@ -482,12 +485,12 @@ const fixUserSelectedUnitsInCalendarView = (schema, view) => {
|
|
|
482
485
|
visitViewUnit: (fromType, unit) => fixViewUnit(schema, fromType, unit)
|
|
483
486
|
});
|
|
484
487
|
};
|
|
485
|
-
const fixContextExpressionWithBrokenPath$
|
|
488
|
+
const fixContextExpressionWithBrokenPath$6 = (schema, view, defaultContextExpression) => visitView$4(view, {
|
|
486
489
|
visitQueryExpression: query => query,
|
|
487
490
|
visitExpression: (fromType, expression) => expression,
|
|
488
491
|
visitContextExpression: (fromType, expression) => resetContextExpressionIfBroken(schema, fromType, expression, defaultContextExpression)
|
|
489
492
|
});
|
|
490
|
-
const collectGarbage$
|
|
493
|
+
const collectGarbage$6 = view => {
|
|
491
494
|
return visitView$4(view, {
|
|
492
495
|
visitExpression: (fromType, expression) => expression,
|
|
493
496
|
visitQueryExpression: query => query,
|
|
@@ -553,12 +556,12 @@ const fixUserSelectedUnitsInFeedView = (schema, view) => {
|
|
|
553
556
|
visitViewUnit: (fromType, unit) => fixViewUnit(schema, fromType, unit)
|
|
554
557
|
});
|
|
555
558
|
};
|
|
556
|
-
const fixContextExpressionWithBrokenPath$
|
|
559
|
+
const fixContextExpressionWithBrokenPath$5 = (schema, view, defaultContextExpression) => visitView$3(view, {
|
|
557
560
|
visitQueryExpression: query => query,
|
|
558
561
|
visitExpression: (fromType, expression) => expression,
|
|
559
562
|
visitContextExpression: (fromType, expression) => resetContextExpressionIfBroken(schema, fromType, expression, defaultContextExpression)
|
|
560
563
|
});
|
|
561
|
-
const collectGarbage$
|
|
564
|
+
const collectGarbage$5 = view => {
|
|
562
565
|
return visitView$3(view, {
|
|
563
566
|
visitExpression: (fromType, expression) => expression,
|
|
564
567
|
visitQueryExpression: query => query,
|
|
@@ -668,11 +671,34 @@ const replaceIdsWithNamesInMapView = (schema, view) => {
|
|
|
668
671
|
visitExpression: (fromType, expression) => replaceIdsWithNamesInExpression(schema, fromType, expression)
|
|
669
672
|
});
|
|
670
673
|
};
|
|
674
|
+
const deleteExpressionWithNotFoundFieldsOrTypesInMapView = (schema, view) => visitView$2(view, {
|
|
675
|
+
visitQueryExpression: queryExpression => deleteExpressionWithNotFoundFieldsOrTypesInQueryExpression(schema, queryExpression),
|
|
676
|
+
visitExpression: (fromType, expression) => deleteExpressionWithNotFoundFieldsOrTypesInExpression(schema, fromType, expression)
|
|
677
|
+
});
|
|
678
|
+
const fixUserSelectedUnitsInMapView = (schema, view) => {
|
|
679
|
+
return visitView$2(view, {
|
|
680
|
+
visitQueryExpression: query => query,
|
|
681
|
+
visitExpression: (fromType, expression) => expression,
|
|
682
|
+
visitViewUnit: (fromType, unit) => fixViewUnit(schema, fromType, unit)
|
|
683
|
+
});
|
|
684
|
+
};
|
|
685
|
+
const fixContextExpressionWithBrokenPath$4 = (schema, view, defaultContextExpression) => visitView$2(view, {
|
|
686
|
+
visitExpression: (fromType, expression) => expression,
|
|
687
|
+
visitQueryExpression: query => query,
|
|
688
|
+
visitContextExpression: (fromType, expression) => resetContextExpressionIfBroken(schema, fromType, expression, defaultContextExpression)
|
|
689
|
+
});
|
|
690
|
+
const collectGarbage$4 = view => {
|
|
691
|
+
return visitView$2(view, {
|
|
692
|
+
visitQueryExpression: query => query,
|
|
693
|
+
visitExpression: (fromType, expression) => expression,
|
|
694
|
+
visitViewUnit: (fromType, unit) => unit.checked ? unit : REMOVE
|
|
695
|
+
});
|
|
696
|
+
};
|
|
671
697
|
|
|
672
698
|
const visitSmartFolder = (smartFolder, visitor) => immutableUpdate__default["default"](smartFolder, {
|
|
673
699
|
"fibery/meta": {
|
|
674
700
|
items: {
|
|
675
|
-
$apply: items => {
|
|
701
|
+
$apply: (items = []) => {
|
|
676
702
|
const isOldSmartFolder = !items.every(item => item.hasOwnProperty("groupBy"));
|
|
677
703
|
const removedItemsIndexes = items.map((item, index) => visitor.visitQueryExpression(item.query) ? null : index).filter(value => value !== null);
|
|
678
704
|
return items.map((item, index) => {
|
|
@@ -947,6 +973,9 @@ const visitView = (view, visitor) => immutableUpdate__default["default"](view, {
|
|
|
947
973
|
},
|
|
948
974
|
query: {
|
|
949
975
|
$apply: query => query ? visitor.visitQueryExpression(query) : null
|
|
976
|
+
},
|
|
977
|
+
contextExpression: {
|
|
978
|
+
$apply: contextExpression => visitContextExpression(fromType, contextExpression, visitor)
|
|
950
979
|
}
|
|
951
980
|
}) : item;
|
|
952
981
|
}).filter(item => {
|
|
@@ -1042,6 +1071,8 @@ const deleteExpressionWithNotFoundFieldsOrTypesInView = (schema, view, ensureAxi
|
|
|
1042
1071
|
return deleteExpressionWithNotFoundFieldsOrTypesInFeedView(schema, view);
|
|
1043
1072
|
case "form":
|
|
1044
1073
|
return deleteExpressionWithNotFoundFieldsOrTypesInFormView(schema, view);
|
|
1074
|
+
case "map":
|
|
1075
|
+
return deleteExpressionWithNotFoundFieldsOrTypesInMapView(schema, view);
|
|
1045
1076
|
default:
|
|
1046
1077
|
return view;
|
|
1047
1078
|
}
|
|
@@ -1062,6 +1093,8 @@ const fixUserSelectedUnits = (schema, view) => {
|
|
|
1062
1093
|
return fixUserSelectedUnitsInCalendarView(schema, view);
|
|
1063
1094
|
case "feed":
|
|
1064
1095
|
return fixUserSelectedUnitsInFeedView(schema, view);
|
|
1096
|
+
case "map":
|
|
1097
|
+
return fixUserSelectedUnitsInMapView(schema, view);
|
|
1065
1098
|
default:
|
|
1066
1099
|
return view;
|
|
1067
1100
|
}
|
|
@@ -1069,7 +1102,7 @@ const fixUserSelectedUnits = (schema, view) => {
|
|
|
1069
1102
|
const fixContextExpressionWithBrokenPath = (schema, view, defaultContextExpression) => {
|
|
1070
1103
|
switch (view["fibery/type"]) {
|
|
1071
1104
|
case "board":
|
|
1072
|
-
return fixContextExpressionWithBrokenPath$
|
|
1105
|
+
return fixContextExpressionWithBrokenPath$7(schema, view, defaultContextExpression);
|
|
1073
1106
|
case "list":
|
|
1074
1107
|
return fixContextExpressionWithBrokenPath$3(schema, view, defaultContextExpression);
|
|
1075
1108
|
case "grid":
|
|
@@ -1079,8 +1112,10 @@ const fixContextExpressionWithBrokenPath = (schema, view, defaultContextExpressi
|
|
|
1079
1112
|
case "timeline":
|
|
1080
1113
|
return fixContextExpressionWithBrokenPath$1(schema, view, defaultContextExpression);
|
|
1081
1114
|
case "calendar":
|
|
1082
|
-
return fixContextExpressionWithBrokenPath$
|
|
1115
|
+
return fixContextExpressionWithBrokenPath$6(schema, view, defaultContextExpression);
|
|
1083
1116
|
case "feed":
|
|
1117
|
+
return fixContextExpressionWithBrokenPath$5(schema, view, defaultContextExpression);
|
|
1118
|
+
case "map":
|
|
1084
1119
|
return fixContextExpressionWithBrokenPath$4(schema, view, defaultContextExpression);
|
|
1085
1120
|
default:
|
|
1086
1121
|
return view;
|
|
@@ -1105,7 +1140,7 @@ const collectGarbage = (schema, view) => {
|
|
|
1105
1140
|
};
|
|
1106
1141
|
switch (view["fibery/type"]) {
|
|
1107
1142
|
case "board":
|
|
1108
|
-
return deleteRemoved(collectGarbage$
|
|
1143
|
+
return deleteRemoved(collectGarbage$7(view));
|
|
1109
1144
|
case "list":
|
|
1110
1145
|
return deleteRemoved(collectGarbage$3(view));
|
|
1111
1146
|
case "grid":
|
|
@@ -1115,8 +1150,10 @@ const collectGarbage = (schema, view) => {
|
|
|
1115
1150
|
case "timeline":
|
|
1116
1151
|
return deleteRemoved(collectGarbage$1(view));
|
|
1117
1152
|
case "calendar":
|
|
1118
|
-
return deleteRemoved(collectGarbage$
|
|
1153
|
+
return deleteRemoved(collectGarbage$6(view));
|
|
1119
1154
|
case "feed":
|
|
1155
|
+
return deleteRemoved(collectGarbage$5(view));
|
|
1156
|
+
case "map":
|
|
1120
1157
|
return deleteRemoved(collectGarbage$4(view));
|
|
1121
1158
|
default:
|
|
1122
1159
|
return view;
|