From a9b12f4d7c219180e212e65f6a9d2ed25064c5bd Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 17 Aug 2024 19:59:02 -0600 Subject: [PATCH] allow editing of an offer --- src/components/OfferDialog.vue | 45 ++--- src/libs/endorserServer.ts | 23 +-- src/router/index.ts | 7 +- src/views/ClaimView.vue | 56 ++++-- src/views/ContactsView.vue | 9 +- ...iftedDetails.vue => GiftedDetailsView.vue} | 6 +- src/views/NewEditProjectView.vue | 2 - ...{OfferDetails.vue => OfferDetailsView.vue} | 168 +++++++++--------- src/views/ProjectViewView.vue | 6 +- 9 files changed, 190 insertions(+), 132 deletions(-) rename src/views/{GiftedDetails.vue => GiftedDetailsView.vue} (98%) rename src/views/{OfferDetails.vue => OfferDetailsView.vue} (81%) diff --git a/src/components/OfferDialog.vue b/src/components/OfferDialog.vue index af48780..f208571 100644 --- a/src/components/OfferDialog.vue +++ b/src/components/OfferDialog.vue @@ -36,18 +36,27 @@ -
- - Expiration +
+ + + Conditions, expiration... + -

Sign & Send to publish to the world @@ -71,7 +80,6 @@ diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index c19632c..6d282d9 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -271,7 +271,7 @@ @@ -1131,8 +1131,11 @@ export default class ContactsView extends Vue { ); } - openOfferDialog(recipientDid: string) { - (this.$refs.customOfferDialog as OfferDialog).open(recipientDid); + openOfferDialog(recipientDid: string, recipientName: string) { + (this.$refs.customOfferDialog as OfferDialog).open( + recipientDid, + recipientName, + ); } private async onClickCancelName() { diff --git a/src/views/GiftedDetails.vue b/src/views/GiftedDetailsView.vue similarity index 98% rename from src/views/GiftedDetails.vue rename to src/views/GiftedDetailsView.vue index c727bdf..dfdb189 100644 --- a/src/views/GiftedDetails.vue +++ b/src/views/GiftedDetailsView.vue @@ -269,6 +269,7 @@ export default class GiftedDetails extends Vue { this.hideBackButton = (this.$route as Router).query["hideBackButton"] === "true"; this.message = ((this.$route as Router).query["message"] as string) || ""; + // find any offer ID const fulfills = this.prevCredToEdit?.claim?.fulfills; const fulfillsArray = Array.isArray(fulfills) @@ -351,6 +352,7 @@ export default class GiftedDetails extends Vue { ); } } + // these should be functions but something's wrong with the syntax in the <> conditional this.givenToProject = !!this.projectId; this.givenToRecipient = !this.givenToProject && !!this.recipientDid; @@ -549,7 +551,7 @@ export default class GiftedDetails extends Vue { group: "alert", type: "warning", title: "Error", - text: "To assign to a project, you must open this dialog through a project.", + text: "To assign to a project, you must open this page through a project.", }, 3000, ); @@ -574,7 +576,7 @@ export default class GiftedDetails extends Vue { group: "alert", type: "warning", title: "Error", - text: "To assign to a recipient, you must open this dialog from a contact.", + text: "To assign to a recipient, you must open this page from a contact.", }, 3000, ); diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue index 5c469f0..0e167e1 100644 --- a/src/views/NewEditProjectView.vue +++ b/src/views/NewEditProjectView.vue @@ -91,14 +91,12 @@

diff --git a/src/views/OfferDetails.vue b/src/views/OfferDetailsView.vue similarity index 81% rename from src/views/OfferDetails.vue rename to src/views/OfferDetailsView.vue index f6a1225..a733d5d 100644 --- a/src/views/OfferDetails.vue +++ b/src/views/OfferDetailsView.vue @@ -21,9 +21,8 @@

What Was Offered

- From {{ giverName }} - to + Offer to {{ offeredToProject ? projectName @@ -36,7 +35,7 @@