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: import a space into w3console #309

Merged
merged 9 commits into from
Feb 6, 2023
Merged

feat: import a space into w3console #309

merged 9 commits into from
Feb 6, 2023

Conversation

olizilla
Copy link
Contributor

Add an import flow to add a space from a user provided ucan that delegates * capabilites on a space created by another agent.

Provides the w3console agent DID, so you can send it to the other party to create a delegation just for you

w3console-import-space.720p.mov

License: MIT
Signed-off-by: Oli Evans [email protected]

Add an import flow to add a space from a user provided ucan that delegates * capabilites on a space created by another agent.

Provides the w3console agent DID, so you can send it to the other party to create a delegation _just for you_

License: MIT
Signed-off-by: Oli Evans <[email protected]>
@olizilla
Copy link
Contributor Author

I need to appease tsc on this one!

Copy link
Member

@travis travis left a comment

Choose a reason for hiding this comment

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

This is amazing! Looks good, some minor style nits and questions but feel free to merge once you've placated tsc.

})
return car
}

export function SpaceShare (): JSX.Element {
const [, { createDelegation }] = useKeyring()
export async function toDelegation (car: Blob): Promise<Delegation> {
Copy link
Member

Choose a reason for hiding this comment

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

is there anything we should do here to ensure this is actually a delegation or is that handled in the library?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the code should catch where the blob cannot be decoded as a CAR and let the user know that the file isn't a CAR (or corrupted).

and it should catch an error from importDAG if the CAR doesn't contain blocks that can be parsed as a ucan delegation.

This feature in general is very much a proof of concept, so i'd prefer to land it as is, and then prioritise adding the good feedback if we decide it's a thing we want to keep. It'll be much less relevant once we can fetch users other spaces for them from accounts, and share spaces by email address.

examples/react/w3console/src/share.tsx Outdated Show resolved Hide resolved
examples/react/w3console/src/share.tsx Outdated Show resolved Hide resolved
@@ -80,9 +112,43 @@ export function SpaceShare (): JSX.Element {
value={value}
onChange={onChange}
/>
<a className='w3ui-button text-center block w-52 opacity-30' style={{ opacity: downloadUrl !== '' ? '1' : '0.2' }} href={downloadUrl ?? ''} download={downloadName(downloadUrl !== '', value)}>Download UCAN</a>
<a className='w3ui-button text-center block w-52' style={{ opacity: downloadUrl !== '' ? '1' : '0.2' }} href={downloadUrl ?? ''} download={downloadName(downloadUrl !== '', value)}>Download UCAN</a>
Copy link
Member

Choose a reason for hiding this comment

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

similarly, I'd move this style= into the className

Suggested change
<a className='w3ui-button text-center block w-52' style={{ opacity: downloadUrl !== '' ? '1' : '0.2' }} href={downloadUrl ?? ''} download={downloadName(downloadUrl !== '', value)}>Download UCAN</a>
<a className={`w3ui-button text-center block w-52 ${downloadUrl !== '' ? 'opacity-100' : 'opacity-20'}`}
href={downloadUrl ?? ''} download={downloadName(downloadUrl !== '', value)}>
Download UCAN
</a>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had an issue with postcss not being able to detect dynamic classNames, which meant the class name wasn't included in the compiled css.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 2, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f0a3b7d:

Sandbox Source
@w3ui/example-react-file-upload Configuration
@w3ui/example-react-sign-up-in Configuration
@w3ui/example-react-uploads-list Configuration
@w3ui/example-solid-file-upload Configuration
@w3ui/example-solid-sign-up-in Configuration
@w3ui/example-solid-uploads-list Configuration
@w3ui/example-vue-file-upload Configuration
@w3ui/example-vue-sign-up-in Configuration
@w3ui/example-vue-uploads-list Configuration

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

@olizilla
Copy link
Contributor Author

olizilla commented Feb 6, 2023

The solid upload-list example integration test is failing. Am digging in.

the prod build of the upload-list example would lock up the browser, with nothing in the console. Running the dev build worked fine.

it's not very satisfying, but upgading solid has made the error go away, and digging deeper on this is not a priority, so.

License: MIT
Signed-off-by: Oli Evans <[email protected]>
@olizilla olizilla merged commit a69a95b into main Feb 6, 2023
@olizilla olizilla deleted the import-space branch February 6, 2023 21:53
travis pushed a commit that referenced this pull request Feb 8, 2023
🤖 I have created a release *beep* *boop*
---


##
[2.2.0](keyring-core-v2.1.1...keyring-core-v2.2.0)
(2023-02-06)


### Features

* new `addSpace` function that enables clients to import a space given a an appropriate `Delegation`
([#309](#309))
([a69a95b](a69a95b))

---
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>
travis added a commit that referenced this pull request Feb 8, 2023
🤖 I have created a release *beep* *boop*
---


##
[3.0.0](react-keyring-v2.1.0...react-keyring-v3.0.0)
(2023-02-06)


### ⚠ BREAKING CHANGES

* no breaking changes, but a major version bump because I made an error operating release-please

### Features

* "Headless" UI components
([#136](#136))
([46583e0](46583e0))
* delegate access to spaces
([#293](#293))
([441d757](441d757))
* import a space into w3console
([#309](#309))
([a69a95b](a69a95b))

---
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>
Co-authored-by: Travis Vachon <[email protected]>
travis added a commit that referenced this pull request Feb 8, 2023
🤖 I have created a release *beep* *boop*
---


##
[2.1.0](solid-keyring-v2.0.1...solid-keyring-v2.1.0)
(2023-02-06)


### Features

* delegate access to spaces
([#293](#293))
([441d757](441d757))
* import a space into w3console
([#309](#309))
([a69a95b](a69a95b))


### Bug Fixes

* get solid examples working again
([#199](#199))
([78ad7e9](78ad7e9))

---
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>
Co-authored-by: Travis Vachon <[email protected]>
travis pushed a commit that referenced this pull request Mar 23, 2023
🤖 I have created a release *beep* *boop*
---


## 1.0.0 (2023-03-23)


### ⚠ BREAKING CHANGES

* use new account model
([#400](#400))

### Features

* add terms of service page
([#417](#417))
([6deb24d](6deb24d))
* adds space-finder autocomplete combobox
([#268](#268))
([3dcd647](3dcd647))
* allow users to set page size in W3APIProvider
([#308](#308))
([814a293](814a293))
* club tropical w3 auth boxen
([#350](#350))
([2266eb2](2266eb2))
* delegate access to spaces
([#293](#293))
([441d757](441d757))
* import a space into w3console
([#309](#309))
([a69a95b](a69a95b))
* Improve upload component flow
([#285](#285))
([ba9a3bf](ba9a3bf))
* publish console to IPFS & Cloudflare from CI
([#287](#287))
([e2a833e](e2a833e))
* Storybook story improvements
([#294](#294))
([e0de2cc](e0de2cc))
* use new account model
([#400](#400))
([66dd20b](66dd20b))
* w3console example app
([#255](#255))
([df08029](df08029))


### Bug Fixes

* add _headers ([#418](#418))
([4eb1da1](4eb1da1))
* fix w3console styling
([#320](#320))
([74a298c](74a298c))
* remove authenticator class when registed
([#352](#352))
([3668f3b](3668f3b))
* w3console polish
([#284](#284))
([9a67365](9a67365))

---
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