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

Issue 51432: LKSM: special character in sample names is not working well on various pages #1658

Merged
merged 10 commits into from
Dec 9, 2024

Conversation

XingY
Copy link
Contributor

@XingY XingY commented Dec 4, 2024

XingY added 7 commits December 2, 2024 22:05
# Conflicts:
#	packages/components/package-lock.json
#	packages/components/package.json
#	packages/components/releaseNotes/components.md
# Conflicts:
#	packages/components/releaseNotes/components.md
# Conflicts:
#	biologics/package-lock.json
#	biologics/package.json
#	inventory/package-lock.json
#	inventory/package.json
#	sampleManagement/package-lock.json
#	sampleManagement/package.json
@XingY XingY changed the title Issue 51432: LKSM: special character not working well on various pages Issue 51432: LKSM: special character in sample names is not working well on various pages Dec 4, 2024
### version 6.X
*Released*: X 2024
- Issue 51432: LKSM: special character not working well on various pages
- Warn user about missing quotes when pasting data into editable grid that containing comma
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Warn user about missing quotes when pasting data into editable grid that containing comma
- Warn user about missing quotes when pasting data into editable grid that contains a comma

function lookupValidationError(value: string | number | boolean, fromPaste?: boolean): CellMessage {
let suffix = '';
if (fromPaste && typeof value === 'string' && value.toString().indexOf(',') > -1) {
suffix = '. Please make sure values that contains comma(,) are properly quoted.';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
suffix = '. Please make sure values that contains comma(,) are properly quoted.';
suffix = '. Please make sure values that contain commas are properly quoted.';

@@ -781,6 +781,7 @@ function addEdges(
}
}

const FULLWIDTH_AMPERSAND = '&'; // U+FF06, use as alt display for & so vis-network won't error out
Copy link
Contributor

Choose a reason for hiding this comment

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

So odd that this is even a thing.

}

try {
new RegExp(nodeLabel);
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably not a huge deal, but since regular expressions and exception throwing are relatively expensive, perhaps it would be more efficient to always do the replaceAll. Or are there cases where this substitution isn't a good thing?

Copy link
Contributor Author

@XingY XingY Dec 7, 2024

Choose a reason for hiding this comment

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

I was hoping to preserve the original labels as much as possible. The hope is that there aren't many that contains & to trigger this code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably true that there aren't many &-names, or we would have heard more about this problem, and maybe the world of JavaScript is different in this regard than Java, but I still think it's more efficient (and targeted) to do the replacement without regex construction, especially since it seems like this RegExp construction could throw an error for other reasons than the &.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure that makes sense. Since user can't copy label from the vis canvas, it's no harm to do the replacement more aggressively. Updated to use replaceAll instead.

@XingY XingY merged commit 00c0431 into develop Dec 9, 2024
1 check passed
@XingY XingY deleted the fb_issue51432 branch December 9, 2024 16:56
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.

2 participants