Skip to content
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

Prod Deploy #2285

Open
wants to merge 86 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
17f758b
added id and also refactor error message on templates page
heyitsmebev Dec 13, 2024
b731cd6
adding error annoucement
heyitsmebev Dec 13, 2024
12636d6
adding error annoucement
heyitsmebev Dec 13, 2024
56381f5
adding id
heyitsmebev Dec 17, 2024
ca5e5ce
Merge branch 'main' into 2125-send-message-a11y-audit-unique-ids
heyitsmebev Dec 17, 2024
1df019e
adding required html field
heyitsmebev Dec 18, 2024
1e261fd
fixed testing
heyitsmebev Dec 18, 2024
a3db0a9
first round
heyitsmebev Jan 7, 2025
9d09f75
draft dash
heyitsmebev Jan 10, 2025
30293d9
draft dash
heyitsmebev Jan 10, 2025
6d008d4
clean up
heyitsmebev Jan 13, 2025
ce87e21
clean up
heyitsmebev Jan 14, 2025
2159a9d
clean up
heyitsmebev Jan 14, 2025
5c0eb91
poetry
heyitsmebev Jan 14, 2025
82179c0
Merge branch 'main' into 2199-add-pending-message-data-to-daily-and-u…
heyitsmebev Jan 14, 2025
5e61fb8
jest test
heyitsmebev Jan 14, 2025
cd90682
fixed drop down
heyitsmebev Jan 14, 2025
607e112
updated fetching interval
heyitsmebev Jan 15, 2025
8754c03
updating job status states
heyitsmebev Jan 15, 2025
ae083f4
update banner with different status states
heyitsmebev Jan 16, 2025
3e8015e
get rid of some noise in status updates
Jan 16, 2025
6f7202e
fix test
Jan 16, 2025
1c77f8d
fix test
Jan 16, 2025
c6ed4a8
changed pending state
heyitsmebev Jan 16, 2025
7c51799
update verbage
heyitsmebev Jan 16, 2025
dfe421b
refactor code
heyitsmebev Jan 17, 2025
79e8f02
refactor code partial
heyitsmebev Jan 17, 2025
839bd0b
remove service
heyitsmebev Jan 17, 2025
7422b61
Reformat
heyitsmebev Jan 17, 2025
9942ecf
ajax applied to status
heyitsmebev Jan 18, 2025
3f1058f
jest testing
heyitsmebev Jan 18, 2025
028a154
Merge pull request #2268 from GSA/notify-admin-2245
terrazoon Jan 20, 2025
f13595f
merge main
heyitsmebev Jan 20, 2025
b6b1107
flake8 and fixing conditionals
heyitsmebev Jan 20, 2025
82230f9
fixed testing
heyitsmebev Jan 20, 2025
261c231
Bump rollup from 4.30.1 to 4.31.0
dependabot[bot] Jan 20, 2025
7be1872
clean up templates
heyitsmebev Jan 20, 2025
f91af94
removed comments
heyitsmebev Jan 21, 2025
8248833
Merge pull request #2279 from GSA/dependabot/npm_and_yarn/rollup-4.31.0
alexjanousekGSA Jan 21, 2025
2ab7244
fix test and arrival session
heyitsmebev Jan 21, 2025
ac79edf
Update pull_request_template.md
sheevdave Jan 21, 2025
5cde70a
Removed redundant customize copy
alexjanousekGSA Jan 21, 2025
561b2a3
Reverted change that accidentally pushed to main
alexjanousekGSA Jan 21, 2025
564db4c
Removing redundant text
alexjanousekGSA Jan 21, 2025
16b43fa
Removed whitespace to trigger file change for PR
alexjanousekGSA Jan 21, 2025
4a773a5
Merge pull request #2284 from GSA/bugfix/copy-change
ccostino Jan 21, 2025
24cad0f
fix test
heyitsmebev Jan 21, 2025
6615d4f
Merge pull request #2206 from GSA/2125-send-message-a11y-audit-unique…
heyitsmebev Jan 21, 2025
5cedf04
Merge branch 'main' into 2199-add-pending-message-data-to-daily-and-u…
heyitsmebev Jan 22, 2025
fb1609e
merge main
heyitsmebev Jan 22, 2025
38675e8
jest
heyitsmebev Jan 22, 2025
56af196
Merge pull request #2283 from GSA/sheevdave-patch-1
heyitsmebev Jan 22, 2025
084a5e3
Revert "Send Message A11Y Audit - Unique IDs and also refactor error …
heyitsmebev Jan 22, 2025
17c6cd6
Update no-cost service details
ccostino Jan 22, 2025
86dfdb6
Merge pull request #2287 from GSA/revert-2206-2125-send-message-a11y-…
heyitsmebev Jan 22, 2025
0dfad83
Merge pull request #2288 from GSA/update-join-notify-template
heyitsmebev Jan 22, 2025
cb41d9e
changing guidance to how-do
heyitsmebev Jan 22, 2025
aa03fc1
Sentence case
heyitsmebev Jan 22, 2025
c47033a
Update pull_request_template.md
sheevdave Jan 22, 2025
dafe86a
Merge pull request #2290 from GSA/2234-relabel-guidance-to-how-to
heyitsmebev Jan 22, 2025
954f1cc
Merge pull request #2266 from GSA/2168-when-a-user-schedules-a-job-th…
heyitsmebev Jan 23, 2025
8f30f93
Merge branch 'main' into 2199-add-pending-message-data-to-daily-and-u…
heyitsmebev Jan 23, 2025
cae2ec1
refactor naming
heyitsmebev Jan 23, 2025
4e33556
Update issue_template.yml
sheevdave Jan 23, 2025
933348b
Fix jest
heyitsmebev Jan 23, 2025
fc755c1
test
heyitsmebev Jan 23, 2025
1566198
Bump playwright from 1.49.1 to 1.50.0
dependabot[bot] Jan 23, 2025
c6dfc6c
Merge pull request #2294 from GSA/dependabot/npm_and_yarn/playwright-…
alexjanousekGSA Jan 24, 2025
296a964
Bump @babel/core from 7.26.0 to 7.26.7
dependabot[bot] Jan 24, 2025
53b1e12
Bump rollup from 4.31.0 to 4.32.0
dependabot[bot] Jan 24, 2025
cc92642
Merge pull request #2297 from GSA/dependabot/npm_and_yarn/rollup-4.32.0
alexjanousekGSA Jan 27, 2025
db13416
Merge pull request #2296 from GSA/dependabot/npm_and_yarn/babel/core-…
alexjanousekGSA Jan 27, 2025
03984bc
Bump @babel/preset-env from 7.26.0 to 7.26.7
dependabot[bot] Jan 27, 2025
a5e2fd4
Merge pull request #2271 from GSA/1706-updaterevise-status-banner-on-…
heyitsmebev Jan 27, 2025
22fcc70
Update issue_template.yml
sheevdave Jan 27, 2025
7776f99
added id and required field
heyitsmebev Jan 28, 2025
88b114f
test
heyitsmebev Jan 28, 2025
088da55
Merge pull request #2295 from GSA/dependabot/npm_and_yarn/babel/prese…
alexjanousekGSA Jan 28, 2025
6c3d6ee
Merge pull request #2250 from GSA/2199-add-pending-message-data-to-da…
heyitsmebev Jan 28, 2025
6ea4da2
Adding back classes
heyitsmebev Jan 29, 2025
adf9c61
clean log messages
Jan 29, 2025
3e37915
Merge pull request #2292 from GSA/sheevdave-patch-2
sheevdave Jan 29, 2025
057ed6f
Update .github/ISSUE_TEMPLATE/issue_template.yml
sheevdave Jan 30, 2025
653f3f5
Merge pull request #2293 from GSA/sheevdave-patch-3
ccostino Jan 30, 2025
41001b7
Merge pull request #2309 from GSA/clean_log_messages
terrazoon Jan 30, 2025
704fe32
Merge pull request #2300 from GSA/2125-send-message-a11y-audit---uniq…
heyitsmebev Jan 30, 2025
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
6 changes: 3 additions & 3 deletions .ds.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,15 @@
"filename": "tests/app/main/views/test_register.py",
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
"is_verified": false,
"line_number": 200,
"line_number": 199,
"is_secret": false
},
{
"type": "Secret Keyword",
"filename": "tests/app/main/views/test_register.py",
"hashed_secret": "bb5b7caa27d005d38039e3797c3ddb9bcd22c3c8",
"is_verified": false,
"line_number": 273,
"line_number": 272,
"is_secret": false
}
],
Expand Down Expand Up @@ -684,5 +684,5 @@
}
]
},
"generated_at": "2025-01-13T20:16:58Z"
"generated_at": "2025-01-16T16:38:48Z"
}
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/issue_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ body:
validations:
required: false

- type: markdown
attributes:
value: '**Accessibility:**'
- type: textarea
id: accessibility
attributes:
label: "List any specific accessibility guidance or tests that need to be considered for this user story."
description: "List what type of accessibility tests need to pass."
validations:
required: false

- type: markdown
attributes:
value: '**Notes:**'
Expand Down
7 changes: 7 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ Please enter a detailed description here.
* Consideration 1
* Consideration 2
* Consideration ...

## A11y Checks (if applicable)

* Double check work is getting picked up by the automated E2E tests
* Conduct browser-based tests through [AxeDevTools](https://www.deque.com/axe/devtools/) and [WAVE](https://wave.webaim.org/)
* Review the [Manual Checklist](https://docs.google.com/document/d/192bBXStebdXWtYhZQ73qaWMJhGcuSB1W6c9YBXhWZvc/edit?usp=sharing)
* Make sure there are no linting errors in VSCode or other IDE of choice
124 changes: 85 additions & 39 deletions app/assets/javascripts/activityChart.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
(function (window) {

if (document.getElementById('activityChartContainer')) {

let currentType = 'service';
const tableContainer = document.getElementById('activityContainer');
const currentUserName = tableContainer.getAttribute('data-currentUserName');
const currentServiceId = tableContainer.getAttribute('data-currentServiceId');
const COLORS = {
delivered: '#0076d6',
failed: '#fa9441',
pending: '#C7CACE',
text: '#666'
};

const FONT_SIZE = 16;
const FONT_WEIGHT = 'bold';
const MAX_Y = 120;

const createChart = function(containerId, labels, deliveredData, failedData) {
const createChart = function(containerId, labels, deliveredData, failedData, pendingData) {
const container = d3.select(containerId);
container.selectAll('*').remove(); // Clear any existing content

Expand All @@ -35,7 +39,7 @@
}

// Calculate total messages
const totalMessages = d3.sum(deliveredData) + d3.sum(failedData);
const totalMessages = d3.sum(deliveredData) + d3.sum(failedData) + d3.sum(pendingData);

// Create legend only if there are messages
const legendContainer = d3.select('.chart-legend');
Expand All @@ -45,7 +49,8 @@
// Show legend if there are messages
const legendData = [
{ label: 'Delivered', color: COLORS.delivered },
{ label: 'Failed', color: COLORS.failed }
{ label: 'Failed', color: COLORS.failed },
{ label: 'Pending', color: COLORS.pending }
];

const legendItem = legendContainer.selectAll('.legend-item')
Expand Down Expand Up @@ -76,8 +81,9 @@
.range([0, width])
.padding(0.1);
// Adjust the y-axis domain to add some space above the tallest bar
const maxY = d3.max(deliveredData.map((d, i) => d + (failedData[i] || 0)));
const y = d3.scaleSqrt()
const maxY = d3.max(deliveredData.map((d, i) => d + (failedData[i] || 0) + (pendingData[i] || 0)));

const y = d3.scaleSymlog()
.domain([0, maxY + 2]) // Add 2 units of space at the top
.nice()
.range([height, 0]);
Expand All @@ -89,7 +95,7 @@

// Generate the y-axis with whole numbers
const yAxis = d3.axisLeft(y)
.ticks(Math.min(maxY + 2, 10)) // Generate up to 10 ticks based on the data
.ticks(Math.min(maxY + 2, 3))
.tickFormat(d3.format('d')); // Ensure whole numbers on the y-axis

svg.append('g')
Expand All @@ -100,21 +106,22 @@
const stackData = labels.map((label, i) => ({
label: label,
delivered: deliveredData[i],
failed: failedData[i] || 0 // Ensure there's a value for failed, even if it's 0
failed: failedData[i] || 0,
pending: pendingData[i] || 0
}));

// Stack the data
const stack = d3.stack()
.keys(['delivered', 'failed'])
.keys(['delivered', 'failed', 'pending'])
.order(d3.stackOrderNone)
.offset(d3.stackOffsetNone);

const series = stack(stackData);

// Color scale
const color = d3.scaleOrdinal()
.domain(['delivered', 'failed'])
.range([COLORS.delivered, COLORS.failed]);
.domain(['delivered', 'failed', 'pending'])
.range([COLORS.delivered, COLORS.failed, COLORS.pending]);

// Create bars with animation
const barGroups = svg.selectAll('.bar-group')
Expand Down Expand Up @@ -152,7 +159,7 @@
};

// Function to create an accessible table
const createTable = function(tableId, chartType, labels, deliveredData, failedData) {
const createTable = function(tableId, chartType, labels, deliveredData, failedData, pendingData) {
const table = document.getElementById(tableId);
table.innerHTML = ""; // Clear previous data

Expand All @@ -164,7 +171,7 @@

// Create table header
const headerRow = document.createElement('tr');
const headers = ['Day', 'Delivered', 'Failed'];
const headers = ['Day', 'Delivered', 'Failed', 'Pending'];
headers.forEach(headerText => {
const th = document.createElement('th');
th.textContent = headerText;
Expand All @@ -187,6 +194,10 @@
cellFailed.textContent = failedData[index];
row.appendChild(cellFailed);

const cellPending = document.createElement('td');
cellPending.textContent = pendingData[index];
row.appendChild(cellPending);

tbody.appendChild(row);
});

Expand All @@ -196,12 +207,13 @@
};

const fetchData = function(type) {

var ctx = document.getElementById('weeklyChart');
if (!ctx) {
return;
}

var url = type === 'service' ? `/daily_stats.json` : `/daily_stats_by_user.json`;
var url = type === 'service' ? `/services/${currentServiceId}/daily-stats.json` : `/services/${currentServiceId}/daily-stats-by-user.json`;
return fetch(url)
.then(response => {
if (!response.ok) {
Expand All @@ -213,7 +225,7 @@
labels = [];
deliveredData = [];
failedData = [];

pendingData = [];
let totalMessages = 0;

for (var dateString in data) {
Expand All @@ -224,6 +236,8 @@
labels.push(formattedDate);
deliveredData.push(data[dateString].sms.delivered);
failedData.push(data[dateString].sms.failure);
pendingData.push(data[dateString].sms.pending || 0);
totalMessages += data[dateString].sms.delivered + data[dateString].sms.failure + data[dateString].sms.pending;

// Calculate the total number of messages
totalMessages += data[dateString].sms.delivered + data[dateString].sms.failure;
Expand Down Expand Up @@ -252,54 +266,86 @@
}
} else {
// If there are messages, create the chart and table
createChart('#weeklyChart', labels, deliveredData, failedData);
createTable('weeklyTable', 'activityChart', labels, deliveredData, failedData);
}

return data;
})
.catch(error => console.error('Error fetching daily stats:', error));
};
createChart('#weeklyChart', labels, deliveredData, failedData, pendingData);
createTable('weeklyTable', 'activityChart', labels, deliveredData, failedData, pendingData);
}

return data;
})
.catch(error => console.error('Error fetching daily stats:', error));
};
setInterval(() => fetchData(currentType), 25000);
const handleDropdownChange = function(event) {
const selectedValue = event.target.value;
currentType = selectedValue;
const subTitle = document.querySelector(`#activityChartContainer .chart-subtitle`);
const selectElement = document.getElementById('options');
const selectedText = selectElement.options[selectElement.selectedIndex].text;

subTitle.textContent = `${selectedText} - last 7 days`;
fetchData(selectedValue);

// Update ARIA live region
const liveRegion = document.getElementById('aria-live-account');
liveRegion.textContent = `Data updated for ${selectedText} - last 7 days`;

// Switch tables based on dropdown selection
const selectedTable = selectedValue === "individual" ? "table1" : "table2";
const tables = document.querySelectorAll('.table-overflow-x-auto');
tables.forEach(function(table) {
table.classList.add('hidden'); // Hide all tables by adding the hidden class
table.classList.remove('visible'); // Ensure they are not visible
});
const tableToShow = document.getElementById(selectedTable);
tableToShow.classList.remove('hidden'); // Remove hidden class
tableToShow.classList.add('visible'); // Add visible class
const tableHeading = document.querySelector('#tableActivity h2');
const senderColumns = document.querySelectorAll('.sender-column');
const allRows = document.querySelectorAll('#activity-table tbody tr');
const caption = document.querySelector('#activity-table caption');

if (selectedValue === 'individual') {

tableHeading.textContent = 'My activity';
caption.textContent = `Table showing the sent jobs for ${currentUserName}`;

senderColumns.forEach(col => {
col.style.display = 'none';
});

allRows.forEach(row => row.style.display = 'none');

const userRows = Array.from(allRows).filter(row => {
const senderCell = row.querySelector('.sender-column');
const rowSender = senderCell ? senderCell.textContent.trim() : '';
return rowSender === currentUserName;
});

userRows.slice(0, 5).forEach(row => {
row.style.display = '';
});
} else {

tableHeading.textContent = 'Service activity';
caption.textContent = `Table showing the sent jobs for service`;

senderColumns.forEach(col => {
col.style.display = '';
});

allRows.forEach((row, index) => {
row.style.display = (index < 5) ? '' : 'none';
});
}
};

document.addEventListener('DOMContentLoaded', function() {
// Initialize activityChart chart and table with service data by default
fetchData('service');
fetchData(currentType);

const allRows = Array.from(document.querySelectorAll('#activity-table tbody tr'));
allRows.forEach((row, index) => {
row.style.display = (index < 5) ? '' : 'none';
});

// Add event listener to the dropdown
const dropdown = document.getElementById('options');
dropdown.addEventListener('change', handleDropdownChange);
});

// Resize chart on window resize
window.addEventListener('resize', function() {
if (labels.length > 0 && deliveredData.length > 0 && failedData.length > 0) {
createChart('#weeklyChart', labels, deliveredData, failedData);
createTable('weeklyTable', 'activityChart', labels, deliveredData, failedData);
if (labels.length > 0 && deliveredData.length > 0 && failedData.length > 0 && pendingData.length > 0) {
createChart('#weeklyChart', labels, deliveredData, failedData, pendingData);
createTable('weeklyTable', 'activityChart', labels, deliveredData, failedData, pendingData);
}
});

Expand Down
4 changes: 4 additions & 0 deletions app/assets/sass/uswds/_uswds-theme-custom-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1024,3 +1024,7 @@ nav.nav {
font-size: units(3);
font-weight: bold;
}

.form-control-error {
border: 4px solid #b10e1e
}
2 changes: 1 addition & 1 deletion app/content/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Explore Notify, add team members, and practice [sending messages to teammates](/using-notify/trial-mode).

2. ## Personalize content
Learn how to [personalize messages](/using-notify/guidance) to increase response.
Learn how to [personalize messages](/using-notify/how-to) to increase response.

3. ## Check delivery status
[Analyze the delivery](/using-notify/delivery-status) of your messages and download reports
Expand Down
Loading
Loading