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. 46
      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: 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 - 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) - test alerts on all pages -- or refactor to new "notify" (since AlertMessage refactoring may require a change, et. ContactQRScanShowView)
- 40 notifications : - 40 notifications :
@ -28,7 +27,7 @@ tasks:
- 24 Move to Vite assignee:matthew - 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 - .1 Remove notification alert visuals on home page
- .5 Add infinite scroll to gifts on the 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 - .5 bug - search for "Safari" does not find the project, but if already on the "Anywhere" tab it shows all

46
src/components/GiftedDialog.vue

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

7
src/views/ContactGiftingView.vue

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

7
src/views/HomeView.vue

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

2
src/views/ProjectViewView.vue

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

Loading…
Cancel
Save