Browse Source

refactor some verbiage & look-and-feel

split_build_process
Trent Larson 2 months ago
parent
commit
7acf921e82
  1. 4
      src/libs/util.ts
  2. 51
      src/views/ClaimView.vue
  3. 48
      src/views/ConfirmGiftView.vue
  4. 8
      src/views/ProjectViewView.vue

4
src/libs/util.ts

@ -348,9 +348,9 @@ export function offerGiverDid(
export const canFulfillOffer = ( export const canFulfillOffer = (
veriClaim: GenericCredWrapper<GenericVerifiableCredential>, veriClaim: GenericCredWrapper<GenericVerifiableCredential>,
) => { ) => {
return !!( return (
veriClaim.claimType === "Offer" && veriClaim.claimType === "Offer" &&
offerGiverDid(veriClaim as GenericCredWrapper<OfferVerifiableCredential>) !!offerGiverDid(veriClaim as GenericCredWrapper<OfferVerifiableCredential>)
); );
}; };

51
src/views/ClaimView.vue

@ -201,11 +201,15 @@
</span> </span>
</div> </div>
<div class="mt-2">
<span v-if="totalConfirmers() === 0">Nobody has confirmed this.</span> <span v-if="totalConfirmers() === 0">Nobody has confirmed this.</span>
<span v-else-if="totalConfirmers() === 1"> <span v-else-if="totalConfirmers() === 1">
One person has confirmed this. One person has confirmed this.
</span> </span>
<span v-else> {{ totalConfirmers() }} people have confirmed this. </span> <span v-else>
{{ totalConfirmers() }} people have confirmed this.
</span>
</div>
<div v-if="totalConfirmers() > 0"> <div v-if="totalConfirmers() > 0">
<div <div
@ -312,9 +316,7 @@
<!-- Note that a similar section is found in ConfirmGiftView.vue --> <!-- Note that a similar section is found in ConfirmGiftView.vue -->
<div> <div>
<h2 class="font-bold uppercase text-xl mt-8 mb-2"> <h2 class="font-bold uppercase text-xl mt-8 mb-2">Details</h2>
{{ serverUtil.containsHiddenDid(veriClaim) ? "Visible " : "" }}Details
</h2>
<div <div
v-if=" v-if="
serverUtil.containsHiddenDid(veriClaim) && serverUtil.containsHiddenDid(veriClaim) &&
@ -393,11 +395,12 @@
</button> </button>
</span> </span>
<span v-if="veriClaim.publicUrls?.[visDid]" <span v-if="veriClaim.publicUrls?.[visDid]"
>, found at >, found at&nbsp;<a
<fa icon="globe" class="fa-fw text-slate-400" />&nbsp;<a
:href="veriClaim.publicUrls?.[visDid]" :href="veriClaim.publicUrls?.[visDid]"
class="text-blue-500" class="text-blue-500"
>{{ >
<fa icon="globe" class="fa-fw text-slate-400" />
{{
veriClaim.publicUrls[visDid].substring( veriClaim.publicUrls[visDid].substring(
veriClaim.publicUrls[visDid].indexOf("//") + 2, veriClaim.publicUrls[visDid].indexOf("//") + 2,
) )
@ -428,7 +431,7 @@
> >
</div> </div>
<h2 class="font-bold uppercase text-xl mt-8 mb-2">Full Claim</h2> <h2 class="text-xl mt-8 mb-2">Full Claim</h2>
<p class="mb-4"> <p class="mb-4">
The full claim includes the claim as it was originally issued, including The full claim includes the claim as it was originally issued, including
the signature (ie. the proof of issuance by that person). the signature (ie. the proof of issuance by that person).
@ -761,13 +764,35 @@ export default class ClaimView extends Vue {
console.error("Error retrieving full claim:", error); console.error("Error retrieving full claim:", error);
const serverError = error as AxiosError; const serverError = error as AxiosError;
if (serverError.response?.status === 403) { if (serverError.response?.status === 403) {
let issuerPhrase = "";
const issuerContact = serverUtil.contactForDid(
this.veriClaim.issuer,
this.allContacts,
);
if (issuerContact?.name) {
issuerPhrase +=
"Ask " +
issuerContact.name +
" to show you the full claim details.";
}
if (
this.confirmerIdList.length > 0 ||
this.confsVisibleToIdList.length > 0
) {
if (issuerContact?.name) {
issuerPhrase +=
"You could also ask someone in the Confirmations section to make an introduction.";
} else {
issuerPhrase +=
"Ask someone in the Confirmations section to make an introduction.";
}
}
this.fullClaimMessage = this.fullClaimMessage =
"You are not authorized to view the full contents of this claim." + "You are not authorized to view the full contents of this claim." +
" To see all the details, ask the issuer to allow you to see their claims." + issuerPhrase +
" If you cannot see the issuer's DID, ask someone in the Confirmations section above." + " You might ask someone in your network -- like the person who registered you --" +
" If there are no connections, you will have to ask people in your" + " if they can find out more and make an introduction: " +
" network for their help, some other way; send them to this page and" + " send them this page and see if they can make a connection for you.";
" see if they can make a connection for you.";
} else { } else {
this.$notify( this.$notify(
{ {

48
src/views/ConfirmGiftView.vue

@ -54,13 +54,6 @@
Confirm Confirm
<fa icon="circle-check" class="ml-2 text-white cursor-pointer" /> <fa icon="circle-check" class="ml-2 text-white cursor-pointer" />
</button> </button>
<a
v-if="isRegistered"
class="col-span-1 bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white ml-2 px-4 py-2 rounded-md"
:href="urlForNewGive"
>
Record a Similar One
</a>
</div> </div>
<!-- Details --> <!-- Details -->
@ -264,13 +257,13 @@
<!-- Note that a similar section is found in ClaimView.vue --> <!-- Note that a similar section is found in ClaimView.vue -->
<h2 <h2
class="font-bold uppercase text-xl text-blue-500 mt-8 mb-2 cursor-pointer" class="font-bold uppercase text-xl text-blue-500 mt-8 mb-2 cursor-pointer"
@click="showDetails = !showDetails" @click="showVeriClaimDump = !showVeriClaimDump"
> >
{{ serverUtil.containsHiddenDid(veriClaim) ? "Visible " : "" }}Details Details
<span v-if="!showDetails"><fa icon="chevron-down" /></span> <span v-if="!showVeriClaimDump"><fa icon="chevron-down" /></span>
<span v-else><fa icon="chevron-up" /></span> <span v-else><fa icon="chevron-up" /></span>
</h2> </h2>
<div v-if="showDetails"> <div v-if="showVeriClaimDump">
<div <div
v-if=" v-if="
serverUtil.containsHiddenDid(veriClaim) && serverUtil.containsHiddenDid(veriClaim) &&
@ -286,7 +279,9 @@
<a @click="onClickShareClaim()" class="text-blue-500" <a @click="onClickShareClaim()" class="text-blue-500"
>click to send them this info</a >click to send them this info</a
> >
and see if they are willing to make an introduction. and see if they are willing to make an introduction. They are surely
connected to someone; if you don't know who to ask, you might try
the person who registered you.
</span> </span>
<span v-else> <span v-else>
If you'd like to ask any of your contacts to take a look and see if If you'd like to ask any of your contacts to take a look and see if
@ -313,7 +308,9 @@
<span v-else> <span v-else>
If you'd like an introduction, If you'd like an introduction,
<a <a
@click="copyToClipboard('Location', windowLocation.href)" @click="
copyToClipboard('A link to this page', windowLocation.href)
"
class="text-blue-500" class="text-blue-500"
>share this page with them and ask if they'll tell you more about >share this page with them and ask if they'll tell you more about
about the participants.</a about the participants.</a
@ -373,19 +370,28 @@
class="text-sm overflow-x-scroll px-4 py-3 bg-slate-100 rounded-md" class="text-sm overflow-x-scroll px-4 py-3 bg-slate-100 rounded-md"
>{{ veriClaimDump }}</pre >{{ veriClaimDump }}</pre
> >
</div> <div class="mt-2 ml-2">
</div>
<div v-else-if="!isLoading">This does not have details to confirm.</div>
<div class="mt-4" v-if="!isLoading">
<a <a
@click="showClaimPage(veriClaim.id)" @click="showClaimPage(veriClaim.id)"
class="text-blue-500 cursor-pointer" class="text-blue-500 cursor-pointer"
> >
<fa icon="file-lines" class="pl-2" /> <fa icon="file-lines" />
All Generic Info See All Generic Info
</a> </a>
</div> </div>
<div class="mt-2 ml-2">
<a
v-if="isRegistered"
class="text-blue-500 cursor-pointer"
:href="urlForNewGive"
>
<fa icon="file-lines" />
Record a Give Similar to the Original
</a>
</div>
</div>
</div>
<div v-else-if="!isLoading">This does not have details to confirm.</div>
<div <div
class="fixed left-6 bottom-24 text-center text-4xl leading-none bg-slate-400 text-white w-14 py-2.5 rounded-full" class="fixed left-6 bottom-24 text-center text-4xl leading-none bg-slate-400 text-white w-14 py-2.5 rounded-full"
@ -438,7 +444,7 @@ export default class ClaimView extends Vue {
isRegistered = false; isRegistered = false;
numConfsNotVisible = 0; // number of hidden DIDs in the confirmerIdList, minus the issuer if they aren't visible numConfsNotVisible = 0; // number of hidden DIDs in the confirmerIdList, minus the issuer if they aren't visible
recipientName = ""; recipientName = "";
showDetails = false; showVeriClaimDump = false;
urlForNewGive = ""; urlForNewGive = "";
veriClaim = serverUtil.BLANK_GENERIC_SERVER_RECORD; veriClaim = serverUtil.BLANK_GENERIC_SERVER_RECORD;
veriClaimDump = ""; veriClaimDump = "";

8
src/views/ProjectViewView.vue

@ -14,7 +14,7 @@
> >
<fa icon="chevron-left" class="fa-fw"></fa> <fa icon="chevron-left" class="fa-fw"></fa>
</button> </button>
Idea Project Idea
<h2 class="text-xl font-semibold"> <h2 class="text-xl font-semibold">
{{ name }} {{ name }}
<button <button
@ -226,7 +226,7 @@
@click="openOfferDialog()" @click="openOfferDialog()"
class="block w-full bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white rounded-md" class="block w-full bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white rounded-md"
> >
Offer (maybe with conditions)... Offer to this (maybe with conditions)...
</button> </button>
</div> </div>
</div> </div>
@ -403,7 +403,9 @@
:fromProjectId="this.projectId" :fromProjectId="this.projectId"
/> />
<h3 class="text-lg font-bold mb-3 mt-4">Benefitted By This</h3> <h3 class="text-lg font-bold mb-3 mt-4">
Benefitted From This Project
</h3>
<div v-if="givesProvidedByThis.length === 0">(None yet.)</div> <div v-if="givesProvidedByThis.length === 0">(None yet.)</div>

Loading…
Cancel
Save