Commit 56cdc171 authored by Anton's avatar Anton

Replace author with creator, replace old map types with new classes

parent 64a095b6
......@@ -129,7 +129,7 @@
// 'Created': DateTime.fromISO(annotationData.created).toFormat('yyyy LLL dd, HH:mm:ss.SSS'),
'Start': this.root.millisToText(ms),
'Duration': annotationData.target.selector._valueDuration ? this.root.millisToText(annotationData.target.selector._valueDuration) : '-',
'Author': annotationData.author.name,
'Author': annotationData.creator.name,
// 'Purpose': annotationData.body.purpose,
// 'Body Type': annotationData.body.type,
'Body Value': annotationData.body.value
......
......@@ -328,13 +328,13 @@
filtered[group] = this.annotations.filter(annotation => annotation.body.type === group)
}
}
else if (this.groupAnnotationsBy === 'author') {
else if (this.groupAnnotationsBy === 'creator') {
groups = this.annotations.reduce((sum, annotation) => {
if (sum.indexOf(annotation.author.name) === -1) sum.push(annotation.author.name)
if (sum.indexOf(annotation.creator.name) === -1) sum.push(annotation.creator.name)
return sum
}, [])
for (let group of groups) {
filtered[group] = this.annotations.filter(annotation => annotation.author.name === group)
filtered[group] = this.annotations.filter(annotation => annotation.creator.name === group)
}
}
}
......
......@@ -14,10 +14,10 @@
div(:class="{'text-grey-8': radioFilter == 'none'}")
q-tabs(color="dark")
q-tab(:class="{'bg-green': filterAuthors.length > 0}", slot="title", name="authors") authors
q-tooltip.bg-dark.shadow-8.moba-border(v-if="filterAuthors.length > 0", anchor="bottom middle", self="top middle", :offset="[10, 0]")
q-tab(:class="{'bg-green': filterCreators.length > 0}", slot="title", name="creators") creators
q-tooltip.bg-dark.shadow-8.moba-border(v-if="filterCreators.length > 0", anchor="bottom middle", self="top middle", :offset="[10, 0]")
q-list.no-border.no-padding
q-item.q-caption.q-pa-xs.no-margin(v-for="author in filterAuthors") {{ author }}
q-item.q-caption.q-pa-xs.no-margin(v-for="creator in filterCreators") {{ creator }}
q-tab(:class="{'bg-green': filterTags.length > 0}", slot="title", name="tags") tags
q-tooltip.bg-dark.shadow-8.moba-border(v-if="filterTags.length > 0", anchor="bottom middle", self="top middle", :offset="[10, 0]")
......@@ -32,13 +32,13 @@
q-tab(slot="title", name="date") date
q-tab(slot="title", name="search") search
q-tab-pane(name="authors")
q-tab-pane(name="creators")
q-btn-group.row.full-width
q-btn.col-6 select all
q-btn.col-6(@click="filterAuthors = ['']") select none
q-btn.col-6(@click="filterCreators = ['']") select none
q-list.no-border
q-item.no-padding(v-for="author in authors")
q-checkbox.q-caption(v-model="filterAuthors", :val="author", :label="author", color="white")
q-item.no-padding(v-for="creator in creators")
q-checkbox.q-caption(v-model="filterCreators", :val="creator", :label="creator", color="white")
q-tab-pane(name="tags")
q-btn-group.row.full-width
......
......@@ -14,10 +14,10 @@
// AUTHOR
//
span.text-grey-9 {{ shortenName(annotation.author.name) }}  
span.text-grey-9 {{ shortenName(annotation.creator.name) }}  
q-tooltip.bg-dark.shadow-8.moba-border(anchor="center left",
self="center right", :offset="[10, 0]")
| {{ annotation.author.name }}
| {{ annotation.creator.name }}
// TEXT
//
......
......@@ -31,7 +31,7 @@
q-item-main {{ video.annotation.body.source.id }}
q-item
q-item-side Author:
q-item-main {{ video.annotation.author.name }}
q-item-main {{ video.annotation.creator.name }}
q-item
q-item-side Created:
q-item-main {{ video.annotation.created }}
......
......@@ -113,8 +113,10 @@ export default {
annotation_body: 'Annotation text',
accept_terms: 'I accept the Terms and Conditions',
author: 'Author',
creator: 'Creator',
biovision_hierarchy: 'Biovision Hierarchy',
unknown_author: 'Unknown Author',
anonymous_creator: 'Anonymous',
unknown_creator: 'Unknown',
created: 'Created',
css_stylesheet: 'CSS Stylesheet',
updated: 'Updated',
......
......@@ -6,7 +6,7 @@ class ACLHelpers {
if (recursive) {
const results = await context.$store.dispatch('annotations/find', { 'target.id': payload.id })
for (let item of results.items) {
if (item.author.id === context.$store.state.auth.user.uuid) {
if (item.creator.id === context.$store.state.auth.user.uuid) {
const itemPayload = ObjectUtil.merge({}, payload)
itemPayload._uuid = item._uuid
await context.$store.dispatch(action, itemPayload)
......
......@@ -19,7 +19,7 @@ const exportCSV = function (items, filename = undefined) {
annotation.body.purpose,
start,
duration ? duration.as('seconds') : '',
annotation.author.name || 'Unknown',
annotation.creator.name || 'Unknown',
annotation.body.type,
annotation._created,
annotation._updated || ''
......
......@@ -52,7 +52,7 @@
headers: {
Authorization: `Bearer ${localStorage.getItem('access_token')}`
},
type: constants.mapTypes.MAP_TYPE_2DGRID,
type: constants.mapClasses.MAP_CLASS_GRID,
payload: {},
schema: {
fields: {
......@@ -68,7 +68,7 @@
},
submit: {
handler () {
_this.payload.type = [constants.mapTypes.MAP_TYPE_2DGRID]
_this.payload.type = [constants.mapClasses.MAP_CLASS_GRID]
return _this.$store.dispatch('maps/post', _this.payload)
.then(() => _this.$router.push({ name: 'mosys.grids.list' }))
}
......
......@@ -103,7 +103,7 @@
group_remove: undefined,
recursive: false
},
type: constants.mapTypes.MAP_TYPE_2D_GRID,
type: constants.mapClasses.MAP_CLASS_GRID,
payload: this.$route.params.uuid ? _this.$store.dispatch('maps/get', _this.$route.params.uuid) : undefined,
schema: {
fields: {
......
......@@ -35,14 +35,14 @@
data () {
const _this = this
return {
query: { type: constants.mapTypes.MAP_TYPE_2DGRID },
query: { type: constants.mapClasses.MAP_CLASS_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.creator = row.creator ? row.creator.name : _this.$t('labels.unknown_creator')
transformed._uuid = row._uuid
transformed.id = row.id
rows[i] = transformed
......@@ -67,9 +67,9 @@
.toLocaleString(DateTime.DATETIME_SHORT_WITH_SECONDS)
},
{
name: 'author',
label: _this.$t('labels.author'),
field: 'author',
name: 'creator',
label: _this.$t('labels.creator'),
field: 'creator',
sortable: true,
filter: true
}
......
......@@ -45,7 +45,7 @@
const tags = await _this.$store.dispatch('tags/get', row)
transformed.tags = tags.join(', ')
transformed.type = row.body.type
transformed.author = row.author ? row.author.name : _this.$t('labels.unknown_author')
transformed.creator = row.creator ? row.creator.name : _this.$t('labels.unknown_creator')
transformed._uuid = row._uuid
transformed.id = row.id
rows[i] = transformed
......@@ -98,9 +98,9 @@
field: 'tags'
},
{
name: 'author',
label: _this.$t('labels.author'),
field: 'author',
name: 'creator',
label: _this.$t('labels.creator'),
field: 'creator',
sortable: true,
filter: true
}
......
......@@ -59,7 +59,7 @@
headers: {
Authorization: `Bearer ${localStorage.getItem('access_token')}`
},
type: constants.mapTypes.MAP_TYPE_TIMELINE,
type: constants.mapClasses.MAP_CLASS_TIMELINE,
payload: undefined,
schema: {
fields: {
......@@ -75,7 +75,7 @@
},
submit: {
handler () {
_this.payload.type = [constants.mapTypes.MAP_TYPE_TIMELINE]
_this.payload.type = [constants.mapClasses.MAP_CLASS_TIMELINE]
return _this.$store.dispatch('maps/post', _this.payload)
.then(() => _this.$router.push({ name: 'piecemaker.timelines.list' }))
}
......
......@@ -79,7 +79,7 @@
exportLabel: this.$t('buttons.export_timeline'),
downloadUrlCSV: undefined,
exportLabelCSV: this.$t('buttons.export_timeline_csv'),
type: constants.mapTypes.MAP_TYPE_TIMELINE,
type: constants.mapClasses.MAP_CLASS_TIMELINE,
payload: this.$route.params.uuid ? _this.$store.dispatch('maps/get', _this.$route.params.uuid) : undefined,
acl: {
group: undefined,
......
......@@ -63,14 +63,14 @@
height: 100,
offsetY: 20
},
query: { type: constants.mapTypes.MAP_TYPE_TIMELINE },
query: { type: constants.mapClasses.MAP_CLASS_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.creator = row.creator ? (row.creator.name || _this.$t('labels.anonymous_creator')) : _this.$t('labels.unknown_creator')
transformed._uuid = row._uuid
transformed.id = row.id
rows[i] = transformed
......@@ -96,9 +96,9 @@
.toLocaleString(DateTime.DATETIME_SHORT_WITH_SECONDS)
},
{
name: 'author',
label: _this.$t('labels.author'),
field: 'author',
name: 'creator',
label: _this.$t('labels.creator'),
field: 'creator',
sortable: true,
filter: true
}
......
......@@ -6,7 +6,7 @@
.col-10.offset-1(slot="form-title")
h5.no-margin.text-center
div {{ map.title }}
.text-grey-8 {{ map.author.name }}
.text-grey-8 {{ map.creator.name }}
// btn: back
q-btn.absolute-top-left(slot="backButton", @click="$router.push({ name: 'piecemaker.timelines.list' })", icon="keyboard_backspace", round, small, style="top: 66px; left: 16px;")
......
......@@ -4,7 +4,7 @@ const swimLane = {
groupAnnotationsBy: 'type',
options: [
{label: 'Type', value: 'type'},
{label: 'Author', value: 'author'}
{label: 'Creator', value: 'creator'}
],
laneMode: 'collapse',
optionsLaneMode: [
......
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