Feat/webpack (#2998)

* First commit

* Removed govuk for webpack. Modernized javascript importing. Removed dead js

* Fixed tests, a few styling bugs

* Fixed some table errors and regenerated backstop ref images

* Updated tests for coverage

* Changes from carlo suggestions
This commit is contained in:
Alex Janousek
2025-10-14 13:20:58 -04:00
committed by GitHub
parent 3b3191b337
commit 3a39d910b3
62 changed files with 1657 additions and 4861 deletions

View File

@@ -1,5 +1,5 @@
{% macro mapping_table(caption='', field_headings=[], field_headings_visible=True, caption_visible=True, equal_length=False, border_visible=False) -%}
<table class="usa-table{{' usa-table--borderless' if not border_visible}} width-full">
{% macro mapping_table(caption='', field_headings=[], field_headings_visible=True, caption_visible=True, equal_length=False, border_visible=False, striped=False) -%}
<table class="usa-table{{' usa-table--borderless' if not border_visible}}{{' usa-table--striped' if striped}} width-full">
<caption class="font-body-lg table-heading{{ ' usa-sr-only' if not caption_visible}}">
{{ caption }}
</caption>
@@ -22,10 +22,10 @@
</table>
{%- endmacro %}
{% macro list_table(items, caption='', empty_message='', field_headings=[], field_headings_visible=True, caption_visible=True, equal_length=False, border_visible=False) -%}
{% macro list_table(items, caption='', empty_message='', field_headings=[], field_headings_visible=True, caption_visible=True, equal_length=False, border_visible=False, striped=False) -%}
{% set parent_caller = caller %}
{% call mapping_table(caption, field_headings, field_headings_visible, caption_visible, equal_length, border_visible) %}
{% call mapping_table(caption, field_headings, field_headings_visible, caption_visible, equal_length, border_visible, striped) %}
{% for item in items %}
{% call row(item.id) %}
{{ parent_caller(item, loop.index + 1) }}

View File

@@ -165,7 +165,7 @@ recipients.column_headers %}
<h2 class="font-body-lg" id="file-preview">{{ original_file_name }}</h2>
<div class="fullscreen-content" data-module="fullscreen-table">
<div class="spreadsheet usa-table-container--scrollable" tabindex="0">
{% call(item, row_number) list_table(
recipients.displayed_rows,
caption=original_file_name,

View File

@@ -57,7 +57,7 @@
</div>
</div>
<div class="fullscreen-content" data-module="fullscreen-table">
<div class="spreadsheet usa-table-container--scrollable" tabindex="0">
{% call(item, row_number) mapping_table(
caption="Errors in " + original_file_name,
caption_visible=False,

View File

@@ -75,7 +75,7 @@
<h2 class="font-body-lg">A spreadsheet is available to use</h2>
<div class="spreadsheet" data-module="fullscreen-table">
<div class="spreadsheet usa-table-container--scrollable" tabindex="0">
{% call(item, row_number) list_table(
example,
caption="Example spreadsheet",

View File

@@ -39,16 +39,9 @@
{% call row() %}
{{ text_field('Send text messages') }}
{{ boolean_field('sms' in current_service.permissions) }}
{# {{ edit_field(
'Change',
url_for(
'.service_set_channel',
service_id=current_service.id,
channel='sms'
),
permissions=[ServicePermission.MANAGE_SERVICE],
suffix='your settings for sending text messages',
)}} #}
{% call field(align='right') %}
<span class="table-field-status-default">Set automatically</span>
{% endcall %}
{% endcall %}
{% if current_user.platform_admin %}
@@ -218,6 +211,9 @@
{{ text_field('Live')}}
{% if current_service.trial_mode and not current_service.organization_id %}
{{ text_field('No (organization must be set first)') }}
{% call field(align='right') %}
<span class="table-field-status-default">Set automatically</span>
{% endcall %}
{% else %}
{{ boolean_field(not current_service.trial_mode) }}
{{ edit_field('Change', url_for('.service_switch_live', service_id=current_service.id), suffix='service status') }}