Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

feat: orgs #1813

Merged
merged 1 commit into from
Jun 18, 2021
Merged

feat: orgs #1813

merged 1 commit into from
Jun 18, 2021

Conversation

rudolfs
Copy link
Member

@rudolfs rudolfs commented Apr 21, 2021

This PR implements radicle Orgs on Ethereum via Gnosis Safe.

All tasks are outlined in the "Orgs" section of: #1893.

@brandonhaslegs
Copy link
Contributor

Make sure to update to the latest anchor icon. The wrong one was in the icons file, my bad.

@rudolfs
Copy link
Member Author

rudolfs commented Jun 9, 2021

@brandonhaslegs replaced both: cabe53a.

ui/src/org.ts Outdated Show resolved Hide resolved
ui/DesignSystem/Component/AnchorMetadataModal.svelte Outdated Show resolved Hide resolved
ui/src/urn.ts Show resolved Hide resolved
ui/src/transaction.ts Outdated Show resolved Hide resolved
ui/src/proxy/project.ts Outdated Show resolved Hide resolved
ui/src/router.ts Outdated Show resolved Hide resolved
ui/src/theGraphApi.ts Outdated Show resolved Hide resolved
ui/Modal/Org/Create.svelte Outdated Show resolved Hide resolved
ui/Screen/Org/Projects.svelte Outdated Show resolved Hide resolved
ui/src/org.ts Outdated
@@ -0,0 +1,342 @@
import * as svelteStore from "svelte/store";
Copy link
Contributor

Choose a reason for hiding this comment

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

On the organization of code in this module and theGraphApi I’d propose the following: Let’s split it into a stateless data fetching layer and the stateful “service” layer.

The data fetching layer would not contain any stateful code. It would not make use of stores, notifcations, module-level variables, etc. It’s primary purpose would be to export functions that get or update org-related data from the sources. (Maybe we separate data fetchers for the graph, contracts, and gnosis safe.)

On top of this layer would be the layer that keeps state and interacts with the UI (e.g. through notifications.)

Copy link
Member Author

Choose a reason for hiding this comment

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

let projectUrn: urn.Urn | undefined = undefined;

$: if (projectUrn) {
projectScreen.fetch(projectUrn);
Copy link
Contributor

Choose a reason for hiding this comment

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

I fear it will be quite dangerous re-using and mutating the global project screen store here.-We should use a dedicated project store only for this view. I don’t know however how much of the logic of the screen store we would need to reuse to accomplish this. To be able to re-use logic may need to better separate the data fetching logic from the state update logic in the project module.

Copy link
Member Author

Choose a reason for hiding this comment

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

Tracked in #1998.

ui/Modal/Org/AnchorProject.svelte Outdated Show resolved Hide resolved
ui/src/proxy/project.ts Outdated Show resolved Hide resolved
ui/DesignSystem/Component/AnchorMetadataModal.svelte Outdated Show resolved Hide resolved
ui/DesignSystem/Component/ProjectList.svelte Outdated Show resolved Hide resolved
ui/Modal/Org/Create.svelte Show resolved Hide resolved
ui/src/org.ts Outdated Show resolved Hide resolved
ui/src/org.ts Outdated Show resolved Hide resolved
ui/src/org.ts Outdated Show resolved Hide resolved
ui/src/org.ts Outdated Show resolved Hide resolved
ui/Modal/Org/AnchorProject.svelte Outdated Show resolved Hide resolved
ui/Screen/Org.svelte Outdated Show resolved Hide resolved
ui/src/org.ts Outdated Show resolved Hide resolved
],
});

router.push({ type: "org", address: orgAddress, activeTab: "projects" });
Copy link
Contributor

Choose a reason for hiding this comment

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

router.push is async now. Is there a good reason not to await?

Copy link
Member Author

Choose a reason for hiding this comment

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

What do we gain by awaiting here? There are no actions that happen after. We also don't await any of the other router.pushes anywhere else in the code.

ui/src/org.ts Outdated Show resolved Hide resolved
ui/Modal/Org/Create.svelte Outdated Show resolved Hide resolved
@brandonhaslegs
Copy link
Contributor

brandonhaslegs commented Jun 15, 2021

Some feedback from Abbey and my review:

  • Need persistent notifications for any situation when we're waiting for the user to approve a transaction
  • When clicking "Go to Org" in the "org created" notification, there's an Error
  • We need to rewrite the copy for the transaction notifications. I can just do this directly in code.
  • Add "View in browser" button in the [•••] overflow dropdown (use the same icon as View on Gnosis Safe)
  • Instead of "Not yet supported" make the tooltip say "Coming soon"

@rudolfs
Copy link
Member Author

rudolfs commented Jun 15, 2021

Add "View in browser" button in the [•••] overflow dropdown (use the same icon as View on Gnosis Safe)

@brandonhaslegs we'll have to figure out how to make sure that the wallet in the browser is connected to the same Ethereum network as the app. Or instruct the user to match the network settings. Otherwise if the user clicks on "Open in browser" and the networks mismatch, they will see:

Screenshot 2021-06-15 at 17 47 04

@brandonhaslegs
Copy link
Contributor

Updated the icons so we don't have two identical icons in the same dropdown.

Use the gnosisSafe icon for View in Gnosis Safe, and use the globe icon for View in browser.

@rudolfs
Copy link
Member Author

rudolfs commented Jun 15, 2021

Use the gnosisSafe icon for View in Gnosis Safe, and use the globe icon for View in browser.

Screenshot 2021-06-15 at 18 15 26

@rudolfs rudolfs self-assigned this Jun 15, 2021
@brandonhaslegs
Copy link
Contributor

brandonhaslegs commented Jun 16, 2021

Hi, here's a walletError icon for when the wallet is connected to a different wallet than Upstream is.

@brandonhaslegs
Copy link
Contributor

@brandonhaslegs we'll have to figure out how to make sure that the wallet in the browser is connected to the same Ethereum network as the app. Or instruct the user to match the network settings. Otherwise if the user clicks on "Open in browser" and the networks mismatch, they will see:

I think this is fine for now. Most likely that they will connect to the same network.

@rudolfs
Copy link
Member Author

rudolfs commented Jun 18, 2021

I think this is fine for now. Most likely that they will connect to the same network.

I also think this won't be a problem once we implement: #2002.

Copy link
Contributor

@geigerzaehler geigerzaehler left a comment

Choose a reason for hiding this comment

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

A couple of final comments

ui/DesignSystem/Component/ProjectList.svelte Outdated Show resolved Hide resolved
ui/DesignSystem/Component/ProjectList.svelte Outdated Show resolved Hide resolved
Co-authored-by: Julien Donck <[email protected]>
Co-authored-by: Thomas Scholtes <[email protected]>
Co-authored-by: Alexis Sellier <[email protected]>
Co-authored-by: Rūdolfs Ošiņš <[email protected]>

Signed-off-by: Rūdolfs Ošiņš <[email protected]>
@rudolfs rudolfs merged commit d567444 into master Jun 18, 2021
@rudolfs rudolfs deleted the cloudhead/orgs branch June 18, 2021 12:51
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