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

Feature/deseng657: Implemented language selector in engagement creation wizard #2560

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

jareth-whitney
Copy link
Contributor

  • Feature Admin authoring experience - language selector 🎟️ DESENG-657
    • Created loader for engagement creation wizard
    • Created language selector field in engagement creation wizard

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the met-public license (Apache 2.0).

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.96%. Comparing base (085451b) to head (928d8fb).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2560   +/-   ##
=======================================
  Coverage   75.96%   75.96%           
=======================================
  Files         609      609           
  Lines       21960    21960           
  Branches     1711     1711           
=======================================
  Hits        16682    16682           
  Misses       5015     5015           
  Partials      263      263           
Flag Coverage Δ
metweb 64.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@NatSquared NatSquared left a comment

Choose a reason for hiding this comment

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

Approved! Overall looks good; just a few things to check

<Grid id="language-column3" columns={12} lg={4} xs={12} direction="column">
<Await resolve={languages}>
{(languageResponse) => {
return handleLanguageColumn(languageResponse, 10, 14);
Copy link
Contributor

Choose a reason for hiding this comment

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

You may be able to revise this to remove the 15 column limit :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I did this, and refactored the code so there is no repetition.

@@ -149,7 +178,31 @@ const EngagementCreationWizard = () => {
All engagements must be offered in English, but you may also add content in additional
languages if you select multi-language.
</BodyText>
{_TemporaryConstructionNotice}
<Suspense fallback={<MidScreenLoader />}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using a <Skeleton> component for consistency with the rest of the app! 90vh is quite tall

@@ -49,6 +51,7 @@ const EngagementCreationWizard = () => {
const [open, setOpen] = React.useState(true);
const navigate = useNavigate();
const fetcher = useFetcher();
const { languages } = useRouteLoaderData('wizard-loader') as { languages: Language[] };
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're on the route we're loading from, consider using useLoaderData() instead :)

<>
<span>
<Checkbox
defaultChecked={'English' === language.name && true}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
defaultChecked={'English' === language.name && true}
defaultChecked={Boolean('English' === language.name)}

Are these && true statements doing anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes they work, but I don't mind doing it the other way

Copy link

sonarcloud bot commented Jul 22, 2024

@jareth-whitney jareth-whitney merged commit ce13757 into main Jul 22, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants