Skip to content

Commit

Permalink
Fixing time not saving correctly in edit event dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 committed Nov 7, 2023
1 parent aa34c76 commit e568810
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
v-model="started_at"
class="time-picker"
:timezone="timezone"
@update:modelValue="update_started_at"

Check warning on line 17 in src/dispatch/static/dispatch/src/incident/EditEventDialog.vue

View workflow job for this annotation

GitHub Actions / build

v-on event '@update:modelValue' must be hyphenated
/>
<span
class="ml-10 time-utc text-caption"
style="position: absolute; margin-top: -20px"
>
Time in UTC is {{ formatToUTC(started_at) }}
Time in UTC is {{ formatToUTC(started_at_in_utc) }}
</span>
</v-col>
<v-col cols="5">
Expand Down Expand Up @@ -77,6 +78,7 @@ export default {
return {
timezones: ["UTC", "America/Los_Angeles"],
timezone: "UTC",
started_at_in_utc: "",
}
},
Expand Down Expand Up @@ -109,9 +111,14 @@ export default {
setTimeToNow() {
this.eventStart = new Date()
},
update_started_at(val) {
this.started_at = val
this.started_at_in_utc = val
}

Check failure on line 117 in src/dispatch/static/dispatch/src/incident/EditEventDialog.vue

View workflow job for this annotation

GitHub Actions / build

Insert `,`
},
mounted() {
this.init()
this.started_at_in_utc = this.started_at
},
}
</script>
Expand Down
8 changes: 4 additions & 4 deletions src/dispatch/static/dispatch/src/incident/TimelineTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Export
</v-btn>
<timeline-filter-dialog ref="filter_dialog" />
<edit-event-dialog />
<edit-event-dialog v-if="showEditEventDialog" />
<delete-event-dialog />
</v-row>
<template v-if="events && events.length">
Expand Down Expand Up @@ -66,7 +66,7 @@
</v-col>
<v-col cols="1">
<div v-if="isEditable(event)" class="custom-event-edit">
<v-btn variant="plain" @click="showEditEventDialog(event)">
<v-btn variant="plain" @click="showNewEditEventDialog(event)">
<v-icon>mdi-pencil</v-icon>
</v-btn>
<br />
Expand Down Expand Up @@ -197,7 +197,7 @@ export default {
},
computed: {
...mapFields("incident", ["selected.events", "selected.name", "timeline_filters"]),
...mapFields("incident", ["selected.events", "selected.name", "timeline_filters", "dialogs.showEditEventDialog",]),

Check failure on line 200 in src/dispatch/static/dispatch/src/incident/TimelineTab.vue

View workflow job for this annotation

GitHub Actions / build

Replace `"selected.events",·"selected.name",·"timeline_filters",·"dialogs.showEditEventDialog",` with `⏎······"selected.events",⏎······"selected.name",⏎······"timeline_filters",⏎······"dialogs.showEditEventDialog",⏎····`
sortedEvents: function () {
return this.events.slice().sort((a, b) => new Date(a.started_at) - new Date(b.started_at))
Expand All @@ -206,7 +206,7 @@ export default {
methods: {
...mapActions("incident", [
"showNewEventDialog",
"showEditEventDialog",
"showNewEditEventDialog",
"showDeleteEventDialog",
"showNewPreEventDialog",
"togglePin",
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/static/dispatch/src/incident/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const actions = {
commit("SET_DIALOG_SHOW_HANDOFF", false)
commit("RESET_SELECTED")
},
showEditEventDialog({ commit }, event) {
showNewEditEventDialog({ commit }, event) {
state.selected.currentEvent = event
commit("SET_DIALOG_EDIT_EVENT", true)
},
Expand Down

0 comments on commit e568810

Please sign in to comment.