Commit Graph

238 Commits

Author SHA1 Message Date
Jonathan Bobel
0ae369d54b Updated the date to April 16th instead of April 9 2024-03-12 13:27:37 -04:00
Jonathan Bobel
507973f9ae Edited the test, updated content 2024-03-01 09:34:25 -05:00
Jonathan Bobel
d5f40dffe1 Commit before merge 2024-02-27 11:53:51 -05:00
stvnrlly
73b367f4cf delete cookie stuff to even out js converage 2023-12-18 16:30:59 -05:00
stvnrlly
f600dd95d6 remove email branding 2023-12-18 16:10:12 -05:00
Carlo Costino
a46a21a519 Revert recent changes for window location updates
There are a few other things at play that will require more investigation at a future date:

- Why window.location.assign() or history.pushState() do not work
- If any other config or polyfills are needed with JSDOM

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-10-12 10:00:30 -04:00
Andrew Shumway
93ac55ce35 Separate logout by user or inactivity 2023-10-02 15:20:23 -06:00
Andrew Shumway
00db493305 Clean up code/tests 2023-10-02 14:48:35 -06:00
Andrew Shumway
020dc871f7 Added test for code coverage 2023-10-02 09:18:30 -06:00
Carlo Costino
57f2ee798b Made several adjustments for session timer tests
- Turned the timeoutPopup module into a proper module that is exported
- Pulled out the setInterval inner function to be its own method
- Adjusted the session timer tests to have additional setup and teardown pieces
- Added a few tests

There may be some additional adjustments needed, e.g., we may not have to expose all of the methods, but then we have to figure out how to make them accessible in the tests another way.

h/t @A-Shumway42 for pairing with me to review all of these changes and approach!

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-09-28 15:31:08 -04:00
Andrew Shumway
8ab49f72ae Remove unused function in test 2023-09-27 11:47:52 -06:00
Andrew Shumway
d856e39484 Create export of session timer for tests 2023-09-14 08:56:46 -06:00
Andrew Shumway
f257a38084 Refactor code/initial tests 2023-09-13 12:44:40 -06:00
Jonathan Bobel
67c8bef7aa Trying to change govukFieldset but I keep getting testing errors 2023-08-31 14:57:45 -04:00
Jonathan Bobel
2e16d8d31b Updates after merging black 2023-08-28 12:12:21 -04:00
Jonathan Bobel
8ab550a22f Radio buttons and list edits 2023-08-25 15:31:44 -04:00
Jonathan Bobel
8b3807da3c Removing the govuk-body class 2023-08-25 11:49:13 -04:00
Jonathan Bobel
a388178e2a Removing or changing more govuk styles 2023-08-25 10:40:56 -04:00
Jonathan Bobel
966e929d47 Got the tests to work 2023-08-23 11:24:35 -04:00
Jonathan Bobel
a4fc40bcba Renamed components folder, put failing tests back in to get some assistance with those 2023-08-22 12:40:53 -04:00
Jonathan Bobel
51fde90f79 A few clean-up items in the Platform Admin section 2023-08-18 11:30:30 -04:00
Jonathan Bobel
a574fc7b3a Working through the Platform Admin section 2023-08-17 15:13:26 -04:00
Jonathan Bobel
d66ff27bae Merge branch 'main' of https://github.com/GSA/notifications-admin into 686-remove-uk-styles
# Conflicts:
#	app/assets/stylesheets/main.scss
#	app/templates/views/find-users/user-information.html
#	app/templates/views/two-factor-webauthn.html
#	app/templates/views/user-profile/manage-security-key.html
#	app/templates/views/user-profile/security-keys.html
#	gulpfile.js
2023-08-15 13:29:39 -04:00
Jonathan Bobel
6b22c347da Got the tests to pass, so doing a commit 2023-08-15 13:22:39 -04:00
Carlo Costino
9e609efa1c Remove webauthn hooks
This changeset removes webauthn from the Notify.gov admin app.  We are not using webauthn at all in our implementation and will be looking at an entirely different authentication system in the near future.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2023-08-14 16:59:38 -04:00
Jonathan Bobel
1be305d045 Reworking checkboxes to adhere to USWDS styling 2023-08-14 10:35:11 -04:00
Jonathan Bobel
348e29fb40 - Removed links to the gov uk stylesheets
- Deleted /stylesheets folder
- Removed sass build from gulpfile
- Changed gov links to usa links
- Changed other govuk styles, like breadcrumbs
- Changed name of uk_components file to us_components
- Fixed a few tests that broke on account of the changes
2023-08-08 16:19:17 -04:00
Jonathan Bobel
bbc03d2ddb Deleting instead of commenting out 2023-07-14 10:39:12 -04:00
Jonathan Bobel
f11746324d Changing white space to try to kick this test off again 2023-07-13 12:54:40 -04:00
Jonathan Bobel
e2ba5e5bb7 Commenting out this test 2023-07-13 10:46:15 -04:00
Jonathan Bobel
1da906279f Removed links to the sticky javascript, but didn't remove altogether 2023-07-12 15:43:21 -04:00
Jonathan Bobel
f266084ddb Test passed, good time to commit 2023-06-16 14:55:24 -04:00
Steven Reilly
da623c87d6 Add Google Tag Manager for analytics (#541) 2023-06-12 13:52:38 -04:00
Jonathan Bobel
e0d2d74067 Update dashboard and template flow (#514)
* Updated header and footer
* Moved files around and updated gulpfile to correct the build process when it goes to production
* Updated fonts
* Adjusted grid templating
* Adding images to assets
* Updated account pages, dashboard, and pages in message sending flow
* Updated the styling for the landing pages in the account section once logged in
2023-06-08 13:12:00 -04:00
Steven Reilly
454b778582 Cookie streamlining (#493)
* remove cookie banner
* remove form from cookies.html
* move cookie content to privacy page
2023-05-03 15:33:27 -04:00
Andrew Shumway
575c2b7d75 Notify 473: add code coverage for jest (#488) 2023-05-02 16:38:28 -04:00
stvnrlly
b6bc02eb6b us → u.s. 2022-12-06 11:03:47 -05:00
stvnrlly
c8486ea015 midday → noon 2022-11-28 16:57:49 -05:00
Ryan Ahearn
e335487b9e Address PR feedback 2022-10-27 18:16:24 +00:00
Ryan Ahearn
bb2d57b27b Update tests to use most recent jest and supporting libraries 2022-10-27 11:12:39 -04:00
jimmoffet
dad051a662 2767 passing 2022-08-05 00:25:03 -07:00
Chris Hill-Scott
6f856fdece Make terminology around visually hidden prefix clearer and more consistent
Co-authored-by: Ben Thorner <benthorner@users.noreply.github.com>
2022-05-10 10:33:27 +01:00
Chris Hill-Scott
e82970d490 Remove whitespace around API key in JS templates
We removed whitespace in the HTML of the copy to clipboard component
in https://github.com/alphagov/notifications-admin/pull/4236/files

When the Javascript on the page loads it re-renders the component,
using HTML which is embedded in the .js file.

This means we also need to apply the same change to the .js file
to remove any extraneous whitespace.
2022-05-09 12:38:18 +01:00
Tom Byers
8521d1e45f Add assertions against stray classes
In previous iterations of the classPersister, we
found issues with the implementation meant classes
it should have added back to elements were also
added to other elements. This adds tests for this
scenario to ensure it doesn't happen again.

Also includes changes to fix a linting error with
the JS which complained about a function being
defined in a loop while referencing variables in
the outer scope.
2022-02-18 12:07:41 +00:00
Tom Byers
3a86bd1685 Change internals of classesPersister
The assumption that the classes you want to
persist will always have parity with the elements
that have those classes, at that point, won't
always be true.

Because of that, this changes the way elements
with those classes are stored, to be in a map
between classes and the elements with them (at
that point).

Also includes an extra test for a scenario where
more than one updating component is in the page
with classes that need to persist through updates.
2022-02-16 15:59:29 +00:00
Tom Byers
41ee340b45 Rewrite updateContent tests 2022-02-16 11:25:50 +00:00
Tom Byers
e310ff3469 Quick fixes for updateContent tests
To address issues in these comments:
- https://github.com/alphagov/notifications-admin/pull/4155#discussion_r804641078
- https://github.com/alphagov/notifications-admin/pull/4155#discussion_r804642005
2022-02-11 16:36:49 +00:00
Tom Byers
51594e7d46 Add test for changes to component HTML on start
The updateContent JS was changed in this commit so
the replacement of the original HTML (with GOVUK
modules data-attributes) was moved into the start
method rather than being a slightly odd side
effect of the render function diffing:

476ed1593c

This adds a test to make it more clear this
happens, as requested in this comment:

https://github.com/alphagov/notifications-admin/pull/4155#discussion_r804689618
2022-02-11 15:10:23 +00:00
Tom Byers
3fa2650ffa Make updateContent persist specified classNames
Wrap the code that updates the HTML with changes
from the server with code that stores and
re-applies specified classes.

This is to allow other JS to add classes which
change the visual state of the HTML without them
being considered by the code that diffs our
in-page HTML against that from the server.

They are called classesToPersist because this
should make the visual state they create persist
between updates.

Includes the addition of tests for updateContent
that cover the addition/deletion of elements so we
can write a test for classNames persisting through
updates. The existing tests only cover updates
that change the content of elements. Just adding
the test for these changes to those would simulate
a scenario that doesn't exist in the app. Writing
extra tests for the kind of updates these changes
act on keeps them in line with the app code.
2022-02-09 12:24:59 +00:00
Tom Byers
77f7d1453c Replace domdiff library with morphdom
We added domdiff to replace the DiffDOM library
here:

87f54d1e88

DiffDOM had updated its code to be written to the
ECMAScript 6 (ES6) standard and so needed extra
work to work with the older browsers in our
support matrix. This was recorded as an issue
here:

https://www.pivotaltracker.com/n/projects/1443052/stories/165380360

Domdiff didn't work (see below for more details)
so this replaces it with the morphdom library.
Morphdom supports the same browsers as us and is
relied on by a range of large open source
projects:

https://github.com/patrick-steele-idem/morphdom#what-projects-are-using-morphdom

It was tricky to find alternatives to DiffDOM so
if we have to source alternatives in future, other
options could be:
- https://github.com/choojs/nanomorph
- https://diffhtml.org/index.html (using its
  outerHTML method)

Why domdiff didn't work

Turns out that domdiff was replacing the page HTML
with the HTML from the AJAX response every time,
not just when they differed. This isn't a bug.
Domdiff is bare bones enough that it compares old
DOM nodes to new DOM nodes with ===. With our
code, this always results to false because our new
nodes are made from HTML strings from AJAX
response so are never the same node as the old
one.
2022-01-27 11:37:53 +00:00