Browse Source

add copy-paste icon next to non-anonymous, non-hidden DIDs on details page

starred-projects
Trent Larson 10 months ago
parent
commit
a0911bb0fd
  1. 5
      project.task.yaml
  2. 2
      src/libs/util.ts
  3. 63
      src/views/ClaimView.vue
  4. 2
      src/views/ProjectViewView.vue

5
project.task.yaml

@ -1,9 +1,8 @@
tasks: tasks:
- .5 give list of visible IDs on the claim detail page - add share button for sending a message to confirmers when we can't see the claim
- instead of text, make links to share the data with contacts and ask for help - add TimeSafari as a shareable app https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target
- Add TimeSafari as a shareable app https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target
- make a shortcut for BVC - make a shortcut for BVC
- choose an agent via a contact chooser (not just copy-paste a DID) - choose an agent via a contact chooser (not just copy-paste a DID)
- .5 find out why clicking quickly back-and-forth onto the "my project" page often shows error "You need an identifier to load your projects." (easier to reproduce on desktop?) - .5 find out why clicking quickly back-and-forth onto the "my project" page often shows error "You need an identifier to load your projects." (easier to reproduce on desktop?)

2
src/libs/util.ts

@ -55,7 +55,7 @@ export const doCopyTwoSecRedo = (text: string, fn: () => void) => {
* @returns true if the user can confirm the claim * @returns true if the user can confirm the claim
* @param veriClaim is expected to have fields: claim, claimType, and issuer * @param veriClaim is expected to have fields: claim, claimType, and issuer
*/ */
export const giveRecordTheUserCanConfirm = ( export const isGiveRecordTheUserCanConfirm = (
veriClaim: GenericServerRecord, veriClaim: GenericServerRecord,
activeDid: string, activeDid: string,
confirmerIdList: string[] = [], confirmerIdList: string[] = [],

63
src/views/ClaimView.vue

@ -125,7 +125,7 @@
<button <button
class="col-span-1 bg-blue-600 text-white px-4 py-2 rounded-md" class="col-span-1 bg-blue-600 text-white px-4 py-2 rounded-md"
v-if=" v-if="
libsUtil.giveRecordTheUserCanConfirm( libsUtil.isGiveRecordTheUserCanConfirm(
veriClaim, veriClaim,
activeDid, activeDid,
confirmerIdList, confirmerIdList,
@ -179,12 +179,24 @@
<li <li
v-for="confirmerId in confirmerIdList" v-for="confirmerId in confirmerIdList"
:key="confirmerId" :key="confirmerId"
class="list-disc" class="list-disc ml-4"
> >
<div class="flex gap-4"> <div class="flex gap-4">
<div class="grow overflow-hidden"> <div class="grow overflow-hidden">
<div class="text-sm"> <div class="text-sm">
{{ confirmerId }} {{ didInfo(confirmerId) }}
<span v-if="!serverUtil.isEmptyOrHiddenDid(confirmerId)">
<button
@click="
copyToClipboard(
'The DID of ' + confirmerId,
confirmerId,
)
"
>
<fa icon="copy" class="text-slate-400 fa-fw" />
</button>
</span>
</div> </div>
</div> </div>
</div> </div>
@ -193,12 +205,14 @@
</div> </div>
<!-- <!--
Never need to show the following message. Never need to show this message:
"Nobody that you know can see someone who has confirmed this claim."
If there is nobody in the confirmerIdList then we'll show the combined "nobody" message. If there is nobody in the confirmerIdList then we'll show the combined "nobody" message.
If there is somebody in the confirmerIdList then that's all they need to show. If there is somebody in the confirmerIdList then that's all they need to show.
--> -->
<!-- Nobody that you know can see someone who has confirmed this claim. -->
<!-- Now show anyone linked to confirmers. -->
<div v-if="confsVisibleToIdList.length > 0"> <div v-if="confsVisibleToIdList.length > 0">
The following people can connect you with people who have issued or The following people can connect you with people who have issued or
confirmed this claim. confirmed this claim.
@ -206,12 +220,24 @@
<li <li
v-for="confsVisibleTo in confsVisibleToIdList" v-for="confsVisibleTo in confsVisibleToIdList"
:key="confsVisibleTo" :key="confsVisibleTo"
class="list-disc" class="list-disc ml-4"
> >
<div class="flex gap-4"> <div class="flex gap-4">
<div class="grow overflow-hidden"> <div class="grow overflow-hidden">
<div class="text-sm"> <div class="text-sm">
{{ confsVisibleTo }} {{ didInfo(confsVisibleTo) }}
<span v-if="!serverUtil.isEmptyOrHiddenDid(confsVisibleTo)">
<button
@click="
copyToClipboard(
'The DID of ' + confsVisibleTo,
confsVisibleTo,
)
"
>
<fa icon="copy" class="text-slate-400 fa-fw" />
</button>
</span>
</div> </div>
</div> </div>
</div> </div>
@ -258,7 +284,9 @@
<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
their contacts can see more details, their contacts can see more details,
<a @click="copyToClipboard(windowLocation)" class="text-blue-500" <a
@click="copyToClipboard('Location', windowLocation)"
class="text-blue-500"
>share this page with them</a >share this page with them</a
> >
and see if they are willing to make an introduction. and see if they are willing to make an introduction.
@ -277,7 +305,9 @@
</span> </span>
<span v-else> <span v-else>
If you'd like an introduction, If you'd like an introduction,
<a @click="copyToClipboard(windowLocation)" class="text-blue-500" <a
@click="copyToClipboard('Location', windowLocation)"
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
> >
@ -301,8 +331,15 @@
> >
<div class="text-sm mt-2"> <div class="text-sm mt-2">
<span> <span>
{{ didInfo(visDid) {{ didInfo(visDid) }}
}}<span v-if="veriClaim.publicUrls?.[visDid]" <span v-if="!serverUtil.isEmptyOrHiddenDid(visDid)">
<button
@click="copyToClipboard('The DID of ' + visDid, visDid)"
>
<fa icon="copy" class="text-slate-400 fa-fw" />
</button>
</span>
<span v-if="veriClaim.publicUrls?.[visDid]"
>, found at >, found at
<fa icon="globe" class="fa-fw text-slate-400"></fa <fa icon="globe" class="fa-fw text-slate-400"></fa
>&nbsp;<a >&nbsp;<a
@ -756,7 +793,7 @@ export default class ClaimView extends Vue {
); );
} }
copyToClipboard(text: string) { copyToClipboard(name: string, text: string) {
useClipboard() useClipboard()
.copy(text) .copy(text)
.then(() => { .then(() => {
@ -765,7 +802,7 @@ export default class ClaimView extends Vue {
group: "alert", group: "alert",
type: "toast", type: "toast",
title: "Copied", title: "Copied",
text: "Location was copied to clipboard.", text: (name || "That") + " was copied to the clipboard.",
}, },
2000, 2000,
); );

2
src/views/ProjectViewView.vue

@ -800,7 +800,7 @@ export default class ProjectViewView extends Vue {
claimType: "GiveAction", claimType: "GiveAction",
issuer: give.agentDid, issuer: give.agentDid,
}; };
return libsUtil.giveRecordTheUserCanConfirm(giveDetails, this.activeDid); return libsUtil.isGiveRecordTheUserCanConfirm(giveDetails, this.activeDid);
} }
// similar code is found in ClaimView // similar code is found in ClaimView

Loading…
Cancel
Save