Browse Source

fix where the project ID was not included; fix the pause when submitting give & show toast of aknowledgement; remove 'emit'

kb/add-usage-guide
Trent Larson 1 year ago
parent
commit
5b7ccf9ef0
  1. 3
      project.task.yaml
  2. 40
      src/components/GiftedDialog.vue
  3. 7
      src/views/ContactGiftingView.vue
  4. 7
      src/views/HomeView.vue
  5. 2
      src/views/ProjectViewView.vue

3
project.task.yaml

@ -1,7 +1,6 @@
tasks:
- figure out why a give directly on the project doesn't show in that project afterward
- in endorser-push-server - mount folder for persistent sqlite DB outside of container
- test alerts on all pages -- or refactor to new "notify" (since AlertMessage refactoring may require a change, et. ContactQRScanShowView)
- 40 notifications :
@ -28,7 +27,7 @@ tasks:
- 24 Move to Vite assignee:matthew
- .2 fit more than 8 icons on home & project view screens, with a "more" button to contacts page if there are more than 2 rows
- .2 fit as many icons as possible on home & project view screens but only going halfway down the page
- .1 Remove notification alert visuals on home page
- .5 Add infinite scroll to gifts on the home page
- .5 bug - search for "Safari" does not find the project, but if already on the "Anywhere" tab it shows all

40
src/components/GiftedDialog.vue

@ -51,16 +51,9 @@
</template>
<script lang="ts">
import { Vue, Component, Prop, Emit } from "vue-facing-decorator";
import {
createAndSubmitGive,
CreateAndSubmitGiveResult,
ErrorResult,
GiverInputInfo,
GiverOutputInfo,
} from "@/libs/endorserServer";
import { Vue, Component, Prop } from "vue-facing-decorator";
import { createAndSubmitGive, GiverInputInfo } from "@/libs/endorserServer";
import { accountsDB, db } from "@/db/index";
import { Contact } from "@/db/tables/contacts";
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
import { Account } from "@/db/tables/accounts";
@ -76,6 +69,7 @@ export default class GiftedDialog extends Vue {
$notify!: (notification: Notification, timeout?: number) => void;
@Prop message = "";
@Prop projectId = "";
activeDid = "";
apiServer = "";
@ -93,7 +87,7 @@ export default class GiftedDialog extends Vue {
this.activeDid = settings?.activeDid || "";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
console.log("Error retrieving settings from database.", err);
console.log("Error retrieving settings from database:", err);
this.$notify(
{
group: "alert",
@ -125,27 +119,34 @@ export default class GiftedDialog extends Vue {
this.hours = `${Math.max(0, (parseFloat(this.hours) || 1) - 1)}`;
}
@Emit("dialog-result")
cancel(): GiverOutputInfo {
cancel() {
this.close();
this.description = "";
this.giver = undefined;
this.hours = "0";
return { action: "cancel" };
}
@Emit("dialog-result")
async confirm() {
await this.recordGive(
this.close();
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
this.recordGive(
this.giver?.did as string | undefined,
this.description,
parseFloat(this.hours),
);
this.close();
).then(() => {
this.description = "";
this.giver = undefined;
this.hours = "0";
return { action: "confirm" };
});
}
public async getIdentity(activeDid: string) {
@ -211,6 +212,7 @@ export default class GiftedDialog extends Vue {
this.activeDid,
description,
hours,
this.projectId,
);
if (
@ -236,7 +238,7 @@ export default class GiftedDialog extends Vue {
title: "Success",
text: "That gift was recorded.",
},
-1,
10000,
);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any

7
src/views/ContactGiftingView.vue

@ -66,12 +66,7 @@
</li>
</ul>
<GiftedDialog
ref="customDialog"
@dialog-result="handleDialogResult"
message="Received from"
>
</GiftedDialog>
<GiftedDialog ref="customDialog" message="Received from"> </GiftedDialog>
</section>
</template>

7
src/views/HomeView.vue

@ -58,12 +58,7 @@
</div>
</div>
<GiftedDialog
ref="customDialog"
@dialog-result="handleDialogResult"
message="Received from"
>
</GiftedDialog>
<GiftedDialog ref="customDialog" message="Received from"> </GiftedDialog>
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4">
<h2 class="text-xl font-bold mb-4">Latest Activity</h2>

2
src/views/ProjectViewView.vue

@ -196,8 +196,8 @@
<GiftedDialog
ref="customDialog"
@dialog-result="handleDialogResult"
message="Received from"
:projectId="this.projectId"
>
</GiftedDialog>
</section>

Loading…
Cancel
Save