-
Notifications
You must be signed in to change notification settings - Fork 4
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
On ws notifications, update name, details, and state in flow sidebar #1353
Changes from 3 commits
5b1f5b5
b66de1c
b5dc045
af91a01
8df0bf6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,21 @@ const MenuView = View.extend({ | |
}, | ||
}); | ||
|
||
const NameView = View.extend({ | ||
className: 'patient-flow-sidebar__name', | ||
template: hbs`{{ name }}`, | ||
}); | ||
|
||
const DetailsView = View.extend({ | ||
className: 'sidebar__details', | ||
template: hbs` | ||
{{ details }} | ||
{{#unless details}} | ||
<span class="sidebar--no-results">{{ @intl.patients.sidebar.flow.flowSidebarTemplate.noDetails }}</span> | ||
{{/unless}} | ||
`, | ||
}); | ||
|
||
const PermissionView = View.extend({ | ||
className: 'flex u-margin--t-8', | ||
template: hbs` | ||
|
@@ -73,6 +88,8 @@ const PermissionView = View.extend({ | |
const SidebarView = View.extend({ | ||
template: FlowSidebarTemplate, | ||
regions: { | ||
name: '[data-name-region]', | ||
details: '[data-details-region]', | ||
state: '[data-state-region]', | ||
owner: '[data-owner-region]', | ||
permission: '[data-permission-region]', | ||
|
@@ -88,7 +105,9 @@ const SidebarView = View.extend({ | |
}; | ||
}, | ||
modelEvents: { | ||
'change:_state': 'showOwner', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why this was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. canEdit is only affected by the owner. I think this should just be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this was originally If the flow state is set to So I have it set to But in this scenario |
||
'change:name': 'showName', | ||
'change:details': 'showDetails', | ||
'change:_state': 'showFlow', | ||
'change:_owner': 'showFlow', | ||
}, | ||
onRender() { | ||
|
@@ -98,13 +117,23 @@ const SidebarView = View.extend({ | |
showFlow() { | ||
this.canEdit = this.model.canEdit(); | ||
|
||
this.showName(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think name or details need to be in this function.. they can just be in onRender.. this function appears to be needed if something changes that affects There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. really I think this method did more a bit ago and it likely doesn't make any sense now.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved |
||
this.showDetails(); | ||
this.showActions(); | ||
}, | ||
showActions() { | ||
this.showState(); | ||
this.showOwner(); | ||
this.showPermission(); | ||
}, | ||
showName() { | ||
const nameView = new NameView({ model: this.model }); | ||
this.showChildView('name', nameView); | ||
}, | ||
showDetails() { | ||
const detailsView = new DetailsView({ model: this.model }); | ||
this.showChildView('details', detailsView); | ||
}, | ||
paulfalgout marked this conversation as resolved.
Show resolved
Hide resolved
|
||
showState() { | ||
if (!this.canEdit) { | ||
const readOnlyStateView = new ReadOnlyStateView({ model: this.model }); | ||
|
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.
💡 Codebase verification
Accessibility attributes need to be added to the new regions
The verification reveals that the new name and details regions lack proper accessibility attributes, while other regions in the codebase consistently use semantic HTML with proper labeling. To maintain accessibility:
aria-label
or associate the regions with their respective heading labels usingaria-labelledby
Example locations needing attention:
src/js/views/patients/sidebar/flow/flow-sidebar.hbs
: Add accessibility attributes todata-name-region
anddata-details-region
🔗 Analysis chain
LGTM! Verify accessibility attributes.
The shift to region-based rendering is a good architectural choice that enables real-time updates and better separation of concerns. However, ensure that the new views maintain proper accessibility.
Let's verify the accessibility attributes in the corresponding view files:
Let me gather more information about the views to better understand the accessibility implementation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 1545
Script:
Length of output: 17738