-
Notifications
You must be signed in to change notification settings - Fork 25
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
Conversation
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]>
I need to appease tsc on this one! |
There was a problem hiding this 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> { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@@ -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> |
There was a problem hiding this comment.
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
<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> |
There was a problem hiding this comment.
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.
Co-authored-by: Travis Vachon <[email protected]>
Co-authored-by: Travis Vachon <[email protected]>
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:
|
License: MIT Signed-off-by: Oli Evans <[email protected]>
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]>
see: web3-storage/web3.storage#1206 License: MIT Signed-off-by: Oli Evans <[email protected]>
🤖 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>
🤖 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]>
🤖 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]>
🤖 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>
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]