-
Notifications
You must be signed in to change notification settings - Fork 392
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
CB-4222 feat: read blob data for value panel #2422
Conversation
webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/useTextValue.ts
Show resolved
Hide resolved
if (isResultSetBlobValue(this.cellValue)) { | ||
// uploaded file preview | ||
return URL.createObjectURL(this.cellValue.blob); | ||
return this.cellValue.blob; | ||
} | ||
|
||
if (this.staticSrc) { |
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.
probably we want this condition to be at the end of the function
so if we have some blobs cached we return it first
and only then if there are nothing to give from cache we can give a link to download
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.
priority is:
- changed value (preview)
- available src data (we don't need to have cache in this case)
- available cache if src is not available
() => ({ | ||
observedValueMetadata: new Map(), | ||
|
||
observedValue<TArgs, TValue>(key: string, args: () => TArgs, loader: (args: TArgs) => Promise<TValue>): () => TValue { |
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.
we can consider the key
argument to be a symbol, not a string. to avoid collisions when the same key can has 2 different values depending on context where it was called
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.
there is no difference because the main problem is that the same component can be mounted more than 1 time and will use the same key (no matter the type)
No description provided.