Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: disabled editing in EventList outside of Bucket view
  • Loading branch information
ErikBjare committed Jan 2, 2021
1 parent 9060c9e commit b3ac5a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/views/Bucket.vue
Expand Up @@ -28,7 +28,7 @@ div

vis-timeline(:buckets="[bucket_with_events]", :showRowLabels="false")

aw-eventlist(:bucket_id="id", @save="updateEvent", :events="events")
aw-eventlist(:bucket_id="id", @save="updateEvent", :events="events" editable=true)
</template>

<script>
Expand Down
11 changes: 8 additions & 3 deletions src/visualizations/EventList.vue
@@ -1,5 +1,4 @@
<template lang="pug">

div
b-card.event-container(no-block=true)
span(slot="header")
Expand All @@ -25,8 +24,9 @@ div
icon(name="tags")
// TODO: Add some kind of highlighting to key
| {{ key }}: {{ val }}
span.field.float-right
b-btn(v-b-modal="'edit-modal-' + event.id", variant="outline-dark" size="sm")
span(v-if="editable")
b-btn.field(v-b-modal="'edit-modal-' + event.id", variant="outline-dark" size="sm" style="padding: 0 0.2em 0 0.2em")
icon(name="edit")
| Edit

event-editor(
Expand Down Expand Up @@ -113,6 +113,7 @@ $border-color: #ddd;
</style>

<script>
import 'vue-awesome/icons/edit';
import 'vue-awesome/icons/tags';
import 'vue-awesome/icons/clock';
import 'vue-awesome/icons/calendar';
Expand All @@ -127,6 +128,10 @@ export default {
props: {
bucket_id: String,
events: Array,
editable: {
default: false,
type: Boolean,
},
},
data: function () {
return {
Expand Down

0 comments on commit b3ac5a6

Please sign in to comment.