Skip to content
Snippets Groups Projects
Verified Commit 8083df4c authored by Martin Weise's avatar Martin Weise
Browse files
parent 286d19d6
No related branches found
No related tags found
1 merge request!411WIP
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
</template> </template>
<script> <script>
import { useCacheStore } from '~/stores/cache.js';
export default { export default {
props: { props: {
resource: { resource: {
...@@ -34,6 +36,11 @@ export default { ...@@ -34,6 +36,11 @@ export default {
} }
} }
}, },
data () {
return {
cacheStore: useCacheStore()
}
},
computed: { computed: {
mode () { mode () {
if (!this.resource) { if (!this.resource) {
...@@ -54,8 +61,17 @@ export default { ...@@ -54,8 +61,17 @@ export default {
} }
return this.$t(`pages.database.status.${this.mode}`) return this.$t(`pages.database.status.${this.mode}`)
}, },
cacheUser () {
return this.cacheStore.getUser
},
hasIdentifier () { hasIdentifier () {
return this.resource.identifiers?.length > 0 if (!this.resource.identifiers) {
return false
}
if (!this.cacheUser) {
return this.resource.identifiers.filter(i => i.status === 'published').length
}
return this.resource.identifiers.filter(i => i.status === 'published' || i.owner.id === this.cacheUser.uid)
}, },
color () { color () {
if (this.hasIdentifier) { if (this.hasIdentifier) {
......
...@@ -272,7 +272,7 @@ export default { ...@@ -272,7 +272,7 @@ export default {
if (!this.database || !this.database.identifiers) { if (!this.database || !this.database.identifiers) {
return [] return []
} }
return this.database.identifiers.filter(i => i.query_id === this.$route.params.subset_id) return this.database.identifiers.filter(i => i.database_id === this.$route.params.database_id)
}, },
pid () { pid () {
return this.$route.query.pid return this.$route.query.pid
......
...@@ -33,6 +33,7 @@ import java.util.UUID; ...@@ -33,6 +33,7 @@ import java.util.UUID;
@NamedQuery(name = "Identifier.findSubsetIdentifier", query = "select i from Identifier i where i.database.id = ?1 and i.queryId = ?2 and i.type = 'SUBSET' ORDER BY i.id DESC"), @NamedQuery(name = "Identifier.findSubsetIdentifier", query = "select i from Identifier i where i.database.id = ?1 and i.queryId = ?2 and i.type = 'SUBSET' ORDER BY i.id DESC"),
@NamedQuery(name = "Identifier.findViewIdentifier", query = "select i from Identifier i where i.database.id = ?1 and i.viewId = ?2 and i.type = 'VIEW' ORDER BY i.id DESC"), @NamedQuery(name = "Identifier.findViewIdentifier", query = "select i from Identifier i where i.database.id = ?1 and i.viewId = ?2 and i.type = 'VIEW' ORDER BY i.id DESC"),
@NamedQuery(name = "Identifier.findEarliest", query = "select i from Identifier i ORDER BY i.created ASC limit 1"), @NamedQuery(name = "Identifier.findEarliest", query = "select i from Identifier i ORDER BY i.created ASC limit 1"),
@NamedQuery(name = "Identifier.findAll", query = "select i from Identifier i ORDER BY i.created DESC"),
}) })
public class Identifier implements Serializable { public class Identifier implements Serializable {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment