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

CB-4539 fix: value panel auto type detection #2320

Merged
merged 6 commits into from
Jan 23, 2024

Conversation

Wroud
Copy link
Member

@Wroud Wroud commented Jan 22, 2024

No description provided.

</Button>
</Container>
)}
<Container keepSize>
Copy link
Contributor

Choose a reason for hiding this comment

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

this button now shows all the time. it should only appear for truncated texts only

Copy link
Contributor

Choose a reason for hiding this comment

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

image

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@@ -125,16 +128,16 @@ export const TextValuePresentation: TabContainerPanelComponent<IDataValuePanelPr
const limit = bytesToSize(quotasService.getQuota('sqlBinaryPreviewMaxLength'));
const canSave = firstSelectedCell && contentAction.isDownloadable(firstSelectedCell);
const shouldShowPasteButton = isTextColumn && isTruncated;
const typeExtension = useMemo(() => getTypeExtension(state.currentContentType) ?? [], [state.currentContentType]);
const typeExtension = useMemo(() => getTypeExtension(contentType!) ?? [], [contentType]);
Copy link
Contributor

Choose a reason for hiding this comment

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

should we go with contentType ?? DEFAULT_CONTENT_TYPE? if something went wrong and contentType is null, then interface probably will be broken at all

Copy link
Member Author

Choose a reason for hiding this comment

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

no we shouldn't because this is typescript check and we will never have contentType = null at this point (only if we will broke something)

Comment on lines +165 to +166
<Container keepSize center overflow>
<Container keepSize>
Copy link
Contributor

Choose a reason for hiding this comment

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

image

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose something went wrong inside container component if we have to do this twice Container thing in order to get a correct layout

Copy link
Member Author

Choose a reason for hiding this comment

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

in this case it's because i don't want to add extra styles to TabsList
I suppose it's not always about problem in the Container but in matching other components together

autoContentType = 'application/octet-stream;type=base64';
autoLineWrapping = true;
break;
default:
Copy link
Contributor

Choose a reason for hiding this comment

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

'application/octet-stream;type=hex': - should we consider this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

we will detect tab automatically later, by now we just set base64 as default for all binary data

@Wroud Wroud merged commit 544f3a8 into devel Jan 23, 2024
4 checks passed
@Wroud Wroud deleted the fix/cb-4539/value-panel-auto-type branch January 23, 2024 16:35
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.

4 participants