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

GO-127 Show sender name by FS MessageThreads #474

Merged
merged 5 commits into from
Sep 26, 2024

Conversation

luciajanikova
Copy link
Member

Pri UPVS boxoch je mozna komunikacia ku viacerym subjektom, tak v pripade outboxovych sprav chceme na threade zobrazovat komu posledna outboxova sprava isla, inak odosielatela.
Pri FS boxoch je mozna komunikacia iba k jednemu subjektu (FS), tak chceme na threade zobrazovat vzdy odosielatela.

Comment on lines 30 to 36
<% if @message_thread.box.communication_to_multiple_subjects? %>
<% if @message_thread.is_outbox && @message_thread.recipient.present? %>
Komu: <%= @message_thread.recipient %>
<% elsif !@message_thread.is_outbox && @message_thread.sender.present? %>
Od: <%= @message_thread.sender %>
<% end %>
<% elsif @message_thread.sender.present? %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keby sme tu spravili dve metody show_recipient? a show_sender? a schovali tu logiku tam?

@jsuchal
Copy link
Member

jsuchal commented Sep 19, 2024

@luciajanikova rozumiem co si urobila myslim, ze helper nie je uplne najlepsie miesto, mozno keby sme to nazvali recipient_relevant? a sender_relevant? tak to mozeme rovno hodit do modelov?

@luciajanikova
Copy link
Member Author

@luciajanikova rozumiem co si urobila myslim, ze helper nie je uplne najlepsie miesto, mozno keby sme to nazvali recipient_relevant? a sender_relevant? tak to mozeme rovno hodit do modelov?

Do modelov podla mna uplne nie, lebo to co v tych metodach checkujeme (sender, recipient) tahame cez query takto, nie je to priamo v modeli dostupne. Preto som to dala do helpera.

@jsuchal
Copy link
Member

jsuchal commented Sep 19, 2024

Ok, rozmiem, podla komentu by sa to malo neskor dostat na uroven vlakna cize neskor to mozeme dat aj do modelu, dajme si tam teda todo.

@@ -0,0 +1,9 @@
module MessageThreadHelper
def self.show_recipient?(message_thread)
message_thread.box.communication_to_multiple_subjects? && message_thread.is_outbox && message_thread.recipient.present?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tomuto comunication_to_multiple_subjects? inak uplne nerozumiem. Co to znamena?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snazila som sa tym pomenovat to, ci ten dany typ boxu komunikuje k/od X subjektom - rozne institucie (ako Upvs::Box), vtedy ma zmysel rozlisovat pripady kedy zobrazujeme prijimatela/odosielatela alebo
to je komunikacia vzdy voci 1 subjektu (ako Fs::Box) a vtedy ma zmysel vzdy ukazovat iba odosielatela, resp. asi skor nazov boxu, ktoreho sa to tyka.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, dava zmysel. V tom pripade mi dava skor zmysel to otocit single_recipient?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upravila som

@luciajanikova luciajanikova merged commit abfe888 into main Sep 26, 2024
3 checks passed
@luciajanikova luciajanikova deleted the GO-127/show_sender_by_fs_threads branch September 26, 2024 08:33
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