From 2a2ef61fc412486ba46e52dbe10b184a657ef922 Mon Sep 17 00:00:00 2001 From: jedi Date: Wed, 27 Nov 2024 19:39:58 +0100 Subject: [PATCH] add basic view for item history --- web/src/App.vue | 13 +- web/src/components/AuthenticatedImage.vue | 28 ++- web/src/components/CollapsableCards.vue | 6 +- web/src/components/EditItem.vue | 17 +- web/src/components/Timeline.vue | 76 +++----- web/src/components/TimelineMail.vue | 39 +--- web/src/components/TimelinePlacement.vue | 85 +++++++++ web/src/components/TimelineRelatedItem.vue | 74 ++------ web/src/components/TimelineRelatedTicket.vue | 94 ++++++++++ web/src/components/inputs/AsyncButton.vue | 1 - web/src/components/inputs/InputCombo.vue | 61 +++--- web/src/components/inputs/InputPhoto.vue | 9 +- web/src/router.js | 11 +- web/src/store.js | 37 ++-- web/src/views/Item.vue | 186 +++++++++++++++++++ web/src/views/Items.vue | 54 ++---- web/src/views/Ticket.vue | 130 ++++++++++--- web/src/views/Tickets.vue | 20 +- 18 files changed, 630 insertions(+), 311 deletions(-) create mode 100644 web/src/components/TimelinePlacement.vue create mode 100644 web/src/components/TimelineRelatedTicket.vue create mode 100644 web/src/views/Item.vue diff --git a/web/src/App.vue b/web/src/App.vue index bd4956f..d2c9f7d 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,5 +1,6 @@ diff --git a/web/src/components/Timeline.vue b/web/src/components/Timeline.vue index 88bfa94..41e1274 100644 --- a/web/src/components/Timeline.vue +++ b/web/src/components/Timeline.vue @@ -21,6 +21,9 @@ + + + @@ -30,40 +33,15 @@ + +

{{ item }}

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