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

debt - remove field when no attachments present #184630

Merged
merged 2 commits into from
Jun 8, 2023
Merged

Conversation

Yoyokrazy
Copy link
Contributor

@Yoyokrazy Yoyokrazy commented Jun 8, 2023

Fixes: vscode-jupyter/#13522
Re: #184606

Remove attachment field from cell metadata when no attachments are present in the cell.

todo: maybe address images that have been commented out?
todo: likely will need a rework alongside changes in #184606

@Yoyokrazy Yoyokrazy enabled auto-merge (squash) June 8, 2023 18:23
@Yoyokrazy Yoyokrazy self-assigned this Jun 8, 2023
@Yoyokrazy Yoyokrazy requested a review from rebornix June 8, 2023 18:23
@vscodenpa vscodenpa added this to the June 2023 milestone Jun 8, 2023
@Yoyokrazy Yoyokrazy removed the request for review from rebornix June 8, 2023 21:59
if (Object.keys(markdownAttachmentsInUse).length === 0) {
updateMetadata.attachments = null;
} else {
updateMetadata.attachments = markdownAttachmentsInUse;
Copy link
Contributor

Choose a reason for hiding this comment

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

one-line alternative: updateMetadata.attachments = Object.keys(markdownAttachmentsInUse).length ? markdownAttachmentsInUse : null;

@Yoyokrazy Yoyokrazy merged commit 34bde27 into main Jun 8, 2023
@Yoyokrazy Yoyokrazy deleted the milively/cleaner_debt branch June 8, 2023 22:18
rebornix added a commit that referenced this pull request Jun 28, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notebooks end up with attachment in cell attributes when it should not
3 participants