-
Notifications
You must be signed in to change notification settings - Fork 818
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
Implement new language variants #3458
Conversation
a0612e3
to
981a987
Compare
@@ -437,6 +530,7 @@ const UserClient = { | |||
updateDemographicsPromise, | |||
this.claimContributions(clientId, clientIds), | |||
languages && updateLanguages(clientId, languages), |
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.
Wondering here instead of adding another line for variants we rename updateLanguages
to updateAccents
and then add a function like:
/**
* Updates languages for a given user
*
* @param clientId clientId as string
* @param languages array of UserLanguage
* @returns void
*/
async function updateLanguages(clientId: string, languages: UserLanguage[]) {
return Promise.all([
updateAccents(clientId, languages),
updateVariants(clientId, languages),
]);
}
@@ -0,0 +1,71 @@ | |||
const VARIANTS = [ |
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.
Need to remove this test data
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.
Yeah, need to remove test data, but ill keep it for now, as itll be the basis of the import script once variants are decided
Pushed up an update for the label copy: 60acd5c |
@ftyers Good idea, I'll post it on the JIRA ticket so EM can give some input there too |
Going to merge this in dev to get some more eyes for QA |
* Add migration for new variant table * Remove repeated data * Add initial variants query * Add GET route for variant * Format code * Add working variants query * Add types for variants * Add init user variant update logic * Refactor diff function and add unit tests * Update variant method to handle erroneous variant ids * Init user endpoint for variants * Update tslint * Simplify getdiff code * Simplify getdiff code * Clean up erroneous variables * Use newer type * Update variant type * Updat variant migrations * Refactor update endpoint for one variant per language * Remove early return * chore(languages): fix up current components * feat(variant): UI for new language variants * fix(api): placeholder api response for variants * chore(linting): please tslint * fix(accessibility): replace broken expandable info component * feat(variants): add help text when variant option present * Update user client queries * Remove extra accent check * Fix join when variants table empty * change comment * Update variant join to ensure it matches locale * Use variant api * Clean up log * feat(variant): update label for UI * Remove test data * Add variant data * Ensure user_clients variants are deleted if variant is also deleteD * Add variant data and import it Co-authored-by: g <g@pop-os.localdomain> Co-authored-by: Zac Colley <zac@mozillafoundation.org>
* Add migration for new variant table * Remove repeated data * Add initial variants query * Add GET route for variant * Format code * Add working variants query * Add types for variants * Add init user variant update logic * Refactor diff function and add unit tests * Update variant method to handle erroneous variant ids * Init user endpoint for variants * Update tslint * Simplify getdiff code * Simplify getdiff code * Clean up erroneous variables * Use newer type * Update variant type * Updat variant migrations * Refactor update endpoint for one variant per language * Remove early return * chore(languages): fix up current components * feat(variant): UI for new language variants * fix(api): placeholder api response for variants * chore(linting): please tslint * fix(accessibility): replace broken expandable info component * feat(variants): add help text when variant option present * Update user client queries * Remove extra accent check * Fix join when variants table empty * change comment * Update variant join to ensure it matches locale * Use variant api * Clean up log * feat(variant): update label for UI * Remove test data * Add variant data * Ensure user_clients variants are deleted if variant is also deleteD * Add variant data and import it Co-authored-by: g <g@pop-os.localdomain> Co-authored-by: Zac Colley <zac@mozillafoundation.org>
Frontend
JIRA ticket: https://mozilla-hub.atlassian.net/browse/OI-2044
ExpandableInformation
component to replace broken component (profile-toggle
)Backend
...
Database
Add two tables for variants
variants
holds the literally variant types and associated labelinguser_client_variants
holds the relation between a user and the variant