From e020caaa50bae6c85338853c4a1961480702b2f4 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 23 Mar 2024 17:35:58 -0600 Subject: [PATCH] show warnings before dismissing prompt, and add to tasks and help --- project.task.yaml | 6 +-- src/components/GiftedDialog.vue | 65 ++++++++++++++++++++------------- src/views/GiftedDetails.vue | 62 ++++++++++++++++++------------- src/views/HelpView.vue | 16 ++++---- 4 files changed, 86 insertions(+), 63 deletions(-) diff --git a/project.task.yaml b/project.task.yaml index 4b78769..9dc8aea 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -1,10 +1,6 @@ tasks : -- bug - landscape doesn't show full camera -- bug - got blank screen and errors on iPhone with no bottom tabs -- add to readme - check version, close tabs & restart phone if necessary -- bug maybe - a new give remembers the previous project - alert & stop if give amount < 0 - add warning that all data (except ID) is public - onboarding video @@ -16,6 +12,7 @@ tasks : - .1 on ideas, put an "x" to close it assignee-group:ui - 16 save data backups in Google - 16 generate and use passkeys for identities +- .5 show "give" buttons (eg. from anonymous) even if they can't give, greyed out, and give them a warning and instructions - .2 fix give dialog from "more contacts" off home page to allow giving to this user - .2 fix bottom of project selection map, where the icons are hidden but a tap goes to the icon's page assignee-group:ui @@ -66,6 +63,7 @@ tasks : - .1 add cursor-pointer on the icons for giving on the project page, and on the list of projects on the discover page - .2 record when InfiniteScroll hits the end of the list and don't trigger any more loads (feed, project list, give & offer lists) +- bug (that is hard to reproduce) - got blank screen and errors on iPhone with no bottom tabs - bug - turning notifications on from the help screen did not stay, though account screen toggle did stay (From Jason on iPhone.) - refactor - supply the projectId to the OfferDialog just like we do with the GiftedDialog offerId (in the "open" method, maybe as well as an attribute) - the confirm button on each give on the ProjectViewView page doesn't have all the context of the ClaimView page, so it can show sometimes inappropriately; consider consolidation diff --git a/src/components/GiftedDialog.vue b/src/components/GiftedDialog.vue index 386f762..1a8d8be 100644 --- a/src/components/GiftedDialog.vue +++ b/src/components/GiftedDialog.vue @@ -195,6 +195,45 @@ export default class GiftedDialog extends Vue { } async confirm() { + if (!this.activeDid) { + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: "You must select an identifier before you can record a give.", + }, + 3000, + ); + return; + } + if (parseFloat(this.amountInput) < 0) { + this.$notify( + { + group: "alert", + type: "danger", + text: "You may not send a negative number.", + title: "", + }, + 2000, + ); + return; + } + if (!this.description && !parseFloat(this.amountInput)) { + this.$notify( + { + group: "alert", + type: "danger", + title: "Error", + text: `You must enter a description or some number of ${ + this.libsUtil.UNIT_LONG[this.unitCode] + }.`, + }, + 2000, + ); + return; + } + this.close(); this.$notify( { @@ -229,32 +268,6 @@ export default class GiftedDialog extends Vue { amountInput: number, unitCode: string = "HUR", ) { - if (!this.activeDid) { - this.$notify( - { - group: "alert", - type: "danger", - title: "Error", - text: "You must select an identifier before you can record a give.", - }, - -1, - ); - return; - } - - if (!description && !amountInput) { - this.$notify( - { - group: "alert", - type: "danger", - title: "Error", - text: `You must enter a description or some number of ${this.libsUtil.UNIT_LONG[unitCode]}.`, - }, - -1, - ); - return; - } - try { const identity = await libsUtil.getIdentity(this.activeDid); const result = await createAndSubmitGive( diff --git a/src/views/GiftedDetails.vue b/src/views/GiftedDetails.vue index 0d3c167..1405fba 100644 --- a/src/views/GiftedDetails.vue +++ b/src/views/GiftedDetails.vue @@ -288,27 +288,6 @@ export default class GiftedDetails extends Vue { } async confirm() { - this.$notify( - { - group: "alert", - type: "toast", - text: "Recording the give...", - title: "", - }, - 1000, - ); - // this is asynchronous, but we don't need to wait for it to complete - await this.recordGive(); - } - - /** - * - * @param giverDid may be null - * @param description may be an empty string - * @param amountInput may be 0 - * @param unitCode may be omitted, defaults to "HUR" - */ - public async recordGive() { if (!this.activeDid) { this.$notify( { @@ -317,12 +296,23 @@ export default class GiftedDetails extends Vue { title: "Error", text: "You must select an identifier before you can record a give.", }, - -1, + 2000, ); return; } - - if (!this.description && !this.amountInput) { + if (parseFloat(this.amountInput) < 0) { + this.$notify( + { + group: "alert", + type: "danger", + text: "You may not send a negative number.", + title: "", + }, + 2000, + ); + return; + } + if (!this.description && !parseFloat(this.amountInput)) { this.$notify( { group: "alert", @@ -332,11 +322,33 @@ export default class GiftedDetails extends Vue { this.libsUtil.UNIT_LONG[this.unitCode] }.`, }, - -1, + 2000, ); return; } + this.$notify( + { + group: "alert", + type: "toast", + text: "Recording the give...", + title: "", + }, + 1000, + ); + + // this is asynchronous, but we don't need to wait for it to complete + await this.recordGive(); + } + + /** + * + * @param giverDid may be null + * @param description may be an empty string + * @param amountInput may be 0 + * @param unitCode may be omitted, defaults to "HUR" + */ + public async recordGive() { try { const identity = await libsUtil.getIdentity(this.activeDid); const result = await createAndSubmitGive( diff --git a/src/views/HelpView.vue b/src/views/HelpView.vue index 0db68e2..79571b6 100644 --- a/src/views/HelpView.vue +++ b/src/views/HelpView.vue @@ -39,22 +39,22 @@ and network.

- You can show giving and also offer help to ideas, based on others' - willingness to help out, too. You can record your own ideas and invite - others to collaborate. + You highlight giving and also offer help to ideas -- which could be + conditional on others' willingness to help, too. + You can record your own ideas and invite others to collaborate.

This app uses the power of cryptography to build a reputation, recording activity that you can share at your discretion. You put some activity - public, but your sensitive information is not shared with anyone, - including our services. This is in contrast to Meta and Google, who hold - your data and allow you use it. Those services are useful, but they have - the control; this app gives you the control. + public, but these services don't share your ID with others without explicit consent. + This is in contrast to Meta and Google, who hold + your data and allow you use it while they manage sharing... + those services are useful but they have the control, whereas this app gives you the control.

How do I get started?

- You need someone to register you -- usually the person who told you + You need someone to register you, like the person who told you about this app, on the Contacts page. After they register you, you can select any contact on the home page (or "anonymous") and record your