From bc483a09f11bce38d92f4101558abe853dbb2e81 Mon Sep 17 00:00:00 2001 From: pheobeayo Date: Thu, 31 Oct 2024 21:52:09 +0100 Subject: [PATCH 1/7] feat: added the admin section for copying ID --- apps/dashboard/src/pages/group.tsx | 54 +++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/apps/dashboard/src/pages/group.tsx b/apps/dashboard/src/pages/group.tsx index 9eaafc80..5d186f3f 100644 --- a/apps/dashboard/src/pages/group.tsx +++ b/apps/dashboard/src/pages/group.tsx @@ -52,11 +52,15 @@ export default function GroupPage(): JSX.Element { const addMembersModal = useDisclosure() const toast = useToast() const { groupId, groupType } = useParams() + const {adminId, adminType } = useParams() const [_group, setGroup] = useState() // const { hasCopied, setValue: setApiKey, onCopy } = useClipboard("") const { hasCopied: hasCopiedGroupId, onCopy: onCopyGroupId } = useClipboard( groupId || "" ) + const { hasCopied: hasCopiedAdminId, onCopy: onCopyAdminId } = useClipboard( + adminId || "" + ) const [_searchMember, setSearchMember] = useState("") const [_removeGroupName, setRemoveGroupName] = useState("") const [_selectedMembers, setSelectedMembers] = useState([]) @@ -71,7 +75,7 @@ export default function GroupPage(): JSX.Element { const { data: signer } = useSigner() useEffect(() => { - ;(async () => { + ; (async () => { if (groupId) { const group = groupType === "on-chain" @@ -141,7 +145,7 @@ export default function GroupPage(): JSX.Element { async (memberId: string) => { if ( !window.confirm( - `Are you sure you want to remove member '${memberId}'?` + Are you sure you want to remove member '${memberId}'? ) ) { return @@ -297,7 +301,7 @@ ${memberIds.join("\n")} const url = URL.createObjectURL(blob) const a = document.createElement("a") a.href = url - a.download = `${_group.name}.json` + a.download = ${_group.name}.json document.body.appendChild(a) a.click() document.body.removeChild(a) @@ -322,7 +326,7 @@ ${memberIds.join("\n")} const credentialsObj = JSON.parse(_group.credentials) if (credentialsObj.id) { - credentialsId = `${credentialsObj.id}` + credentialsId = ${credentialsObj.id} if (credentialsObj.criteria) { for (const key in credentialsObj.criteria) { @@ -487,6 +491,46 @@ ${memberIds.join("\n")} + + Admin ID + + + + + + + e.preventDefault()} + icon={ + + } + /> + + + + ) {groupType === "off-chain" && _group.credentials && ( ) -} +} \ No newline at end of file From f3a9d1f300169ea88e7c70d049c91937e38acaa3 Mon Sep 17 00:00:00 2001 From: pheobeayo Date: Fri, 1 Nov 2024 01:08:40 +0100 Subject: [PATCH 2/7] feat: added admin section for copying --- apps/dashboard/src/pages/group.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/src/pages/group.tsx b/apps/dashboard/src/pages/group.tsx index 5d186f3f..04b74d29 100644 --- a/apps/dashboard/src/pages/group.tsx +++ b/apps/dashboard/src/pages/group.tsx @@ -75,7 +75,7 @@ export default function GroupPage(): JSX.Element { const { data: signer } = useSigner() useEffect(() => { - ; (async () => { + ; (async () => if (groupId) { const group = groupType === "on-chain" From f926f664fc9d1f6e558dc53e1ba17680d31435b6 Mon Sep 17 00:00:00 2001 From: pheobeayo Date: Fri, 1 Nov 2024 01:32:56 +0100 Subject: [PATCH 3/7] feat: admin section added --- apps/dashboard/src/pages/group.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/dashboard/src/pages/group.tsx b/apps/dashboard/src/pages/group.tsx index 04b74d29..759fe294 100644 --- a/apps/dashboard/src/pages/group.tsx +++ b/apps/dashboard/src/pages/group.tsx @@ -75,7 +75,7 @@ export default function GroupPage(): JSX.Element { const { data: signer } = useSigner() useEffect(() => { - ; (async () => + ; (async () => { if (groupId) { const group = groupType === "on-chain" @@ -145,7 +145,7 @@ export default function GroupPage(): JSX.Element { async (memberId: string) => { if ( !window.confirm( - Are you sure you want to remove member '${memberId}'? + `Are you sure you want to remove member '${memberId}'?` ) ) { return @@ -301,7 +301,7 @@ ${memberIds.join("\n")} const url = URL.createObjectURL(blob) const a = document.createElement("a") a.href = url - a.download = ${_group.name}.json + a.download = `${_group.name}.json` document.body.appendChild(a) a.click() document.body.removeChild(a) @@ -326,7 +326,7 @@ ${memberIds.join("\n")} const credentialsObj = JSON.parse(_group.credentials) if (credentialsObj.id) { - credentialsId = ${credentialsObj.id} + credentialsId = `${credentialsObj.id}` if (credentialsObj.criteria) { for (const key in credentialsObj.criteria) { @@ -909,4 +909,4 @@ ${memberIds.join("\n")} ) : (
) -} \ No newline at end of file +} From 1c0893e696748dbbafb68b09c11a8054d68494d6 Mon Sep 17 00:00:00 2001 From: pheobeayo Date: Fri, 1 Nov 2024 16:37:01 +0100 Subject: [PATCH 4/7] feat: updated changes required --- apps/dashboard/src/pages/group.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/src/pages/group.tsx b/apps/dashboard/src/pages/group.tsx index 759fe294..cf533cd6 100644 --- a/apps/dashboard/src/pages/group.tsx +++ b/apps/dashboard/src/pages/group.tsx @@ -52,14 +52,14 @@ export default function GroupPage(): JSX.Element { const addMembersModal = useDisclosure() const toast = useToast() const { groupId, groupType } = useParams() - const {adminId, adminType } = useParams() + const [_group, setGroup] = useState() // const { hasCopied, setValue: setApiKey, onCopy } = useClipboard("") const { hasCopied: hasCopiedGroupId, onCopy: onCopyGroupId } = useClipboard( groupId || "" ) const { hasCopied: hasCopiedAdminId, onCopy: onCopyAdminId } = useClipboard( - adminId || "" + (_group && _group.admin) || "" ) const [_searchMember, setSearchMember] = useState("") const [_removeGroupName, setRemoveGroupName] = useState("") From 981abb39caa3001acacea71ef8652dc94eb470b1 Mon Sep 17 00:00:00 2001 From: pheobeayo Date: Fri, 1 Nov 2024 17:08:10 +0100 Subject: [PATCH 5/7] feat: fix deployment issues --- apps/dashboard/src/pages/group.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/src/pages/group.tsx b/apps/dashboard/src/pages/group.tsx index cf533cd6..f7399bff 100644 --- a/apps/dashboard/src/pages/group.tsx +++ b/apps/dashboard/src/pages/group.tsx @@ -502,7 +502,7 @@ ${memberIds.join("\n")} From 03a4a7f3b9a681204e37e3ce6b23c3ee1c67a2d7 Mon Sep 17 00:00:00 2001 From: pheobeayo Date: Fri, 1 Nov 2024 20:14:39 +0100 Subject: [PATCH 6/7] style: uodated requested changes --- apps/dashboard/src/pages/group.tsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/apps/dashboard/src/pages/group.tsx b/apps/dashboard/src/pages/group.tsx index f7399bff..db80058a 100644 --- a/apps/dashboard/src/pages/group.tsx +++ b/apps/dashboard/src/pages/group.tsx @@ -52,7 +52,6 @@ export default function GroupPage(): JSX.Element { const addMembersModal = useDisclosure() const toast = useToast() const { groupId, groupType } = useParams() - const [_group, setGroup] = useState() // const { hasCopied, setValue: setApiKey, onCopy } = useClipboard("") const { hasCopied: hasCopiedGroupId, onCopy: onCopyGroupId } = useClipboard( @@ -457,7 +456,6 @@ ${memberIds.join("\n")} borderRadius="8px" > Group ID - - Admin ID - - Date: Fri, 1 Nov 2024 21:38:06 +0100 Subject: [PATCH 7/7] fix: fix CI issues --- apps/dashboard/src/pages/group.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/src/pages/group.tsx b/apps/dashboard/src/pages/group.tsx index db80058a..da96f0d8 100644 --- a/apps/dashboard/src/pages/group.tsx +++ b/apps/dashboard/src/pages/group.tsx @@ -74,7 +74,7 @@ export default function GroupPage(): JSX.Element { const { data: signer } = useSigner() useEffect(() => { - ; (async () => { + ;(async () => { if (groupId) { const group = groupType === "on-chain"