From aa8498bc15ba9d74f36fcbd0f1b8abbddbf23bc3 Mon Sep 17 00:00:00 2001 From: Rodrigo Perez Date: Sat, 12 Mar 2022 23:36:10 -0300 Subject: [PATCH 1/7] permissions first iteration --- package.json | 2 +- .../Garden/Preferences/GlobalPreferences.js | 4 ++ .../Garden/Preferences/Permissions.tsx | 56 +++++++++++++++ src/environment.js | 1 + src/hooks/useGardenHooks.ts | 2 +- src/hooks/usePromise.ts | 2 +- src/hooks/useRoles.ts | 68 +++++++++++++++++++ src/hooks/useStakes.ts | 2 +- src/utils/app-utils.ts | 2 + 9 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 src/components/Garden/Preferences/Permissions.tsx create mode 100644 src/hooks/useRoles.ts diff --git a/package.json b/package.json index 5a59e2f52..b6202f173 100644 --- a/package.json +++ b/package.json @@ -133,4 +133,4 @@ } ] } -} +} \ No newline at end of file diff --git a/src/components/Garden/Preferences/GlobalPreferences.js b/src/components/Garden/Preferences/GlobalPreferences.js index 989a1424e..57b0ff275 100644 --- a/src/components/Garden/Preferences/GlobalPreferences.js +++ b/src/components/Garden/Preferences/GlobalPreferences.js @@ -18,16 +18,19 @@ import { useEsc } from '../../../hooks/useKeyboardArrows' import AppsAddresses from './AppsAddresses' import EVMExecutor from './EVMExecutor' +import Permissions from './Permissions' const SECTIONS = new Map([ ['generalInfo', 'General Info'], ['evmExecutor', 'EVM Executor'], + ['permissions', 'Permissions'] ]) const PATHS = Array.from(SECTIONS.keys()) const VALUES = Array.from(SECTIONS.values()) const GENERAL_INFO_INDEX = 0 const EVM_EXECUTOR_INDEX = 1 +const PERMISSIONS_INDEX = 2 const AnimatedDiv = animated.div @@ -87,6 +90,7 @@ function GlobalPreferences({ compact, onClose, onNavigation, sectionIndex }) { {sectionIndex === EVM_EXECUTOR_INDEX && ( )} + {sectionIndex === PERMISSIONS_INDEX && } diff --git a/src/components/Garden/Preferences/Permissions.tsx b/src/components/Garden/Preferences/Permissions.tsx new file mode 100644 index 000000000..844cb4567 --- /dev/null +++ b/src/components/Garden/Preferences/Permissions.tsx @@ -0,0 +1,56 @@ +/* eslint-disable react/jsx-key */ +import React from 'react' +import { DataView, IdentityBadge, textStyle } from '@1hive/1hive-ui' +import { useRoles } from '@/hooks/useRoles' + +const ENTRIES_PER_PAGE = 10 + +function Permissions() { + const appRoles = useRoles() + + const fields = [ + 'Action', + 'On app', + { label: 'Assigned to entity', childStart: true }, + 'Managed by', + ] + console.log('installed with perm ', appRoles) + + return ( +
+ renderEntry(entry)} + /> +
+ ) +} + +interface EntryProps { + appAddress: string, + appName: string, + description: string, + manager: any, + permissions: any +} + +function renderEntry({ appAddress, appName, description, manager, permissions }: EntryProps) { + + const cells = [ + + {description} + , + , + , + , + ] + return cells +} + +export default Permissions \ No newline at end of file diff --git a/src/environment.js b/src/environment.js index 266a272c0..42a243a56 100644 --- a/src/environment.js +++ b/src/environment.js @@ -1,3 +1,4 @@ +const DEFAULT_AGENT_APP_NAME = 'agent' const DEFAULT_AGREEMENT_APP_NAME = 'agreement' const DEFAULT_CONVICTION_APP_NAME = 'disputable-conviction-voting' const DEFAULT_HOOKED_TOKEN_MANAGER = 'wrappable-hooked-token-manager' diff --git a/src/hooks/useGardenHooks.ts b/src/hooks/useGardenHooks.ts index 85f377cdd..1328afc45 100644 --- a/src/hooks/useGardenHooks.ts +++ b/src/hooks/useGardenHooks.ts @@ -226,4 +226,4 @@ export function useTokenBalances( }, [account, balances, timeout, tokenContract, token]) return balances -} +} \ No newline at end of file diff --git a/src/hooks/usePromise.ts b/src/hooks/usePromise.ts index 56cb278d4..da75e741d 100644 --- a/src/hooks/usePromise.ts +++ b/src/hooks/usePromise.ts @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react' export default function usePromise( fn: () => Promise, memoParams: Array, - defaultValue: boolean + defaultValue: any ) { const [result, setResult] = useState(defaultValue) diff --git a/src/hooks/useRoles.ts b/src/hooks/useRoles.ts new file mode 100644 index 000000000..52ee9d6dd --- /dev/null +++ b/src/hooks/useRoles.ts @@ -0,0 +1,68 @@ +import { useMemo } from 'react' +import { useGardenState } from '@providers/GardenState' +import usePromise from '@hooks/usePromise' +import { getAppPresentationByAddress } from '@utils/app-utils' + +interface ManagerProps { + address: string, + shortenedName: string, +} + +interface PermissionProps { + allowed: boolean, + appAddress: string, + granteeAddress: string, + granteeName: string | undefined, + params: Array, + roleHash: string +} + +interface RoleProps { + appAddress: string, + appName: string, + description: string | undefined, // TODO- check why this is happening proabably old ABI + hash: string, + manager: Array, + name: string, + params: Array, + permissions: Array +} + +export function useRoles() { + const { installedApps } = useGardenState() + + console.log('installed apps ', installedApps) + + const appsWithPermissions = useMemo(() => { + return () => Promise.all(installedApps.map(async (app: any) => { + return { + ...app, + roles: await app.roles() + } + })) + }, [installedApps]) + + const appsWithRolesResolved = usePromise(appsWithPermissions, [], []) + + const rolesWithEntitiesResolved: Array = appsWithRolesResolved.map((app: any) => { + return app.roles.map((role: any) => { + return { + ...role, + appName: getAppPresentationByAddress(installedApps, app.address)?.shortenedName, + manager: { + address: role.manager, + shortenedName: getAppPresentationByAddress(installedApps, role.manager)?.shortenedName + }, + permissions: role.permissions.map((permission: any) => { + return { + ...permission, + granteeName: getAppPresentationByAddress(installedApps, permission.granteeAddress)?.shortenedName + } + }) + } + }) + }) + + return rolesWithEntitiesResolved.flat() + +} diff --git a/src/hooks/useStakes.ts b/src/hooks/useStakes.ts index ae893df83..87b13f8f0 100644 --- a/src/hooks/useStakes.ts +++ b/src/hooks/useStakes.ts @@ -96,5 +96,5 @@ export function useInactiveProposalsWithStake(account: string) { ) }) - return inactiveStakes + return inactiveStakes.flat() } diff --git a/src/utils/app-utils.ts b/src/utils/app-utils.ts index 44c91633f..570c8dabe 100644 --- a/src/utils/app-utils.ts +++ b/src/utils/app-utils.ts @@ -57,6 +57,7 @@ export function getAppPresentation( humanName: string iconSrc: string name?: string + shortenedName?: string } | null { const { contentUri, name, manifest, appId } = app // Get human readable name and icon from manifest if available @@ -68,6 +69,7 @@ export function getAppPresentation( humanName, iconSrc: iconPath ? getIpfsUrlFromUri(contentUri) + iconPath : '', name, + shortenedName: SHORTENED_APPS_NAMES.get(name) || name, } } From 261a10d8e76cddc11c7c1b973ed9b5dc9ea291c7 Mon Sep 17 00:00:00 2001 From: Rodrigo Perez Date: Sat, 19 Mar 2022 15:38:07 -0300 Subject: [PATCH 2/7] pushing progress just for the migration --- src/hooks/useRoles.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hooks/useRoles.ts b/src/hooks/useRoles.ts index 52ee9d6dd..2ea0b5dd7 100644 --- a/src/hooks/useRoles.ts +++ b/src/hooks/useRoles.ts @@ -20,6 +20,7 @@ interface PermissionProps { interface RoleProps { appAddress: string, appName: string, + appIcon: string, description: string | undefined, // TODO- check why this is happening proabably old ABI hash: string, manager: Array, @@ -44,11 +45,14 @@ export function useRoles() { const appsWithRolesResolved = usePromise(appsWithPermissions, [], []) + console.log('appsWithRolesResolved ', appsWithRolesResolved) + const rolesWithEntitiesResolved: Array = appsWithRolesResolved.map((app: any) => { return app.roles.map((role: any) => { return { ...role, appName: getAppPresentationByAddress(installedApps, app.address)?.shortenedName, + appIcon: getAppPresentationByAddress(installedApps, app.address)?.iconSrc, manager: { address: role.manager, shortenedName: getAppPresentationByAddress(installedApps, role.manager)?.shortenedName From 88f764c9b654eb73deb9534b4eaa72e35492dd43 Mon Sep 17 00:00:00 2001 From: Rodrigo Perez Date: Thu, 7 Apr 2022 20:33:25 -0300 Subject: [PATCH 3/7] change css for styled components --- .../Garden/Preferences/GlobalPreferences.js | 22 ++++++++++++++---- .../Garden/Preferences/Permissions.tsx | 23 ++++++++++++------- src/hooks/useRoles.ts | 8 +++---- 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/src/components/Garden/Preferences/GlobalPreferences.js b/src/components/Garden/Preferences/GlobalPreferences.js index 57b0ff275..9e9218a93 100644 --- a/src/components/Garden/Preferences/GlobalPreferences.js +++ b/src/components/Garden/Preferences/GlobalPreferences.js @@ -11,6 +11,7 @@ import { useTheme, useViewport, } from '@1hive/1hive-ui' +import styled from 'styled-components' import { Transition, animated } from 'react-spring/renderprops' import { useConnectedGarden } from '@providers/ConnectedGarden' import { useWallet } from '@/providers/Wallet' @@ -20,6 +21,17 @@ import AppsAddresses from './AppsAddresses' import EVMExecutor from './EVMExecutor' import Permissions from './Permissions' + +const LayoutWrapper = styled(Layout)` + z-index: 2; + height: 100%; +` +const ParentDiv = styled.div` + display: flex; + height: 100%; + outline: 0; +` + const SECTIONS = new Map([ ['generalInfo', 'General Info'], ['evmExecutor', 'EVM Executor'], @@ -69,8 +81,8 @@ function GlobalPreferences({ compact, onClose, onNavigation, sectionIndex }) { }, [account, connectedGarden, ethers, isSafari]) return ( -
- + +
- + } - -
+ + ) } diff --git a/src/components/Garden/Preferences/Permissions.tsx b/src/components/Garden/Preferences/Permissions.tsx index 844cb4567..92ecd8063 100644 --- a/src/components/Garden/Preferences/Permissions.tsx +++ b/src/components/Garden/Preferences/Permissions.tsx @@ -2,11 +2,12 @@ import React from 'react' import { DataView, IdentityBadge, textStyle } from '@1hive/1hive-ui' import { useRoles } from '@/hooks/useRoles' +import Loader from '@components/Loader' const ENTRIES_PER_PAGE = 10 function Permissions() { - const appRoles = useRoles() + const [appRoles, loading] = useRoles() const fields = [ 'Action', @@ -17,13 +18,19 @@ function Permissions() { console.log('installed with perm ', appRoles) return ( -
- renderEntry(entry)} - /> +
+ {loading ? + ( + + + ) : + renderEntry(entry)} + /> + }
) } diff --git a/src/hooks/useRoles.ts b/src/hooks/useRoles.ts index 2ea0b5dd7..f5b42a868 100644 --- a/src/hooks/useRoles.ts +++ b/src/hooks/useRoles.ts @@ -1,4 +1,4 @@ -import { useMemo } from 'react' +import { useMemo, useState } from 'react' import { useGardenState } from '@providers/GardenState' import usePromise from '@hooks/usePromise' import { getAppPresentationByAddress } from '@utils/app-utils' @@ -30,10 +30,9 @@ interface RoleProps { } export function useRoles() { + const [loading, setLoading] = useState(true) const { installedApps } = useGardenState() - console.log('installed apps ', installedApps) - const appsWithPermissions = useMemo(() => { return () => Promise.all(installedApps.map(async (app: any) => { return { @@ -67,6 +66,7 @@ export function useRoles() { }) }) - return rolesWithEntitiesResolved.flat() + + return [rolesWithEntitiesResolved.flat(), loading] } From 41efc9d3e80d47223354956bb62614a93e8d5e9a Mon Sep 17 00:00:00 2001 From: Rodrigo Perez Date: Fri, 22 Apr 2022 11:56:24 -0300 Subject: [PATCH 4/7] roles --- .../Garden/Preferences/GlobalPreferences.js | 29 +++++++++++----- .../Garden/Preferences/Permissions.tsx | 5 ++- src/hooks/useRoles.ts | 33 ++++++++++++------- 3 files changed, 46 insertions(+), 21 deletions(-) diff --git a/src/components/Garden/Preferences/GlobalPreferences.js b/src/components/Garden/Preferences/GlobalPreferences.js index 9e9218a93..9bca38313 100644 --- a/src/components/Garden/Preferences/GlobalPreferences.js +++ b/src/components/Garden/Preferences/GlobalPreferences.js @@ -32,6 +32,16 @@ const ParentDiv = styled.div` outline: 0; ` +const RootWrapper = styled(Root.Provider)` + display: flex; + flex-direction: column; + height: 100%; +` + +const HeaderWrapper = styled(Header)` + padding-top: ${(props) => !props.compact ? 10 * GU : 0}px; +` + const SECTIONS = new Map([ ['generalInfo', 'General Info'], ['evmExecutor', 'EVM Executor'], @@ -80,17 +90,18 @@ function GlobalPreferences({ compact, onClose, onNavigation, sectionIndex }) { getEvmCrispr() }, [account, connectedGarden, ethers, isSafari]) + console.log('sectionIndex ', sectionIndex) + return ( - + -
- + +
+ + } - + ) diff --git a/src/components/Garden/Preferences/Permissions.tsx b/src/components/Garden/Preferences/Permissions.tsx index 92ecd8063..d513fac5a 100644 --- a/src/components/Garden/Preferences/Permissions.tsx +++ b/src/components/Garden/Preferences/Permissions.tsx @@ -7,15 +7,18 @@ import Loader from '@components/Loader' const ENTRIES_PER_PAGE = 10 function Permissions() { + console.log('PERMISSIONS!!!!! ') const [appRoles, loading] = useRoles() + + const fields = [ 'Action', 'On app', { label: 'Assigned to entity', childStart: true }, 'Managed by', ] - console.log('installed with perm ', appRoles) + // console.log('installed with perm ', appRoles) return (
diff --git a/src/hooks/useRoles.ts b/src/hooks/useRoles.ts index f5b42a868..d3882cfde 100644 --- a/src/hooks/useRoles.ts +++ b/src/hooks/useRoles.ts @@ -1,4 +1,4 @@ -import { useMemo, useState } from 'react' +import { useEffect, useMemo, useState } from 'react' import { useGardenState } from '@providers/GardenState' import usePromise from '@hooks/usePromise' import { getAppPresentationByAddress } from '@utils/app-utils' @@ -31,42 +31,53 @@ interface RoleProps { export function useRoles() { const [loading, setLoading] = useState(true) - const { installedApps } = useGardenState() + const gardenState = useGardenState() + console.log('gardenState ', gardenState) const appsWithPermissions = useMemo(() => { - return () => Promise.all(installedApps.map(async (app: any) => { + if (!gardenState?.installedApps) { + return async () => { null } + } + return () => Promise.all(gardenState?.installedApps.map(async (app: any) => { return { ...app, roles: await app.roles() } })) - }, [installedApps]) + }, [gardenState]) const appsWithRolesResolved = usePromise(appsWithPermissions, [], []) console.log('appsWithRolesResolved ', appsWithRolesResolved) - const rolesWithEntitiesResolved: Array = appsWithRolesResolved.map((app: any) => { + const rolesWithEntitiesResolved: Array = appsWithRolesResolved ? appsWithRolesResolved.map((app: any) => { return app.roles.map((role: any) => { return { ...role, - appName: getAppPresentationByAddress(installedApps, app.address)?.shortenedName, - appIcon: getAppPresentationByAddress(installedApps, app.address)?.iconSrc, + appName: getAppPresentationByAddress(gardenState?.installedApps, app.address)?.shortenedName, + appIcon: getAppPresentationByAddress(gardenState?.installedApps, app.address)?.iconSrc, manager: { address: role.manager, - shortenedName: getAppPresentationByAddress(installedApps, role.manager)?.shortenedName + shortenedName: getAppPresentationByAddress(gardenState?.installedApps, role.manager)?.shortenedName }, permissions: role.permissions.map((permission: any) => { return { ...permission, - granteeName: getAppPresentationByAddress(installedApps, permission.granteeAddress)?.shortenedName + granteeName: getAppPresentationByAddress(gardenState?.installedApps, permission.granteeAddress)?.shortenedName } }) } }) - }) + }) : null + useEffect(() => { + if (rolesWithEntitiesResolved) { + setLoading(false) + } + }, [rolesWithEntitiesResolved]) - return [rolesWithEntitiesResolved.flat(), loading] + + + return [rolesWithEntitiesResolved ? rolesWithEntitiesResolved.flat() : [], loading] } From 0acb24b8c864b37b2c7813f7c803648a34da56ed Mon Sep 17 00:00:00 2001 From: Rodrigo Perez Date: Thu, 12 May 2022 21:04:31 -0300 Subject: [PATCH 5/7] etities badges --- .../Garden/Preferences/Permissions.tsx | 63 ++++++++++++++++--- src/hooks/useRoles.ts | 21 +++++-- 2 files changed, 70 insertions(+), 14 deletions(-) diff --git a/src/components/Garden/Preferences/Permissions.tsx b/src/components/Garden/Preferences/Permissions.tsx index d513fac5a..44ac1139a 100644 --- a/src/components/Garden/Preferences/Permissions.tsx +++ b/src/components/Garden/Preferences/Permissions.tsx @@ -1,16 +1,28 @@ /* eslint-disable react/jsx-key */ import React from 'react' -import { DataView, IdentityBadge, textStyle } from '@1hive/1hive-ui' +import { AppBadge, DataView, IdentityBadge, textStyle } from '@1hive/1hive-ui' +import { useGardenState } from '@providers/GardenState' import { useRoles } from '@/hooks/useRoles' import Loader from '@components/Loader' +import { getAppPresentationByAddress } from '@utils/app-utils' const ENTRIES_PER_PAGE = 10 +interface EntryProps { + appAddress: string, + appIcon: string, + appName: string, + description: string, + manager: any, + permissions: any +} + + function Permissions() { - console.log('PERMISSIONS!!!!! ') const [appRoles, loading] = useRoles() + const { installedApps } = useGardenState() - + console.log('APP ROLES ', appRoles) const fields = [ 'Action', @@ -31,7 +43,7 @@ function Permissions() { entriesPerPage={ENTRIES_PER_PAGE} fields={fields} entries={appRoles} - renderEntry={(entry: any) => renderEntry(entry)} + renderEntry={(entry: EntryProps) => renderEntry(entry, installedApps)} /> }
@@ -40,14 +52,43 @@ function Permissions() { interface EntryProps { appAddress: string, + appIcon: string, appName: string, description: string, manager: any, permissions: any } -function renderEntry({ appAddress, appName, description, manager, permissions }: EntryProps) { +function EntryEntities({ permissions, installedApps }: { permissions: any, installedApps: any }) { + const allowedEntities = permissions.filter((permission: any) => permission.allowed === true) + + if (allowedEntities.length === 1) { + return + } + + return + {allowedEntities.length} entities + +} + +function EntityBadge({ address, name, icon, installedApps }: { address: string, name: string, icon: string, installedApps: any }) { + if (installedApps.find((app: any) => app.address === address)) { + + return + } + + return +} + +function renderEntry(entry: EntryProps, installedApps: any) { + + const { appAddress, appIcon, appName, description, manager, permissions } = entry + console.log('ENTRY ', entry) const cells = [ {description} , - , - , - , + , + , + // , + + ] return cells } + + + + export default Permissions \ No newline at end of file diff --git a/src/hooks/useRoles.ts b/src/hooks/useRoles.ts index d3882cfde..982cbd097 100644 --- a/src/hooks/useRoles.ts +++ b/src/hooks/useRoles.ts @@ -3,6 +3,8 @@ import { useGardenState } from '@providers/GardenState' import usePromise from '@hooks/usePromise' import { getAppPresentationByAddress } from '@utils/app-utils' +const ANY_ADDRESS = "0xffffffffffffffffffffffffffffffffffffffff" + interface ManagerProps { address: string, shortenedName: string, @@ -33,7 +35,6 @@ export function useRoles() { const [loading, setLoading] = useState(true) const gardenState = useGardenState() - console.log('gardenState ', gardenState) const appsWithPermissions = useMemo(() => { if (!gardenState?.installedApps) { return async () => { null } @@ -48,22 +49,30 @@ export function useRoles() { const appsWithRolesResolved = usePromise(appsWithPermissions, [], []) - console.log('appsWithRolesResolved ', appsWithRolesResolved) + // console.log('appsWithRolesResolved ', appsWithRolesResolved) + + function isAnyAddress(address: string) { + return address === ANY_ADDRESS + } const rolesWithEntitiesResolved: Array = appsWithRolesResolved ? appsWithRolesResolved.map((app: any) => { return app.roles.map((role: any) => { + const appPresentation = getAppPresentationByAddress(gardenState?.installedApps, app.address) + return { ...role, - appName: getAppPresentationByAddress(gardenState?.installedApps, app.address)?.shortenedName, - appIcon: getAppPresentationByAddress(gardenState?.installedApps, app.address)?.iconSrc, + appName: appPresentation?.shortenedName || appPresentation?.humanName, + appIcon: appPresentation?.iconSrc, manager: { address: role.manager, - shortenedName: getAppPresentationByAddress(gardenState?.installedApps, role.manager)?.shortenedName + shortenedName: getAppPresentationByAddress(gardenState?.installedApps, role.manager)?.shortenedName, + managerIcon: getAppPresentationByAddress(gardenState?.installedApps, role.manager)?.iconSrc }, permissions: role.permissions.map((permission: any) => { return { ...permission, - granteeName: getAppPresentationByAddress(gardenState?.installedApps, permission.granteeAddress)?.shortenedName + granteeName: isAnyAddress(permission.granteeAddress) ? 'Any account' : getAppPresentationByAddress(gardenState?.installedApps, permission.granteeAddress)?.shortenedName, + granteeIcon: getAppPresentationByAddress(gardenState?.installedApps, permission.granteeAddress)?.iconSrc } }) } From 1ec22226c541a57f0c111615ed62ed4b07f50413 Mon Sep 17 00:00:00 2001 From: Rodrigo Perez Date: Thu, 12 May 2022 21:26:31 -0300 Subject: [PATCH 6/7] render entry expansion --- src/components/Garden/Preferences/Permissions.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/Garden/Preferences/Permissions.tsx b/src/components/Garden/Preferences/Permissions.tsx index 44ac1139a..9e448fe46 100644 --- a/src/components/Garden/Preferences/Permissions.tsx +++ b/src/components/Garden/Preferences/Permissions.tsx @@ -44,6 +44,7 @@ function Permissions() { fields={fields} entries={appRoles} renderEntry={(entry: EntryProps) => renderEntry(entry, installedApps)} + renderEntryExpansion={(entry: EntryProps) => renderEntryExpansion(entry, installedApps)} /> }
@@ -106,6 +107,16 @@ function renderEntry(entry: EntryProps, installedApps: any) { return cells } +function renderEntryExpansion(entry: EntryProps, installedApps: any) { + const allowedEntities = entry.permissions.filter((permission: any) => permission.allowed === true) + + return allowedEntities.length < 2 + ? null + : allowedEntities.map((entity: any) => ( + + )) +} + From e1cbe78f93516895f527d0c999e3604c719880cb Mon Sep 17 00:00:00 2001 From: Rodrigo Perez Date: Thu, 12 May 2022 21:42:54 -0300 Subject: [PATCH 7/7] remove console.log --- src/components/Garden/Preferences/Permissions.tsx | 8 +------- src/hooks/useRoles.ts | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/components/Garden/Preferences/Permissions.tsx b/src/components/Garden/Preferences/Permissions.tsx index 9e448fe46..7450a4d0a 100644 --- a/src/components/Garden/Preferences/Permissions.tsx +++ b/src/components/Garden/Preferences/Permissions.tsx @@ -4,7 +4,6 @@ import { AppBadge, DataView, IdentityBadge, textStyle } from '@1hive/1hive-ui' import { useGardenState } from '@providers/GardenState' import { useRoles } from '@/hooks/useRoles' import Loader from '@components/Loader' -import { getAppPresentationByAddress } from '@utils/app-utils' const ENTRIES_PER_PAGE = 10 @@ -22,15 +21,12 @@ function Permissions() { const [appRoles, loading] = useRoles() const { installedApps } = useGardenState() - console.log('APP ROLES ', appRoles) - const fields = [ 'Action', 'On app', { label: 'Assigned to entity', childStart: true }, 'Managed by', ] - // console.log('installed with perm ', appRoles) return (
@@ -87,9 +83,8 @@ function EntityBadge({ address, name, icon, installedApps }: { address: string, function renderEntry(entry: EntryProps, installedApps: any) { - const { appAddress, appIcon, appName, description, manager, permissions } = entry - console.log('ENTRY ', entry) + const cells = [ , , , - // , ] diff --git a/src/hooks/useRoles.ts b/src/hooks/useRoles.ts index 982cbd097..20c727b50 100644 --- a/src/hooks/useRoles.ts +++ b/src/hooks/useRoles.ts @@ -49,8 +49,6 @@ export function useRoles() { const appsWithRolesResolved = usePromise(appsWithPermissions, [], []) - // console.log('appsWithRolesResolved ', appsWithRolesResolved) - function isAnyAddress(address: string) { return address === ANY_ADDRESS }