forked from jsnbuchanan/crowd-funder-for-time-pwa
add confirmation before confirming hours, plus some other verbiage
This commit is contained in:
@@ -6,7 +6,6 @@
|
|||||||
- replace user-affecting console.logs with error messages (eg. catches)
|
- replace user-affecting console.logs with error messages (eg. catches)
|
||||||
|
|
||||||
- contacts v1 :
|
- contacts v1 :
|
||||||
- produce a video assignee:trent
|
|
||||||
- .2 warn about amounts when you cannot see them
|
- .2 warn about amounts when you cannot see them
|
||||||
- .1 remove 'copy' until it works
|
- .1 remove 'copy' until it works
|
||||||
- .5 switch to prod server
|
- .5 switch to prod server
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
<fa icon="circle-check" class="text-green-600 fa-fw ml-1" />
|
<fa icon="circle-check" class="text-green-600 fa-fw ml-1" />
|
||||||
<span class="tooltiptext">Confirmed</span>
|
<span class="tooltiptext">Confirmed</span>
|
||||||
</span>
|
</span>
|
||||||
<button v-else class="tooltip" @click="confirm(record)">
|
<button v-else class="tooltip" @click="confirmGiven(record)">
|
||||||
<fa icon="circle" class="text-blue-600 fa-fw ml-1" />
|
<fa icon="circle" class="text-blue-600 fa-fw ml-1" />
|
||||||
<span class="tooltiptext">Unconfirmed</span>
|
<span class="tooltiptext">Unconfirmed</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -239,7 +239,11 @@ export default class ContactsView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async confirm(record: GiveServerRecord) {
|
async confirmGiven(record: GiveServerRecord) {
|
||||||
|
if (!confirm("Are you sure you want to mark this as confirmed?")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Make claim
|
// Make claim
|
||||||
// I use clone here because otherwise it gets a Proxy object.
|
// I use clone here because otherwise it gets a Proxy object.
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
|||||||
@@ -166,7 +166,11 @@
|
|||||||
/* eslint-enable prettier/prettier */
|
/* eslint-enable prettier/prettier */
|
||||||
}}
|
}}
|
||||||
<span class="tooltiptext-left">
|
<span class="tooltiptext-left">
|
||||||
{{ givenByMeDescriptions[contact.did] || "Nothing" }}
|
{{
|
||||||
|
givenByMeDescriptions[contact.did]
|
||||||
|
? "Most recently: " + givenByMeDescriptions[contact.did]
|
||||||
|
: "(None given yet.)"
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
class="text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-6"
|
class="text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-6"
|
||||||
@@ -188,7 +192,11 @@
|
|||||||
/* eslint-enable prettier/prettier */
|
/* eslint-enable prettier/prettier */
|
||||||
}}
|
}}
|
||||||
<span class="tooltiptext-left">
|
<span class="tooltiptext-left">
|
||||||
{{ givenToMeDescriptions[contact.did] || "Nothing" }}
|
{{
|
||||||
|
givenToMeDescriptions[contact.did]
|
||||||
|
? "Most recently: " + givenToMeDescriptions[contact.did]
|
||||||
|
: "(None received yet.)"
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
class="text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-6"
|
class="text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-6"
|
||||||
@@ -324,8 +332,8 @@ export default class ContactsView extends Vue {
|
|||||||
const contactUnconfirmed: Record<string, number> = {};
|
const contactUnconfirmed: Record<string, number> = {};
|
||||||
const allData: Array<GiveServerRecord> = resp.data.data;
|
const allData: Array<GiveServerRecord> = resp.data.data;
|
||||||
for (const give of allData) {
|
for (const give of allData) {
|
||||||
if (give.unit == "HUR") {
|
const recipDid: string = give.recipientDid;
|
||||||
const recipDid: string = give.recipientDid;
|
if (recipDid && give.unit == "HUR") {
|
||||||
if (give.amountConfirmed) {
|
if (give.amountConfirmed) {
|
||||||
const prevAmount = contactConfirmed[recipDid] || 0;
|
const prevAmount = contactConfirmed[recipDid] || 0;
|
||||||
contactConfirmed[recipDid] = prevAmount + give.amount;
|
contactConfirmed[recipDid] = prevAmount + give.amount;
|
||||||
@@ -339,7 +347,6 @@ export default class ContactsView extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//console.log("Done retrieving gives", contactConfirmed);
|
|
||||||
this.givenByMeDescriptions = contactDescriptions;
|
this.givenByMeDescriptions = contactDescriptions;
|
||||||
this.givenByMeConfirmed = contactConfirmed;
|
this.givenByMeConfirmed = contactConfirmed;
|
||||||
this.givenByMeUnconfirmed = contactUnconfirmed;
|
this.givenByMeUnconfirmed = contactUnconfirmed;
|
||||||
|
|||||||
Reference in New Issue
Block a user