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(FE selection sorting): fix emoji and selection id = 0 handling #539

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

datenangebot
Copy link
Collaborator

  • remove emojis to sort by the real value
  • correct handling of selection-id = 0
  • code cleanup

closes #462

- remove emojis to sort by the real value
- correct handling of selection-id = 0
- code cleanup

Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com>
@datenangebot datenangebot added this to the v0.6.0 milestone Sep 12, 2023
@datenangebot datenangebot requested review from a team, juliusknorr and office-team-bot and removed request for a team September 12, 2023 09:53
return ((valueA < valueB) ? -1 : (valueA > valueB) ? 1 : 0) * factor
}
}

removeEmoji(str) {
return str.replace(/([#0-9]\u20E3)|[\xA9\xAE\u203C\u2047-\u2049\u2122\u2139\u3030\u303D\u3297\u3299][\uFE00-\uFEFF]?|[\u2190-\u21FF][\uFE00-\uFEFF]?|[\u2300-\u23FF][\uFE00-\uFEFF]?|[\u2460-\u24FF][\uFE00-\uFEFF]?|[\u25A0-\u25FF][\uFE00-\uFEFF]?|[\u2600-\u27BF][\uFE00-\uFEFF]?|[\u2900-\u297F][\uFE00-\uFEFF]?|[\u2B00-\u2BF0][\uFE00-\uFEFF]?|(?:\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDEFF])[\uFE00-\uFEFF]?/g, '')
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a reference to where that regex is from? The one I found when quickly checking is much larger:

https://github.com/mathiasbynens/emoji-regex/blob/main/index.js
https://github.com/tc39/proposal-regexp-unicode-sequence-properties#matching-emoji-sequences

Copy link
Member

Choose a reason for hiding this comment

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

We had this earlier (to remove trailing emojis) in Collectives, don't know how accurate this is: https://github.com/nextcloud/collectives/blob/efd5559e7e95787e7d966b70ff52fb4c26861302/src/decorators/collective.js#L23-L50

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We used this regex before to escape the export file name... I don't remember the source anymore. 🙄

Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

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

Would not block the merge for the emoji regex question

@datenangebot datenangebot merged commit ef49b5e into main Sep 12, 2023
9 checks passed
@datenangebot datenangebot deleted the fix/462-FE-sorting branch September 12, 2023 11:01
@github-actions
Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the reviewing process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR reviewing process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

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.

Column FE sorting, fuzzy with empty cells
3 participants