Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Translation Epic TS3 - Add Has Valid Language Guard #308

Open
3 tasks done
Karvel opened this issue Apr 6, 2021 · 0 comments
Open
3 tasks done

Translation Epic TS3 - Add Has Valid Language Guard #308

Karvel opened this issue Apr 6, 2021 · 0 comments
Labels
feature New feature or change that directly affects users test Code tests only

Comments

@Karvel
Copy link
Contributor

Karvel commented Apr 6, 2021

Desired Use Case

The webapp should only load routes with the :languageCode route parameter when the parameter is one of the supported language codes.

Actual/Current Behavior

The feature is not yet implemented.

Steps to Implement This Feature

  • Add isAvailableLanguageCode() service method.
  • Add new translation key and translations for the error notification.
  • Add HasValidLanguageGuard.

Pre-Testing TODOs

What needs to be done before testing.

  1. This feature will be wired up to the forthcoming set-translate route. To test it now, add the following to the content routing module:
      {
        path: 'set-translation/:id/:languageCode',
        component: AgentDetailSmartComponent,
        canActivate: [CanEditAuthGuard, HasValidLanguageGuard],
        resolve: {
          agent: resolverList.UpdateAgentResolver,
        },
      },

Testing Steps

If you are not a member of this project, skip this step

How do the users test this change?

  1. Log in (as at least an editor).
  2. Go to the agents view.
  3. Choose a table row and click on the set translation button.
  4. Choose and click on a language in the popover.
  5. Confirm that the language code for the selected language shows in the browser window (It will likely be something like http://localhost:4200/content/set-translation/1/en-US).
  6. Try changing the language code value to something invalid: (http://localhost:4200/content/set-translation/1/test).
  7. Confirm that the app returns to the agent view.
  8. Confirm that it shows a notification message when it doesn't get a valid language code.
  9. Confirm that the notification messages translate into the active language.
@Karvel Karvel added the feature New feature or change that directly affects users label Apr 6, 2021
@Karvel Karvel added this to the Translation - Sprint #5 milestone Apr 6, 2021
@Karvel Karvel self-assigned this Apr 6, 2021
@Karvel Karvel added the test Code tests only label Apr 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or change that directly affects users test Code tests only
Projects
None yet
Development

No branches or pull requests

1 participant