Skip to content

Commit 8adc331

Browse files
authored
Merge pull request #2923 from GSA/main
09/19/2025 Production Deploy
2 parents 695af82 + f30c8dc commit 8adc331

File tree

74 files changed

+1946
-9335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1946
-9335
lines changed

.ds.baseline

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,23 +527,23 @@
527527
"filename": "tests/app/main/views/test_register.py",
528528
"hashed_secret": "bdbb156d25d02fd7792865824201dda1c60f4473",
529529
"is_verified": false,
530-
"line_number": 115,
530+
"line_number": 111,
531531
"is_secret": false
532532
},
533533
{
534534
"type": "Secret Keyword",
535535
"filename": "tests/app/main/views/test_register.py",
536536
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
537537
"is_verified": false,
538-
"line_number": 185,
538+
"line_number": 172,
539539
"is_secret": false
540540
},
541541
{
542542
"type": "Secret Keyword",
543543
"filename": "tests/app/main/views/test_register.py",
544544
"hashed_secret": "bb5b7caa27d005d38039e3797c3ddb9bcd22c3c8",
545545
"is_verified": false,
546-
"line_number": 256,
546+
"line_number": 243,
547547
"is_secret": false
548548
}
549549
],
@@ -634,5 +634,5 @@
634634
}
635635
]
636636
},
637-
"generated_at": "2025-08-21T16:06:57Z"
637+
"generated_at": "2025-09-17T19:16:00Z"
638638
}

.github/actions/setup-project/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ runs:
99
sudo apt-get update \
1010
&& sudo apt-get install -y --no-install-recommends \
1111
libcurl4-openssl-dev
12-
- name: Set up Python 3.12.9
12+
- name: Set up Python 3.13.2
1313
uses: actions/setup-python@v4
1414
with:
15-
python-version: "3.12.9"
15+
python-version: "3.13.2"
1616
- name: Install poetry
1717
shell: bash
1818
run: pip install poetry==2.1.3

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,12 @@ session to make the changes take effect.
189189
Now we're ready to install the Python version we need with `pyenv`, like so:
190190

191191
```sh
192-
pyenv install 3.12
192+
pyenv install 3.13
193193
```
194194

195-
This will install the latest version of Python 3.12.
195+
This will install the latest version of Python 3.13.
196196

197-
_NOTE: This project currently runs on Python 3.12.x._
197+
_NOTE: This project currently runs on Python 3.13.x._
198198

199199
#### [API Step] Python Dependency Installation
200200

@@ -246,12 +246,12 @@ git clone git@github.com:GSA/notifications-admin.git
246246

247247
Now go into the project directory (`notifications-admin` by default), create a
248248
virtual environment, and set the local Python version to point to the virtual
249-
environment (assumes version Python `3.12.9` is what is installed on your
249+
environment (assumes version Python `3.13.2` is what is installed on your
250250
machine):
251251

252252
```sh
253253
cd notifications-admin
254-
pyenv virtualenv 3.12.9 notify-admin
254+
pyenv virtualenv 3.13.2 notify-admin
255255
pyenv local notify-admin
256256
```
257257

@@ -284,10 +284,10 @@ If you're upgrading an existing project to a newer version of Python, you can
284284
follow these steps to get yourself up-to-date.
285285

286286
First, use `pyenv` to install the newer version of Python you'd like to use;
287-
we'll use `3.12` in our example here since we recently upgraded to this version:
287+
we'll use `3.13` in our example here since we recently upgraded to this version:
288288

289289
```sh
290-
pyenv install 3.12
290+
pyenv install 3.13
291291
```
292292

293293
Next, delete the virtual environment you previously had set up. If you followed
@@ -302,7 +302,7 @@ environment with the newer version of Python you just installed:
302302

303303
```sh
304304
cd notifications-admin
305-
pyenv virtualenv 3.12.9 notify-admin
305+
pyenv virtualenv 3.13.2 notify-admin
306306
pyenv local notify-admin
307307
```
308308

app/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def add_security_headers(response):
191191
@application.context_processor
192192
def inject_feature_flags():
193193
# this is where feature flags can be easily added as a dictionary within context
194-
feature_socket_enabled = application.config.get("FEATURE_SOCKET_ENABLED", False)
194+
feature_socket_enabled = application.config.get("FEATURE_SOCKET_ENABLED", True)
195195
return dict(
196196
FEATURE_SOCKET_ENABLED=feature_socket_enabled,
197197
)

app/assets/javascripts/activityChart.js

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
const tableContainer = document.getElementById('activityContainer');
66
const currentUserName = tableContainer.getAttribute('data-currentUserName');
77
const currentServiceId = tableContainer.getAttribute('data-currentServiceId');
8+
let pollInterval;
9+
let isPolling = false;
10+
const POLL_INTERVAL_MS = 25000;
811
const COLORS = {
912
delivered: '#0076d6',
1013
failed: '#fa9441',
@@ -153,8 +156,6 @@
153156
.on('mouseout', function() {
154157
tooltip.style('display', 'none');
155158
})
156-
.transition()
157-
.duration(1000)
158159
.attr('y', d => y(d[1]))
159160
.attr('height', d => {
160161
const calculatedHeight = y(d[0]) - y(d[1]);
@@ -209,28 +210,35 @@
209210
table.append(tbody);
210211
};
211212

212-
const fetchData = function(type) {
213+
const fetchData = async function(type) {
214+
if (isPolling) {
215+
return;
216+
}
217+
218+
if (document.hidden) {
219+
return;
220+
}
213221

214222
var ctx = document.getElementById('weeklyChart');
215223
if (!ctx) {
216224
return;
217225
}
218226

227+
isPolling = true;
228+
219229
var userTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
220230

221231
var url = type === 'service'
222232
? `/services/${currentServiceId}/daily-stats.json?timezone=${encodeURIComponent(userTimezone)}`
223233
: `/services/${currentServiceId}/daily-stats-by-user.json?timezone=${encodeURIComponent(userTimezone)}`;
224234

235+
try {
236+
const response = await fetch(url);
237+
if (!response.ok) {
238+
throw new Error('Network response was not ok');
239+
}
225240

226-
return fetch(url)
227-
.then(response => {
228-
if (!response.ok) {
229-
throw new Error('Network response was not ok');
230-
}
231-
return response.json();
232-
})
233-
.then(data => {
241+
const data = await response.json();
234242
labels = [];
235243
deliveredData = [];
236244
failedData = [];
@@ -277,10 +285,41 @@
277285
}
278286

279287
return data;
280-
})
281-
.catch(error => console.error('Error fetching daily stats:', error));
282-
};
283-
setInterval(() => fetchData(currentType), 25000);
288+
} catch (error) {
289+
console.error('Error fetching daily stats:', error);
290+
} finally {
291+
isPolling = false;
292+
}
293+
};
294+
295+
function startPolling() {
296+
fetchData(currentType);
297+
298+
pollInterval = setInterval(() => {
299+
fetchData(currentType);
300+
}, POLL_INTERVAL_MS);
301+
}
302+
303+
function stopPolling() {
304+
if (pollInterval) {
305+
clearInterval(pollInterval);
306+
pollInterval = null;
307+
}
308+
}
309+
310+
document.addEventListener('visibilitychange', () => {
311+
if (document.hidden) {
312+
stopPolling();
313+
} else {
314+
stopPolling();
315+
startPolling();
316+
}
317+
});
318+
319+
if (typeof jest === 'undefined') {
320+
startPolling();
321+
}
322+
284323
const handleDropdownChange = function(event) {
285324
const selectedValue = event.target.value;
286325
currentType = selectedValue;

app/assets/javascripts/collapsibleCheckboxes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@
118118
CollapsibleCheckboxes.prototype.addHeadingHideLegend = function() {
119119
const headingLevel = this.$component.data('heading-level') || '2';
120120

121-
this.$heading = $(`<h${headingLevel} class="heading-small">${this.legendText}</h${headingLevel}>`);
121+
this.$heading = $(`<h${headingLevel} class="heading-small"></h${headingLevel}>`);
122+
this.$heading.text(this.legendText);
122123
this.$fieldset.before(this.$heading);
123124

124125
this.$fieldset.find('legend').addClass('usa-sr-only');

app/assets/javascripts/modules/all.mjs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import Button from 'govuk-frontend/components/button/button';
1414
import Radios from 'govuk-frontend/components/radios/radios';
1515

1616
// Modules from 3rd party vendors
17-
import morphdom from 'morphdom';
1817

1918
/**
2019
* TODO: Ideally this would be a NodeList.prototype.forEach polyfill
@@ -67,13 +66,8 @@ var Frontend = {
6766
"initAll": initAll
6867
}
6968

70-
var vendor = {
71-
"morphdom": morphdom
72-
}
73-
7469
// The exported object will be assigned to window.GOVUK in our production code
7570
// (bundled into an IIFE by RollupJS)
7671
export {
77-
Frontend,
78-
vendor
72+
Frontend
7973
}

app/assets/javascripts/radioSlider.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
if (valuesInLabel.length === 2) {
1515
leftValue = valuesInLabel[0];
1616
rightValue = valuesInLabel[1];
17-
$(this).find('.radio-slider-left-value').html(leftValue);
18-
$(this).find('.radio-slider-right-value').html(rightValue);
17+
$(this).find('.radio-slider-left-value').text(leftValue);
18+
$(this).find('.radio-slider-right-value').text(rightValue);
1919
}
2020

2121
})

0 commit comments

Comments
 (0)