Make all properties available in Tabulator records list, show record type with icon #233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements half of #229 and half of #228. Showing record types or all properties in the detail view is not yet implemented, although some of the logic introduced in this branch could be reused for that purpose. I wanted to go all the way, but did not manage to go beyond the record list because of time constraints and distractions.
The
autoColumnsDefinitions
callback fromfrontend/vre/record/record.list.view.js
was outfactored tofrontend/vre/utils/tabulator-utils.js
and then extended to always include all possible properties as available columns. The set of visible columns is still determined in the same way, though the decision to make a column visible now happens in a different place. For the extended logic, I used theMappedCollection
feature from the freshly outfactored, still-to-be-released backbone-collection-transformers.Then, I added an icon column to convey the record type: a person silhouette for a biographical record, a book for a bibliographical record. The HTML for the icon is rendered using a Mustache template. That template is potentially reusable for a
Backbone.View
. The HTML includes textual labels for screen readers. Record types are indicated at the individual record level rather than the catalog level, because I seemed to recall that some catalogs are mixed.The new code lacks tests, but it has a low complexity and I hope it is sufficiently documented.
This branch has some side effects:
postgres
service port is no longer forwarded to the host. This was never necessary to make docker-compose work. The reason to remove it is that it somehow prevented me from starting the container.<textarea>
back into a default<input>
, because the height difference with other columns annoyed me.edpop-record-ontology.json
that I discovered by coincidence.As an aside, I notice that
edpoprec:BiographicalRecord
is a subclass ofedpoprec:Record
whileedpoprec:BibliographicalRecord
isn't. Conversely,BibliographicalRecord
has a cardinality constraint whileBiographicalRecord
doesn't. I did not address this because I didn't know whether it was merely an oversight or whether there was a good reason for it.