Commit 7645201a authored by Anton Koch's avatar Anton Koch

Update mbjs-quasar module to use new data table version

Closes #91 - Tables are now fully searchable
Adds optional requestTransform function to tables to alter incoming rows on request call
parent 5768d835
......@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Data tables now use an optional requestTransform function to process rows on each data update
- Info button in the post-annotator shows video metadata (so far only title)
- Hyperlinks in annotations are now clickable in the post-annotator
- Limited markdown support for annotations (allowed tags: 'b', 'i', 'em', 'strong', 'a', 'br', 'p')
......@@ -27,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Tables are now propely searchable
- Timeline list now updates after deleting an item
### Removed
......
......@@ -8673,9 +8673,9 @@
}
},
"mbjs-quasar": {
"version": "0.0.41",
"resolved": "https://registry.npmjs.org/mbjs-quasar/-/mbjs-quasar-0.0.41.tgz",
"integrity": "sha512-yY3+idVql29OgRR22Q2dzlJtZQ9vmnqXVyF4RSrbHLBY3dZiMjEa/ygJJALIU+sZnKy/1cLBSuTxgXuy6ANOvg==",
"version": "0.0.42",
"resolved": "https://registry.npmjs.org/mbjs-quasar/-/mbjs-quasar-0.0.42.tgz",
"integrity": "sha512-3qm0P0MB4l4vPe9U1s2mq1alNcjCLVuwoeVtKPajMH7Pk9D8zbW9agdqWpPWAz/QTWy0wfhr3fbe7Z4UM46LDQ==",
"requires": {
"marked": "^0.5.2",
"sanitize-html": "^1.19.2"
......
......@@ -9,6 +9,7 @@
:title="'routes.mosys.grids.list.title'",
path="maps",
:query="query",
:requestTransform="requestTransform"
base-path="grids",
:has-show="true")
template(slot="buttons-left")
......@@ -24,6 +25,19 @@
const _this = this
return {
query: { type: constants.MAP_TYPE_2D_GRID },
requestTransform: async rows => {
for (let i in rows) {
const transformed = {}
const row = rows[i]
transformed.title = row.title
transformed.last_updated = row.updated ? row.updated : row.created
transformed.author = row.author ? row.author.name : _this.$t('labels.unknown_author')
transformed.uuid = row.uuid
transformed.id = row.id
rows[i] = transformed
}
return rows
},
config: {
columns: [
{
......@@ -37,15 +51,16 @@
label: _this.$t('labels.last_updated'),
sortable: true,
sort: _this.$sort.onDateValue,
field: row => row.updated ? row.updated : row.created,
field: 'last_updated',
format: val => DateTime.fromISO(val)
.toLocaleString(DateTime.DATETIME_SHORT_WITH_SECONDS)
},
{
name: 'author',
label: _this.$t('labels.author'),
field: row => row.author ? row.author.name : _this.$t('labels.unknown_author'),
sortable: true
field: 'author',
sortable: true,
filter: true
}
],
actions: [
......
......@@ -21,7 +21,7 @@
// rect.moba-test(@click="testWidth = testWidth + 30", fill="red", :width="testWidth", height="30")
data-table(:config="config", :title="'routes.piecemaker.timelines.list.title'", ref="listTable",
path="maps", :query="query", base-path="timelines", :has-show="isStaging")
path="maps", :query="query", base-path="timelines", :has-show="isStaging", :request-transform="requestTransform")
template(slot="buttons-left")
q-btn(@click="$router.push({ name: 'piecemaker.timelines.create' })", color="primary") {{ $t('buttons.create_timeline') }}
</template>
......@@ -66,12 +66,25 @@
}
], */
query: { type: constants.MAP_TYPE_TIMELINE },
requestTransform: async rows => {
for (let i in rows) {
const transformed = {}
const row = rows[i]
transformed.title = row.title
transformed.last_updated = row.updated ? row.updated : row.created
transformed.author = row.author ? row.author.name : _this.$t('labels.unknown_author')
transformed.uuid = row.uuid
transformed.id = row.id
rows[i] = transformed
}
return rows
},
config: {
columns: [
{
name: 'title',
label: _this.$t('labels.title'),
field: row => row.title,
field: 'title',
filter: true,
sortable: true
},
......@@ -80,15 +93,16 @@
label: _this.$t('labels.last_updated'),
sortable: true,
sort: _this.$sort.onDateValue,
field: row => row.updated ? row.updated : row.created,
field: 'last_updated',
format: val => DateTime.fromISO(val)
.toLocaleString(DateTime.DATETIME_SHORT_WITH_SECONDS)
},
{
name: 'author',
label: _this.$t('labels.author'),
field: row => row.author ? row.author.name : _this.$t('labels.unknown_author'),
sortable: true
field: 'author',
sortable: true,
filter: true
}
],
actions: [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment