-
Notifications
You must be signed in to change notification settings - Fork 477
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(kit): InputFlies
new value of i18n-token TUI_INPUT_FILE_TEXTS
triggers text changes
#2711
Conversation
Pull request was closed ✔️All saved screenshots (for current PR) were deleted 🗑️ |
InputFlies
no text changes with new value of i18n-token TUI_INPUT_FILE_TEXTS
InputFlies
trigger text changes with new value of i18n-token TUI_INPUT_FILE_TEXTS
Visit the preview URL for this PR (updated for commit 2cd06ac): https://taiga-ui--pr2711-input-files-i18n-fix-c1e3bg58.web.app (expires Fri, 16 Sep 2022 14:42:10 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
InputFlies
trigger text changes with new value of i18n-token TUI_INPUT_FILE_TEXTS
InputFlies
new value of i18n-token TUI_INPUT_FILE_TEXTS
triggers text changes
@tuiPure | ||
getMaxSizeRejectionError$(maxFileSize: number): Observable<string> { | ||
return combineLatest([this.inputFileTexts$, this.units$]).pipe( | ||
map( | ||
([{maxSizeRejectionReason}, units]) => | ||
maxSizeRejectionReason + tuiFormatSize(units, maxFileSize), | ||
), | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can make it better in a separate pipe?
<ng-template #maxSizeRejection>
{{ maxFileSize | maxSizeRejectionError | async ?? '' }}
</ng-template>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done ✅
Codecov Report
@@ Coverage Diff @@
## main #2711 +/- ##
==========================================
- Coverage 56.68% 56.67% -0.02%
==========================================
Files 955 956 +1
Lines 9233 9237 +4
Branches 1894 1894
==========================================
+ Hits 5234 5235 +1
- Misses 3588 3591 +3
Partials 411 411
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
||
cy.get(`#demoContent tui-file`) | ||
.should(`contain.text`, `Wrong file type`) | ||
.matchImageSnapshot(`01-01-input-files-[english]-wrong-file-type`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
cy.get(`#demoContent tui-file`) | ||
.should(`contain.text`, `Verkeerd bestandsformaat`) | ||
.matchImageSnapshot(`01-02-input-files-[dutch]-wrong-file-type`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
cy.get(`#demoContent tui-file`) | ||
.should(`contain.text`, `File is too large 2 KB`) | ||
.matchImageSnapshot(`02-01-input-files-[english]-file-too-large`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
cy.get(`#demoContent tui-file`) | ||
.should(`contain.text`, `Bestandsgrootte overschreden 2 KB`) | ||
.matchImageSnapshot(`02-02-input-files-[dutch]-file-too-large`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… triggers text changes (#2711) Cherry-picked from `v3.x`
… triggers text changes (#2711) Cherry-picked from `v3.x`
… triggers text changes (taiga-family#2711) * fix(kit): `InputFlies` no text changes with new value of i18n-token `TUI_INPUT_FILE_TEXTS` * chore(demo-integrations): new cypress tests * refactor: create `tuiMaxSizeRejectionError`-pipe
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #2709
What is the new behavior?
You can dynamically change language of error messages for rejected files.
Does this PR introduce a breaking change?