Skip to content

Commit

Permalink
more README, release 1.1.0
Browse files Browse the repository at this point in the history
This marks the completion of the CRUD functionality using the native table.
However, no sorting, filtering, or responsiveness is implemented yet.
  • Loading branch information
michael-brade committed Oct 15, 2015
1 parent d20c63a commit ff72138
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 16 deletions.
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# A Perfect DerbyJS CRUD Component

This is a completely generic, responsive, and realtime collaborative DerbyJS component to create, read, update,
and delete entities in a database using Racer. The items of an entity are displayed using
the great jQuery DataTables plugin. Realtime collaboration and conflict resolution is achieved
and delete entities in a database using Racer. The items of an entity are displayed using either the great jQuery
DataTables plugin, or a native DerbyJS implementation. Realtime collaboration and conflict resolution is achieved
through RacerJS and ShareJS.

That said, perfection is hard to achieve and there always seems something more that could be done. You are welcome
Expand Down Expand Up @@ -35,7 +35,8 @@ TODO
- model path `$locale.locale` to point the current lowercase locale (en, de, ...)
- view function `t($locale, path, params)` to return the translation of path in the current locale
See below for detailed i18n information.
* a browserify bundle that provides `jQuery` and exposes the following DataTables requires:
* in case you want the DataTables implementation: a browserify bundle that provides `jQuery` and exposes the following
DataTables requires:
```
require('datatables')
require('datatables.bootstrap')
Expand All @@ -54,6 +55,29 @@ require('datatables.searchHighlight')

An object with entity definitions is needed to tell derby-entity what to display, it doesn't analyze the database by
itself. Each entity, the items of which are to be displayed and edited, has to be defined with all its attributes.
How that is to be done is documented in [derby-entities-lib](https://github.com/michael-brade/derby-entities-lib).

Since I wanted this component to be really real-time, I created an unusual editing model: there is no cancel or save
when you select an item, changes are instantly written to the model and visible from all clients. This carries a
drawback I haven't been able to solve yet: there is no undo (hard to implement with Derby at the moment), and it is
thus possible to inadvertently change something, maybe even without noticing. I need a good idea on this one. So far
I thought about saving the current item in local storage as soon as it is changed, but I am not sure if that is an ideal
way... how to recover it? How to display it?

Now, about technical usage: you need to load the component with

```ls
app.component require('derby-entity')
```

then in your view, use

```html
<view name="entity" entity="{{_page.entity}}" item="{{_page.item}}" />
```

to instantiate it, and provide it with an `entity` schema object. Optionally, pass along an `item`
that should already be selected initially.


### i18n
Expand Down
21 changes: 8 additions & 13 deletions package.json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: 'derby-entity'
description: 'A Perfect DerbyJS CRUD Component'
version: '1.0.0'
version: '1.1.0'

author:
name: 'Michael Brade'
Expand All @@ -11,6 +11,7 @@ author:
keywords:
'derby'
'entity'
'crud'


repository:
Expand All @@ -21,24 +22,18 @@ dependencies:
# utils
'lodash': '3.x'

# the following are commented out because they are not immediate
# dependencies - the app needs to depend on those

# derby
#'derby': 'michael-brade/derby'

# racer
#'racer': 'michael-brade/racer'
#'racer-bundle': 'michael-brade/racer-bundle'


# derby components
'derby-entities-lib': '1.0.x'
'derby-entities-lib': '1.1.x'
'derby-entity-select2': '1.0.x'

'derby-ui-toast': '*'
'd-comp-palette': '*'

peerDependencies:
'derby': 'michael-brade/derby'



devDependencies:
'livescript': '1.x'
'node-sass': '3.3.x'
Expand Down

0 comments on commit ff72138

Please sign in to comment.