Skip to content
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

Merged
merged 5 commits into from
Dec 5, 2023
Merged

Conversation

stage-rl
Copy link
Collaborator

@stage-rl stage-rl commented Dec 3, 2023

No description provided.

@stage-rl
Copy link
Collaborator Author

stage-rl commented Dec 4, 2023

2023-12-04.17-54-26.mp4

@stage-rl stage-rl requested a review from jsuchal December 4, 2023 17:14
<%= 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 %>
Copy link
Member

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.

Comment on lines 78 to 82
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
Copy link
Member

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.


def destroyable?
message.draft? && message.not_yet_submitted? && !form?
unsigned_object = nested_message_objects&.first
Copy link
Member

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

Copy link
Collaborator Author

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)

@stage-rl stage-rl requested a review from jsuchal December 5, 2023 10:13
@stage-rl stage-rl merged commit dded5ca into main Dec 5, 2023
3 checks passed
@jsuchal jsuchal deleted the GO-392/signed_draft_UX_unsign branch December 24, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants