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

fix: LEAP-859: Fix data manager breaking on displaying specific data #5692

Merged
merged 8 commits into from
Apr 11, 2024

Conversation

Gondragos
Copy link
Collaborator

@Gondragos Gondragos commented Apr 8, 2024

The commit replaces usage of toStudlyCaps across several files with a new function normalizeCellAlias to standardize cell alias normalization across the app. This change ensures a consistent approach to handling cell alias normalization.

CellViews is used only to chose the right way do display the column and for aliases there are just a couple of variants that are apllicable in that case. So that changing any other string will not break anything.

PR fulfills these requirements

  • Tests for the changes have been added/updated
  • Docs have been added/updated
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance

Describe the reason for change

toStudlyCaps includes code

value.replace(/[-_\s]+(.)?/g, function (match, chr) {
  return toUpperCase(chr);
});

which does not work with values like "smthng_" as chr should be a string but we get undefined. To prevent this we need to remove unsafe trailing special characters before using this function.

This change affects (describe how if yes)

  • Performance
  • Security
  • UX

Does this PR introduce a breaking change?

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

What level of testing was included in the change?

  • e2e (codecept)
  • integration (cypress)
  • unit (jest)

Which logical domain(s) does this change affect?

CellViews

The commit replaces usage of 'toStudlyCaps' across several files with a new function 'normalizeCellAlias' to standardize cell alias normalization across the app. This change ensures a consistent approach to handling cell alias normalization.
Copy link

netlify bot commented Apr 8, 2024

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 45a4ab3
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/6618026a3ae88500086deb22

@github-actions github-actions bot added the fix label Apr 8, 2024
Copy link

netlify bot commented Apr 8, 2024

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 45a4ab3
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/6618026a40879d00087c2945

Copy link
Contributor

@juliosgarbi juliosgarbi left a comment

Choose a reason for hiding this comment

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

LGTM, with just a few minor adjustments needed to improve readability but not a blocket

web/libs/datamanager/src/components/CellViews/index.js Outdated Show resolved Hide resolved
web/libs/datamanager/src/components/CellViews/index.js Outdated Show resolved Hide resolved
Copy link
Contributor

@juliosgarbi juliosgarbi left a comment

Choose a reason for hiding this comment

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

Also that would be nice if we had some tests here

Gondragos and others added 2 commits April 9, 2024 14:48
Co-authored-by: Julio Sgarbi <julio.sgarbi@hotmail.com>
Co-authored-by: yyassi-heartex <104568407+yyassi-heartex@users.noreply.github.com>
@Gondragos
Copy link
Collaborator Author

Gondragos commented Apr 11, 2024

/git merge develop

Workflow run
Successfully merged: 108 files changed, 2197 insertions(+), 1985 deletions(-)

@Gondragos Gondragos merged commit 3abdab2 into develop Apr 11, 2024
28 of 29 checks passed
@Gondragos Gondragos deleted the fb-leap-859/colimn-special-characters branch April 11, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants