-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(uve): Implement Language selector on new FTM toolbar (#30849)
### Showcase Traditional: https://github.com/user-attachments/assets/4b45d59f-0c5e-4c6c-9242-65223580c0ce Headless: https://github.com/user-attachments/assets/cca951fb-d240-4940-af5d-628cde74cf32 This pull request includes significant refactoring and improvements to the `dot-ema-shell.component.ts` and related files. The changes streamline the code, enhance functionality, and improve the testing framework. The most important changes include removing unused services and methods, adding a language selector component, and updating the testing specifications. ### Codebase simplification and cleanup: * Removed unused imports and services from `dot-ema-shell.component.ts`, including `DotMessageService`, `ConfirmationService`, and `DotLanguage`. [[1]](diffhunk://#diff-677330662fea6dadc7e48fd8455ec2a6fe60d624c7ed1f01f0a3e985aacd05c6L19-L26) [[2]](diffhunk://#diff-677330662fea6dadc7e48fd8455ec2a6fe60d624c7ed1f01f0a3e985aacd05c6L37-R42) * Deleted the `createNewTranslation` and `shouldNavigate` methods from `dot-ema-shell.component.ts` and replaced them with utility functions `getTargetUrl` and `shouldNavigate`. ### New functionality: * Added a new `dot-edit-ema-language-selector` component to the toolbar in `dot-uve-toolbar.component.html`. This component allows users to select a language and handles the selection event. * Implemented the `onLanguageSelected` method in `dot-uve-toolbar.component.ts` to handle language selection and trigger page translation if necessary. [[1]](diffhunk://#diff-217a9e619d6590c4f652e85353b9637ba5e464ddeb0424be35aef39bb8dceb30L2-R23) [[2]](diffhunk://#diff-217a9e619d6590c4f652e85353b9637ba5e464ddeb0424be35aef39bb8dceb30L24-R121) ### Testing improvements: * Updated the `dot-uve-toolbar.component.spec.ts` to include tests for the new language selector component and its interactions. This includes mocking the `ConfirmationService` and adding tests for language selection scenarios. [[1]](diffhunk://#diff-3eaa147616a5d1ff374a5fa27b0f38f0159a9039ef7e8d672dec43631f48a9e1L1-R10) [[2]](diffhunk://#diff-3eaa147616a5d1ff374a5fa27b0f38f0159a9039ef7e8d672dec43631f48a9e1R39) [[3]](diffhunk://#diff-3eaa147616a5d1ff374a5fa27b0f38f0159a9039ef7e8d672dec43631f48a9e1R55-R57) [[4]](diffhunk://#diff-3eaa147616a5d1ff374a5fa27b0f38f0159a9039ef7e8d672dec43631f48a9e1L129-R138) [[5]](diffhunk://#diff-3eaa147616a5d1ff374a5fa27b0f38f0159a9039ef7e8d672dec43631f48a9e1R179) [[6]](diffhunk://#diff-3eaa147616a5d1ff374a5fa27b0f38f0159a9039ef7e8d672dec43631f48a9e1R204-R225) These changes collectively improve the maintainability and functionality of the `dot-ema-shell` component and its related parts. --------- Co-authored-by: Kevin Davila <[email protected]>
- Loading branch information
1 parent
2642ee6
commit da51ee9
Showing
16 changed files
with
412 additions
and
451 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
Oops, something went wrong.