forked from jsnbuchanan/crowd-funder-for-time-pwa
refactor project screen: add action to record a give from it, and add checks to give confirmation buttons
This commit is contained in:
@@ -172,7 +172,7 @@
|
||||
Nobody that you know issued or confirmed this claim.
|
||||
</div>
|
||||
<div v-if="confirmerIdList.length > 0">
|
||||
The following people issued or confirmed this claim.
|
||||
The following people confirmed this claim.
|
||||
<ul class="ml-4">
|
||||
<li
|
||||
v-for="confirmerId in confirmerIdList"
|
||||
@@ -661,34 +661,16 @@ export default class ClaimView extends Vue {
|
||||
}
|
||||
|
||||
// retrieve the list of confirmers
|
||||
const confirmUrl =
|
||||
this.apiServer +
|
||||
"/api/report/issuersWhoClaimedOrConfirmed?claimId=" +
|
||||
encodeURIComponent(serverUtil.stripEndorserPrefix(claimId));
|
||||
const confirmHeaders = await serverUtil.getHeaders(userDid);
|
||||
const response = await this.axios.get(confirmUrl, {
|
||||
headers: confirmHeaders,
|
||||
});
|
||||
if (response.status === 200) {
|
||||
const resultList1 = response.data.result || [];
|
||||
//const publicUrls = resultList.publicUrls || [];
|
||||
delete resultList1.publicUrls;
|
||||
// remove any hidden DIDs
|
||||
const resultList2 = R.reject(serverUtil.isHiddenDid, resultList1);
|
||||
// remove confirmations by this user
|
||||
const resultList3 = R.reject(
|
||||
(did: string) => did === this.giveDetails?.issuerDid,
|
||||
resultList2,
|
||||
);
|
||||
this.confirmerIdList = resultList3;
|
||||
this.numConfsNotVisible = resultList1.length - resultList2.length;
|
||||
if (resultList3.length === resultList2.length) {
|
||||
// the issuer was not in the "visible" list so they must be hidden
|
||||
// so subtract them from the non-visible confirmers count
|
||||
this.numConfsNotVisible = this.numConfsNotVisible - 1;
|
||||
}
|
||||
this.confsVisibleToIdList =
|
||||
response.data.result.resultVisibleToDids || [];
|
||||
const confirmerInfo = await libsUtil.retrieveConfirmerIdList(
|
||||
this.apiServer,
|
||||
claimId,
|
||||
this.veriClaim.issuer,
|
||||
userDid,
|
||||
);
|
||||
if (confirmerInfo) {
|
||||
this.confirmerIdList = confirmerInfo.confirmerIdList;
|
||||
this.confsVisibleToIdList = confirmerInfo.confsVisibleToIdList;
|
||||
this.numConfsNotVisible = confirmerInfo.numConfsNotVisible;
|
||||
} else {
|
||||
this.confsVisibleErrorMessage =
|
||||
"Had problems retrieving confirmations.";
|
||||
@@ -797,6 +779,17 @@ export default class ClaimView extends Vue {
|
||||
}
|
||||
|
||||
notifyWhyCannotConfirm() {
|
||||
libsUtil.notifyWhyCannotConfirm(
|
||||
this.$notify,
|
||||
this.isRegistered,
|
||||
this.veriClaim.claimType,
|
||||
this.giveDetails,
|
||||
this.activeDid,
|
||||
this.confirmerIdList,
|
||||
);
|
||||
}
|
||||
|
||||
notifyWhyCannotConfirmBak() {
|
||||
if (!this.isRegistered) {
|
||||
this.$notify(
|
||||
{
|
||||
@@ -853,7 +846,7 @@ export default class ClaimView extends Vue {
|
||||
group: "alert",
|
||||
type: "info",
|
||||
title: "Cannot Confirm",
|
||||
text: "You cannot confirm this claim.",
|
||||
text: "You cannot confirm this claim. There are no other details, but we can help more if you contact us and send us screenshots.",
|
||||
},
|
||||
3000,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user