@fibery/views 19.1.1 → 19.1.2

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.
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.getAvatarSelectQuery = exports.getAvatarSelect = exports.isAvatarExtensionField = exports.isAvatarExtensionEnabledType = exports.AVATAR_EXTENSION_FIELD = exports.AVATAR_MIXIN_NAME = void 0;
4
+ const _1 = require("@fibery/helpers/src/_");
7
5
  const select_1 = require("@fibery/query-utils/src/select");
8
- const compact_1 = __importDefault(require("lodash/compact"));
9
6
  exports.AVATAR_MIXIN_NAME = "avatar/avatar-mixin";
10
7
  exports.AVATAR_EXTENSION_FIELD = "avatar/avatars";
11
8
  const isAvatarExtensionEnabledType = (typeObject) => {
@@ -18,7 +15,7 @@ const isAvatarExtensionField = (fieldObject) => {
18
15
  return fieldObject.name === exports.AVATAR_EXTENSION_FIELD && fieldObject.type === "fibery/file";
19
16
  };
20
17
  exports.isAvatarExtensionField = isAvatarExtensionField;
21
- const getAvatarSelect = (fieldObject) => (0, select_1.toSelectMapClause)((0, compact_1.default)([fieldObject.typeObject.idField, fieldObject.typeObject.titleField, "fibery/content-type", "fibery/secret"]));
18
+ const getAvatarSelect = (fieldObject) => (0, select_1.toSelectMapClause)([fieldObject.typeObject.idField, fieldObject.typeObject.titleField, "fibery/content-type", "fibery/secret"].filter(_1.truthy));
22
19
  exports.getAvatarSelect = getAvatarSelect;
23
20
  const getAvatarSelectQuery = ({ typeObject }) => {
24
21
  if ((0, exports.isAvatarExtensionEnabledType)(typeObject)) {
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.getFilesSelect = void 0;
4
+ const _1 = require("@fibery/helpers/src/_");
7
5
  const select_1 = require("@fibery/query-utils/src/select");
8
- const compact_1 = __importDefault(require("lodash/compact"));
9
- const getFilesSelect = ({ typeObject }) => (0, select_1.toSelectMapClause)((0, compact_1.default)([
6
+ const getFilesSelect = ({ typeObject }) => (0, select_1.toSelectMapClause)([
10
7
  typeObject.idField,
11
8
  typeObject.titleField,
12
9
  "fibery/creation-date",
@@ -14,5 +11,5 @@ const getFilesSelect = ({ typeObject }) => (0, select_1.toSelectMapClause)((0, c
14
11
  "fibery/content-length",
15
12
  "fibery/secret",
16
13
  "fibery/rank",
17
- ]));
14
+ ].filter(_1.truthy));
18
15
  exports.getFilesSelect = getFilesSelect;
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.calculateReferenceCollectionQuery = exports.getCollectionCountSelect = exports.getCountKey = exports.makeCollectionCountExpression = exports.REFERENCE_COLLECTION_LIMIT = void 0;
7
+ const _1 = require("@fibery/helpers/src/_");
7
8
  const select_1 = require("@fibery/query-utils/src/select");
8
- const compact_1 = __importDefault(require("lodash/compact"));
9
9
  const last_1 = __importDefault(require("lodash/last"));
10
10
  const access_1 = require("../unit-utils/access");
11
11
  const dynamic_keys_1 = require("../unit-utils/dynamic-keys");
@@ -32,19 +32,19 @@ const calculateReferenceCollectionQuery = ({ fieldObjects, expression, limit, })
32
32
  }
33
33
  const collectionSubQuery = {
34
34
  "q/from": expression,
35
- "q/select": (0, select_1.mergeDenormalizedSelects)((0, compact_1.default)([
36
- (0, select_1.toSelectMapClause)((0, compact_1.default)([
35
+ "q/select": (0, select_1.mergeDenormalizedSelects)([
36
+ (0, select_1.toSelectMapClause)([
37
37
  fieldObject.typeObject.idField,
38
38
  fieldObject.typeObject.titleField,
39
39
  // keep public id - required to build Links
40
40
  fieldObject.typeObject.publicIdField,
41
- ])),
41
+ ].filter(_1.truthy)),
42
42
  (0, access_1.generateAccessCheckQueryExpression)({ typeObject: fieldObject.typeObject }),
43
43
  (0, avatar_1.getAvatarSelectQuery)({ typeObject: fieldObject.typeObject }),
44
44
  (0, icon_1.getEntityIconSelect)({ typeObject: fieldObject.typeObject }),
45
45
  fieldObject.type === "fibery/file" && (0, file_1.getFilesSelect)(fieldObject),
46
46
  (0, enums_1.getEnumIconColorQuery)({ typeObject: fieldObject.typeObject }),
47
- ])),
47
+ ].filter(_1.truthy)),
48
48
  "q/limit": limit,
49
49
  };
50
50
  // Wrap the collection query in intermediate reference fields (innermost to outermost).
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.getReferenceFieldNormalizedSelectClause = exports.getReferenceTypeSelectClause = void 0;
4
+ const _1 = require("@fibery/helpers/src/_");
7
5
  const select_1 = require("@fibery/query-utils/src/select");
8
- const compact_1 = __importDefault(require("lodash/compact"));
9
6
  const access_1 = require("../unit-utils/access");
10
7
  const enums_1 = require("../unit-utils/enums");
11
8
  const avatar_1 = require("./avatar");
@@ -15,13 +12,13 @@ const user_active_1 = require("./user-active");
15
12
  const workflow_1 = require("./workflow");
16
13
  const getReferenceTypeSelectClause = ({ typeObject }, contextPath) => {
17
14
  return {
18
- ...(0, select_1.toSelectMapClause)((0, compact_1.default)([
15
+ ...(0, select_1.toSelectMapClause)([
19
16
  typeObject.idField,
20
17
  typeObject.publicIdField,
21
18
  typeObject.titleField,
22
19
  typeObject.rankField,
23
20
  typeObject.name === "fibery/user" ? "user/email" : null,
24
- ])),
21
+ ].filter(_1.truthy)),
25
22
  ...(0, access_1.generateAccessCheckQueryExpression)({ typeObject, contextPath }),
26
23
  ...(0, workflow_1.getIsFinalStateSelect)({ typeObject, contextPath }),
27
24
  ...(0, user_active_1.getIsUserActiveSelect)({
@@ -5,13 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.enableHideWhenEmptyForCheckedEditableUnits = exports.enableHideWhenEmptyForCovers = exports.collectGarbage = exports.fixContextExpressionWithBrokenPath = exports.fixUserSelectedUnitsInBoardView = exports.deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView = exports.replaceNamesWithIdsInBoardView = exports.replaceIdsWithNamesInBoardView = void 0;
7
7
  const utils_1 = require("@fibery/expression-utils/src/utils");
8
+ const _1 = require("@fibery/helpers/src/_");
8
9
  const immutability_helper_1 = __importDefault(require("immutability-helper"));
9
10
  const entries_1 = __importDefault(require("lodash/entries"));
10
11
  const get_1 = __importDefault(require("lodash/get"));
11
12
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
12
13
  const set_1 = __importDefault(require("lodash/set"));
13
14
  const some_1 = __importDefault(require("lodash/some"));
14
- const truthy_1 = require("../truthy");
15
15
  const units_1 = require("./units");
16
16
  const utils_2 = require("./utils");
17
17
  const visitQueryExpressionHolder = (queryHolder, visitor) => {
@@ -50,7 +50,7 @@ const visitAxisUnits = (axis, fromType, visitor) => {
50
50
  units: {
51
51
  $apply: (units) => units
52
52
  ? units
53
- .filter(truthy_1.truthy)
53
+ .filter(_1.truthy)
54
54
  .map((unit) => (0, utils_2.visitViewUnit)(fromType, unit, visitor))
55
55
  .filter(utils_2.isUnitExpressionValid)
56
56
  .map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
@@ -162,7 +162,7 @@ const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
162
162
  units: {
163
163
  $apply: (units) => units
164
164
  ? units
165
- .filter(truthy_1.truthy)
165
+ .filter(_1.truthy)
166
166
  .map((unit) => (0, utils_2.visitViewUnit)(fromType, unit, visitor))
167
167
  .filter(utils_2.isUnitExpressionValid)
168
168
  .map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.enableHideWhenEmptyForCheckedUnits = exports.collectGarbage = exports.fixContextExpressionWithBrokenPath = exports.fixUserSelectedUnitsInCalendarView = exports.deleteExpressionWithNotFoundFieldsOrTypesInCalendarView = exports.replaceIdsWithNamesInCalendarView = exports.replaceNamesWithIdsInCalendarView = void 0;
7
+ const _1 = require("@fibery/helpers/src/_");
7
8
  const immutability_helper_1 = __importDefault(require("immutability-helper"));
8
9
  const get_1 = __importDefault(require("lodash/get"));
9
- const truthy_1 = require("../truthy");
10
10
  const units_1 = require("./units");
11
11
  const utils_1 = require("./utils");
12
12
  const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
@@ -35,7 +35,7 @@ const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
35
35
  units: {
36
36
  $apply: (units) => units
37
37
  ? units
38
- .filter(truthy_1.truthy)
38
+ .filter(_1.truthy)
39
39
  .map((unit) => (0, utils_1.visitViewUnit)(fromType, unit, visitor))
40
40
  .filter(utils_1.isUnitExpressionValid)
41
41
  .map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.enableHideWhenEmptyForCheckedUnits = exports.collectGarbage = exports.fixContextExpressionWithBrokenPath = exports.fixUserSelectedUnitsInFeedView = exports.deleteExpressionWithNotFoundFieldsOrTypesInFeedView = exports.replaceIdsWithNamesInFeedView = exports.replaceNamesWithIdsInFeedView = void 0;
7
+ const _1 = require("@fibery/helpers/src/_");
7
8
  const immutability_helper_1 = __importDefault(require("immutability-helper"));
8
9
  const get_1 = __importDefault(require("lodash/get"));
9
- const truthy_1 = require("../truthy");
10
10
  const units_1 = require("./units");
11
11
  const utils_1 = require("./utils");
12
12
  const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
@@ -32,7 +32,7 @@ const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
32
32
  units: {
33
33
  $apply: (units) => units
34
34
  ? units
35
- .filter(truthy_1.truthy)
35
+ .filter(_1.truthy)
36
36
  .map((unit) => (0, utils_1.visitViewUnit)(fromType, unit, visitor))
37
37
  .filter(utils_1.isUnitExpressionValid)
38
38
  .map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.enableHideWhenEmptyForCheckedUnits = exports.collectGarbage = exports.fixContextExpressionWithBrokenPath = exports.fixUserSelectedUnitsInMapView = exports.deleteExpressionWithNotFoundFieldsOrTypesInMapView = exports.replaceIdsWithNamesInMapView = exports.replaceNamesWithIdsInMapView = void 0;
7
+ const _1 = require("@fibery/helpers/src/_");
7
8
  const immutability_helper_1 = __importDefault(require("immutability-helper"));
8
9
  const get_1 = __importDefault(require("lodash/get"));
9
- const truthy_1 = require("../truthy");
10
10
  const units_1 = require("./units");
11
11
  const utils_1 = require("./utils");
12
12
  const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
@@ -32,7 +32,7 @@ const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
32
32
  units: {
33
33
  $apply: (units) => units
34
34
  ? units
35
- .filter(truthy_1.truthy)
35
+ .filter(_1.truthy)
36
36
  .map((unit) => (0, utils_1.visitViewUnit)(fromType, unit, visitor))
37
37
  .filter(utils_1.isUnitExpressionValid)
38
38
  .map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.enableHideWhenEmptyForCheckedUnits = exports.collectGarbage = exports.fixUserSelectedUnitsInSmartFolder = exports.fixContextExpressionWithBrokenPath = exports.deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder = exports.replaceIdsWithNamesInSmartFolder = exports.replaceNamesWithIdsInSmartFolder = exports.replaceNamesWithIdsInGroupByExpression = exports.replaceIdsWithNamesInGroupByExpression = exports.deleteExpressionWithNotFoundFieldsOrTypesInGroupByExpression = void 0;
7
7
  const visitors_1 = require("@fibery/expression-utils/src/visitors");
8
+ const _1 = require("@fibery/helpers/src/_");
8
9
  const immutability_helper_1 = __importDefault(require("immutability-helper"));
9
10
  const get_1 = __importDefault(require("lodash/get"));
10
11
  const isEqual_1 = __importDefault(require("lodash/isEqual"));
11
- const truthy_1 = require("../truthy");
12
12
  const units_1 = require("./units");
13
13
  const utils_1 = require("./utils");
14
14
  const visitSmartFolder = (smartFolder, visitor) => (0, immutability_helper_1.default)(smartFolder, {
@@ -77,7 +77,7 @@ const visitSmartFolder = (smartFolder, visitor) => (0, immutability_helper_1.def
77
77
  $apply: (units) => {
78
78
  return units
79
79
  ? units
80
- .filter(truthy_1.truthy)
80
+ .filter(_1.truthy)
81
81
  .map((unit) => (0, utils_1.visitViewUnit)(fromType, unit, visitor))
82
82
  .filter(utils_1.isUnitExpressionValid)
83
83
  .map((unit, index, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
@@ -154,7 +154,7 @@ const deleteExpressionWithNotFoundFieldsOrTypesInGroupByExpression = (schema, gr
154
154
  }
155
155
  return null;
156
156
  })
157
- .filter(truthy_1.truthy);
157
+ .filter(_1.truthy);
158
158
  return entries.length > 0 ? Object.fromEntries(entries) : null;
159
159
  };
160
160
  exports.deleteExpressionWithNotFoundFieldsOrTypesInGroupByExpression = deleteExpressionWithNotFoundFieldsOrTypesInGroupByExpression;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.enableHideWhenEmptyForCheckedEditableUnits = exports.collectGarbage = exports.fixContextExpressionWithBrokenPath = exports.fixUserSelectedUnitsInTimelineView = exports.deleteExpressionWithNotFoundFieldsOrTypesInTimelineView = exports.replaceIdsWithNamesInTimelineView = exports.replaceNamesWithIdsInTimelineView = void 0;
7
+ const _1 = require("@fibery/helpers/src/_");
7
8
  const immutability_helper_1 = __importDefault(require("immutability-helper"));
8
9
  const entries_1 = __importDefault(require("lodash/entries"));
9
10
  const first_1 = __importDefault(require("lodash/first"));
@@ -12,7 +13,6 @@ const has_1 = __importDefault(require("lodash/has"));
12
13
  const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
13
14
  const set_1 = __importDefault(require("lodash/set"));
14
15
  const some_1 = __importDefault(require("lodash/some"));
15
- const truthy_1 = require("../truthy");
16
16
  const smart_folder_1 = require("./smart-folder");
17
17
  const units_1 = require("./units");
18
18
  const utils_1 = require("./utils");
@@ -103,7 +103,7 @@ const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
103
103
  units: {
104
104
  $apply: (units) => units
105
105
  ? units
106
- .filter(truthy_1.truthy)
106
+ .filter(_1.truthy)
107
107
  .map((unit) => (0, utils_1.visitViewUnit)(fromType, unit, visitor))
108
108
  .filter(utils_1.isUnitExpressionValid)
109
109
  .map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.replaceNamesWithIdsInUnitGroupKey = exports.replaceIdsWithNamesInUnitGroupKey = exports.getFieldObjectsById = exports.isUnitExpressionValid = exports.resetContextExpressionIfBroken = exports.deleteExpressionWithNotFoundFieldsOrTypesInExpression = exports.replaceNamesWithIdsInQueryExpression = exports.replaceNamesWithIdsInFilter = exports.replaceIdsWithNamesInFilter = exports.replaceIdsWithNamesInQueryExpression = exports.visitContextExpression = exports.visitViewUnit = exports.replaceIdsWithNamesInExpression = exports.replaceNamesWithIdsInExpression = exports.deleteExpressionWithNotFoundFieldsOrTypesInQueryExpression = exports.deleteExpressionWithNotFoundFieldsOrTypesInFilter = exports.skipRemove = exports.REMOVE = void 0;
7
7
  const visitors_1 = require("@fibery/expression-utils/src/visitors");
8
+ const _1 = require("@fibery/helpers/src/_");
8
9
  const pickBy_1 = __importDefault(require("lodash/pickBy"));
9
- const truthy_1 = require("../truthy");
10
10
  // Return this symbol from a visitor callback to remove the node from the
11
11
  // output. Not supported in all places, add support as needed.
12
12
  exports.REMOVE = Symbol("remove");
@@ -34,7 +34,7 @@ function visitDeleteExpressionInFilterGroup(filter, visitExpression) {
34
34
  },
35
35
  };
36
36
  })
37
- .filter(truthy_1.truthy);
37
+ .filter(_1.truthy);
38
38
  if (value.length === 0) {
39
39
  return null;
40
40
  }
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.AvatarCollection = void 0;
7
4
  const utils_1 = require("@fibery/expression-utils/src/utils");
5
+ const _1 = require("@fibery/helpers/src/_");
8
6
  const select_1 = require("@fibery/query-utils/src/select");
9
- const compact_1 = __importDefault(require("lodash/compact"));
10
7
  const avatar_1 = require("../field-utils/avatar");
8
+ const access_1 = require("../unit-utils/access");
11
9
  const common_1 = require("../unit-utils/common");
12
10
  const get_export_value_1 = require("../unit-utils/get-export-value");
13
11
  const get_field_label_1 = require("../unit-utils/get-field-label");
@@ -27,10 +25,11 @@ exports.AvatarCollection = {
27
25
  const terminalFieldObject = fieldObjects[fieldObjects.length - 1];
28
26
  const collectionSubQuery = {
29
27
  "q/from": expression,
30
- "q/select": (0, select_1.mergeDenormalizedSelects)((0, compact_1.default)([
28
+ "q/select": (0, select_1.mergeDenormalizedSelects)([
31
29
  (0, select_1.toSelectMapClause)([terminalFieldObject.typeObject.idField, terminalFieldObject.typeObject.titleField]),
30
+ (0, access_1.generateAccessCheckQueryExpression)({ typeObject: terminalFieldObject.typeObject }),
32
31
  (0, avatar_1.getAvatarSelectQuery)({ typeObject: terminalFieldObject.typeObject }),
33
- ])),
32
+ ].filter(_1.truthy)),
34
33
  "q/limit": "q/no-limit",
35
34
  };
36
35
  return [...expression].reverse().reduce((inner, field, reversedIndex) => {
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.Avatar = void 0;
7
4
  const utils_1 = require("@fibery/expression-utils/src/utils");
5
+ const _1 = require("@fibery/helpers/src/_");
8
6
  const select_1 = require("@fibery/query-utils/src/select");
9
- const compact_1 = __importDefault(require("lodash/compact"));
10
7
  const avatar_1 = require("../field-utils/avatar");
8
+ const access_1 = require("../unit-utils/access");
11
9
  const common_1 = require("../unit-utils/common");
12
10
  const get_export_value_1 = require("../unit-utils/get-export-value");
13
11
  const get_field_label_1 = require("../unit-utils/get-field-label");
@@ -49,10 +47,11 @@ exports.Avatar = {
49
47
  if ((0, avatar_1.isAvatarExtensionField)(terminalFieldObject)) {
50
48
  return getSelfAvatarSelectQuery(typeObject);
51
49
  }
52
- const innerSelect = (0, select_1.normalizeSelect)((0, select_1.mergeDenormalizedSelects)((0, compact_1.default)([
50
+ const innerSelect = (0, select_1.normalizeSelect)((0, select_1.mergeDenormalizedSelects)([
53
51
  (0, select_1.toSelectMapClause)([terminalFieldObject.typeObject.idField, terminalFieldObject.typeObject.titleField]),
52
+ (0, access_1.generateAccessCheckQueryExpression)({ typeObject: terminalFieldObject.typeObject, contextPath: expression }),
54
53
  (0, avatar_1.getAvatarSelectQuery)({ typeObject: terminalFieldObject.typeObject }),
55
- ])));
54
+ ].filter(_1.truthy)));
56
55
  // Wrap in the full expression path (innermost to outermost).
57
56
  // For intermediate reference fields, also include their entity's id so normalizr can normalize them.
58
57
  const nested = [...expression].reverse().reduce((inner, field, reversedIndex) => {
@@ -8,7 +8,6 @@ const _1 = require("@fibery/helpers/src/_");
8
8
  const array_1 = require("@fibery/helpers/utils/array");
9
9
  const trace_1 = require("@fibery/helpers/utils/trace");
10
10
  const select_1 = require("@fibery/query-utils/src/select");
11
- const compact_1 = __importDefault(require("lodash/compact"));
12
11
  const constant_1 = __importDefault(require("lodash/constant"));
13
12
  const flatMap_1 = __importDefault(require("lodash/flatMap"));
14
13
  const groupBy_1 = __importDefault(require("lodash/groupBy"));
@@ -150,7 +149,7 @@ const makeUnitDefinitionsFactory = (allUnitDefinitions) => {
150
149
  return [];
151
150
  }
152
151
  const unitsFactory = unitsFactoryByFieldKind[fieldObject.kind] || (0, constant_1.default)([]);
153
- return (0, compact_1.default)(unitsFactory(fieldObject, options)).map(makeUnit);
152
+ return unitsFactory(fieldObject, options).filter(_1.truthy).map(makeUnit);
154
153
  };
155
154
  const staticUnitsTypeOrder = [Id, AvatarCollection, TypeIcon, TypeBadge, TypeBadgeAbbr, Avatar, Title, UserButton]
156
155
  .filter(Boolean)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/views",
3
- "version": "19.1.1",
3
+ "version": "19.1.2",
4
4
  "private": false,
5
5
  "description": "Operations on view objects",
6
6
  "license": "UNLICENSED",
@@ -39,10 +39,10 @@
39
39
  "lodash": "4.17.21",
40
40
  "moment": "2.29.4",
41
41
  "@fibery/context-filters": "1.1.4",
42
- "@fibery/expression-utils": "9.7.2",
43
- "@fibery/query-utils": "1.1.7",
44
- "@fibery/schema": "10.2.17",
45
- "@fibery/helpers": "3.0.0"
42
+ "@fibery/expression-utils": "9.7.3",
43
+ "@fibery/query-utils": "1.1.8",
44
+ "@fibery/helpers": "3.1.0",
45
+ "@fibery/schema": "10.2.18"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@babel/core": "7.28.5",
@@ -52,8 +52,8 @@
52
52
  "@fibery/babel-preset": "7.4.2"
53
53
  },
54
54
  "peerDependencies": {
55
- "@fibery/expression-utils": "^9.7.2",
56
- "@fibery/schema": "^10.2.17",
55
+ "@fibery/expression-utils": "^9.7.3",
56
+ "@fibery/schema": "^10.2.18",
57
57
  "immutability-helper": "^2.4.0",
58
58
  "lodash": "4.17.21"
59
59
  },
@@ -63,7 +63,7 @@
63
63
  "test:ci": "../../scripts/test.sh --ci",
64
64
  "test:coverage": "../../scripts/test.sh --ci --coverage",
65
65
  "check": "../../scripts/check.sh",
66
- "lint": "../../scripts/lint.sh"
66
+ "lint": "pnpm -w lint ."
67
67
  },
68
68
  "types": "./lib/index.d.ts"
69
69
  }
@@ -1 +0,0 @@
1
- export declare const truthy: <T>(x: T | null | undefined | false) => x is T;
package/lib/src/truthy.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.truthy = void 0;
4
- const truthy = (x) => {
5
- return Boolean(x);
6
- };
7
- exports.truthy = truthy;