Closed Tguntenaar closed 1 year ago
@ailisp , I discussed with elliot that the function to delete available addons were out of scope. Removing an addon from a community tab is possible. Let me know what you think!
Hi @frol, since @ailisp is OOO. Could you review this PR? It's vital to continue the Community Plugins MVP milestone.
would it be better to use a LookupMap
for the community plugin configuration data? That way it would be possible to look up the config for the plugin in view, and also not make the community config object potentially very large.
@petersalomonsen
Can you demonstrate? Is this is to replace parameters JSON string?
yeah I was thinking that pub addon_list: Vec<CommunityAddOnConfig>
could just be a list of strings, an those strings represent the keys in a LookupMap<String,CommunityAddonConfig>
so that each config has a separate entry in the NEAR key/value storage. I believe this will scale better with multiple addons, or addons with larger config objects.
I updated the contract to use a LookupMap instead. Thanks @petersalomonsen for the review. New contract deployed here: https://explorer.testnet.near.org/transactions/DEu1TwCZM2fBbpqWZxZBL62ik6et7bCC9DeRbaMD4sdh
@ailisp could you review these contract changes?
@frol, @petersalomonsen, Based on the comments + discussion above, here's a diagram of the contract changes that @Tguntenaar and I have decided on implementing, and the way it is reflected on the UI:
Changes
The goal was to keep it as modular as possible and with a separation of duties; This way, I think we could also implement permissions control for individual addon configs? And maybe more, I think this pattern could be generalized and used for more structures similar to communities. @carina-akaia @ailisp @jaswinder6991
Here you can test a dummy example :
Check out the Screams and Whispers of Vlad's Haunted Hack House!
I think this looks great!
Just wondering when referencing community.configs[addon_id]
. Is then addon_id
unique for the community? We don't want other communities to get the same config if using the same addon as another community. Or have I missed something?
Lol sorry, there are a lot of moving parts and it's hard to keep the naming straight! You are correct, in the diagram, this should not be addon_id, but rather "config_id", where config_id is unique to the community via the Tuple: LookupMap<(CommunityHandle, CommunityAddOnConfigId), CommunityAddOnConfig> as suggested by @frol
I have updated the original post
Thank you everyone for the comments and review points. I deployed the latest version on thomaselliot.testnet
@frol one more try! :)
Resolves #253
The following structs have been added:
Acceptence Criteria (not all AC apply to the smart contract side)
I tested the migration with the following transactions: From V7 to V8 V8 to 'done'