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

PB-1327: Refactored 'DropdownItem' to translate the button title internally #1191

Merged
merged 5 commits into from
Jan 16, 2025

Conversation

sami-nouidri-swisstopo
Copy link
Contributor

@sami-nouidri-swisstopo sami-nouidri-swisstopo commented Jan 9, 2025

This involves translating the title in the getter, such that when called, it is up-to-date with the current language context in web-mapviewer.

Test link

Copy link

cypress bot commented Jan 9, 2025

web-mapviewer    Run #4291

Run Properties:  status check passed Passed #4291  •  git commit 82aff82b01: Merge pull request #1191 from geoadmin/bug_PB-1327-categories-translation-issue
Project web-mapviewer
Branch Review develop
Run status status check passed Passed #4291
Run duration 01m 47s
Commit git commit 82aff82b01: Merge pull request #1191 from geoadmin/bug_PB-1327-categories-translation-issue
Committer Pascal Barth
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 1
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 48
View all changes introduced in this branch ↗︎

@sami-nouidri-swisstopo sami-nouidri-swisstopo self-assigned this Jan 9, 2025
@pakb pakb force-pushed the bug_PB-1327-categories-translation-issue branch from 9b9729e to 86e6336 Compare January 13, 2025 12:04
@sami-nouidri-swisstopo sami-nouidri-swisstopo force-pushed the bug_PB-1327-categories-translation-issue branch from 022e513 to 272e962 Compare January 15, 2025 15:03
Sami Nouidri and others added 5 commits January 16, 2025 08:49
…rnally.

This involves translating the title in the getter, such that when called, it is
up-to-date with the current language context in web-mapviewer.
instead of failing and raising an error while using t(...), vue-i18n now gives back the "key" or text it received unchanged. This way we can call translation tool on input from other component without worrying on raising errors.

The DropdownButton now translates anything it receives, making it possible to give it either keys, or translated text directly.

Removing the class DropdownItem and replacing it with a typedef instead. We now know that passing classes with get/set to Vuex is a bad practice, and we should avoid it.
Adapted the cypress tests to the new drop down item values.
so that it uses aliases on element whenever possible, and also test the payload of feedback for the category too.
@pakb pakb force-pushed the bug_PB-1327-categories-translation-issue branch from d1d19cd to d97dae8 Compare January 16, 2025 07:53
Copy link
Contributor

@pakb pakb left a comment

Choose a reason for hiding this comment

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

should be good to go now

@pakb pakb merged commit 82aff82 into develop Jan 16, 2025
6 checks passed
@pakb pakb deleted the bug_PB-1327-categories-translation-issue branch January 16, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants