Skip to content
Merged

0.377.0 #1813

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 55 additions & 55 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,45 @@ GEM
aasm-diagram (0.1.3)
aasm (~> 5.0, >= 4.12)
ruby-graphviz (~> 1.2)
actioncable (8.0.1)
actionpack (= 8.0.1)
activesupport (= 8.0.1)
actioncable (8.0.2)
actionpack (= 8.0.2)
activesupport (= 8.0.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (8.0.1)
actionpack (= 8.0.1)
activejob (= 8.0.1)
activerecord (= 8.0.1)
activestorage (= 8.0.1)
activesupport (= 8.0.1)
actionmailbox (8.0.2)
actionpack (= 8.0.2)
activejob (= 8.0.2)
activerecord (= 8.0.2)
activestorage (= 8.0.2)
activesupport (= 8.0.2)
mail (>= 2.8.0)
actionmailer (8.0.1)
actionpack (= 8.0.1)
actionview (= 8.0.1)
activejob (= 8.0.1)
activesupport (= 8.0.1)
actionmailer (8.0.2)
actionpack (= 8.0.2)
actionview (= 8.0.2)
activejob (= 8.0.2)
activesupport (= 8.0.2)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (8.0.1)
actionview (= 8.0.1)
activesupport (= 8.0.1)
actionpack (8.0.2)
actionview (= 8.0.2)
activesupport (= 8.0.2)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (8.0.1)
actionpack (= 8.0.1)
activerecord (= 8.0.1)
activestorage (= 8.0.1)
activesupport (= 8.0.1)
actiontext (8.0.2)
actionpack (= 8.0.2)
activerecord (= 8.0.2)
activestorage (= 8.0.2)
activesupport (= 8.0.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (8.0.1)
activesupport (= 8.0.1)
actionview (8.0.2)
activesupport (= 8.0.2)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
Expand All @@ -66,22 +66,22 @@ GEM
activemodel (>= 4.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (8.0.1)
activesupport (= 8.0.1)
activejob (8.0.2)
activesupport (= 8.0.2)
globalid (>= 0.3.6)
activemodel (8.0.1)
activesupport (= 8.0.1)
activerecord (8.0.1)
activemodel (= 8.0.1)
activesupport (= 8.0.1)
activemodel (8.0.2)
activesupport (= 8.0.2)
activerecord (8.0.2)
activemodel (= 8.0.2)
activesupport (= 8.0.2)
timeout (>= 0.4.0)
activestorage (8.0.1)
actionpack (= 8.0.1)
activejob (= 8.0.1)
activerecord (= 8.0.1)
activesupport (= 8.0.1)
activestorage (8.0.2)
actionpack (= 8.0.2)
activejob (= 8.0.2)
activerecord (= 8.0.2)
activesupport (= 8.0.2)
marcel (~> 1.0)
activesupport (8.0.1)
activesupport (8.0.2)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -103,7 +103,7 @@ GEM
aes_key_wrap (1.1.0)
ast (2.4.2)
aws-eventstream (1.3.2)
aws-partitions (1.1064.0)
aws-partitions (1.1065.0)
aws-record (2.13.2)
aws-sdk-dynamodb (~> 1, >= 1.85.0)
aws-sdk-core (3.220.1)
Expand Down Expand Up @@ -298,7 +298,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.10.1)
json (2.10.2)
json-jwt (1.16.7)
activesupport (>= 4.2)
aes_key_wrap
Expand Down Expand Up @@ -447,20 +447,20 @@ GEM
rack (>= 1.3)
rackup (2.2.1)
rack (>= 3)
rails (8.0.1)
actioncable (= 8.0.1)
actionmailbox (= 8.0.1)
actionmailer (= 8.0.1)
actionpack (= 8.0.1)
actiontext (= 8.0.1)
actionview (= 8.0.1)
activejob (= 8.0.1)
activemodel (= 8.0.1)
activerecord (= 8.0.1)
activestorage (= 8.0.1)
activesupport (= 8.0.1)
rails (8.0.2)
actioncable (= 8.0.2)
actionmailbox (= 8.0.2)
actionmailer (= 8.0.2)
actionpack (= 8.0.2)
actiontext (= 8.0.2)
actionview (= 8.0.2)
activejob (= 8.0.2)
activemodel (= 8.0.2)
activerecord (= 8.0.2)
activestorage (= 8.0.2)
activesupport (= 8.0.2)
bundler (>= 1.15.0)
railties (= 8.0.1)
railties (= 8.0.2)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -477,9 +477,9 @@ GEM
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (8.0.1)
actionpack (= 8.0.1)
activesupport (= 8.0.1)
railties (8.0.2)
actionpack (= 8.0.2)
activesupport (= 8.0.2)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
Expand Down
42 changes: 21 additions & 21 deletions app/assets/javascripts/uswds.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/javascripts/uswds.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/assets/stylesheets/uswds-styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/stylesheets/uswds-styles.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def index
if current_user.admin? && params[:scope] == :all
@users = User.includes(:organization).order('inactive DESC', :organization_id, :email)
elsif current_user.admin? && params[:scope] == :inactive
@users = User.includes(:organization).where('current_sign_in_at < ? OR current_sign_in_at ISNULL', 90.days.ago).order(:organization_id, :email)
@users = User.inactive.includes(:organization).order(:organization_id, :email)
elsif current_user.admin?
@users = User.active.includes(:organization).order('inactive DESC', :organization_id, :email)
@users = User.active.includes(:organization).order(:organization_id, :email)
else
organization = current_user.organization
@users = organization.users.active.includes(:organization).order(:organization_id, :email)
Expand Down
1 change: 1 addition & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def update_api_key_updated_at
validates :email, presence: true, if: :tld_check

scope :active, -> { where(inactive: false) }
scope :inactive, -> { where(inactive: true) }

scope :admins, -> { where(admin: true) }
scope :performance_managers, -> { where(performance_manager: true) }
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/forms/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>

<%- if @forms.present? %>
<table class="usa-table usa-table--sticky-header width-full">
<table class="usa-table usa-table--sticky-header width-full font-sans-2xs">
<thead class="font-sans-3xs z-top">
<tr>
<th>#</th>
Expand Down
76 changes: 52 additions & 24 deletions app/views/components/widget/_widget-uswds.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -946,8 +946,17 @@ const CALENDAR_YEAR_PICKER = `.${CALENDAR_YEAR_PICKER_CLASS}`;
const CALENDAR_MONTH_FOCUSED = `.${CALENDAR_MONTH_FOCUSED_CLASS}`;
const CALENDAR_YEAR_FOCUSED = `.${CALENDAR_YEAR_FOCUSED_CLASS}`;
const VALIDATION_MESSAGE = "Please enter a valid date";
const MONTH_LABELS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
const DAY_OF_WEEK_LABELS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

// An array of Dates that represent each month in the year
const MONTH_DATE_SEED = Array.from({
length: 12
}).map((_, i) => new Date(0, i));

// An array of Dates that represent each day of the week
const DAY_OF_WEEK_DATE_SEED = Array.from({
length: 7
}).map((_, i) => new Date(0, 0, i));
const CALENDAR_LABELS_BY_LANG = new Map();
const ENTER_KEYCODE = 13;
const YEAR_CHUNK = 12;
const DEFAULT_MIN_DATE = "0000-01-01";
Expand Down Expand Up @@ -1478,6 +1487,27 @@ const getDatePickerContext = el => {
if (minDate && maxDate && minDate > maxDate) {
throw new Error("Minimum date cannot be after maximum date");
}
const lang = document.documentElement.lang || "en";

// if the language is not found generate the list
if (!CALENDAR_LABELS_BY_LANG.has(lang)) {
CALENDAR_LABELS_BY_LANG.set(lang, {
monthLabels: MONTH_DATE_SEED.map(date => date.toLocaleString(lang, {
month: "long"
})),
dayOfWeeklabels: DAY_OF_WEEK_DATE_SEED.map(date => date.toLocaleString(lang, {
weekday: "long"
})),
dayOfWeeksAbv: DAY_OF_WEEK_DATE_SEED.map(date => date.toLocaleString(lang, {
weekday: "narrow"
}))
});
}
const {
monthLabels,
dayOfWeeklabels,
dayOfWeeksAbv
} = CALENDAR_LABELS_BY_LANG.get(lang);
return {
calendarDate,
minDate,
Expand All @@ -1492,7 +1522,10 @@ const getDatePickerContext = el => {
calendarEl,
rangeDate,
defaultDate,
statusEl
statusEl,
monthLabels,
dayOfWeeklabels,
dayOfWeeksAbv
};
};

Expand Down Expand Up @@ -1708,7 +1741,10 @@ const renderCalendar = (el, _dateToDisplay) => {
selectedDate,
maxDate,
minDate,
rangeDate
rangeDate,
monthLabels,
dayOfWeeklabels,
dayOfWeeksAbv
} = getDatePickerContext(el);
const todaysDate = today();
let dateToDisplay = _dateToDisplay || todaysDate;
Expand All @@ -1728,7 +1764,7 @@ const renderCalendar = (el, _dateToDisplay) => {
withinRangeStartDate,
withinRangeEndDate
} = setRangeDates(selectedDate || dateToDisplay, rangeDate);
const monthLabel = MONTH_LABELS[focusedMonth];
const monthLabel = monthLabels[focusedMonth];
const generateDateHtml = dateToRender => {
const classes = [CALENDAR_DATE_CLASS];
const day = dateToRender.getDate();
Expand Down Expand Up @@ -1772,8 +1808,8 @@ const renderCalendar = (el, _dateToDisplay) => {
tabindex = "0";
classes.push(CALENDAR_DATE_FOCUSED_CLASS);
}
const monthStr = MONTH_LABELS[month];
const dayStr = DAY_OF_WEEK_LABELS[dayOfWeek];
const monthStr = monthLabels[month];
const dayStr = dayOfWeeklabels[dayOfWeek];
const btn = document.createElement("button");
btn.setAttribute("type", "button");
btn.setAttribute("tabindex", tabindex);
Expand Down Expand Up @@ -1857,21 +1893,12 @@ const renderCalendar = (el, _dateToDisplay) => {
table.insertAdjacentElement("beforeend", tableHead);
const tableHeadRow = document.createElement("tr");
tableHead.insertAdjacentElement("beforeend", tableHeadRow);
const daysOfWeek = {
Sunday: "S",
Monday: "M",
Tuesday: "T",
Wednesday: "W",
Thursday: "Th",
Friday: "Fr",
Saturday: "S"
};
Object.keys(daysOfWeek).forEach(key => {
dayOfWeeklabels.forEach((dayOfWeek, i) => {
const th = document.createElement("th");
th.setAttribute("class", CALENDAR_DAY_OF_WEEK_CLASS);
th.setAttribute("scope", "col");
th.setAttribute("aria-label", key);
th.textContent = daysOfWeek[key];
th.setAttribute("aria-label", dayOfWeek);
th.textContent = dayOfWeeksAbv[i];
tableHeadRow.insertAdjacentElement("beforeend", th);
});
const tableBody = createTableBody(datesGrid);
Expand Down Expand Up @@ -2077,11 +2104,12 @@ const displayMonthSelection = (el, monthToDisplay) => {
statusEl,
calendarDate,
minDate,
maxDate
maxDate,
monthLabels
} = getDatePickerContext(el);
const selectedMonth = calendarDate.getMonth();
const focusedMonth = monthToDisplay == null ? selectedMonth : monthToDisplay;
const months = MONTH_LABELS.map((month, index) => {
const months = monthLabels.map((month, index) => {
const monthToCheck = setMonth(calendarDate, index);
const isDisabled = isDatesMonthOutsideMinOrMax(monthToCheck, minDate, maxDate);
let tabindex = "-1";
Expand Down Expand Up @@ -3049,7 +3077,7 @@ function toggleModal(event) {
});
} else if (!safeActive && menuButton && returnFocus) {
// The modal window is closed.
// Non-modals now accesible to screen reader
// Non-modals now accessible to screen reader
document.querySelectorAll(NON_MODALS_HIDDEN).forEach(nonModal => {
nonModal.removeAttribute("aria-hidden");
nonModal.removeAttribute(NON_MODAL_HIDDEN_ATTRIBUTE);
Expand Down Expand Up @@ -3253,7 +3281,7 @@ module.exports = {
// browser supported touch events; if it did, `CLICK` was set to
// `touchstart`. However, this had downsides:
//
// * It pre-empted mobile browsers' default behavior of detecting
// * It pre-emptied mobile browsers' default behavior of detecting
// whether a touch turned into a scroll, thereby preventing
// users from using some of our components as scroll surfaces.
//
Expand Down Expand Up @@ -3365,7 +3393,7 @@ module.exports = (context, additionalKeyBindings = {}) => {
keydown: keyMappings
}, {
init() {
// TODO: is this desireable behavior? Should the trap always do this by default or should
// TODO: is this desirable behavior? Should the trap always do this by default or should
// the component getting decorated handle this?
if (tabEventHandler.firstTabStop) {
tabEventHandler.firstTabStop.focus();
Expand Down
Loading