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

[To Main] Implement UX designs for engagement wizard #2573

Merged

Conversation

NatSquared
Copy link
Contributor

Issue #: https://citz-gdx.atlassian.net/browse/DESENG-663

Description of changes:

  • Feature Implement UX designs for engagement creation wizard
    • Implemented the new design for the engagement creation wizard
    • Added a new "Step" component to handle the wizard's steps
    • Added a new "SystemMessage" component to display system messages
    • Made engagement configuration form reusable for an edit engagement flow
    • Added a new "EngagementWizard" component to handle the entire wizard

User Guide update ticket (if applicable):
N/A

@NatSquared NatSquared requested review from Baelx and jareth-whitney and removed request for Baelx August 9, 2024 00:21
@NatSquared NatSquared requested a review from Baelx August 9, 2024 00:38
@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.04%. Comparing base (9ace9ec) to head (71839a6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2573   +/-   ##
=======================================
  Coverage   76.03%   76.04%           
=======================================
  Files         609      609           
  Lines       22076    22080    +4     
  Branches     1783     1785    +2     
=======================================
+ Hits        16786    16790    +4     
  Misses       5026     5026           
  Partials      264      264           
Flag Coverage Δ
metweb 65.02% <100.00%> (+0.01%) ⬆️

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

Files Coverage Δ
met-web/src/components/common/Input/FormField.tsx 100.00% <100.00%> (ø)
met-web/src/components/common/Input/TextInput.tsx 100.00% <100.00%> (ø)
met-web/src/components/common/Layout/index.tsx 90.00% <100.00%> (+1.11%) ⬆️
...et-web/src/components/engagement/listing/index.tsx 76.12% <100.00%> (ø)
...eb/src/components/layout/Header/InternalHeader.tsx 87.37% <100.00%> (+0.24%) ⬆️
met-web/src/components/layout/SideNav/SideNav.tsx 94.33% <100.00%> (ø)
met-web/src/styles/Theme.ts 100.00% <ø> (ø)

@NatSquared NatSquared added the javascript Pull requests that update Javascript code label Aug 9, 2024
Copy link
Collaborator

@Baelx Baelx left a comment

Choose a reason for hiding this comment

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

Thanks for the thorough work as always Nat :)

Could I request that we review the screen reader and keyboard experience for the new wizard? In particular, sighted users get a lot of directions for each field, do nonsighted users get the same? We should use a label tag wherever possible with form fields.

- Logging functions are left in that aren't required or needed later (with exceptions for error logging, i.e. console.error, etc.)
- Commented-code is left in that isn't needed later
- Unsafe function calls like `eval()`
- Widespread incorrect syntax use (using snake case for many variables in JS when it's not required)
- Significant amount of repeition in code that can be condensed without much issue (code isn't DRY) *
- Unnecessary function calls, overly verbose code *
- Significant amount of repeition in code that can be condensed without much issue (code isn't DRY) \*
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh thanks for this!

import { colors } from 'styles/Theme';
import { BodyText, Header2 } from '../Typography';

export const circleNumberIcons = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does const this need to be exported?

@@ -44,109 +47,126 @@ const EngagementVisibilityControl = () => {
});
return () => subscription.unsubscribe();
}, [watch, hasBeenEdited]);

useEffect(() => {
// When the user selects a visibility option and the name has not been edited, set isEditing to true immediately
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's nice that you built in isEditing from the get-go - given we'll likely re-use this form for editing purposes.

Just for my own understanding, why does visibility selection + untouched engagement name = isEditing

</Grid>
<Grid item container xs justifyContent="flex-start" alignItems="flex-start" pb="16px">
<Grid item xs={12}>
<Header2 sx={{ mt: 0, fontSize: '20px', fontWeight: '300' }}>{question}</Header2>
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's nice that you've built this handy modular component for the "step" style fields! Can we modify this slightly so that nonsighted users get all the same nice instructions as sighted users? There are multiple ways this could be done but we should definitely use a label tag somewhere and make sure it's tied to the right form field.

This WCAG resource states we should ideally have a label tag and possibly an aria-label to concatenate lengthy instructions. https://www.w3.org/WAI/WCAG21/Understanding/labels-or-instructions.html

setIsConfirmed(false);
field.onChange({ target: { value: e.target.value === 'true' } });
}}
aria-label="is_internal"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Following up on my previous comment about form labels and sighted vs. nonsighted users, a screen reader is only going to read "is_internal" whereas a sighted user will get the two sentences of instruction on how to fill out this field.

<Box width="100%">
<RadioGroup
onChange={(e) => setIsSingleLanguage(e.target.value === 'true')}
aria-label="Select Engagement's Language Type"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for continuing to add aria-labels !

buttonLabel="Add Language"
loading={false}
selectedOptions={selectedLanguages}
selectLabel="Add Languages"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the labelling!

getOptionRequired,
value,
isOptionEqualToValue = (option, value) => option === value,
selectLabel = 'Add Options',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we maybe remove the default value for these label parameters? If we make them required, it'll force developers to add meaningful labels whenever using this component.

<SystemMessage status="info">
You will be able to modify the configuration of your engagement later in the case the parameters of
your engagement change. If you prefer, you can use{' '}
<Link size="small" to="../form">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Always nice that you provide our users with convenience features like this :) links to old versions they may be used to, helpful under constructions messages, etc.

<Controller
control={control}
name="name"
rules={{ required: 'Engagement title is required' }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do screen readers read this out if it appears?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It gets wrapped in the <label> element so it should be!

@NatSquared NatSquared requested a review from Baelx August 13, 2024 22:10
Copy link

sonarcloud bot commented Aug 13, 2024

@NatSquared NatSquared merged commit 8d2b133 into main Aug 13, 2024
8 checks passed
@NatSquared NatSquared deleted the feature/DESENG-663-engagement-authoring-wizard-design-compliance branch August 13, 2024 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants