-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locked draft behavior hotfix #225
Conversation
2023-12-04.17-54-26.mp4 |
<%= text_field_tag message_title_id, @message.title, placeholder: "Predmet", "data-action": "change->message-drafts#update", class: "mb-3 px-3 py-4 placeholder-slate-300 text-slate-900 relative bg-white bg-white rounded-lg text-base border-0 shadow outline-none focus:outline-none focus:ring w-full" %> | ||
<%= text_area_tag message_text_id, @message.metadata["message_body"], autofocus: @is_last, placeholder: "Text", "data-action": "change->message-drafts#update", rows: 10, class: "px-3 py-4 placeholder-slate-300 text-slate-900 relative bg-white bg-white rounded-lg text-base border-0 shadow outline-none focus:outline-none focus:ring w-full h-full" %> | ||
<% else %> | ||
<%= link_to locked_message_draft_path(@message), data: { turbo_frame: "modal" } do %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tato logika sa mi nepozdava. Stav ci je to locked nie je na klientovi ale na serveri. Co ak to si otvorim draft a medzicasom ho niekto "odlockuje" alebo "zalockuje" ? Dialog by mal vyletiet podla toho aky je aktualny stav.
app/models/message_object.rb
Outdated
transaction do | ||
update(name: unsigned_object.name, mimetype: unsigned_object.mimetype, is_signed: false) | ||
message_object_datum.update(blob: unsigned_object.content) | ||
unsigned_object.destroy | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transakcie by sa nemali diat v modeloch, je to infrastukturna vec, toto ma riadit controller.
app/models/message_object.rb
Outdated
|
||
def destroyable? | ||
message.draft? && message.not_yet_submitted? && !form? | ||
unsigned_object = nested_message_objects&.first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Toto mi pride ako silny predpoklad. Potrebujes si pytat explicitne formular
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ak som spravne pochopil implementaciu tychto nested objektov, tak toto je spravne. Kedze self je v tomto pripade formular, tak nested uz nemoze byt nic ine ako podpisany formular. Pod formular sa ine objekty nevesaju (vesaju sa vedla neho, pod message). Nested objekt ani nema atributy, ktorymi by si odlisil, ci je to formular (len nazov suboru)
No description provided.