Browse Source

show warnings before dismissing prompt, and add to tasks and help

feat/vitejs-trent
Trent Larson 8 months ago
parent
commit
e020caaa50
  1. 6
      project.task.yaml
  2. 65
      src/components/GiftedDialog.vue
  3. 62
      src/views/GiftedDetails.vue
  4. 16
      src/views/HelpView.vue

6
project.task.yaml

@ -1,10 +1,6 @@
tasks : 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 - alert & stop if give amount < 0
- add warning that all data (except ID) is public - add warning that all data (except ID) is public
- onboarding video - onboarding video
@ -16,6 +12,7 @@ tasks :
- .1 on ideas, put an "x" to close it assignee-group:ui - .1 on ideas, put an "x" to close it assignee-group:ui
- 16 save data backups in Google - 16 save data backups in Google
- 16 generate and use passkeys for identities - 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 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 - .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 - .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) - .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.) - 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) - 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 - 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

65
src/components/GiftedDialog.vue

@ -195,6 +195,45 @@ export default class GiftedDialog extends Vue {
} }
async confirm() { 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.close();
this.$notify( this.$notify(
{ {
@ -229,32 +268,6 @@ export default class GiftedDialog extends Vue {
amountInput: number, amountInput: number,
unitCode: string = "HUR", 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 { try {
const identity = await libsUtil.getIdentity(this.activeDid); const identity = await libsUtil.getIdentity(this.activeDid);
const result = await createAndSubmitGive( const result = await createAndSubmitGive(

62
src/views/GiftedDetails.vue

@ -288,27 +288,6 @@ export default class GiftedDetails extends Vue {
} }
async confirm() { 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) { if (!this.activeDid) {
this.$notify( this.$notify(
{ {
@ -317,12 +296,23 @@ export default class GiftedDetails extends Vue {
title: "Error", title: "Error",
text: "You must select an identifier before you can record a give.", text: "You must select an identifier before you can record a give.",
}, },
-1, 2000,
); );
return; return;
} }
if (parseFloat(this.amountInput) < 0) {
if (!this.description && !this.amountInput) { 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( this.$notify(
{ {
group: "alert", group: "alert",
@ -332,11 +322,33 @@ export default class GiftedDetails extends Vue {
this.libsUtil.UNIT_LONG[this.unitCode] this.libsUtil.UNIT_LONG[this.unitCode]
}.`, }.`,
}, },
-1, 2000,
); );
return; 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 { try {
const identity = await libsUtil.getIdentity(this.activeDid); const identity = await libsUtil.getIdentity(this.activeDid);
const result = await createAndSubmitGive( const result = await createAndSubmitGive(

16
src/views/HelpView.vue

@ -39,22 +39,22 @@
and network. and network.
</p> </p>
<p> <p>
You can show giving and also offer help to ideas, based on others' You highlight giving and also offer help to ideas -- which could be
willingness to help out, too. You can record your own ideas and invite conditional on others' willingness to help, too.
others to collaborate. You can record your own ideas and invite others to collaborate.
</p> </p>
<p> <p>
This app uses the power of cryptography to build a reputation, recording This app uses the power of cryptography to build a reputation, recording
activity that you can share at your discretion. You put some activity activity that you can share at your discretion. You put some activity
public, but your sensitive information is not shared with anyone, public, but these services don't share your ID with others without explicit consent.
including our services. This is in contrast to Meta and Google, who hold This is in contrast to Meta and Google, who hold
your data and allow you use it. Those services are useful, but they have your data and allow you use it while they manage sharing...
the control; this app gives you the control. those services are useful but they have the control, whereas this app gives you the control.
</p> </p>
<h2 class="text-xl font-semibold">How do I get started?</h2> <h2 class="text-xl font-semibold">How do I get started?</h2>
<p> <p>
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 about this app, on the Contacts
<fa icon="users" class="fa-fw" /> page. After they register you, you can <fa icon="users" class="fa-fw" /> page. After they register you, you can
select any contact on the home page (or "anonymous") and record your select any contact on the home page (or "anonymous") and record your

Loading…
Cancel
Save