Skip to content
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

feat: share spaces via email #123

Merged
merged 4 commits into from
Sep 24, 2024
Merged

feat: share spaces via email #123

merged 4 commits into from
Sep 24, 2024

Conversation

fforbeck
Copy link
Member

@fforbeck fforbeck commented Sep 18, 2024

Add Share via Email Feature

Context:
This PR introduces the Share via Email feature, allowing users to share spaces using either an email address or DID. Depending on the input, we render different buttons and actions (e.g., sharing via email or generating a downloadable UCAN). Once shared via email, the “Shared With” panel lists all shared emails (did:mailto) along with their capabilities, fetched from the delegations stored in the client.

Short Demo:
https://www.loom.com/share/b33ee2f22a5b44628e5d9fc3d599dbf7?sid=0b008211-fc28-4cd4-a716-e67f44067661

Minor Notes:

  • The Share button dynamically changes based on whether the user provides an email or DID.
  • The delegation list is displayed with relevant capabilities in the “Shared With” panel.

Copy link
Contributor

github-actions bot commented Sep 18, 2024

src/components/Tooltip.tsx Outdated Show resolved Hide resolved
src/components/Tooltip.tsx Outdated Show resolved Hide resolved
src/components/Tooltip.tsx Show resolved Hide resolved
src/share.tsx Outdated Show resolved Hide resolved
src/share.tsx Show resolved Hide resolved
src/share.tsx Outdated Show resolved Hide resolved
src/share.tsx Show resolved Hide resolved
src/share.tsx Outdated

const next = { email: delegatedEmail, capabilities: delegation.capabilities.map(c => c.can) }
setSharedEmails(prev => {
if (prev.some(item => item.email === next.email)) {
Copy link
Member

Choose a reason for hiding this comment

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

...should probably also check same set of capabilities

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if I understood that. The idea was to check the e-mail so we don't add it twice to the shared list on the UI. The capabilities are always the same.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah...not sure what I was thinking there...maybe I was thinking capabilities were the usual can, with, nb. We typically refer to the "can" as an ability, with "capability" as can, with, nb. Might be an idea to rename to abilities?

src/share.tsx Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/share.tsx Outdated

const next = { email: delegatedEmail, capabilities: delegation.capabilities.map(c => c.can) }
setSharedEmails(prev => {
if (prev.some(item => item.email === next.email)) {
Copy link
Member

Choose a reason for hiding this comment

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

Yeah...not sure what I was thinking there...maybe I was thinking capabilities were the usual can, with, nb. We typically refer to the "can" as an ability, with "capability" as can, with, nb. Might be an idea to rename to abilities?

@alanshaw
Copy link
Member

Everything else looks great, but please revert the dep bump because there's still an issue that needs to be resolved before we can do that.

src/share.tsx Outdated Show resolved Hide resolved
.pnpmfile.cjs Outdated Show resolved Hide resolved
src/components/Tooltip.tsx Outdated Show resolved Hide resolved
src/share.tsx Outdated Show resolved Hide resolved
@fforbeck fforbeck force-pushed the share-spaces branch 5 times, most recently from a6bd991 to 8859ae4 Compare September 24, 2024 13:09
@fforbeck fforbeck merged commit 896079b into main Sep 24, 2024
5 checks passed
@fforbeck fforbeck deleted the share-spaces branch September 24, 2024 13:52
fforbeck pushed a commit that referenced this pull request Sep 24, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.11.0](w3console-v1.10.0...w3console-v1.11.0)
(2024-09-24)


### Features

* share spaces via email
([#123](#123))
([896079b](896079b))


### Bug Fixes

* import space preview
([#127](#127))
([1f2acf6](1f2acf6))
* share space via ucan file
([#126](#126))
([ba934a2](ba934a2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants