Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

fix(quantity): add several name length limits #356

Merged
merged 15 commits into from
Jan 30, 2023

Conversation

Arinono
Copy link
Contributor

@Arinono Arinono commented Oct 24, 2022

Authors

@Arinono

Issue

Refs (and used by, kinda, not required, but better) withthegrid/platform-client#1407
Used by https://github.com/withthegrid/platform/pull/1907

While I was working on the ticket above: inputing very long names everywhere, I got an API error for a quantity.unit name being too long. DB schema has a varchar(10), and the SDK doesn't check this.

So I'm opening a PR to add this to the SDK.

👀 As discussed with Rob, this won't be breaking change(s), since the API would have blocked the requests anyways.
I introduced one 🤓

Implementation details

quantity.unit

Limiting to 10 chars to follow the DB schema

unit name longer than 10 chars

image

Entities names 🚨 BREAKING 🚨 (stringOrTranslations)

The names of localisable entities were not limited in length.
So I updated the helper that was giving the schema for these to introduce a max length of 255 for version 9 (new version) onwards.

measurement-filter

Add limit of 100 on name and 255 on description (add and update)

webhook

Limited name to 255

@Arinono Arinono force-pushed the feat-platform-client-1407-text-overflow branch 8 times, most recently from adf78f8 to eeb37c1 Compare October 27, 2022 15:03
@Arinono Arinono force-pushed the feat-platform-client-1407-text-overflow branch from 3998dcf to 854f72a Compare December 15, 2022 09:17
@Arinono Arinono force-pushed the feat-platform-client-1407-text-overflow branch 3 times, most recently from 2c3b38f to 0719bed Compare January 17, 2023 16:11
@Arinono Arinono changed the title fix(quantity): add unit name length limit fix(quantity): add several name length limits Jan 18, 2023
@Arinono Arinono marked this pull request as ready for review January 18, 2023 09:26
@Arinono Arinono requested review from srieding and removed request for srieding January 18, 2023 09:26
@Arinono Arinono marked this pull request as draft January 18, 2023 15:56
@Arinono Arinono requested a review from srieding January 18, 2023 16:09
@Arinono Arinono marked this pull request as ready for review January 18, 2023 16:09
Copy link
Collaborator

@srieding srieding left a comment

Choose a reason for hiding this comment

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

Now that there is a migration for the database fields. Do we still stick to the same api version boundaries?

src/models/string-or-translations.ts Show resolved Hide resolved
@Arinono Arinono requested a review from srieding January 25, 2023 08:59
src/routes/command-type/add.ts Outdated Show resolved Hide resolved
@Arinono Arinono force-pushed the feat-platform-client-1407-text-overflow branch 2 times, most recently from e44a6c2 to 1cd34ee Compare January 25, 2023 10:51
@Arinono Arinono requested a review from srieding January 26, 2023 09:36
src/index.ts Outdated Show resolved Hide resolved
@Arinono Arinono force-pushed the feat-platform-client-1407-text-overflow branch from 1cd34ee to 75937ee Compare January 30, 2023 09:39
@Arinono Arinono merged commit 4eb8bd5 into main Jan 30, 2023
@Arinono Arinono deleted the feat-platform-client-1407-text-overflow branch January 30, 2023 10:33
github-actions bot pushed a commit that referenced this pull request Jan 30, 2023
## [18.0.0](v17.73.1...v18.0.0) (2023-01-30)

### ⚠ BREAKING CHANGES

* **quantity:** localised entities names are now limited in length

### Bug Fixes

* **quantity:** add several name length limits ([#356](#356)) ([4eb8bd5](4eb8bd5))
@github-actions
Copy link

🎉 This PR is included in version 18.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants