in practice waiting up to 1 min 30 for requests could cause too many threads to be blocked under periods of slow OS Places API
this reduces the max wait time to 45 seconds, as requested by CORE
* CLDC-4028: Ensure logs will update when an organisation name change is created, as they draw the org name
this could lead to redundant exports if the name change does not impact the log at its startdate (which we put into the log), but it'd be more difficult to query this way so fine to be safe here
also query name changes by updated_at. shouldn't really matter as we don't expect name changes to be updated but worth being safe in case we need to update a name change for maintenance reasons
* CLDC-4028: Fix created at name change in lettings log
always safer to use updated at for checking whether the record has changed
* CLDC-4094: Use IDs to reassociate logs after a merge
using names was unsafe as these are not guaranteed unique in an organisation or scheme
build a list of old to new log IDs as merging schemes and locations, then use this when merging lettings logs
* CLDC-4094: Add a verifying test
* CLDC-4044: Reset last_sign_at fields on reactivation
this is to ensure that the code considers them a fresh user
specifically, ensures that the "Resend invite link" button will show
* CLDC-4044: Allow sending activation emails for unconfirmed users that have logged in
looks like CORE treats this state functionally for reconfirmed users & has a unique email sent out
so instead, change code to account for this and allow for sending emails to unconfirmed but signed in users
* CLDC-4044: Add verifying test
* CLDC-4044: Add clarifying comment
specifically, during bulk uploads an object is validated many times before saving
dirty checks only reset on save meaning after setting the UPRN the process_uprn_change code would run on every validation, leading to many calls
to solve this, add a flag to the log which blocks further UPRN calls if it tries to set the uprn twice to the same value. if different values are returned then continue checking
this offers a tradeoff between number of api calls and also should not break existing functionality
* send confirmation if user is unconfirmed on password reset
* update copy on password reset page if user is unconfirmed
* fixup! update copy on password reset page if user is unconfirmed
also check if they've been sent a confirmation email
otherwise, this text shows if the user doesn't exist
* CLDC-4033 Fix name of variable
* CLDC-4033: Correct name of resource variable
this override function is passed a resource symbol, not a resource object
---------
Co-authored-by: David May-Miller <David.May-Miller@softwire.com>
* CLDC-4046: Remove forcing on Q84 based on Q76 answer
* CLDC-4046: Removing forcing on latter half of Q84 as well
* CLDC-4046: Remove orphaned translations
* CLDC-4086: Fix tests
2 months ago
23 changed files with 175 additions and 69 deletions
<p class="govuk-body">We’ve sent a link to confirm your email address to <strong><%= @email %></strong>. This will complete your registration onto the CORE service.</p>
<% else %>
<p class="govuk-body">We’ve sent a link to reset your password to <strong><%= @email %></strong>.</p>
<% end %>
<p class="govuk-body">You’ll only receive this link if your email address already exists in our system.</p>
<p class="govuk-body">If you don’t receive the email within 5 minutes, check your spam or junk folders. Try again if you still haven’t received the email.</p>
dont_know_required:"Answer must be ‘don’t know’ as you told us you don’t know the tenant’s main reason for leaving."
not_internal_transfer:"Answer cannot be ‘permanently decanted from another property owned by this landlord’ as you told us the source of referral for this tenancy was not an internal transfer."
other_not_settled:"Please give the reason for the tenant leaving their last settled home. This is where they were living before they became homeless, were living in temporary accommodation or sleeping rough."
condition_effects:
@ -102,11 +101,5 @@ en:
referral:
prevten_invalid:"Answer cannot be internal transfer as the household situation immediately before this letting was %{prevten}."
leaving_last_settled_home:
reason_permanently_decanted:"Answer must be internal transfer as the tenant was permanently decanted from another property owned by this landlord."
la_general_needs:
internal_transfer:"Answer cannot be internal transfer as it’s the same landlord on the tenancy agreement and the household had either a fixed-term or lifetime local authority general needs tenancy immediately before this letting."
referral_type:
leaving_last_settled_home:
reason_permanently_decanted:"Answer must be from a PRP-only housing register or waiting list (no local authority involvement) as the tenant was permanently decanted from another property owned by this landlord."
@ -147,22 +138,30 @@ Also ensure you have firefox installed
bundle exec rake db:seed
```
5. For Ordinance Survey related functionality, such as using the UPRN, you will need to set `OS_DATA_KEY` in your .env file. This key is shared across the team and can be found in AWS Secrets Manager.
6. For email functionality, you will need a GOV.UK Notify API key, which is individual to you. Ask an existing team member to invite you to the "CORE Helpdesk" Notify service. Once invited, sign in and go to "API integration" to generate an API key, and set this as `GOVUK_NOTIFY_API_KEY` in your .env file.
5. Build assets once before running the app for the first time:
```bash
yarn build --mode=development
```
6. For Ordinance Survey related functionality, such as using the UPRN, you will need to set `OS_DATA_KEY` in your .env file. This key is shared across the team and can be found in AWS Secrets Manager.
7. For email functionality, you will need a GOV.UK Notify API key, which is individual to you. Ask an existing team member to invite you to the "CORE Helpdesk" Notify service. Once invited, sign in and go to "API integration" to generate an API key, and set this as `GOVUK_NOTIFY_API_KEY` in your .env file.
## Running Locally
### Application
Start the dev servers
Start the dev servers via one of the following methods:
a. Using Foreman:
a. If using RubyMine, run the "submit-social-housing-lettings-and-sales-data" Rails configuration.
b. Using Foreman:
```bash
./bin/dev
```
b. Individually:
c. Individually:
Rails:
@ -176,20 +175,18 @@ JavaScript (for hot reloading):
yarn build --mode=development --watch
```
If you’re not modifying front end assets you can bundle them as a one off task:
```bash
yarn build --mode=development
```
Development mode will target the latest versions of Chrome, Firefox and Safari for transpilation while production mode will target older browsers.
The Rails server will start on <http://localhost:3000>.
To sign in locally, you can use any username and password from your local database. The seed task in `seeds.rb` creates users in various roles all with the password `REVIEW_APP_USER_PASSWORD` from your .env file (which has default value `password`).
To create any other users, you can edit the seed commands, or run similar commands in the rails console.
To create any other users, you can log in as a support user and create new users via the admin interface. Or, you can edit the seed commands, or run similar commands in the rails console.
You can also insert a new user row using SQL, but you will need to generate a correctly encrypted password. You can find the value to use for encrypted password which corresponds to the password `YOURPASSWORDHERE` using `User.new(:password => [YOURPASSWORDHERE]).encrypted_password`.
### rbenv
In general, whenever needing to run a Ruby command, use `bundle exec <command>` to ensure the correct Ruby version and gemset are used. Rbenv will automatically use the correct Ruby version.
### Debugging
Add the line `binding.pry` to the code to pause the execution of the code at that line and open a powerful interactive console for debugging.
@ -219,6 +216,8 @@ More details on debugging in RubyMine can be found at <https://www.jetbrains.com
bundle exec rspec
```
Or if using RubyMine, right click a spec file and select the 'Run' option.