Closed Mike-Heneghan closed 5 years ago
For the start of this feature need to add a column to the services for the first implementation at least.
To do list:
last_reviewed
.Datetime field types https://docs.djangoproject.com/en/1.11/ref/models/fields/#datetimefield.
The auto_now_add field is not editable so maybe best to assign the current date as per the last_edited field.
There might be a bit of repeating code as there's a lot of similarities between the last_reviewed
and last_edited
.
Maybe the last_reviewed
date should be initially set as the last_edited
? Potentially adding unnecessary complication.
Is there any value to adding the last_reviewed
field to the Elasticsearch index? Would we want to add some sort of extra score to recently reviewed services? It does suggest higher quality data and even if the service hasn't changed but it's been confirmed as valid then that could be more valuable to users? Maybe extra complication for a feature that doesn't add a great deal of value?
I was initially intending on assigned the last_reviewed date as the current date is None. So the users would have the full review period i.e. six weeks from when the feature is implemented.
Although maybe a better approach would be to have the users prompted to review the services on login and the last_reviewed
field starting on the very first review. This would also allow us to check for services that have never been reviewed and hence check data quality?
This would require the feature on user login to prompt for a review based on the condition that the last_reviewed
date was None
or if it was out with the comparison time frame i.e. six weeks.
I think a new method would be required to check the date of a user login against the datetime
of the last_reviewed
of the services they edit.
Potentially need to create a more sophisticated view for the login to handle checking whether a user is an editor and is so the services that might need to be reviewed.
Now that an ALISSUser
is accessible on login need to write a method on ALISSUser
which checks the services they have.
Currently ALISSUser
has a method claimed_organisations
which returns all organisations associated. A service cannot be claimed independently form an organisation and there is no direct link from a user to the services they can edit?
Need to create a new method claimed_services
which takes the result of claimed_organisations
and iterates through to return the services?
Need to create a method on services which checks whether a service either has an out of date last_reviewed
or no last_reviewed
.
Doing visual tests the new feature seems to be working to the point of returning ids of services to review.
Now on login a user will be checked to see if they represent services and if so whether or not they are within the last_reviewed time frame.
Before moving on to redirect to a review service content
page it might be best to test methods and start refactoring to improve them and reduce unnecessary trips to the database.
Added tests for checking that a service has a last_reviewed
field and that the check_service_last_reviewed
method returns an id when out of date range and none when it doesn't have to be reviewed.
Need to add a test/tests for ALISSUser
to check that any services which the user represents are returned.
Need to add a new test file for ALISSUser.
Now that a user is checked for services to be reviewed when they log in it is now necessary to add a new view to handle reviews.
The user could automatically be redirected to reviews or a notification of some type could appear. Such as a change of the username or a new link appearing.
Potentially a list of services names with a link to review or approve. With a similar format to saved services.
The review option would link to the Edit Service
and the approve would update the last_reviewed which would remove it from the list.
Or it could be part of the My notifications
tab and based on that format.
I remember it was important to be able to navigate to the review section without the redirect on login so adding a new tab of My reviews
could be a good solution.
last_reviewed
so that the older services become a priority. Added a conditional redirect on login based on whether a user has services to review. Need to check the if not request.POST.get('remember_me', None):
.
To do list:
Link to the last_edited
more closely.
Last reviewed someone has looked at this and its accurate language could be off.
Language "last updated" might be the best unless.
last_reviewed should be the same as last_edited unless any entry has been approved.
Last reviewed should start as last_edited.
Explanation of feature i.e. the below hasn't been updated in the last 6 weeks please check and confirm. This copy should be reflected in the buttons.
As the last_reviewed field will hold the datetime
at which the service was most recenlty edited or confirmed valid at some stage this should be the value that is displayed to users for any references to "Last updated".
Need to make sure all of the code is being thoroughly tested before moving all user seen references of last updated to use the last_reviewed
field. Also, need to change the language of "Last edited" to "Last updated" this was previously changed but might have been ta step backwards.
Check out exactly who should be reviewing these services. Have a look at 'My Organisations' especially for the admin users.
It was decided that there was too much similarity between last_edited
and last_reviewed
and a lot of complexity to add the new column. Better to update last_edited
when a user approves a review.
Will create a new branch and copy across logic but using last_edited
rather than last_reviewed
.
To do list:
check_service_last_reviewed
method. Add test for confirming services from 'My reviews" page.
Currently, the redirect from a login is too aggressive in that it redirects the user if they have to log in to complete an operation. Does this interrupt the flow of what they might be trying to achieve?
Add a view test to ensure the services to review appear.
Merged into master
In an effort to improve the quality of data ALISS stores it could be valuable to prompt users to review information on their services and organisations periodically. At login, a user would be given a convenient means of checking information and either editing or approving the content, restarting the review check time period.
To achieve this on login a user's organisation/services
last_edited
field would be compared against the current date and review period. If outwith the review period they would be presented with a view allowing the information to be checked easily. If all is in order they could approve it which would restart the review period again. Otherwise, the content could be edited.It would also be useful to have a way for the user to navigate to the review page even if they have not exceeded the review period.
This feature would likely require a
last_reviewed
column to be added to organisation and services models?