This is a redux based framework for managering api entities and application forms.
Check out the docs for more info.
- Added
validateAll
form config option
- Added error message for bad-set pagination property
- Added orderableFormFieldName to options. No forms and arrays can be ordered by any field.
- Added getEndpoint() selector to models and forms
- Added opporunity to load model by empty id(for singltone models - just loads the endpoint and save the schema)
- Fixed unregistered field warning for custom idField
- Added
transformBeforeSubmit
option to form config
- Added
getByUrl
andasyncGetByUrl
methods to EntityList. Also, you can defineapiName
in config
transformBeforeSubmit
can be a function (formValues) => data. Can be used to send arrays
- Added opportunity to pass RegExp to
getForm
(and others) selectors. Returns object with matched form name keys - Added opportunity to pass form names array to
getFormActions
. Returns object with form name keys
- Now
RestifyForeignKey
andRestifyForeignKeysArray
can be set for plain id fields, or even for changing behaviour from model to id fields. They will return model by auto-request anyway - Added
mapServerDataToIds
option to form config.applyServerData
now can respects form model field and map models into ids for sending to server
- Added
allowIdRequests
option to api model
getToken
can now return Promise
- Now
getIsLoadingById
andgetIsLoadingArrray
returns true, if the url is not registered inloadsManager
- Now
allowNested
param for foreign key respects all models, not only self-recursive
- Added
clearData
action to entityManager, so we can clear all api data for model. Useful for cases, when we want to forget some corrupted entities loaded. - Added
clearDataOnRouteChange
setting for model, so we can clear all model data on route changes
- Added
fetchConfig
to RestifyLinkedModel. This config will be applied in linkedModel.getById(, fetchConfig)
- Added
transformArrayResponse
andgetEntityUrl
to api and model configs
- Added
crudAction
andspecialAction
togetEntityUrl
, nowgetEntityUrl
can return an object with utl and method - Added
transformEntityResponse
to api and model configs
- Added
$modelType
field to all restify models
- Added
clearPagesOnRouteChange
setting for model, so we can config default clearing pages on route changes
- Added
modelConfig
setting forgetArray
and other array getters, allowing to tweak model config for given request
- Added
RestifyField
base field class. Does not have any functionality yet, but can be used to give a field a verbose name and default values - Added
warnAboutUnregisteredFields
option to model config
- Added
onXhrReady
callback for api calls
- Added
RestifyGenericForeignKey
for gereric relations
- Added
forceLoad
option for arrays
- Added
getPaginationQuery
option for model and api config
- Added
getHeaders
option for xhr adapter
- Added
trasformedValues
argument totransformBeforeSubmit
function, so you can use values with applied fakeId, submitExclude and other default transforms
- Added
query
param into form config, so you can send forms to endpoints with query params - Added
authMethod
option to api config
- Added
withCredentials
param for api config
- Added
skipLoadsManager
config param for grneral api actions
- Added
useSnakeCase
api parameter, so we can disable snake_case convertation for api
- Now
asyncGetById
also has async getters for missing model fields
- Now creating a new entity clears pages carefully, caching old version and serving it, while new request is in process
- Added typescript typings
- Added
transformErrorResponse
function
- Added
useOptimisticUpdate
config to form
- Added
parentEntities
config to getById
- Added
hasById
selector
- Added
key
anddata
params to generic fields
- Added config and
useOptimistic
parameter todeleteById
action. Use, if you want to show element deletion progress.
- Added modelName parameter to transform Response functions
- Added
retries
retryTimeoutMs
options to restify config, so user can define default reties behaviour
- Added
trackDirtyFields
andsubmitOnlyDirtyFields
options to form config (see docs)
- Added
apiConfig
field to form config, allowing to override api settings, likegetToken
etc.
- Added
updateRestify
for dynamic add models and forms
updateRestify({
apiDefinitions,
modelsDefinitions,
formsDefinitions,
onUpdateRestify: () => {
RESTIFY_CONFIG.store.replaceReducer(getReducer())
},
})
- Added boolean
clearOldPages
parameter(default - true) to clearPages actions. If passed false, oldPages are not cleared by this actions, so data can still be displayed, while loading new one.
- Return a Promise resolving to
true
from httpCodesCallback to retry a request
- Added boolean
clearOldSingleEntities
parameter(default - true) to clearData actions. If passed false, oldSingleEntities are not cleared by this actions, so data can still be displayed, while loading new one.
- Added support for unregistered parents for models
- Added $old key to RestifyModel, for detecting old data being updated at the moment
- Added opportunity to return promise from onXhrReady
- Added pagination parameter to
getPaginationQuery
option
- Added request data to code callbacks function call
- Added
preventAutoGetters
option togetById
- Added
invokeBaseCallbacks
tohttpCodesCallbacks
api config option for easier overrides
- Export low-level api
calculateValidationResult
for validation customisation
- Added
updateEntityManagerData
action
- Added
withPages
andapiConfig
options toRestifyForeignKeysArray
action, allowing to store model fields with links to custom filtering configs
- Added
preventLoad
option togetArrayConfig
- Added
useRequestsLock
api andwithRequestsLock
option toRestifyForeignKeysArray