diff --git a/core/files/media_v2.py b/core/files/media_v2.py index 00161b3..9cc8f23 100644 --- a/core/files/media_v2.py +++ b/core/files/media_v2.py @@ -38,8 +38,6 @@ def media_urls(request, hash): 'Age': 0, 'ETag': file.hash, }) - except FileNotFoundError: - return Response(status=status.HTTP_404_NOT_FOUND) except File.DoesNotExist: return Response(status=status.HTTP_404_NOT_FOUND) except EmailAttachment.DoesNotExist: @@ -82,8 +80,6 @@ def thumbnail_urls(request, size, hash): 'ETag': file.hash + "_" + str(size), }) - except FileNotFoundError: - return Response(status=status.HTTP_404_NOT_FOUND) except File.DoesNotExist: return Response(status=status.HTTP_404_NOT_FOUND) except EmailAttachment.DoesNotExist: diff --git a/web/src/App.vue b/web/src/App.vue index d2c9f7d..bd4956f 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,6 +1,5 @@ diff --git a/web/src/components/Timeline.vue b/web/src/components/Timeline.vue index 41e1274..88bfa94 100644 --- a/web/src/components/Timeline.vue +++ b/web/src/components/Timeline.vue @@ -21,9 +21,6 @@ - - - @@ -33,15 +30,40 @@ - -

{{ item }}

  • - + + + +
    +
    + + + + Save Comment + +
    +
  • - + + + +
    +
    + {{ newestMailSubject }} +
    +
    + + + + Send Mail + +
    +
  • @@ -56,20 +78,12 @@ import TimelineAssignment from "@/components/TimelineAssignment.vue"; import TimelineRelatedItem from "@/components/TimelineRelatedItem.vue"; import TimelineShippingVoucher from "@/components/TimelineShippingVoucher.vue"; import AsyncButton from "@/components/inputs/AsyncButton.vue"; -import TimelinePlacement from "@/components/TimelinePlacement.vue"; -import TimelineRelatedTicket from "@/components/TimelineRelatedTicket.vue"; export default { name: 'Timeline', components: { - TimelineRelatedTicket, - TimelinePlacement, - TimelineShippingVoucher, - TimelineRelatedItem, - TimelineAssignment, - TimelineStateChange, - TimelineComment, - TimelineMail + TimelineShippingVoucher, AsyncButton, + TimelineRelatedItem, TimelineAssignment, TimelineStateChange, TimelineComment, TimelineMail }, props: { timeline: { @@ -77,13 +91,33 @@ export default { default: () => [] } }, + emits: ['sendMail', 'addComment'], + data: () => ({ + newMail: "", + newComment: "" + }), computed: { - ...mapGetters(['stateInfo']) + ...mapGetters(['stateInfo']), + newestMailSubject() { + const mail = this.timeline.filter(item => item.type === 'mail').pop(); + return mail ? mail.subject : ""; + }, }, + methods: { + ...mapActions(['sendMail', 'postComment']), + sendMailAndClear: async function () { + await this.sendMail(this.newMail); + this.newMail = ""; + }, + addCommentAndClear: async function () { + await this.postComment(this.newComment); + this.newComment = ""; + } + } }; - \ No newline at end of file diff --git a/web/src/components/TimelineRelatedItem.vue b/web/src/components/TimelineRelatedItem.vue index 2670215..c17a3a8 100644 --- a/web/src/components/TimelineRelatedItem.vue +++ b/web/src/components/TimelineRelatedItem.vue @@ -1,15 +1,12 @@ @@ -38,11 +72,16 @@ import AuthenticatedImage from "@/components/AuthenticatedImage.vue"; import AuthenticatedDataLink from "@/components/AuthenticatedDataLink.vue"; -import {mapMutations} from "vuex"; +import Lightbox from "@/components/Lightbox.vue"; export default { name: 'TimelineRelatedItem', - components: {AuthenticatedImage, AuthenticatedDataLink}, + components: {Lightbox, AuthenticatedImage, AuthenticatedDataLink}, + data() { + return { + lightboxHash: null, + } + }, props: { 'item': { type: Object, @@ -59,8 +98,13 @@ export default { }, methods: { - ...mapMutations(['openLightboxModalWith']) - } + openLightboxModalWith(attachment) { + this.lightboxHash = attachment.hash; + }, + closeLightboxModal() { // Closes the editing modal and discards the edited copy of the item. + this.lightboxHash = null; + }, + }, }; diff --git a/web/src/components/TimelineRelatedTicket.vue b/web/src/components/TimelineRelatedTicket.vue deleted file mode 100644 index 694a4e0..0000000 --- a/web/src/components/TimelineRelatedTicket.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - - - \ No newline at end of file diff --git a/web/src/components/inputs/AsyncButton.vue b/web/src/components/inputs/AsyncButton.vue index 833f964..a3c1712 100644 --- a/web/src/components/inputs/AsyncButton.vue +++ b/web/src/components/inputs/AsyncButton.vue @@ -24,6 +24,7 @@ export default { }, methods: { async handleClick() { + console.log("AsyncButton.handleClick() called"); if (this.task && typeof this.task === 'function') { this.disabled = true; try { diff --git a/web/src/components/inputs/InputCombo.vue b/web/src/components/inputs/InputCombo.vue index fc64d42..50b5459 100644 --- a/web/src/components/inputs/InputCombo.vue +++ b/web/src/components/inputs/InputCombo.vue @@ -1,36 +1,39 @@ diff --git a/web/src/components/inputs/InputPhoto.vue b/web/src/components/inputs/InputPhoto.vue index 90745a4..e50033b 100644 --- a/web/src/components/inputs/InputPhoto.vue +++ b/web/src/components/inputs/InputPhoto.vue @@ -2,10 +2,9 @@
    Image not available.