- 
                Notifications
    You must be signed in to change notification settings 
- Fork 361
Feature/2397 display guard information in settings #2662
Feature/2397 display guard information in settings #2662
Conversation
| CLA Assistant Lite All Contributors have signed the CLA. | 
| ESLint Summary View Full Report
 
 
 Report generated by eslint-plus-action | 
| Blocked by safe-global/safe-gateway-typescript-sdk#13 | 
| @juampibermani published the updated library version, should be unbloked now | 
| E2E Tests Passed | 
        
          
                src/routes/safe/components/Settings/Advanced/RemoveGuardModal.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/routes/safe/components/Settings/Advanced/RemoveGuardModal.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | }} | ||
| </EditableTxParameters> | ||
| </Modal> | ||
| ) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a lot of code duplication from the Review modal. For this PR it's fine but we should definitely think of a way to reuse the same code for tx popups.
        
          
                src/routes/safe/components/Settings/Advanced/TransactionGuard.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/routes/safe/components/Settings/Advanced/TransactionGuard.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/logic/safe/utils/__tests__/shouldSafeStoreBeUpdated.test.ts
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | . | ||
| </InfoText> | ||
|  | ||
| {!guard ? <NoTransactionGuardLegend /> : <TransactionGuard address={guard} />} | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: I'd put NoTransactionGuardLegend inside the TransactionGuard component. If we keep implementing the same logic inside this component for each field we have, it might get dirty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change this when we improve the reuse of components for modules and guard
        
          
                src/routes/safe/components/Settings/Advanced/RemoveGuardModal.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/routes/safe/components/Settings/Advanced/RemoveGuardModal.tsx
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | return ( | ||
| <> | ||
| <TableContainer> | ||
| <Table columns={columns} data={[address]} defaultFixed disablePagination label="Modules" noBorder> | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it was written on the ticket, but we don't really need a table there. It makes things complicated. There's only one transaction guard per safe, so it will always use 1 row.
This is not required, but you can think about how we can remove it if you want.
| E2E Tests Passed | 
…ttps://github.com/gnosis/safe-react into feature/2397-display-guard-information-in-settings
| E2E Tests Passed | 
| E2E Tests Passed | 
| E2E Tests Passed | 
| E2E Tests Passed | 
| Safe and env :https://pr2662--safereact.review.gnosisdev.com/rinkeby/app/#/safes/0x6E94311ab6964E53aa319Dc106836fBE8aEB142D/transactions According of what Dani told me, the scope of the ticket is make sure that the user is able to setUp the guard, that is registered as one (not as a random module) and that can be deleted. We tested using the guard in the description 0x4f8a82d73729A33E0165aDeF3450A7F85f007528, which owner is this MM account 0xF2CeA96575d6b10f51d9aF3b10e3e4E5738aa6bd Test steps done: Looks good to me | 
| E2E Tests Passed | 
What it solves
Resolves #2397
How this PR fixes it
We display a table containing the transaction guard information with a button to delete the transaction guard
Creating the PR as draft since i'm not sure how ModulePair works and how to set a transaction guard
How to test it
1.- Make sure you have access to TestOwner key or check with Liliy
2.- Use the transaction builder to create a transaction using
setGuardmethod of your safe configuring this safe Guard0x4f8a82d73729A33E0165aDeF3450A7F85f0075283.- After correctly enabling the guard test that now its showed under
Settings->Advanced4.- Check that currently you can't execute any transactions with your safe. Try a send funds or any settings change and you won't be able to do anything
5.- When you are ready you can go here and add your safeAddress to "allowTarget" function and submit the transaction so it's stored in the Guard
6.- BONUS try to enable and disable some functions at different points in the guard and check that the safe behaves as expected. To remove the guard make sure that "allowTarget" contains your safeAddress and you will be able to remove the Guard