@8base/utils
Advanced tools
Comparing version 0.36.0 to 0.36.1
@@ -38,3 +38,3 @@ import { ParametricSelector } from 'reselect'; | ||
}>; | ||
export declare const getFieldKind: import("reselect").OutputParametricSelector<FieldSchema | (void & FieldSchema), void & TableSchema[], string, (res1: boolean, res2: string, res3: TableSchema[]) => string>; | ||
export declare const getFieldKind: import("reselect").OutputParametricSelector<FieldSchema | (void & FieldSchema), void & TableSchema[], string, (res1: string, res2: boolean, res3: string, res4: TableSchema[]) => string>; | ||
//# sourceMappingURL=tableFieldSelectors.d.ts.map |
@@ -38,7 +38,11 @@ "use strict"; | ||
exports.getDataFeatures = reselect_1.createSelector(exports.getTableField, R.prop('dataFeatures')); | ||
exports.getFieldKind = reselect_1.createSelector(exports.isSystemField, exports.getRelationTableId, (_, tablesSchema) => tablesSchema, (isSystem, relationTableId, tablesSchema) => { | ||
exports.getFieldKind = reselect_1.createSelector(exports.getTableId, exports.isSystemField, exports.getRelationTableId, (_, tablesSchema) => tablesSchema, (tableId, isSystem, relationTableId, tablesSchema) => { | ||
let kind = constants_1.FIELD_KINDS.USER; | ||
const table = tablesListSelectors.getTableById(tablesSchema, tableId); | ||
if (isSystem) { | ||
kind = constants_1.FIELD_KINDS.SYSTEM; | ||
} | ||
else if (tableSelectors.isIntegrationTable(table)) { | ||
kind = constants_1.FIELD_KINDS.EXTERNAL; | ||
} | ||
else if (relationTableId) { | ||
@@ -45,0 +49,0 @@ const refTable = tablesListSelectors.getTableById(tablesSchema, relationTableId); |
{ | ||
"name": "@8base/utils", | ||
"version": "0.36.0", | ||
"version": "0.36.1", | ||
"repository": "https://github.com/8base/sdk", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/8base/sdk/tree/master/packages/utils#readme", |
@@ -121,10 +121,15 @@ import * as R from 'ramda'; | ||
export const getFieldKind = createSelector( | ||
getTableId, | ||
isSystemField, | ||
getRelationTableId, | ||
(_, tablesSchema: TableSchema[]): TableSchema[] => tablesSchema, | ||
(isSystem: boolean, relationTableId: string, tablesSchema: TableSchema[]) => { | ||
(tableId: string, isSystem: boolean, relationTableId: string, tablesSchema: TableSchema[]) => { | ||
let kind = FIELD_KINDS.USER; | ||
const table = tablesListSelectors.getTableById(tablesSchema, tableId); | ||
if (isSystem) { | ||
kind = FIELD_KINDS.SYSTEM; | ||
} else if (tableSelectors.isIntegrationTable(table)) { | ||
kind = FIELD_KINDS.EXTERNAL; | ||
} else if (relationTableId) { | ||
@@ -131,0 +136,0 @@ const refTable = tablesListSelectors.getTableById(tablesSchema, relationTableId); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
272253
4399