-
Notifications
You must be signed in to change notification settings - Fork 19
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/deseng695: Updated Who is Listening Widget, changed colour of Video Widget overlay logo, fixed media query for Map Widget expand link. #2598
Conversation
…d icon color for video widget, adjusted viewport for expand map link in map widget.
…date to image picker.
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.
Thanks Jareth! Looks good, could you please review all my comments. To proceed, could you:
- Remove the empty labels on form controls (see my comment) or, even better, link MetLabels to form controls
- See my comment about the widget listening context, just curious about this approach for this
sa.ForeignKeyConstraint(['widget_id'], ['widget.id'], ondelete='CASCADE'), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
op.add_column('widget_translation', sa.Column('listening_description', sa.Text(), nullable=True)) |
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.
Thanks for remembering the translation for it!
|
||
@cors_preflight('GET, POST') | ||
@API.route('') | ||
class Listenings(Resource): |
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.
😂 the name
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.
I know, it reminds me of a horror movie. "The Listening".
fake = Faker() | ||
|
||
|
||
def test_create_listening_widget(client, jwt, session, |
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.
Thanks for adding a few tests here! Our coverage has been slowly slipping as we add a bunch of huge new features
data-testid="contact-form/phone" | ||
aria-label="Phone: optional." | ||
variant="outlined" | ||
label=" " |
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.
Thanks for improving the accessibility here. I'd recommend removing this empty label in case it causes confusion.
const [addedContacts, setAddedContacts] = useState<Contact[]>([]); | ||
const [loadingContacts, setLoadingContacts] = useState(true); | ||
|
||
if (!widget) { |
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.
Just curious about this part - why did we need to check if there was no widget and then return a different context provider?
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.
The widget is passed down as a prop, and if it's missing, it just displays a blank widget. That's the way it was designed before. We could change it if needed. I have moved the useEffect to the top of the component to avoid the errors.
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.
Just to confirm what we discussed over Teams, it's a useContext, not a prop, that it's passed down from. I know that I didn't create this code, but I couldn't find it on main, so I removed it, made some additional conditions, and tested again. I'm having no errors or issues now, so this code has been removed.
setListeningWidget({ ...listeningWidget, description: e.target.value }); | ||
}} | ||
label=" " | ||
aria-label="Description: optional." |
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.
No need to change things now, but in the future I'd advise that we use the actual label. If you have multiple elements that label a control, you can use aria-labelledby="id1 id2"
where the IDs correspond to each labelling element. From WCAG: "Whenever possible, use the label element to associate text with form elements explicitly."
setIsLoading(false); | ||
} catch (error) { | ||
setIsLoading(false); | ||
console.log(error); |
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.
Even though we may retire this code at some point soon, I'd still recommend you use console.error
and give the log a descriptive label to help us locate it in the code if we're troubleshooting.
console.log(error); | |
console.error('Error loading who is listening widget.', error); |
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.
Yes sorry, that was just for my benefit, it's been removed.
<Grid container justifyContent={{ xs: 'center', md: 'flex-start' }} item xs={12}> | ||
<BodyText>{contact.title}</BodyText> | ||
<Grid justifyContent={{ xs: 'center', md: 'flex-start' }} xs={12}> | ||
<BodyText sx={contactTitleStyles} aria-label="Contact job title:"> |
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.
Hmm, I'm not necessarily against this but just curious on why you added the aria label? Is it clear to sighted users that this is a job title, but not to non-sighted users?
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.
I guess it depends how you think it should be read. To me, it should be like name: John Smith, contact job title: minister of mining, etc. But it could also just read the fields, like John Smith, Minister of Mining.
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.
I changed it to the shorter way.
Quality Gate passedIssues Measures |
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.
Thanks for the changes! Approved
Issue #: https://citz-gdx.atlassian.net/browse/DESENG-695
Issue #: https://citz-gdx.atlassian.net/browse/DESENG-692
Issue #: https://citz-gdx.atlassian.net/browse/DESENG-693
Description of changes:
New Who is Listening widget front end
Video Widget
Map Widget
User Guide update ticket (if applicable):
N/A