* feat: add blank homepage, update routing and tests
* feat: add welcome message and thoroughly test routing
* refactor: lint
* feat: update tests
* CLDC-3076: Make example dates consistent (#2107)
* CLDC-3076: Make example dates consistent
* Use example date even when some hint text provided already
* Temp remove some date restrictions
* Update to 2 line breaks
* Revert "Temp remove some date restrictions"
This reverts commit cd7f18f9f1.
* Fix lettings log accessor in date question (#2117)
* Fix lettings log accessor in date question
* Remove hardcoded date example from mrcdate question (#2118)
---------
Co-authored-by: Rachael Booth <Rachael.Booth@softwire.com>
* CLDC-3061 Add guidance page (#2121)
* Add guidance page
* Link to guidance from start page
* feat: test home/start paths explicitly
* CLDC-2253 Add collection resources (#2120)
* Update collection resources, add to homepage
* Add guidance link to an empty page
* Update headings
* Rebase fix
* Update title
* Update file names
* Add section break
* CLDC-2593 Add upcoming deadlines section (#2119)
* Add upcoming deadlines section
* Update the content to use the correct dates
* Update content
* lint
* typos
* CLDC-2252 Add homepage task section (#2115)
* feat: wip add lettings, sales and schemes sections with correct text, counts, links and colouring
* feat: add flex styling to match designs
* CLDC-3076: Make example dates consistent (#2107)
* CLDC-3076: Make example dates consistent
* Use example date even when some hint text provided already
* Temp remove some date restrictions
* Update to 2 line breaks
* Revert "Temp remove some date restrictions"
This reverts commit cd7f18f9f1.
* Fix lettings log accessor in date question (#2117)
* Fix lettings log accessor in date question
* Remove hardcoded date example from mrcdate question (#2118)
---------
Co-authored-by: Rachael Booth <Rachael.Booth@softwire.com>
* feat: update breakpoints for responsive layout changes
* lint: use hash lookup where possible
* lint: erblinting
* feat: improve formatting
* Reuse govuk grid
* Revert "Reuse govuk grid"
This reverts commit 8c71f5d9ed.
* feat: test home page data boxes
* refactor: lint
* refactor: lint
* feat: test link behaviour is correct in all user scenarios
* refactor: lint
* feat: update tests
* feat: combine task, resources, deadlines sections
---------
Co-authored-by: Rachael Booth <Rachael.Booth@softwire.com>
Co-authored-by: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
Co-authored-by: Kat <kosiak.katrina@gmail.com>
* CLDC-2255 Add homepage notifications (#2131)
* feat: add notification table
* feat: add notification banner, use unread gem for notification management
* feat: add notifications page and remove unread_notification.rb
* feat: add blank homepage, update routing and tests
* feat: add welcome message and thoroughly test routing
* refactor: lint
* feat: update tests
* CLDC-3061 Add guidance page (#2121)
* Add guidance page
* Link to guidance from start page
* feat: test home/start paths explicitly
* feat: add notification table
* feat: add notification banner, use unread gem for notification management
* feat: add notifications page and remove unread_notification.rb
* feat: default p tag around sanitized page content
* feat: add active scope
* feat: use newest active unread/unauthenticated notification and update start page
* feat: add tests of notification behaviour and routing and refactor
* refactor: lint
* feat: update Gemfile.lock
* feat: add timestamps to readmark table
* feat: update gemfile.lock
* refactor: lint
* feat: test notifications page doesn't show notifications and code simplification
* feat: move notification helper methods to notifications_helper.rb
---------
Co-authored-by: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
* feat: clear all no-status filters on in progress links
* CLDC-2590 Add about this service section (#2124)
* Add about core section
* Move about core to the correct spot on start page
* Update content
* Add some margins
---------
Co-authored-by: Rachael Booth <Rachael.Booth@softwire.com>
Co-authored-by: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
Co-authored-by: Kat <kosiak.katrina@gmail.com>
* Filter schemes
* Add status filter to schemes pages
* Filter schemes deactivating in more than 6 monts as active
* Always serialize session filters for schemes
* Remove ordering in search, fix tests
* Update incomplete scope
* Update govuk-prototype-components
* Update node version
* Udate versions in the pipeline
* Do not fix to a specific buildpack version
* Update ruby version
* Upgrade govuk-frontend
* Update summary cards to use govuk frontend component
* some minor refactoring
remove methods from child class that replicate methods on the parent class
tidy up check for nil
remove gubbins and inline method body given only used once
* update import services for lettings and sales to import creation method
write tests to cover this
* create sales log field import service and associated spec file, with methods and tests for importing the creation method of logs that have already been imported
* update lettings log field import service and related spec to allow importing creation method of logs
* use the methods dynamically created by active record in all relevant places, removing obsolete methods in teh process.
various tests tweaked to suppor this change.
rake task from another ticket folded into this ticket to prevent merge conflicts
* rename method for ruby conventions
* update PR for altered spec
upload id now decided to be a better indicator of bulk upload status, import service amended accordingly
tests updated in line with this
* update field import services in line with import services to use upload id rather than upload method as the source of truth for how a log was created
* slight refactor to reduce nesting and dodge linter complaints
* minor amendment to log creator spec in bulk upload to use enum dynamic methods
* Remove new_data_protection_confirmation? flag
* Update schema
- drop index
- add org and user data to dpc table
* Persist org and user data at import
* Do not show invalid emails
* Persist user and org data while signing agreement
* Add migration to persist org and user data on DPC
* Rebase fix
* fix typo
* Display active status is location/scheme deactivation is in more than 6 months
* Override existing location deactivation period with new deactivation
* Override existing scheme deactivation period with new deactivation
* add reactivate to policy
* Change status tag method
* Update instance double in test
* Update deactivates_in_a_long_time? method
* Uncoment a test
* add a button to the logs list to delete multiple logs
style and position of button
helpers for displaying the button conditionally depending on user role and what filters and search are active
* correct indentation from 4 spaces to 2 in view file
* test appearance of delete logs button on index page for lettings logs
* write a happy path feature test for the entire journey
* create basic tests for the view component for listing logs to delete
* create request tests for the GET delete-logs path
* create request tests for the GET delete-logs-confirmation path
* create request tests for the DELETE delete-logs path
* comprehensive reworking after code review
ensure that we are not passing lists of ids through params in the query string, risking overflowing the maximum URL length,
adjust tests accordingly,
do not attempt to reuse the same table for sales and lettings
* alter config to allow creating controllers from the command line with associated spec files that matches how we test
* extract controller methods and associated tests to do with the delete logs feature into their own controller,
amend routes accordingly
* implement same work for sales as for lettings
* implement the story for lettings and sales logs under the organisation tab
routing and controller methods
testing for deleting sales logs, lettings or sales logs for an organisation
move storage of relevant routes inside the form object as a comprehensive view model
* merge the delete pages for lettings logs and sales logs, add to the tests for the lettings page to test sales specific content
* minor refactor to delete logs controller: ensure session filters are only fetched from teh session when needed and extract discard logs method to private method
* extract tables for lettings and sales to own partials
* refactor delete logs controller after tech review
improve the private method that builds the form object so that it has the flexibility to do so for all controller methods
ensure that the search term is passed to the delete logs controller when navigating through the organisations tab
ensure that noly logs for that organisation are displayed when navigating to delete logs through the organisations tab
* remove unnecessary untested arguments
* test new helper methods
* implement dirty fiddle to get the checkboxes smaller and also not misaligned
* ensure delete logs button is always visible on log lists when in the organisations tab
* minor linting corrections
* revert change, causing errors and outside the scope of this ticket
* simplify tests for whether delete logs button appears on index page
* replicate request specs from lettings for sales and organisations controllers
* minor refactor of lettings log feature spec setup, replicate happy path for sales
* minor refactors after rebasing onto Nat's work
* temp
* write tests for the delete logs form object
* lint: add new line at end of file
* respond to PO feedback
the log id in the delte logs table should be a link to the log
the delete logs button should be visible when the user is in a bulk upload journey
updated associated tests
* Remove bulk_upload_lettings_logs flag
* Add spacing above actions in data sharing agreement
* Add banner
* Add model validation
* fix log component
* Fix factory
* Put validation behind feature flag
* start adapting to data protection confirmation
* Make tests more generic
* Add tests for display_organisation_attributes
* Use data_protection_confirmed? method
* Address code review
* rubocop
* Prevent access to bulk upload pages when DPC not signed
* Address PO review
* Add data sharing agreement
* Add data sharing agreement view
* Add controller actions
* Update details page
* Rubocop fix
* Fill in placeholders and persist data in table
* Update agreement template
# Context
- https://digital.dclg.gov.uk/jira/browse/CLDC-1732
- data providers are given read-only able access to schemes and locations
# Changes
- introduce `pundit` policies to schemes and locations. the old scope mechanism has been removed
- apply policies at view level so hide write access based functionality from data providers
# Context
- https://digital.dclg.gov.uk/jira/browse/CLDC-2305
- This is rework to add missing validations for sales setup fields for bulk upload
# Changes
- There is code that clears log fields if they are not a valid option. in order to generate errors for these we check certain fields for content prior to `log.valid?` being called. Unfortunately there does not appear to be an easy way to access to valid options therefore these values have been hard coded
- Privacy notice must be accepted other considered a setup error
- The `type` question can actually be one of three questions with the same identifier. these are excluded as part of `validate_valid_radio_option` and instead validated with a different mechanism. The rationale being that `log.valid?` will clear data before we get there
- Remove tests associated to upload threshold which are no longer required
# Context
- https://digital.dclg.gov.uk/jira/browse/CLDC-2184
- bulk upload error reports were not sorting by cells correctly
# Changes
- there was an issue where `Z100` would come after `AA100` which is not correct
- fix ordering issue above
- also made change so this is now delegated to the database rather than sorting in ruby
* Add abstract log class and sales log class
Created a parent log class for sales log and lettings log. Any bits common
to both sales and lettings can live in the parent class. As the sales log
functionality is built up any commonalities with lettings log can be extracted
into the parent log class. The sales log model is set up without a json form
and instead the form is defined in code - like the setup section of the lettings
log.
* update sales logs controller
* update lettings controller specs
* update filter method name
* update organisations controller
* use lettings method
* Add deleted tests back
* lint
Co-authored-by: Kat <katrina@madetech.com>
Co-authored-by: Kat <kosiak.katrina@gmail.com>
This renames the case_log to lettings_log as everything we've written so
far has been geared towards lettings of social housing so it makes sense to
have the name describe this. This is also a precursor to adding in stuff for
sales logs (whatever shape that takes)
Co-authored-by: James Rose <james@jbpr.net>
* Add Pagy pagination to logs index
* Add result count
* Show total count at top
* Replace view spec with request spec
* More logs context
* Make sure we have next/prev
* Add total count
* Generisize
* Remove pagination indicators when only 1 page
* Add pagination to title
* Whole pagination nav only shows if > 1 page
* Dry up paginated titles
* Update style namespace
* Set up failing test for new soft validation design
* remove unneeded js controller
* remove unneeded controller and spec
* rename net income validation override column
* spec form changes (to allow tests to run)
* validation spec changes
* replace all instances of override_net_income_validatiom
* passing first test
* Add to form and import styling
* remove unneeded code from interruption screen view
* Update test & code - failing last new expectation
* Display 2 previous question answers in the informative text
* extract displaying of the informative text into a helper
* Add tests for helper
* Remove some of the previous soft validations set up
* fix some failing specs
* Fix more tests
* lint
* Reset earnings question prefix and suffix to initial values instead of nil
* make it route backwards on a no
* test and linter fixes
* refactor next_page
* stryling
* more changes
* fix specs
* update real form
* design tweaks
* delete commented out tests
* content changes
* content changes
* changes to informative/hint text
* More robust styles for interuption panel, use smart quotes
* Rubocop
Co-authored-by: Kat <katrina@madetech.com>
Co-authored-by: Paul Robert Lloyd <me+git@paulrobertlloyd.com>
Co-authored-by: baarkerlounger <db@slothlife.xyz>
* Change net income known question
* earnings and frequency on same page
* check answers changes and other fixes
* some fixes
* delete unnecessary test
* fix failing spec
* Refactor answer label
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* test and lint fixes
* Method args
* Fix specs
* Rubocop
* Incfreq doesn't have it's own check answers display
* Add suffix to actual form
* JSON linting
* Conditional suffix only applies to check answers
* Validate that earnings and incfreq must be provided together
* Rubocop
* Fix spec
* Fix page view specs
* form fixes
* update error messages
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
Co-authored-by: baarkerlounger <db@slothlife.xyz>
* Add custom guidance partials
* Add a test for the partial being rendered
* Add some unit tests for this
* Rubocop
* Don't introduce heisenspecs
* Use component
* Add comment
* Update check values
* Make net_income_known enum
* Infer la from postcode
* Fix other tests and lint
* Add routing based on inferred la
* reset la to inferred false
* Use postcodes io gem
* reset values if la cannot be inferred
* Fix tests
* Refactor feature specs into smaller units
* DRY spec helpers
* Bump Turbo
* Use database ID assignment everywhere we need ID to reduce flakiness
* Update gemfile.lock
* Email is unique
* Selenium deprecation
* Don't need let bang
* Remove the uneeded extra options
* Remove flaky test mitigations that didn't work
* Use lockstep to remove test flakiness
* Dry up condition evaluation
* Spec admin user edit form
* Test income refused derivation
* Set valid incref
* Test Case Log deletion failures
* Test other household member age validations
* Test all reasonable preference validation paths
* Add checked answers values as true if they are passed back as case log params from the form
* Allow changing/unticking saved checkbox values
* rubocop
* Save keys for checkboxes instead of labels
* Add conditional effects keys and table fields
* Add reasonable preference reason keys and table fields
* Redo the migrations
* Move method call around
* Update case_log params before checking them with page_params
* Reload case log rather than multiple lookups
* Refactor checkbox question selection
* Refactor out the need to get list of checkbox questions
* Spec merging of answers across different question types
* Update readme to include checkbox question data model assumptions
* Fix postcode duplication
Co-authored-by: baarkerlounger <db@slothlife.xyz>