Comments (13)
Being done as part of the data model refactoring project
from roadmap.
Added lock_version to answers table. This triggers optimistic locking.
If you try to save with a lock_version < the current lock_version it throws a StaleObjectException.
When an answer is saved it calls answers#update expecting a JS response.
If the save works then the JS return only updates the lock_version otherwise the next save will fail.
An empty div is added to the answer_form partial.
If a staleObject gets caught then respionse uses this to display the conflicting answer and user.
The lock_version also gets updated so that next time the user saves it will succeed.
There's a fair amount of JS which was to do with locking which is no longer needed.
The answer timestamp also gets changed. It was working of 'created_at' rather than 'updated_at' because we used to created a new answer every time.
As part of this I have also tried to rationalise the testing of question_formats. They used to always be string comps. They now use an enum field.
I had also earlier added question_format constants to avoid string comps. This was an ugly solution and can now go.
from roadmap.
Commits:
DigitalCurationCentre@51c78fc
DigitalCurationCentre@2a9cead
DigitalCurationCentre@a9cc1b2
DigitalCurationCentre@a6f2a54
from roadmap.
looks great @raycarrick-ed. moving this on to 'Ready for PR'
from roadmap.
This appears to be working as expected, however, we should consider adding a message to notify users that their answer was not saved/another user was editing the plan simultaneously. At present I receive the default timestamp message if I click Save during simultaneous editing - Answered 4 minutes ago by [email protected]
I only discover that my answer was not actually recorded when I refresh the page.
Would it be very complicated to add a message @raycarrick-ed ?
from roadmap.
Pulling this back to 'in progress' so I can revisit this
from roadmap.
this was addresses by fixes made for #241
from roadmap.
The message looks great and answers save/overwrite as expected. It's still too easy to accidentally overwrite a collaborator's answer, however. In the screenshot below, if I click "Save" without deleting or combining my answer text in the lower box as advised, it overwrites the answer in the upper box.
Since we think this is an edge case, maybe it's not worth messing w/now. We can target this for future usability testing. What do you think @sjDCC ?
from roadmap.
Yes, I agree this is a good case for future usability testing. People are likely to just hit save so it'd be easy to overwrite without incorporating changes. I also got confused about where the new text should go - in the top or bottom box (even though the guidance is clear when I re-read!).
Perhaps we need to add an additional bit of guidance text like:
"The edits in the box below will overwrite the existing answer from [user name] once you click save"
from roadmap.
@sjDCC I like your suggestion about amending the message:
"The edits in the box below will overwrite the existing answer from [user name] once you click save"
from roadmap.
Possibly grey out top box suggested by @vyruss
from roadmap.
Updated the messaging per @sjDCC suggestion above and greyed out/disabled the text box to prevent further confusion.
from roadmap.
This looks good for now. Closing issue.
from roadmap.
Related Issues (20)
- Disable debug checking for rubocop >=1.45.0 HOT 2
- Flash warning `Error: Record Not Found: Couldn't find Template without an ID` somewhere after visiting `/plans` HOT 1
- Message of `No questions have been answered for this DMP` or `Rest of the DMP hasn't been completed yet.` should be added when export a uncomplete plan
- [FEATURE]: Retain hmtl code when downloading to pdf
- Removing question_option in admin template triggers a full reload
- Google tracker code in org admin edit page has no effect when root organisation has none HOT 1
- Error while integrate with Keycloak OpenID Connect HOT 10
- [BUG]: Formatting errors in Word download
- [BUG]: formatting errors in PDF download
- [FEATURE]: Allow admins to delete a template HOT 6
- Notify researchers when there is an updated version of a template
- Migrate off of FlagShihTzu gem
- Migrate away from the WickedPdf gem and WkHtmlToPdf package
- New CSSBundling compilation fails in production
- API internal server error 500 HOT 3
- ruby gem `spring` is required by command `bin/rails`, even in production environment HOT 2
- Latest version of better_errors triggers "cannot load such file -- sassc (LoadError)" HOT 1
- default font size for pdf exports is too small
- GillSansLight font not rendering for header elements HOT 1
- Allow institutions to copy sections they create from one template to other templates
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roadmap.