-
Notifications
You must be signed in to change notification settings - Fork 501
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(files): CAR Import #2323
feat(files): CAR Import #2323
Conversation
… file and validate file name
making UI match bulk import feature
+ unifying import/export language
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.
Thank you @badgooooor!
I've pushed small cosmetic changes to follow similar visual language as in "Bulk import" feature added in #2307, added CLI tutor docs and unified CAR Import/Export language.
Looks good to merge on my end, but would appreciate second set of eyes on UI and language.
@SgtPooki / @2color mind taking a final look, and if looks ok, merge?
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 discovered a bug when you try to import and the name already exists. I've pushed a229aa9 to fix this, in lieu of a better way to show errors, I just throw a more helpful error.
Besides that, LGTM.
Thanks @badgooooor 🎉
i'm getting an error when importing:
commenting out changes from a229aa9 resolves this. Will look into a more robust fix. |
@SgtPooki sorry that was oversight on my end. I used the |
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.
// TODO: Not sure why we do this. Perhaps a generic error is used | ||
// to avoid leaking private information via Countly? | ||
throw Object.assign(new Error('ipfs.files.cp call failed'), { |
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.
FYI we no longer use countly.. we need to strip it from this repo
|
||
declare export interface IPFSService extends CoreService { | ||
pin: PinService; | ||
files: FileService; | ||
name: NameService; | ||
object: ObjectService; | ||
config: ConfigService; | ||
dag: KuboRPCClient['dag']; |
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.
note that I removed the custom defined types here so we don't have to manage them later. Ideally this whole IPFSService will be going away and we'll be using types from kubo-rpc-client going forward.
"description": "Choose a CAR file to import a DAG from and specify a name for it to be imported into the current directory.", | ||
"selectCARButtonText": "Select CAR…", | ||
"namePlaceholder": "Name", | ||
"renameImportPath": "Rename import" |
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.
new label for rename input
// @ts-expect-error - https://github.com/ipfs/js-kubo-rpc-client/issues/278 | ||
const result = await all(ipfs.dag.import(stream, { |
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.
kubo-rpc-client types need updated.
{/* Gray text showing original car file name */} | ||
{ file != null | ||
? <div className='mt1 f7 center charcoal-muted tl w-90'>{file.path}</div> | ||
: null | ||
} |
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.
new display of original car file
<p className='mt0 center charcoal tl w-90'>{t('addByCarModal.description')}</p> | ||
</div> | ||
|
||
<label htmlFor='import-car-file-name' className='mt0 f7 center charcoal-muted tl w-90'>{t('addByCarModal.renameImportPath')}</label> |
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.
new label for rename input
Description
IPFSService