diff --git a/project.task.yaml b/project.task.yaml index 49db271..a89444a 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -1,7 +1,6 @@ tasks: -- link to the project claim from the project screen - supply the projectId to the OfferDialog just like we do with the offerId - the confirm button on each give on the ProjectViewView page doesn't have all the context of the ClaimView page, so it can show sometimes inappropriately; consider consolidation - choose an agent via a contact chooser (not just copy-paste a DID) diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index ec4a926..72db288 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -160,6 +160,10 @@ export function isHiddenDid(did: string) { return did === HIDDEN_DID; } +export function isEmptyOrHiddenDid(did?: string) { + return !did || did === HIDDEN_DID; // catching empty string as well +} + /** * @return true for any nested string where func(input) === true * diff --git a/src/libs/util.ts b/src/libs/util.ts index 2892c24..a1bb31d 100644 --- a/src/libs/util.ts +++ b/src/libs/util.ts @@ -8,6 +8,7 @@ import { MASTER_SETTINGS_KEY } from "@/db/tables/settings"; import { deriveAddress, generateSeed, newIdentifier } from "@/libs/crypto"; import { GenericServerRecord, containsHiddenDid } from "@/libs/endorserServer"; import * as serverUtil from "@/libs/endorserServer"; +import { useClipboard } from "@vueuse/core"; // eslint-disable-next-line @typescript-eslint/no-var-requires const Buffer = require("buffer/").Buffer; @@ -25,6 +26,13 @@ export const giveIsConfirmable = (veriClaim: GenericServerRecord) => { return veriClaim.claimType === "GiveAction"; }; +export const doCopyTwoSecRedo = (text: string, fn: () => void) => { + fn(); + useClipboard() + .copy(text) + .then(() => setTimeout(fn, 2000)); +}; + /** * @returns true if the user can confirm the claim * @param veriClaim is expected to have fields: claim, claimType, and issuer diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 9ebb1d6..f6b4c7c 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -89,7 +89,7 @@ > - Copied! + Copied @@ -248,7 +248,7 @@ > - Copied! + Copied
Public Key (hex)
@@ -264,7 +264,7 @@ > - Copied! + Copied
Derivation Path
@@ -283,7 +283,7 @@ > - Copied! + Copied diff --git a/src/views/ClaimView.vue b/src/views/ClaimView.vue index 5a7d763..7ecf409 100644 --- a/src/views/ClaimView.vue +++ b/src/views/ClaimView.vue @@ -26,6 +26,18 @@
{{ veriClaim.id }} + + Copied ID
@@ -34,6 +46,20 @@
{{ veriClaim.issuer }} + + + Copied DID +
@@ -295,6 +321,8 @@ export default class ClaimView extends Vue { fullClaimDump = ""; fullClaimMessage = ""; numConfsNotVisible = 0; // number of hidden DIDs in the confirmerIdList, minus the issuer if they aren't visible + showDidCopy = false; + showIdCopy = false; veriClaim = serverUtil.BLANK_GENERIC_SERVER_RECORD; veriClaimDump = ""; diff --git a/src/views/ProjectViewView.vue b/src/views/ProjectViewView.vue index 8989311..c6cd66c 100644 --- a/src/views/ProjectViewView.vue +++ b/src/views/ProjectViewView.vue @@ -35,7 +35,23 @@
- {{ issuer }} + {{ + serverUtil.didInfo(issuer, activeDid, allMyDids, allContacts) + }} + + + Copied DID +
@@ -371,6 +387,7 @@ export default class ProjectViewView extends Vue { name = ""; offersToThis: Array = []; projectId = localStorage.getItem("projectId") || ""; // handle ID + showDidCopy = false; timeSince = ""; truncatedDesc = ""; truncateLength = 40;