From 05a459d000847da848c0dc39effb6a5343d5846b Mon Sep 17 00:00:00 2001 From: Darren Ethier Date: Tue, 4 Dec 2018 14:01:21 -0500 Subject: [PATCH] update for model specific selectors, actions, resolvers --- .../{base-entities.js => base-model.js} | 0 .../actions/create-entities-generators.js | 2 +- .../core/actions/receive-entities.js | 6 +- .../core/actions/remove-relations.js | 2 +- assets/src/data/eventespresso/core/index.js | 19 +- .../core/model/entity-actions.js | 120 +++++++++ .../core/model/entity-resolvers.js | 28 ++ .../core/model/entity-selectors.js | 52 ++++ .../data/eventespresso/core/model/index.js | 22 ++ .../core/model/relation-actions.js | 246 ++++++++++++++++++ .../core/model/relation-selectors.js | 48 ++++ assets/src/data/eventespresso/core/models.js | 125 --------- .../eventespresso/core/reducers/entities.js | 14 +- .../eventespresso/core/resolvers/relations.js | 2 +- .../src/data/eventespresso/lists/entities.js | 2 +- .../src/data/eventespresso/lists/resolvers.js | 2 +- .../src/data/eventespresso/schema/entities.js | 2 +- .../test/{base-entities.js => base-model.js} | 2 +- 18 files changed, 540 insertions(+), 154 deletions(-) rename assets/src/data/eventespresso/{base-entities.js => base-model.js} (100%) create mode 100644 assets/src/data/eventespresso/core/model/entity-actions.js create mode 100644 assets/src/data/eventespresso/core/model/entity-resolvers.js create mode 100644 assets/src/data/eventespresso/core/model/entity-selectors.js create mode 100644 assets/src/data/eventespresso/core/model/index.js create mode 100644 assets/src/data/eventespresso/core/model/relation-actions.js create mode 100644 assets/src/data/eventespresso/core/model/relation-selectors.js delete mode 100644 assets/src/data/eventespresso/core/models.js rename assets/src/data/eventespresso/test/{base-entities.js => base-model.js} (99%) diff --git a/assets/src/data/eventespresso/base-entities.js b/assets/src/data/eventespresso/base-model.js similarity index 100% rename from assets/src/data/eventespresso/base-entities.js rename to assets/src/data/eventespresso/base-model.js diff --git a/assets/src/data/eventespresso/core/actions/create-entities-generators.js b/assets/src/data/eventespresso/core/actions/create-entities-generators.js index 800c02720cf..4442734dca6 100644 --- a/assets/src/data/eventespresso/core/actions/create-entities-generators.js +++ b/assets/src/data/eventespresso/core/actions/create-entities-generators.js @@ -25,6 +25,6 @@ export function* createEntity( modelName, entity ) { return null; } const entityInstance = factory.createNew( entity ); - yield receiveEntity( modelName, entityInstance ); + yield receiveEntity( entityInstance ); return entityInstance; } diff --git a/assets/src/data/eventespresso/core/actions/receive-entities.js b/assets/src/data/eventespresso/core/actions/receive-entities.js index 6e4cfdd9662..08556638636 100644 --- a/assets/src/data/eventespresso/core/actions/receive-entities.js +++ b/assets/src/data/eventespresso/core/actions/receive-entities.js @@ -53,15 +53,13 @@ function receiveAndReplaceEntityRecords( modelName, entities = {} ) { * Action creator for adding an entity to the state (as opposed to an entity * record) * - * @param {string} modelName * @param {BaseEntity} entity - * @return {{type: string, modelName: string, entity: BaseEntity}} An action + * @return {{type: string, entity: BaseEntity}} An action * object. */ -function receiveEntity( modelName, entity ) { +function receiveEntity( entity ) { return { type: types.RECEIVE_ENTITY, - modelName, entity, }; } diff --git a/assets/src/data/eventespresso/core/actions/remove-relations.js b/assets/src/data/eventespresso/core/actions/remove-relations.js index db989741ef7..09035f0a7ac 100644 --- a/assets/src/data/eventespresso/core/actions/remove-relations.js +++ b/assets/src/data/eventespresso/core/actions/remove-relations.js @@ -15,7 +15,7 @@ const { types } = ACTION_TYPES.relations; * Action creator for removing all indexed relations for a specific entity from * the state. * - * Note: The following things are accomplished by this action: + * Note: The following things are accomplished by this action (via the reducer): * - The relation index for the relation on this entity is removed from state. * - If the relation entities themselves have no other relation index, they * are also removed from state. diff --git a/assets/src/data/eventespresso/core/index.js b/assets/src/data/eventespresso/core/index.js index 528a3044d0b..f627f14890f 100644 --- a/assets/src/data/eventespresso/core/index.js +++ b/assets/src/data/eventespresso/core/index.js @@ -10,24 +10,21 @@ import reducer from './reducers'; import * as selectors from './selectors'; import * as actions from './actions'; import * as resolvers from './resolvers'; -import { createEntitySelectors } from './models'; +import { + selectors as modelSelectors, + actions as modelActions, + resolvers as modelResolvers, +} from './model'; import { REDUCER_KEY } from './constants'; import controls from '../base-controls'; -/** - * creates specific model entity selectors (getEvents, getDatetimes etc) - * wrapping the generic selectors. - * @type {Object} - */ -const entitySelectors = createEntitySelectors( selectors ); - /** * Registers store for 'eventespresso/core'. */ export default registerStore( REDUCER_KEY, { reducer, - actions, - selectors: { ...selectors, ...entitySelectors }, - resolvers: { ...resolvers }, + actions: { ...actions, ...modelActions }, + selectors: { ...selectors, ...modelSelectors }, + resolvers: { ...resolvers, ...modelResolvers }, controls, } ); diff --git a/assets/src/data/eventespresso/core/model/entity-actions.js b/assets/src/data/eventespresso/core/model/entity-actions.js new file mode 100644 index 00000000000..e1d2c0b1429 --- /dev/null +++ b/assets/src/data/eventespresso/core/model/entity-actions.js @@ -0,0 +1,120 @@ +/** + * External import + */ +import { MODEL_NAMES } from '@eventespresso/model'; + +/** + * Internal imports + */ +import { getMethodName } from '../../base-model'; + +/** + * Dynamic creation of actions for entities + * @param {Object} action The action object that dynamically created functions + * will be mapped to. + * @return {Object} The new action object containing functions for each model. + */ +export const createActions = ( action ) => MODEL_NAMES.reduce( + ( actions, modelName ) => { + actions[ getMethodName( + modelName, + '', + 'create' + ) ] = ( entity ) => action.createEntity( modelName, entity ); + actions[ getMethodName( + modelName, + 'byId', + 'delete' + ) ] = ( entityId ) => action.deleteEntityById( modelName, entityId ); + actions[ getMethodName( + modelName, + 'byId', + 'trash', + ) ] = ( entityId ) => action.trashEntityById( modelName, entityId ); + actions[ getMethodName( + modelName, + 'record', + 'persist' + ) ] = ( entity ) => action.persistEntityRecord( modelName, entity ); + actions[ getMethodName( + modelName, + 'id', + 'persistFor', + ) ] = ( entityId ) => action.persistForEntityId( modelName, entityId ); + actions[ getMethodName( + modelName, + 'ids', + 'persistFor', + ) ] = ( entityIds ) => action.persistForEntityIds( + modelName, + entityIds + ); + actions[ getMethodName( + modelName, + '', + 'persistDeletesFor', + ) ] = () => action.persistDeletesForModel( modelName ); + actions[ getMethodName( + modelName, + '', + 'persistTrashesFor', + ) ] = () => action.persistTrashesForModel( modelName ); + actions[ getMethodName( + modelName, + 'byId', + 'remove', + ) ] = ( entityId ) => action.removeEntityById( modelName, entityId ); + actions[ getMethodName( + modelName, + 'id', + 'removeDelete', + ) ] = ( entityId ) => action.removeDeleteEntityId( + modelName, + entityId + ); + actions[ getMethodName( + modelName, + 'id', + 'removeTrash', + ) ] = ( entityId ) => action.removeTrashEntityId( modelName, entityId ); + actions[ getMethodName( + modelName, + 'records', + 'receive', + ) ] = ( entities ) => action.receiveEntityRecords( + modelName, + entities + ); + actions[ getMethodName( + modelName, + 'records', + 'receiveAndReplace', + ) ] = ( entities ) => action.recieveAndReplaceEntityRecords( + modelName, + entities + ); + actions[ getMethodName( + modelName, + 'byId', + 'remove', + ) ] = ( entityId ) => action.removeEntityById( modelName, entityId ); + actions[ getMethodName( + modelName, + 'id', + 'receiveTrash', + ) ] = ( entityId ) => action.receiveTrashEntityId( + modelName, + entityId + ); + actions[ getMethodName( + modelName, + 'id', + 'receiveDelete', + ) ] = ( entityId ) => action.receiveDeleteEntityId( + modelName, + entityId + ); + return actions; + }, + {} +); diff --git a/assets/src/data/eventespresso/core/model/entity-resolvers.js b/assets/src/data/eventespresso/core/model/entity-resolvers.js new file mode 100644 index 00000000000..57522144bc7 --- /dev/null +++ b/assets/src/data/eventespresso/core/model/entity-resolvers.js @@ -0,0 +1,28 @@ +/** + * External import + */ +import { MODEL_NAMES } from '@eventespresso/model'; + +/** + * Internal imports + */ +import { getMethodName } from '../../base-model'; + +/** + * Dynamic creation of resolvers for entities + * @param {Object} resolver The resolver object that dynamically created + * functions will be mapped to. + * @return {Object} The new resolver object containing functions for each model. + */ +export const createResolvers = ( resolver ) => MODEL_NAMES.reduce( + ( resolvers, modelName ) => { + resolvers[ getMethodName( + modelName, + 'byId', + 'get' + ) ] = ( entityId ) => resolver.getEntityById( modelName, entityId ); + + return resolvers; + }, + {} +); diff --git a/assets/src/data/eventespresso/core/model/entity-selectors.js b/assets/src/data/eventespresso/core/model/entity-selectors.js new file mode 100644 index 00000000000..659f6514e8f --- /dev/null +++ b/assets/src/data/eventespresso/core/model/entity-selectors.js @@ -0,0 +1,52 @@ +/** + * External import + */ +import { MODEL_NAMES } from '@eventespresso/model'; + +/** + * Internal imports + */ +import { getMethodName } from '../../base-model'; + +/** + * Dynamic creation of selectors for entities + * @param {Object} selector selector object that dynamically created functions + * will be mapped to. + * @return {Object} The new selector objects for each model. + */ +export const createSelectors = ( selector ) => MODEL_NAMES.reduce( + ( selectors, modelName ) => { + selectors[ getMethodName( modelName, 'records' ) ] = ( + state + ) => selector.getEntityRecordsForModel( state, modelName ); + selectors[ getMethodName( modelName, '', 'get', true ) ] = ( + state + ) => selector.getEntitiesForModel( state, modelName ); + selectors[ getMethodName( modelName, 'byId' ) ] = ( + state, + entityId + ) => selector.getEntityById( state, modelName, entityId ); + selectors[ getMethodName( modelName, 'byIds', 'get', true ) ] = ( + state, + entityIds, + ) => selector.getEntitiesByIds( state, modelName, entityIds ); + selectors[ getMethodName( + modelName, + 'idsQueuedForTrash', + 'get' + ) ] = ( state ) => selector.getEntityIdsQueuedForTrash( + state, + modelName + ); + selectors[ getMethodName( + modelName, + 'idsQueuedForDelete', + 'get' + ) ] = ( state ) => selector.getEntityIdsQueuedforDelete( + state, + modelName + ); + return selectors; + }, + {} +); diff --git a/assets/src/data/eventespresso/core/model/index.js b/assets/src/data/eventespresso/core/model/index.js new file mode 100644 index 00000000000..fa5182f4be0 --- /dev/null +++ b/assets/src/data/eventespresso/core/model/index.js @@ -0,0 +1,22 @@ +import * as entityActions from './entity-actions'; +import * as entityResolvers from './entity-resolvers'; +import * as entitySelectors from './entity-selectors'; +import * as relationActions from './relation-actions'; +import * as relationSelectors from './relation-selectors'; +import * as baseSelectors from '../selectors'; +import * as baseActions from '../actions'; +import * as baseResolvers from '../resolvers'; + +export const selectors = { + ...entitySelectors.createSelectors( baseSelectors ), + ...relationSelectors.createSelectors( baseSelectors ), +}; + +export const actions = { + ...entityActions.createActions( baseActions ), + ...relationActions.createActions( baseActions ), +}; + +export const resolvers = { + ...entityResolvers.createResolvers( baseResolvers ), +}; diff --git a/assets/src/data/eventespresso/core/model/relation-actions.js b/assets/src/data/eventespresso/core/model/relation-actions.js new file mode 100644 index 00000000000..d0c1ff8d87d --- /dev/null +++ b/assets/src/data/eventespresso/core/model/relation-actions.js @@ -0,0 +1,246 @@ +/** + * External import + */ +import { MODEL_NAMES } from '@eventespresso/model'; + +/** + * Internal imports + */ +import { getMethodName } from '../../base-model'; + +/** + * Dynamic creation of actions for relations + * @param {Object} action The action object that dynamically created functions + * will be mapped to. + * @return {Object} The new action object containing functions for each model + * relation. + */ +export const createActions = ( action ) => MODEL_NAMES.reduce( + ( actions, modelName ) => { + actions[ getMethodName( + modelName, + 'relation', + 'create', + ) ] = ( entityId, relationName, relationEntity ) => action + .createRelation( + modelName, + entityId, + relationName, + relationEntity, + ); + actions[ getMethodName( + modelName, + 'relations', + 'create', + ) ] = ( entityId, relationName, relationEntities ) => action + .createRelations( + modelName, + entityId, + relationName, + relationEntities, + ); + actions[ getMethodName( + modelName, + 'relationForAddition', + 'removeDirty' + ) ] = ( entityId, relationName, relationEntityId ) => actions + .removeDirtyRelationForAddition( + modelName, + entityId, + relationName, + relationEntityId, + ); + actions[ getMethodName( + modelName, + '', + 'removeRelationFor' + ) ] = ( entityId, relationName, relationEntityId ) => actions + .removeRelationForEntity( + modelName, + entityId, + relationName, + relationEntityId + ); + actions[ getMethodName( + modelName, + '', + 'persistAddRelationsFor' + ) ] = () => actions.persistAddRelationsForModel( modelName ); + actions[ getMethodName( + modelName, + '', + 'persistDeleteRelationsFor' + ) ] = () => actions.persistDeleteRelationsForModel( modelName ); + actions[ getMethodName( + modelName, + '', + 'persistRelationsFor' + ) ] = ( addRelation ) => + actions.persistAddRelationsForModel( modelName, addRelation ); + actions[ getMethodName( + modelName, + 'relationsForId', + 'persist' + ) ] = ( entityId, addRelation ) => actions + .persistRelationsForEntityId( + modelName, + entityId, + addRelation + ); + actions[ getMethodName( + modelName, + 'relationsForIdAndRelation', + 'persist' + ) ] = ( entityId, relationName, addRelation ) => actions + .persistRelationsForEntityIdAndRelation( + modelName, + entityId, + relationName, + addRelation + ); + actions[ getMethodName( + modelName, + 'relationsForIdAndRelationId', + 'persist' + ) ] = ( entityId, relationName, relationId, addRelation ) => actions + .persistRelationsForEntityIdAndRelationId( + modelName, + entityId, + relationName, + relationId, + addRelation + ); + actions[ getMethodName( + modelName, + 'id', + 'removeDirtyRelationsFor' + ) ] = ( entityId, relationName, relationId, addRelation ) => actions + .removeDirtyRelations( + relationName, + relationId, + modelName, + entityId, + addRelation + ); + actions[ getMethodName( + modelName, + 'id', + 'receiveRelatedEntitiesFor' + ) ] = ( entityId, relationName, relationEntityIds ) => actions + .receiveRelatedEntities( + modelName, + entityId, + relationName, + relationEntityIds + ); + actions[ getMethodName( + modelName, + 'id', + 'receiveDirtyRelationIndexFor' + ) ] = ( relationName, relationId, entityId, addRelation ) => actions + .receiveDirtyRelationIndex( + relationName, + relationId, + modelName, + entityId, + addRelation + ); + actions[ getMethodName( + modelName, + 'id', + 'receiveDirtyRelationAdditionFor' + ) ] = ( relationName, relationId, entityId ) => actions + .receiveDirtyRelationAddition( + relationName, + relationId, + modelName, + entityId + ); + actions[ getMethodName( + modelName, + 'id', + 'receiveDirtyRelationDeletionFor' + ) ] = ( relationName, relationId, entityId ) => actions + .receiveDirtyRelationDeletion( + relationName, + relationId, + modelName, + entityId + ); + actions[ getMethodName( + modelName, + 'relations', + 'receiveUpdatedEntityIdFor' + ) ] = ( oldId, newId ) => actions + .receiveUpdatedEntityIdForRelations( + modelName, + oldId, + newId + ); + actions[ getMethodName( + modelName, + 'id', + 'removeAllRelatedEntitiesFor' + ) ] = ( entityId ) => actions.removeAllRelatedEntitiesForModelEntity( + modelName, + entityId + ); + actions[ getMethodName( + modelName, + 'idAndRelation', + 'removeRelatedEntitiesFor' + ) ] = ( entityId, relationName, relationIds ) => actions + .removeRelatedEntities( + modelName, + entityId, + relationName, + relationIds, + ); + actions[ getMethodName( + modelName, + 'idAndRelation', + 'removeDirtyRelationIndexFor' + ) ] = ( + relationName, + relationEntityId, + entityId, + addRelation, + ) => actions.removeDirtyRelationIndex( + relationName, + relationEntityId, + modelName, + entityId, + addRelation + ); + actions[ getMethodName( + modelName, + 'idAndRelation', + 'removeDirtyRelationAdditionFor' + ) ] = ( + relationName, + relationEntityId, + entityId, + ) => actions.removeDirtyRelationAddition( + relationName, + relationEntityId, + modelName, + entityId, + ); + actions[ getMethodName( + modelName, + 'idAndRelation', + 'removeDirtyRelationDeletionFor' + ) ] = ( + relationName, + relationEntityId, + entityId, + ) => actions.removeDirtyRelationDeletion( + relationName, + relationEntityId, + modelName, + entityId, + ); + return actions; + }, + {} +); diff --git a/assets/src/data/eventespresso/core/model/relation-selectors.js b/assets/src/data/eventespresso/core/model/relation-selectors.js new file mode 100644 index 00000000000..74d78972549 --- /dev/null +++ b/assets/src/data/eventespresso/core/model/relation-selectors.js @@ -0,0 +1,48 @@ +/** + * External import + */ +import { MODEL_NAMES } from '@eventespresso/model'; + +/** + * Internal imports + */ +import { getMethodName } from '../../base-model'; + +/** + * Dynamic creation of selectors for relations + * @param {Object} selector selector object that dynamically created functions + * will be mapped to. + * @return {Object} The new selector objects for each model relation. + */ +export const createSelectors = ( selector ) => MODEL_NAMES.reduce( + ( selectors, modelName ) => { + selectors[ getMethodName( + modelName, + 'additionRelations', + 'getQueued' + ) ] = ( state ) => selector.getRelationAdditionsQueuedForModel( + state, + modelName + ); + selectors[ getMethodName( + modelName, + 'deleteRelations', + 'getQueued' + ) ] = ( state ) => selector.getRelationAdditionsQueuedForModel( + state, + modelName + ); + selectors[ getMethodName( + modelName, + '', + 'countRelationModelsIndexedFor' + ) ] = ( state, entityId ) => selector + .countRelationModelsIndexedForEntity( + state, + modelName, + entityId + ); + return selectors; + }, + {} +); diff --git a/assets/src/data/eventespresso/core/models.js b/assets/src/data/eventespresso/core/models.js deleted file mode 100644 index 4712cb0536c..00000000000 --- a/assets/src/data/eventespresso/core/models.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Internal dependencies - */ -import { getMethodName } from '../base-entities'; -import { MODEL_NAMES } from '../../model'; - -/** - * This method creates selectors for each registered model name wrapping the - * generic source selectors. - * - * @param {Object} selector - * @return {Object} All the generated selectors. - */ -export const createEntitySelectors = ( selector ) => MODEL_NAMES.reduce( - ( selectors, modelName ) => { - selectors[ getMethodName( modelName, 'records' ) ] = ( - state - ) => selector.getEntityRecordsForModel( state, modelName ); - selectors[ getMethodName( modelName, '', 'get', true ) ] = ( - state - ) => selector.getEntitiesForModel( state, modelName ); - selectors[ getMethodName( modelName, 'byId' ) ] = ( - state, - entityId - ) => selector.getEntityById( state, modelName, entityId ); - selectors[ getMethodName( modelName, 'byIds', 'get', true ) ] = ( - state, - entityIds, - ) => selector.getEntitiesByIds( state, modelName, entityIds ); - selectors[ getMethodName( - modelName, - 'idsQueuedForTrash', - 'get' - ) ] = ( state ) => selector.getEntityIdsQueuedForTrash( - state, - modelName - ); - selectors[ getMethodName( - modelName, - 'idsQueuedForDelete', - 'get' - ) ] = ( state ) => selector.getEntityIdsQueuedforDelete( - state, - modelName - ); - selectors[ getMethodName( - modelName, - 'additionRelations', - 'getQueued' - ) ] = ( state ) => selector.getRelationAdditionsQueuedForModel( - state, - modelName - ); - selectors[ getMethodName( - modelName, - 'deleteRelations', - 'getQueued' - ) ] = ( state ) => selector.getRelationAdditionsQueuedForModel( - state, - modelName - ); - return selectors; - }, - {} -); - -export const createEntityResolvers = ( resolver ) => MODEL_NAMES.reduce( - ( resolvers, modelName ) => { - resolvers[ getMethodName( - modelName, - 'byId', - 'get' - ) ] = ( entityId ) => resolver.getEntityById( modelName, entityId ); - return resolvers; - }, - {} -); - -export const createEntityActions = ( action ) => MODEL_NAMES.reduce( - ( actions, modelName ) => { - actions[ getMethodName( - modelName, - '', - 'create' - ) ] = ( entity ) => action.createEntity( modelName, entity ); - actions[ getMethodName( - modelName, - 'relation', - 'create', - ) ] = ( entityId, relationName, relationEntity ) => action - .createRelation( - modelName, - entityId, - relationName, - relationEntity, - ); - actions[ getMethodName( - modelName, - 'relations', - 'create', - ) ] = ( entityId, relationName, relationEntities ) => action. - createRelations( - modelName, - entityId, - relationName, - relationEntities, - ); - actions[ getMethodName( - modelName, - 'byId', - 'delete' - ) ] = ( entityId ) => action.deleteEntityById( modelName, entityId ); - actions[ getMethodName( - modelName, - 'byId', - 'trash', - ) ] = ( entityId ) => action.trashEntityById( modelName, entityId ); - actions[ getMethodName( - modelName, - - ) ] - return actions; - }, - {} -); diff --git a/assets/src/data/eventespresso/core/reducers/entities.js b/assets/src/data/eventespresso/core/reducers/entities.js index 3d97770f5de..66d2b4bc717 100644 --- a/assets/src/data/eventespresso/core/reducers/entities.js +++ b/assets/src/data/eventespresso/core/reducers/entities.js @@ -4,12 +4,12 @@ import { convertToObjectFromMap } from '@eventespresso/helpers'; import { keys, isEmpty, difference, isMap, isUndefined } from 'lodash'; import { DEFAULT_CORE_STATE } from '@eventespresso/model'; -import { isModelEntityOfModel } from '@eventespresso/validators'; +import { isModelEntity } from '@eventespresso/validators'; /** * Internal imports */ -import { keepExistingEntitiesInObject } from '../../base-entities'; +import { keepExistingEntitiesInObject } from '../../base-model'; import { ACTION_TYPES } from '../actions/action-types'; const { types } = ACTION_TYPES.entities; @@ -46,20 +46,20 @@ function receiveEntity( state, action ) { * @type {string} modelName * @type {BaseEntity|null} entity */ - const { modelName, entity = null } = action; + const { entity } = action; if ( - ! modelName || - ! isModelEntityOfModel( entity, modelName ) || - ( state[ modelName ] && state[ modelName ][ entity.id ] ) + ! isModelEntity( entity ) || + ( state[ entity.modelName ] && state[ entity.modelName ][ entity.id ] ) ) { return state; } + const { modelName, id } = entity; return { ...state, [ modelName ]: { ...state[ modelName ], - [ entity.id ]: entity, + [ id ]: entity, }, }; } diff --git a/assets/src/data/eventespresso/core/resolvers/relations.js b/assets/src/data/eventespresso/core/resolvers/relations.js index af2d0740064..ae573e1cbf2 100644 --- a/assets/src/data/eventespresso/core/resolvers/relations.js +++ b/assets/src/data/eventespresso/core/resolvers/relations.js @@ -32,7 +32,7 @@ import { receiveEntityRecords, receiveRelatedEntities, } from './../actions'; -import { keepExistingEntitiesInObject } from '../../base-entities'; +import { keepExistingEntitiesInObject } from '../../base-model'; import { REDUCER_KEY as CORE_REDUCER_KEY } from './../constants'; import { REDUCER_KEY as SCHEMA_REDUCER_KEY } from '../../schema/constants'; diff --git a/assets/src/data/eventespresso/lists/entities.js b/assets/src/data/eventespresso/lists/entities.js index 233dbf09770..aa5ac495998 100644 --- a/assets/src/data/eventespresso/lists/entities.js +++ b/assets/src/data/eventespresso/lists/entities.js @@ -1,7 +1,7 @@ /** * Internal dependencies */ -import { getMethodName } from '../base-entities'; +import { getMethodName } from '../base-model'; import { MODEL_NAMES } from '../../model'; import { isResolving } from '../base-selectors'; import { REDUCER_KEY } from './constants'; diff --git a/assets/src/data/eventespresso/lists/resolvers.js b/assets/src/data/eventespresso/lists/resolvers.js index 3f60c8a911e..16674e2db30 100644 --- a/assets/src/data/eventespresso/lists/resolvers.js +++ b/assets/src/data/eventespresso/lists/resolvers.js @@ -17,7 +17,7 @@ import { getFactoryByModel, resolveGetEntityByIdForIds, } from '../base-resolvers.js'; -import { keepExistingEntitiesInObject } from '../base-entities'; +import { keepExistingEntitiesInObject } from '../base-model'; import { REDUCER_KEY as CORE_REDUCER_KEY } from '../core/constants'; /** diff --git a/assets/src/data/eventespresso/schema/entities.js b/assets/src/data/eventespresso/schema/entities.js index 7c76d674e3a..53844b98ce1 100644 --- a/assets/src/data/eventespresso/schema/entities.js +++ b/assets/src/data/eventespresso/schema/entities.js @@ -1,7 +1,7 @@ /** * Internal dependencies */ -import { getMethodName } from '../base-entities'; +import { getMethodName } from '../base-model'; import { MODEL_NAMES } from '../../model'; import { isResolving } from '../base-selectors'; import { REDUCER_KEY } from './constants'; diff --git a/assets/src/data/eventespresso/test/base-entities.js b/assets/src/data/eventespresso/test/base-model.js similarity index 99% rename from assets/src/data/eventespresso/test/base-entities.js rename to assets/src/data/eventespresso/test/base-model.js index c188da8454f..2eae3fd8747 100644 --- a/assets/src/data/eventespresso/test/base-entities.js +++ b/assets/src/data/eventespresso/test/base-model.js @@ -1,7 +1,7 @@ /** * Internal imports */ -import { getMethodName, keepExistingEntitiesInObject } from '../base-entities'; +import { getMethodName, keepExistingEntitiesInObject } from '../base-model'; describe( 'getMethodName()', () => { [