-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: truncate attribute plainText (#5225)
* Truncate attribute plainText * add changeset * extract messages * refactor: improve message
- Loading branch information
Showing
6 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"saleor-dashboard": patch | ||
--- | ||
|
||
The value of attribute type `plainText` is now capped. This prevents the UI from freezing when the value is very large. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { getTruncatedTextValue } from "./utils"; | ||
|
||
describe("getTruncatedTextValue", () => { | ||
it("should truncate the value if it is longer than the specified length", () => { | ||
expect(getTruncatedTextValue("Hello, world!", 5)).toBe("Hello..."); | ||
}); | ||
|
||
it("should return the value if it is shorter than the specified length", () => { | ||
expect(getTruncatedTextValue("Hello", 10)).toBe("Hello"); | ||
}); | ||
|
||
it("should return the value if it is exactly the specified length", () => { | ||
expect(getTruncatedTextValue("Hello", 5)).toBe("Hello"); | ||
}); | ||
|
||
it("should return the value if it is empty", () => { | ||
expect(getTruncatedTextValue("", 5)).toBe(""); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters