-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove coin machine & whitelist extensions #3663
Conversation
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.
Nice work! There are still some places that need to be updated:
- In the
actionTypes
file there are someWHITELIST_UPDATE
types that correspond to the whitelist extension. - The
WhitelistAddresses
andWhitelistMembersListExtraContent
components were only used by the whitelist extension. src/types/extensions.ts
only contains a type that was used by the coin machine, so that file can be deleted.- These dependencies can now be uninstalled:
@synaps-io/verify.js
,react-confetti
,react-textfit
, andreact-twitter-widgets
Thanks for your comments, they're very helpful. In fact i was planning on adding a comment on |
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.
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.
Looking great! A lot of deleted code, kind of satisfying :)
@willm30 That's what happens if you hit that URL with any extension that doesn't exist. It's not okay that it's happening but it's not something introduced by this PR. It's something that could be dealt with in this PR if Dan wants to, but it can perfectly be its own Maintenance issue. |
Got it. Made the issue for it here: #3678 |
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.
Very comprehensive work - impressive! You probably needed a lot of patience 🙈
I left a couple of comments of small things that can be removed, it's very hard to catch them. I only know because I implemented some of it.
import { DEFAULT_NETWORK_INFO } from '~constants'; | ||
import { Address, WhitelistPolicy } from '~types/index'; | ||
import { CM_BLOG_POST, CM_GOOGLE_SHEET, CM_DESCRIPTION } from '~externalUrls'; | ||
import { Address } from '~types/index'; |
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 can't comment directly on the line because it was not changed, so will comment for the file. You can remove ColonyPolicySelector
in ExtensionParamType
- it's for whitelist as far as I remember and we are not using it anywhere
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.
you can remove orderNumber
and options
from ExtensionInitParams
, it was only for coin machine and whitelist respectively.
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 think you can also remove disabled
from ExtensionInitParams
& from params.map
in ExtensionSetup
. I think it was only used for whitelist
policy selector (when whitelist agreement was not an option). But please test
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 think tokenLabel
is not needed in ExtensionInitParams
either.
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 think that you can also remove fieldName
from ExtensionInitParams
& from ExtensionSetup
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.
And I think you can remove ExtensionParamType.TokenSelector
from both files
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.
From ExtensionData
I think you can remove:
- address
- header
- descriptionExtended (from ExtensionSetup too)
- descriptionLinks (from ExtensionSetup too)
- tokenContractAddress (from ExtensionSetup too)
- info
- extraInitParams (from ExtensionSetup too)
- enabledExtensionBody
@danbr As I was working through this issue I noticed references to whitelist in a few places, e.g. the I also notice a few search results in VS code when I do a text search for |
@willm30 Thank you for your notification. There will still be code using |
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.
Very nice! This obviously took a lot of work! 💯
I've left some notes on what can be improved and stuff that was missed and needs to be removed.
Since I can't comment on the file itself, I'll leave this note here:
- The
authenticateKYC
method fromsrc/api/auth.ts
needs to be also removed since it's not being used anymore
Either way I'm pre-approving this!
export const dappExtensions = [ | ||
Extension.OneTxPayment, | ||
Extension.VotingReputation, | ||
]; |
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.
So I think we can simplify this even further.
- Remove this
- Remove
Unknown
from theextensions
map insidedata/staticData/extensionData.tsx
(it was set up as an fallback, but we never ended up using it) - Refactor the
extensions
map to useExtension.<ExtensionName>
enums as keys (instead of them being manually typed) - Use that array as the source for what extensions to surface in the dapp
It actually makes sense since if that mapping doesn't have an entry for the extension, it won't have any data to display when trying to render the extension's card on the extension's page.
So it's only fitting that we use this object to also control the "supported" extensions inside the dapp
(maybe leave a comment about this, that we're using this object to control the extensions display)
|
||
const MSG = defineMessages({ | ||
removeCSVText: { | ||
id: 'dashboard.Whitelist.CSVUploader.CSVUploaderItem.removeCSVText', | ||
id: 'core.CSVUploader.CSVUploaderItem.removeCSVText', |
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.
Good attention to details :)
actionType: 'SUBMIT' | 'ERROR' | 'SUCCESS', | ||
extensionId: string, | ||
) => { | ||
export const getButtonAction = (actionType: 'SUBMIT' | 'ERROR' | 'SUCCESS') => { |
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.
Again, nice catch. No reason in keeping it around
// @NOTE get list of installed extensions that are only allowed to be | ||
// used within the dapp |
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.
See my note about using the object from static data for this
// be careful to use matching data with both | ||
// installedExtensionsData & dappInstalledExtensions | ||
installedExtension={getDappInstalledExtension(idx)} |
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.
So extensions can also be installed at the contract level.
Might might want to "enforce" only showing the supported ones, even though the colony has more installed.
export const CM_LEARN_MORE = `https://colony.gitbook.io/colony/extensions/coin-machine`; | ||
export const CM_GET_WHITELISTED = `https://colony.gitbook.io/colony/get-started/how-to-get-whitelisted-for-the-clny-sale.`; | ||
export const CM_BLOG_POST = `https://blog.colony.io/introducing-coin-machine/`; | ||
export const CM_GOOGLE_SHEET = `https://docs.google.com/spreadsheets/d/1ZCuFcwqI4S6ZK5OwTl1yN7AK8mjv5d_V3g-_kMen01Y/edit#gid=2013814210`; | ||
export const CM_DESCRIPTION = 'https://colony.gitbook.io/colony/'; |
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.
Maybe ask @arrenv or however is managing our Gitbook, if these links are still relevant to them, otherwise they should remove them on their end as well.
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.
Good point, there is some content we will still want to use, so, I have temporarily added a note on each of the Coin Machine pages in GitBook until they can be removed.
src/utils/events/subgraphEvents.ts
Outdated
@@ -260,7 +233,6 @@ export const parseSubgraphEvent = ({ | |||
...addressArgumentParser(parsedArguments), | |||
...motionArgumentparser(parsedArguments), | |||
...storageSlotArgumentParser(parsedArguments), | |||
...coinMachineEventsArgumentParser(parsedArguments), | |||
...whitelistEventsArgumentParser(parsedArguments), |
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.
This one should be removed as well
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.
The updates are all correct, so it's good to merge. I agree with Raul that this is a better approach.
type ExtensionDataPartialMap = Partial< | ||
{ | ||
[E in Extension]: ExtensionData; | ||
} |
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.
Very nice type casting!
2662619
to
94aa383
Compare
Description
This PR removes coin machine & whitelist extensions from the Dapp (combining #3531 & #3532).
Extensions authorised to be used within the Dapp are defined here:
https://github.com/JoinColony/colonyDapp/blob/refactor/3532-remove-whitelist-coinmachine/src/modules/dashboard/components/Extensions/index.ts#L7
I have removed the following for both coin machine & whitelist extensions :
There are many changes in this PR, many areas were touched. I have tested many paths through the app without discovering any issues or anomalies.
Resolves #3531 & #3532