diff --git a/project.task.yaml b/project.task.yaml index 49db27171..a89444a43 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 ec4a92674..72db288e6 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 2892c247b..a1bb31d18 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 9ebb1d602..f6b4c7c95 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 5a7d7637a..7ecf40996 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 898931145..c6cd66c29 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;