-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
[webpack] Web Apps #35594
[webpack] Web Apps #35594
Changes from 6 commits
16195d6
6ce8615
569d4c5
2890bb2
b13f00b
47a2bd5
ff214d8
8088593
3f62ccc
689f1b4
797708d
a917ba5
f933d8b
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 |
---|---|---|
|
@@ -2,12 +2,12 @@ | |
<td class="module-column module-column-icon"> | ||
<% if (imageUrl) { %> | ||
<div class="module-icon-image badge-container" style="background-image: url('<%- imageUrl %>');"> | ||
<%= _.template($('#maybe-custom-badge-template').text())(arguments[0]) %>{# maybe-custom-badge-template output is already escaped #} | ||
<span id="module-badge" class="badge bg-dark rounded-pill"><%- badgeText %></span> | ||
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. Replace duplicate IDs with classes for badge elements. The same ID 'module-badge' is used multiple times, which violates HTML specifications. This issue is consistent across all menu templates (row.html, grid_item.html, and audio.html). Apply this change to both badge elements: - <span id="module-badge" class="badge bg-dark rounded-pill"><%- badgeText %></span>
+ <span class="module-badge badge bg-dark rounded-pill"><%- badgeText %></span> Also applies to: 10-10 |
||
</div> | ||
<% } else { %> | ||
<div class="module-icon-container badge-container"> | ||
<i class="fa fa-pencil module-icon" aria-hidden="true"></i> | ||
<%= _.template($('#maybe-custom-badge-template').text())(arguments[0]) %>{# maybe-custom-badge-template output is already escaped #} | ||
<span id="module-badge" class="badge bg-dark rounded-pill"><%- badgeText %></span> | ||
</div> | ||
<% } %> | ||
</td> | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<div> | ||
<% if (imageUrl) { %> | ||
<div class="gridicon badge-container" style="background-image: url('<%- imageUrl %>');"> | ||
<%= _.template($('#maybe-custom-badge-template').text())(arguments[0]) %>{# maybe-custom-badge-template output is already escaped #} | ||
<span id="module-badge" class="badge bg-dark rounded-pill"><%- badgeText %></span> | ||
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. Replace duplicate IDs with classes for badge elements. The same ID 'module-badge' is used multiple times, which violates HTML specifications. Convert to a class to maintain proper HTML semantics while preserving the shared styling. Apply this change to both badge elements: - <span id="module-badge" class="badge bg-dark rounded-pill"><%- badgeText %></span>
+ <span class="module-badge badge bg-dark rounded-pill"><%- badgeText %></span> Also applies to: 14-14 |
||
</div> | ||
<% } else { %> | ||
<div class="gridicon gridicon-circle badge-container"> | ||
|
@@ -11,7 +11,7 @@ | |
<% } else { %> | ||
<i class="fa fa-folder gridicon-icon" aria-hidden="true"></i> | ||
<% } %> | ||
<%= _.template($('#maybe-custom-badge-template').text())(arguments[0]) %>{# maybe-custom-badge-template output is already escaped #} | ||
<span id="module-badge" class="badge bg-dark rounded-pill"><%- badgeText %></span> | ||
</div> | ||
<% } %> | ||
<div class="module-column-name text-center"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<td class="module-column module-column-icon"> | ||
<% if (imageUrl) { %> | ||
<div class="module-icon-image badge-container" style="background-image: url('<%- imageUrl %>');"> | ||
<%= _.template($('#maybe-custom-badge-template').text())(arguments[0]) %>{# maybe-custom-badge-template output is already escaped #} | ||
<span id="module-badge" class="badge bg-dark rounded-pill"><%- badgeText %></span> | ||
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. Replace duplicate IDs with classes for badge elements. Using the same ID 'module-badge' multiple times in the template violates HTML specifications, as IDs must be unique within a document. Since these badges appear to share the same styling, convert the ID to a class. Apply this change to both badge elements: - <span id="module-badge" class="badge bg-dark rounded-pill"><%- badgeText %></span>
+ <span class="module-badge badge bg-dark rounded-pill"><%- badgeText %></span> Also applies to: 14-14 |
||
</div> | ||
<% } else { %> | ||
<div class="module-icon-container badge-container"> | ||
|
@@ -11,7 +11,7 @@ | |
<% } else { %> | ||
<i class="fa fa-folder module-icon" aria-hidden="true"></i> | ||
<% } %> | ||
<%= _.template($('#maybe-custom-badge-template').text())(arguments[0]) %>{# maybe-custom-badge-template output is already escaped #} | ||
<span id="module-badge" class="badge bg-dark rounded-pill"><%- badgeText %></span> | ||
</div> | ||
<% } %> | ||
</td> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
{% load compress %} | ||
{% load statici18n %} | ||
|
||
{% requirejs_main_b5 "cloudcare/js/preview_app/main" %} | ||
{% js_entry "cloudcare/js/preview_app/main" %} | ||
|
||
<!DOCTYPE html> | ||
<html lang="{{ LANGUAGE_CODE }}"> | ||
|
@@ -51,13 +51,14 @@ | |
<script src="{% statici18n LANGUAGE_CODE %}"></script> {# DO NOT COMPRESS #} | ||
|
||
{% include "hqwebapp/partials/requirejs.html" %} | ||
{% include "hqwebapp/partials/webpack.html" %} | ||
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. Is it fine to be including both of these? Seems like it should be one or the other. 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. It's not harmful, because all the logic in |
||
|
||
<style id="list-cell-layout-style"></style> | ||
<!-- For Formplayer's app preview --> | ||
|
||
{# This is fine as an inline script; it'll be removed once form designer is migrated to RequireJS #} | ||
{# This is fine as an inline script; it'll be removed once all of HQ is using webpack #} | ||
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. 🤣 |
||
<script> | ||
window.USE_REQUIREJS = true; | ||
window.USE_WEBPACK = true; | ||
</script> | ||
</head> | ||
<body> | ||
|
@@ -77,6 +78,7 @@ | |
{# do not override this block, use initial_page_data template tag to populate #} | ||
{% endblock %} | ||
</div> | ||
{% registerurl 'notifications_service' %} | ||
<div class="commcarehq-urls" class="d-none"> | ||
{% block registered_urls %} | ||
{# do not override this block, use registerurl template tag to populate #} | ||
|
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.
Transition from hqDefine to ES6 imports needed
According to the PR objectives, we should be transitioning from
hqRequire
to webpack imports. Please update the module definition to use ES6 imports.Here's how to refactor this: