* add start of bulk upload logs journey
* split upload controller into 2
* add year page to bulk upload journey
* bulk upload years now dynamic
* add placeholder for upload your file page
* handle bulk upload when not in crossover
* add bulk upload csv user journey
* bulk upload now persists and sends to S3
* swap ruby-filemagic for file command
* match csv or text file for validation
* in_crossover_period? now uses overlap of forms
- also moved from Form to FormHandler
* add production env var for CSV bucket
* stub kernel call methods
* remove duplicate env var
* hardcode env var for review apps
* move feature toggle to FeatureToggle
* crossover period checks now specific to the form
* fix typo in bulk upload journey
* Conditionally display a correct review log text
* do not allow the aswers from previous collection windows to be changed
* does not let the user navigate to questions for previous collection year logs
* Fix tests
* Add some docs
* Extract collection period check into a before_action and change path to rails route
* update the tasklist message
* Mark log as impacted by deactivation when location is deactivated
* Display affected logs in the table
* Route affected logs to tenancy start date question
* Update routes to get the tenancy start date page from form
* update next_page_redirect_path
* rename column
* Fix tests
* Add next_unresolved_page_id to pages
* Update unresulved when the log is corrected
* Mark logs as unresolved when scheme gets deactivated
* display correct content when there are no unresolved logs
* mark logs resolved after the user leaves check answers page
* Display link in success banner and reset banner when the link is clicked
* display inset hint text for unresolved log questions
* Display unresolved logs banner
* update banner message
* Persist the link in the banner
* update inset text
* Update success banner text
* Add unresolved and created_by scopes
* rename method
* add unresolved_log_redirect_page_id to form + typo and route
* Add UnresolvedLogHelper and extract flack notice message
* pluralize and return early
* remove flash[:notice] = nil
* to keep it consistent for sales log
* Extract unresolved path and fix a link
* extract resolve method and fix attribute nme
* update path
* typo
* add start of bulk upload logs journey
* split upload controller into 2
* add year page to bulk upload journey
* bulk upload years now dynamic
* bulk upload journey: add copy for prepare file
* add link to bulk upload template
* add placeholder for upload your file page
* handle bulk upload when not in crossover
* fix tests around bulk upload redirect
* fix typos in bulk upload jouney
* feat: remove redundant cols from locations table
* feat: add status col to locations table
* test: start adding status tag tests
* test: pick the simplest format for the tag helper tests
* feat: make the locations table (plus related content above & below) 2/3 width
* feat: add incomplete to location status method
* test: all status tag helpers
* test: update test text to match what's being tested
* test: update locations list test in locations_controller_spec.rb
* test: update locations list test in schemes feature tests
* test: that status=incomplete when mandatory info is missing
* feat: simplify logic for incomplete status
Co-authored-by: James Rose <james@jbpr.net>
* feat: hide new locations table layout behind feature flag
* feat: use route helpers to get scheme_location path
* feat: simplify "scheme_id: @scheme.id" to "@scheme"
* feat: reference location, not @location, in scheme_location_path
* feat: reorder postcode and code in locations table
* feat: change ' ' to "" in location_spec
* feat: update wording and ordering for 'view location details' page
* test: re-add tests for locations page when new layout not enabled
* test: check for mobility_type and location_admin_district in locations_controller as support user
* test: update locations helper test to match new field naming and ordering
* feat: always scale locations list by 2/3, not just when new layout used
* feat: scale the scheme details page by 2/3 to match the locations list page
* feat: only make scheme details and locations pages 2/3 scale if feature toggle on
* test: mock new locations layout feature toggle in tests
* feat: use the existing location_toggle_enabled instead of new_locations_table_layout_enabled
* refactor: don't use html inside ruby in locations index page
* refactor: use Rails routes in all places in locations index page
* style: lint
* feat: move logic from views/schemes/show into schemes_helper
* refactor: make consistent the removal of fields from SchemeHelper base_attributes
* test: improvements to tests
* test: make 'returns correct display attributes' tests sensible
* test: check scheme toggle off => no scheme status shown
* style: correct indentation in spec/helpers/schemes_helper_spec.rb
* test: that when owning = managing, "Organisation providing support" hidden
* style: lint code
* test: don't set scheme id explicitly in schemes_helper_spec
* style: reorder tag helper spec to match tag helper
* refactor: ensure display_scheme_attributes always takes user type
* test: make location incomplete status depend on location.confirmed
* test: add missing location validations for nil postcode & mobility type
Co-authored-by: James Rose <james@jbpr.net>
* Update affected logs count and skip the confirmation page if no logs are affected for locations
* Update affected logs count and skip the confirmation page if no logs are affected for schemes
* refactor
* feat: add scheme reactivation behaviour
* test: add tests
* refactor: linting
* fix: find deactivation periods by scheme/location ids rather than just the first
* feat: add activating_soon status to location (not to schemes as they have no startdate field)
* feat: fix logic and add tests fo activating soon
* fix: check for startdate presence
* route deactivated scheme to reactivation page
* Render correct reactivate question content
* refactor into a helper
* display successful reactivation banner for default date
* Save reactivation date
* Add reactivation errors
* lint and fix url in tests
* make toggle translations generic
* Add reactivation status
* Reuse date validation messages
* Show deactivate this location when location is reactivating soon
* Display correct confirmation banner
* Add validation for reactivation date before deactivation date
* Improve availability label
* Use current collection start date if created at is later than that
* Update paths
* Fix controller and don't display the previous day if location availability start afterwards
* refactor availability label
* Filter out active periods
* lint
* Refactor active_period method into the model
* Allow deactivations and reactivations from available from date instead of start of the collection date
* Prevent deactivations during deactivated periods
* lint
* typo
* Remove active periods that last 1 day (because they get deactivated on the same day)
* Move the active_periods into helper
* extract remove_overlapping_and_empty_periods into a separate method
* Remove nested deactivation periods
* Make deactivate/reactvate location form use location_deactivation_period model
* refactor toggle date methods
* extract shared condition
* update validations
* refactor validations
* Update schemes deactivation form to use dectivation model
* Refactor
* lint
* remove redundant location_id and update scheme controller
* update active_periods
* feat: wip update scheme summary page
* feat: wip deactivate scheme schemes page
* feat: wip toggle active page
* feat: wip set deactivation_date to a datetime (to be more specific times later_
* Change conditional question controller to accommodate all models
* feat: add specific datetimes for deactivation
* feat: correct date and add notice
* feat: wip error behaviour
* feat: wip errors
* feat: wip errors refactoring
* feat: wip errors more refactoring
* refactor: linting
* feat: add second error in correct position and wip date range error
* feat: remove unneccessary db field
* feat: change type values to strings
* refactor: tidy up controller logic
* refactor: use same structure as locations deactivation
* feat: add general partially missing date input error
* feat: add tests ("updates existing scheme with valid deactivation date and renders scheme page" still wip) and add new partially nil date behaviour to locations controller
* feat: fix tests, add status tag behaviour and remove unnecessary nils
* refactor: linting
* refactor: erblinting
* refactor: remove redundant line
* refactor: respond to PR comments 1
* refactor: respond to PR comments 2
* refactor: respond to PR comments 3
* refactor: respond to PR comments 3 (locations side)
* fix: remove @locations in location model
* fix: remove @locations in location model
* fix: update status names
* feat: wip validation update
* feat: add validation to model layer
* feat: further separate scheme deactivation behaviour
* test: update tests to new flow
* feat: respond to pr comments and add dynamic success text
* feat: duplicate behaviour schemes -> locations (+ tests)
* refactor: linting
* refactor: typo and remove unnecessary line for this PR
* refactor: feature toggle simplification
* Refactor locations and schemes controller actions
- Rename confirmation partials to `deactivate_confirm.html.erb` so that they match the actions in which they belong to
- Make all deactivation date comparision UTC time
* feat: update deactivation_date validation and add tests
* refactor: linting
Co-authored-by: Kat <katrina@kosiak.co.uk>
Co-authored-by: James Rose <james@jbpr.net>
* Add scopes to OrganisationRelationship
* Update seeds to have more than one org relationships
* Pass current_user to questions
* Add new questions
* Use feature flag
* Update specs
* Address comments
* add deactivation_date to locations
* Change conditional question controller to accommodate all models
* UI spike
* Update toggle-active views and render them correctly
* Display 2 errors
* Update errors
* Extract text to translation file
* Add collection start date
* Add out of range validation
* Update affected logs label
* lint
* Add status method
* update the displayed status tags
* Keep deactivation_date_type selected if an error occurs
* refactor deactivation_date_type to use default and other as options instead of 1 and 2
* refactor
* refactor
* update lettings logs
* Add reactivate ocation button and path
* Fix controller and update deactivate confirm page
* Don't actually update the logs data when deactivating a location
* lint and typos
* update a path
* update current_collection_start_date
* Remove unused scope
* CLDC-1620 Add Google Tag Manager scripts to layout
* Update app/views/layouts/application.html.erb
Co-authored-by: James Rose <james@jbpr.net>
* CLDC-1620 Extract GTM IDs to helper
Co-authored-by: James Rose <james@jbpr.net>
* [CLDC-1619] Add cookies page and logic to manage them
* Update app/views/cookies/show.html.erb
Co-authored-by: James Rose <james@jbpr.net>
Co-authored-by: James Rose <james@jbpr.net>
* feat: add 2022 rent range data, update rake task for population of this
* feat: change file format so ranges_rent_id is recognised
* feat: add updated error messages and casing
* tests: make tests pass
* feat: ensure there is a location_code in all locations and use this (and beds = 0) for supported housing rent validations
* feat: fix general needs validation behaviour
* feat: add local authorities enum to location.rb
* feat: ensure case when beds > 4 is accounted for
* feat: add error messages on property postcode page as well as la page
* feat: add error messages on scheme_id and location_id as well as la page
* feat: add error messages on scheme_id and location_id as well as la page
* feat: null coalescing and validations on changing las to one that invalidates rent in supported housing
* feat: nil protection
* refactor: linting
* refactor: combining duplicated logic
* tests: add hard validation tests split by needstype
* feat: update validations when beds > 4
* feat: update validations when beds > 4
* refactor: simplification, use preivous la method
* refactor: response to PR comments, fixing beds.negative validation
* feat: remove dynamic local auth name text from interruption screens - to be added back in later if this becomes a priority, would need some work on adding local auth name to log for supported housing logs not just leaving it in the location
* wip
* Rename managing_agents column
* add managing relationship
* f
* feat: add my features branched off managing agents branch
* feat: update nav behaviour
* feat: simplify housing_providers view
* feat: fix pluralise to default to plural rather than singular
* feat: remove managing agent related code so can be merged directly
* tests: update tests and add new ones for housing_providers
* refactor: rubocop conciliation
* tests: fix failing navigation tests
* tests: one more plural test
* refactor: erb linting
* refactor: erb linting
* feat: right-align "Remove" text
* feat: update nokogiri to pass bundler-audit
* feat: grey out search button
* feat: remove section-break
Co-authored-by: Jack S <jacopo.scotti@softwire.com>
* feat: core functionality
* feat: update schema.rb
* feat: add link for privacy notice, refactor to separate tenant/buyer
* feat: make privacy notices open in new tab
* test: make previous tests pass
* test: add new tests
* feat: add la manual edit page
* feat: make autocomplete accesible and la readable
* feat: add correct skip and linking behaviour, also rename fallback page
* feat: add page not found and tidy la list
* feat: add redirection behaviour
* feat: add coping with nil add_another_location query string
* test: add postcodes mocks to return local authorities
* feat: validate local authority to not be nil or "Select an option"
* feat: persist add_another_location even on validation failure
* feat: remove url query parsing, put validation before values added to db
* refactor: spacing
* tests: add new tests for edit-local-authority
* tests: remove redundant bangs
* 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>
* Replaced log CSV direct download with email
* Tidy up authorization of organisations controller
- We already have a method to authenticate the scope of the user, so we can reuse that.
* Use Rails routes instead of absolute paths for CSV download links
* Introduce base NotifyMailer to to abstract away shared Notify mail functionality
* Fix mailer spec name
* Add worker instance to PaaS manifest
* Add CSV download bucket instance name into environment
* Update tests for improved search term handling
* Fix download mailer tests
* Clarifying comments
Co-authored-by: natdeanlewissoftwire <nat.dean-lewis@softwire.com>
Co-authored-by: James Rose <james@jbpr.net>
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>
* Back button on edit location page routes to check answers for locations
* Update path
Co-authored-by: James Rose <james@jbpr.net>
Co-authored-by: James Rose <james@jbpr.net>
* Mark scheme location as confirmed
* Route to check your answers after any changes are made to the scheme. Display change for all editable fields
* Add some functionality
* Display banners and redirect to check answers after editing location name
* Remove a test
* update locations confirmation
* reuse can_change_scheme_answer?
* Use path helpers
* Redirect to view scheme when trying to access create form pages for the scheme
(cherry picked from commit 761bf97dc2)
* add before action for confirmed schemes
* update location path
* lint
Co-authored-by: Dushan Despotovic <dushan@madetech.com>