* feat: add absorbing_organisation relationship to orgs
* feat: wip absorbed orgs visibility work
* feat: add absorbed orgs to filter options, make unique
* refactor: simplify
* feat: add test
* feat: update schema
* feat: add absorbed org to user relations
* feat: be more explicit about org scopes
* feat: update log org question selections
* feat: add org question to sales for all users (to be specified again in later ticket)
* feat: revert previous and handle in separate ticket
* feat: update validation and tests
* feat: reload org to populate associations
* feat: check for holding own stock in stock owner question, add schema
* feat: add/update org filter tests
* feat: update test
* feat: update created by id pages
* Add user status filters
* Add filters to the pages
* only show unconfirmed and deactivated logs as deactivated
* Look at last signed in at to determine unconfirmed users
* feat: wip commit
* feat: rest of assigned to filter behaviour
* feat: start to update tests
* feat: update tests
* feat: update tests
* refactor: linting
* feat: add new test
* feat: add new test
* feat: update filters_count
* feat: let support users see all users
* feat: let users select users from stock owners/managing agents too
* refactor: typo
* feat: update tests
* 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
* Add mailer
* Instantiate logs only where needed
* Update banner to handle all possible permutations
* wip
* Send confirmation email to user
* Address PO review
* 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
# Context
- We're currently using a custom fork of devise
# Changes
- Switch back to original devise gem
- This gives us the benefit of being able to more easily upgrade when the time comes
- Minor fixes to validation copy during password reset process which were not correct
* add first page for bulk upload resume journey
* bulk upload resume handles upload again
* add confirm page to bulk upload resume journey
* replace placeholder count with correct value
* apply recommendation for bulk upload resume choice
* add how to fix bulk upload mailer
* integrate new bulk upload approve journey
* add missing bulk upload error mappings
* remove test
* prevent approve being called multiple times
* bulk upload creates invisible logs ahead of time
* work invisible logs into bulk upload flow
* sort errors so deterministic
* remove unused ensure
* remove expected_log_count and processed
- these fields are no longer used or needed
* introduce pending status
* swap visible for pending logs
* only show visible lettings logs
* hard code status filters
* remove unused model methods
* only show visible sales logs
* form controller ignores hidden logs
* locations and schemes only affect visible logs
* refactor with extract method
* can filter logs by bulk upload
* hide log creation button when viewing bulk upload
- this affects the logs index page filtering logs from a specific bulk
upload
* add info banner to bulk upload logs
* placeholder for bulk upload logs header
* when resuming bulk upload set filters
* fill place holder with remaining logs to fix
* add interstitial to resume if logs resolved
* after resolving bulk upload logs show interstitial
* fix linting error
* extract view variable to helper method
* Allow filtering by organisation if organisation has managing agents
* update test name
* Displayed owned/managed by in the logs list if the org has managing agents
* Validate that the user belongs to either the managing or owning organisation
* do not reset created_by and remove user_organisation_chosen?
* Do not default managing organisation to owning organisation
* validate user belongs to organisation
* update tests to specify created_by
* clear create_by for support users
* refactor
* typo
* rebase lint
* Add `updated_by` to logs to track who was the last person to update a log
- Reset `created_by` automatically when a form is updated and the owner does not belong to the managing or owning organisation
* move reset_invalidated_dependent_fields!, update schema file and fix tests
Co-authored-by: James Rose <james@jbpr.net>
While migrating users from the previous service to the new one we discovered that email addresses are not unique in the previous service. This means that one user in the new service might relate to multiple users in the previous service.
This change:
- Adds a new LegacyUser model that can belong to a User. Each LegacyUser model has one old_user_id that corresponds to the user ID in the legacy service.
- Updates the user import service so that we create this association for new users
- Creates a Rake script to backfill the association for existing users
* 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 search by name for users
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* Search is now non case sensitive
* Made search work for data co-ordinators
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* Refactored to scope
* Added search by email
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* WIP Commit - added test for if search term matches a name and an email address simultaneously. Also changed search result caption for organisations to display "Matches X of Y users"
* Rubocop
* Preload org
* Linting
* Refactor filtered_users into module
* Only adjust query param if searched
* Add data coordinator tests
* Add table caption spec
* Dupe attribute
* Refactor into Search ViewComponent
* Rubocop
* Unit test user scopes
Co-authored-by: Ted <ted.booton@madetech.com>
Co-authored-by: baarkerlounger <baarkerlounger@users.noreply.github.com>
* Confirmable
* Remove obsolete rake task
* Skip confirmation for inactive users
* Send beta onboarding template if migrated from Softwire
* Default controller
* Use correct link
* Redirect confirmation to set password
* Confirm account within 3 days
* Only redirect to set password if not previously set
* Rubocop
* Confirm factory bot users
* Set password condition
* Changing email requires reconfirming
* No need to explicitly trigger email, devise does that for us now
* Remove flash banner
* Mock notify
* Mock in the right spec
* Test redirect and text
* User is confirmable
* Rubocop
* Redirect to url so we don't bypass authenticity token
* Update content
* Add test for resend invite flow
* Update link to resend confirmation email
* Rename password reset resend confirmation partial
* Expired link error page
* Remove resend confirmation link
* Update seed
* Expory contact
* Time zone
Co-authored-by: Paul Robert Lloyd <me+git@paulrobertlloyd.com>
* Filter values correctly
* Remove filter value if hidden
* Return empty string rather than nil for accessible autocomplete
* Additional test for accessible automcomplete defaulting
* Rename org filter
* Ensure filters work when ID is passed
* UI init
* Lint
* Fix filter nesting
* Reduce width
* Set checked status of filters correctly
* Test filter presence
* Add filter test
* Rubocop
* Tweak styles for autocomplete within filter
Co-authored-by: Paul Robert Lloyd <me+git@paulrobertlloyd.com>
* A support role exists that can see all case logs
* Support role requires 2FA
* Support user sees 2FA code screen on login
* Use email for OTP code
* Ensure resend paths work
* Support user can see additional organisation columns on logs page
* Simpler test
* Remove spec description spaces
* Add data field
* Add field to views
* Only data coordinators can change role, dpo, keycontact
* Import key contact field
* Rubocop
* Import data accessors
* Handle non-unqiue email imports
* Update controller auth
* Change data protection officer from role to attribute
* Allow changing DPO
* Update wording
* Use radio buttons rather than check box
* Add some integration tests
* Make hidden text dynamic
* 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
* Add organisation model and user association
* Add user admin panel
* email
* Update seeds
* Update spec
* Case logs belong to organisations
* Org case log association
* Add user case log association
* User case log helper methods
* Org case log relation helpers
* Case log index page only shows your organisations case logs
* No access to tasklist page for logs that aren't associated with your org
* No access to form pages for case logs that aren't owned or managed by your org
* Check answers access
* Submit form access
* Refactor out not found methods
* Allow user admin update without password
* Update feature specs
* Rubocop
* Update case log specs
* Test admin user update without password
* Spec grammar