Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

(Feature) [xDai] - Disable safe sections based on network config#1468

Merged
Agupane merged 10 commits intofeature/#1353-xDai-compatibilityfrom
feature/#1456-disable-safe-sections
Oct 13, 2020
Merged

(Feature) [xDai] - Disable safe sections based on network config#1468
Agupane merged 10 commits intofeature/#1353-xDai-compatibilityfrom
feature/#1456-disable-safe-sections

Conversation

@Agupane
Copy link
Contributor

@Agupane Agupane commented Oct 13, 2020

Closes #1456

Description

  • Updates the network config from hardcoded boolean values:
export type SafeFeatures = {
  safeApps?: boolean,	
  collectibles?: boolean,	
  contractInteraction?: boolean	
}

to an array of disabledFeatures:

export type SafeFeatures = FEATURES[]

export enum FEATURES {
  ERC721 = 'ERC721',
  ERC1155 = 'ERC1155',
  SAFE_APPS = 'SAFE_APPS',
  CONTRACT_INTERACTION = 'CONTRACT_INTERACTION'
}

now this let us add more features that could be disabled in the future without modifying the structure of the config each time

Rinkeby config example that disables SAFE_APPS:

const rinkeby: NetworkConfig = {
  environment: {
    dev: {
      ...baseConfig,
    },
    staging: {
      ...baseConfig,
      safeAppsUrl: 'https://safe-apps.staging.gnosisdev.com',
    },
    production: {
      ...baseConfig,
      txServiceUrl: 'https://safe-transaction.rinkeby.gnosis.io/api/v1',
      safeAppsUrl: 'https://apps.gnosis-safe.io',
    },
  },
  network: {
    id: ETHEREUM_NETWORK.RINKEBY,
    backgroundColor: '#E8673C',
    textColor: '#ffffff',
    label: 'Rinkeby',
    isTestNet: true,
    nativeCoin: {
      address: '0x000',
      name: 'Ether',
      symbol: 'ETH',
      decimals: 18,
      logoUri: EtherLogo,
    },
  },
  disabledFeatures: [FEATURES.SAFE_APPS]
}

@Agupane Agupane self-assigned this Oct 13, 2020
@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@Agupane Agupane changed the title Feature/#1456 disable safe sections (Feature) [xDai] - Disable safe sections based on network config Oct 13, 2020
@github-actions
Copy link

github-actions bot commented Oct 13, 2020

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 2 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@Agupane Agupane marked this pull request as ready for review October 13, 2020 13:53
@Agupane Agupane requested review from dasanra, fernandomg and nicosampler and removed request for dasanra October 13, 2020 13:54
@ghost
Copy link

ghost commented Oct 13, 2020

Travis automatic deployment:
https://pr1468--safereact.review.gnosisdev.com/app

render={() => wrapInSuspense(<TxsTable />, null)}
/>
<Route exact path={`${matchSafeWithAddress?.path}/apps`} render={() => wrapInSuspense(<Apps />, null)} />
<Route
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the <Route in case safe-apps are disabled.
{safeAppsEnabled && <Route...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, I understand why you did this!

@ghost
Copy link

ghost commented Oct 13, 2020

Travis automatic deployment:
https://pr1468--safereact.review.gnosisdev.com/app

1 similar comment
@ghost
Copy link

ghost commented Oct 13, 2020

Travis automatic deployment:
https://pr1468--safereact.review.gnosisdev.com/app

@Agupane Agupane merged commit b16c737 into feature/#1353-xDai-compatibility Oct 13, 2020
@Agupane Agupane deleted the feature/#1456-disable-safe-sections branch October 13, 2020 19:05
@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants