-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
[B5] Web Apps #34682
[B5] Web Apps #34682
Conversation
@@ -0,0 +1,7 @@ | |||
--- | |||
+++ |
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.
why are these not unsplit?
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.
They're still used here:
commcare-hq/corehq/apps/integration/templates/integration/base_cloudcare_template.html
Lines 23 to 34 in 75d6299
<link type="text/less" | |
rel="stylesheet" | |
media="all" | |
href="{% static 'cloudcare/less/font-formplayer.less' %}" /> | |
<link type="text/less" | |
rel="stylesheet" | |
media="all" | |
href="{% static 'cloudcare/less/formplayer-common.less' %}"/> | |
<link type="text/less" | |
rel="stylesheet" | |
media="all" | |
href="{% static 'cloudcare/less/formplayer-webapp.less' %}"/> |
c8af755
to
ffee7a4
Compare
This is basically the result of running the bootstrap migration tool.
Followup for ee098af
- dateTimePickerTooltips are already handled by by defaultTranslations in the HQ tempus dominus module - Several callbacks/handlers were no longer needed - It's annoying that showing the clear button is handled through initial page data, but updating that is out of scope
This finishes up a43a527
The migration tool doesn't check js files for CSS class names, and some of these aren't greppable anyway.
This completes changes that were started in 845d9ff
Just following bootstrap convention here
41345f6
to
12daf60
Compare
In Bootstrap 3 we were able to have and intermediate tag as parent of the apps. This is not allowed anymore in Bootstrap 5. The order classes previously used only change the visual order, not the tab order. Adding a hidden reference div and inserting the apps before it results in the right order that also keeps the tab order in place.
12daf60
to
517d1cd
Compare
attachHtml: function attachHtml(els, $container) { | ||
let childElement = $container.find("#put-apps-here"); | ||
$container[0].insertBefore(els, childElement[0]); | ||
}, |
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 don't love this solution but I looked at it for a while and couldn't come up with anything better.
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.
same here
The relative position is needed to place the hover circle around the delete/audio icon correctly. But it interfers with the focus outline of the row. * Remove it from the row related class * Add bootstrap class to add the property to the direct parent of the icon * Add separate column for icons to improve the code structure.
* Button bar should be there independent of screen size * break point for SSCS is lg not md
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 reviewed the changes since last review of "new changes look good". Couple clarifying questions, looks good on the whole.
@@ -4,7 +4,7 @@ | |||
<i class="fa fa-user module-icon" aria-hidden="true"></i> | |||
</div> | |||
</td> | |||
<td class="module-column"> | |||
<td class="module-column module-column-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.
The module-column-name
class gets added here but it looks like the css class was removed, is that right? Or does it serve some other purpose as well?
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 had removed it to get rid of the relative positioning that caused issues. With this commit I am adding it back in because it missing caused some other issue in app preview. Instead I removed the property from the css class and added it to the direct parent of the icon tags that needed the relative position.
@@ -380,7 +380,7 @@ hqDefine('cloudcare/js/utils', [ | |||
let picker = hqTempusDominus.createDatePicker($el.get(0), options); | |||
|
|||
$el.attr("placeholder", dateFormat); | |||
$el.attr("pattern", "[0-9\-/]+"); // eslint-disable-line no-useless-escape | |||
// $el.attr("pattern", "[0-9\-/]+"); // eslint-disable-line no-useless-escape |
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.
What was this used for, and why comment out rather than delete?
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 think it is used for validation but it caused and error with each validation because it is malformed regex. I was not sure what the correct regex should be. So I commented it out for now.
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.
@esoergel do you have any context on what this is meant to be? I know you did work with the datepicker a while back and it looks like one of your commits moved this pattern here initially.
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.
@nospame changed it to $el.attr("pattern", "\\d{1,2}/\\d{1,2}/\\d{4}");
since the format is hard coded to 'M/D/YYYY'.
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 think this is meant to be "integers, dashes, or slashes" - IIRC, users were sometimes typing out "July 1st" or whatever, and this would mark that as an error. The existing datepicker actually accepts string input in a variety of formats, defined here. I believe it starts from left to right and uses the first format that matches:
var dateFormats = ['MM/DD/YYYY', 'YYYY-MM-DD', 'M/D/YYYY', 'M/D/YY', 'M-D-YYYY', 'M-D-YY', moment.defaultFormat]; |
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.
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.
that makes more sense. In the HTML it should end up looking like this pattern="[0-9\-\/]+"
because we the dash and forward slash are inside the [] we need to escape them. But since we are in JS land we need two \ each to get there. so $el.attr("pattern", "[0-9\\-\\/]+");
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.
Think it'll be good to find an answer to #34682 (comment) but not considering it blocking. Approving the changes made here by @MartinRiese in the time @orangejenny has been offline.
@@ -18,12 +18,19 @@ body { | |||
font-size: 1.5rem; | |||
text-transform: uppercase; | |||
color: $cc-neutral-mid; | |||
padding-left: 1.5rem; | |||
padding-left: 12px; |
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.
Is there a relative padding that could be used here instead (e.g. 1rem
)?
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.
There's also $spacer
, though I'm not certain when you'd use that over rem
(I believe $spacer: 2rem
)
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 used px because because .module-column-icon
does too and I did not want to mix two units.
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 don't think this needs to block, but another option would be to use a common reference variable, if the two items need to line up. Can you explain the connection between .page-header > h1
and .module-column-icon
? I see one is set to 12px and the other to 20px, is there an 8px element in the mix somewhere too?
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.
Approving commits since Evan's last approval
Product Description
Turn on bootstrap 5 for web apps. Side by side comparisons are here, but the high level summary is: not much changed. Colors are a little brighter, borders are a little lighter, buttons are a little bigger.
Technical Summary
Review by commit. Most commits are small, except the cleanup commits, which are mechanical. Most of this work has been merged already, what remains in this PR is three major changes:
window.USE_BOOTSTRAP5
check.Safety Assurance
Safety story
High risk, as this is a high visibility area, there are a lot of changes (including changes made in previous PRs that will go live when this is merged), and our test coverage at the UI level is limited. We'll be going through the same QA/safety approach as for the web apps requirejs migration.
Automated test coverage
Not a whole lot.
QA Plan
https://dimagi.atlassian.net/browse/QA-6550
Rollback instructions
This can be rolled back if needed. Due to its size, it may get difficult to automatically roll back relatively soon, although it looks like there hasn't been that much activity in the web apps front end in the past few weeks.
Sentry can be monitored for javascript errors using this filter.
Labels & Review