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

fix(agent-detail): fix the language code in the payload #320

Merged
merged 2 commits into from
Apr 15, 2021

Conversation

pratimasakinala
Copy link
Collaborator

Changes

  1. Fixes the language code that is set to the dynamicContent key by setting it to the languageCode variable in the component

Approach

The languageCode local variable is set to the language for which a translation is being added or the default app language. So utilizing it as part of the payload works best.

Testing Steps

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

  1. Login & go to Agent list view.
  2. Create/Update a record.
  3. Click on the submit button & check the network tab to view the payload. It should look like:
  body: {
    "fullName": "",
      ...
      "dynamicContent": {
        "en-US": {
          "description": ""
        }
      }
  }
  1. Attempt to add a translation for any language.
  2. Submit the form & verify that the payload looks like the above with the language-code matching that in the route.
  3. Change the language selection from the navigation dropdown. Submit any of the above-mentioned forms and verify that the language code in the payload is still the app default language (en-US in this case).

Closes #318

@pratimasakinala pratimasakinala added the refactor Code changes underneath the hood; no difference in user experience label Apr 14, 2021
@pratimasakinala pratimasakinala self-assigned this Apr 14, 2021
@pratimasakinala pratimasakinala requested review from a team, TomAlperin, goseinthemachine, AramayisO, Karvel and mwallert and removed request for Karvel, mwallert and a team April 14, 2021 20:29
Copy link

@goseinthemachine goseinthemachine left a comment

Choose a reason for hiding this comment

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

Like how small this PR is.

@pratimasakinala pratimasakinala merged commit f946737 into ps-locale-translation Apr 15, 2021
@pratimasakinala pratimasakinala deleted the ps-318-agent-payload branch April 15, 2021 22:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
refactor Code changes underneath the hood; no difference in user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants