-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Hook for page action buttons #6090
Hook for page action buttons #6090
Conversation
Create a new event and interface for injecting buttons into the page header rendered by OemrUI. Convert the current help icon, action icon, and expand icons into listeners to the new event
The buttons actually work now!
@robertdown , just noted some escaping stuff. Otherwise code looks great to me :) (btw, I didn't test it) |
Updated the way javascript interacts with the interface The interface dictates public function getAttributes()
{
return [
"onclick" => "function(){ alert('do something'); }"
];
} which would render the onclick attribute (Though the escaping would be problematic because it gets run through OR, you could leverage Still some downsides here, Ideally, the template being included should only contain 1 function, named whatever your pass in getClickHandlerTemplateName(), however, it could be expanded and is now effectively a hook for any javascript you want. Not sure how to force a better solution though. |
@robertdown Installing this PR errors javascript with And |
Hmmm, the patient finder page was one I tested against. Let me try to replicate |
Looks like a dependency scope issue. showActionClass looks like not making it into the DOM. You may need to change how it's declared. |
@sjpadgett I could not replicate the error. Steps I took
|
Okay. I was treating it as a patch which should work and will still see what it takes to work that way. In the end I'll spin up a docker as you did. |
I think this has to do with the initial hide stats is in for the section and will account for why you're not seeing. |
Not sure where the SQL error is coming from, I'm not doing any DB interaction. I built this off of master and I think Brady is planning an actual release, not a patch in the coming days |
Nope sorry that was me not updating sql. I have a simple fix for the javascript error which I'll add to my existing PR. |
elementIcon.classList.remove(showActionClass); | ||
elementIcon.classList.add(hideActionClass); |
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.
elementIcon is never defined I can see. It is defined within the show_hide click() handler so it would be out of scope elsewhere.
I don't see how this would work in any case because while show_hide click will set as soon as routine is exited then you lose scope. elementIcon needs to be assigned/declared somewhere global.
Could you split it into its own PR. Still can't replicate so I want to test further |
If you're not seeing the error then you are not hitting the routine due to shouldDisplay not being set at around L-544 if (should Display) { ...} |
I can give you a call Sunday at the earliest. I trust whatever your fix is |
Create a new event and interface for injecting buttons into the page header rendered by OemrUI. Convert the current help icon, action icon, and expand icons into listeners to the new event. Move the pageHeading() rendering to Twig.
TBD
1. The Action Icon has some logic I need to still resolve2. Create spot to inject custom Javascript to actually do something with your fancy new button.