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

feat(proxy): integrate rad/self #628

Merged
merged 13 commits into from Jul 3, 2020
Merged

feat(proxy): integrate rad/self #628

merged 13 commits into from Jul 3, 2020

Conversation

FintanH
Copy link
Contributor

@FintanH FintanH commented Jul 2, 2020

Depends on radicle-dev/radicle-link#229

Fixes #576
Closes #548

This integrates the use of rad/self in the monorepo. This means when we create an identity, we set the default rad/self in the peer to that User.

We can now filter the projects by the rad/self of the Project is the same as the default rad/self. This is demonstrated in test_list_projects

@FintanH FintanH added this to the β1 milestone Jul 2, 2020
@FintanH FintanH requested review from xla and rudolfs July 2, 2020 16:31
@FintanH FintanH self-assigned this Jul 2, 2020
@FintanH FintanH added this to In progress in Project Tracking/Replication Jul 2, 2020
@FintanH FintanH marked this pull request as draft July 2, 2020 16:37
@FintanH FintanH marked this pull request as ready for review July 2, 2020 16:48
@xla xla changed the title chore(proxy): integrate rad/self feat(proxy): integrate rad/self Jul 3, 2020
@xla xla removed this from the β1 milestone Jul 3, 2020
Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

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

🚇 🎊 🎋 🕹

Copy link
Member

@rudolfs rudolfs left a comment

Choose a reason for hiding this comment

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

Looks great!

Inlined some suggestions.

Would also suggest to apply this patch:

diff --git a/ui/Screen/IdentityCreation.svelte b/ui/Screen/IdentityCreation.svelte
index fc3f077..cfc13b4 100644
--- a/ui/Screen/IdentityCreation.svelte
+++ b/ui/Screen/IdentityCreation.svelte
@@ -16,9 +16,20 @@
     store.set(State.Welcome);
   };

+  const truncateUrn = message => {
+    let urn = message.match(/(rad:git:\w{59})/)[1];
+
+    if (urn) {
+      return message.replace(/(rad:git:\w{59})/, urn.substr(-5));
+    } else {
+      return message;
+    }
+  };
+
   const onError = event => {
-    notification.error(`Could not create identity: ${event.detail}`);
-    pop();
+    notification.error(
+      `Could not create identity: ${truncateUrn(event.detail.message)}`
+    );
   };

   const complete = redirectPath => {
diff --git a/ui/Screen/IdentityCreation/Form.svelte b/ui/Screen/IdentityCreation/Form.svelte
index bb6d1e0..b014c41 100644
--- a/ui/Screen/IdentityCreation/Form.svelte
+++ b/ui/Screen/IdentityCreation/Form.svelte
@@ -63,7 +63,7 @@
   $: if ($store.status === remote.Status.Success) {
     dispatch("success");
   } else if ($store.status === remote.Status.Error) {
-    dispatch("error");
+    dispatch("error", {message: $store.error.message});
   }
 </script>

Before (the pop() sometimes causes the error to not show up):
Screenshot 2020-07-03 at 10 48 42

After:
Screenshot 2020-07-03 at 10 48 17

proxy/src/coco/peer.rs Outdated Show resolved Hide resolved
key,
&kalt,
&repo_path,
"fakie-nose-kickflip-backside-180-to-handplant",
Copy link
Member

Choose a reason for hiding this comment

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

lol

proxy/src/http/identity.rs Outdated Show resolved Hide resolved
xla and others added 2 commits July 3, 2020 11:23
Co-authored-by: Rūdolfs Ošiņš <rudolfs@osins.org>
@xla xla merged commit 69c0adf into master Jul 3, 2020
@xla xla deleted the fintan/rad-self branch July 3, 2020 09:41
@FintanH FintanH moved this from In progress to Done in Project Tracking/Replication Jul 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Project list is kept across identities feat(proxy): User Start Up
3 participants