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-128 Download messages from FS #483

Merged
merged 38 commits into from
Nov 13, 2024
Merged

Conversation

luciajanikova
Copy link
Member

@luciajanikova luciajanikova commented Oct 22, 2024

  • Odoslane spravy maju "zlozenu" vizualizaciu: Informacie o podani (custom vizualizacia podla FS portalu) + vizualizacia samotneho vyplneneho formulara. Je to predelene vodorovnou ciarou.
  • Prijate spravy maju iba custom vizualizaciu podla FS portalu.
  • Ponukame aj moznost stiahnutia akejkolvek spravy v PDF formate: HTML vizualizacia z GO sa ulozi do PDF. Takze obsah PDF je presne taky isty ako to, co pouzivatel vidi v GO (ziadne transformacie).
  • Export spravy klasicky: originaly + ku kazdemu tazko citatelnemu (asice, XML) objektu sa vygeneruje PDF.

Video ukazka na mojej FS schranke importovanej do GO:

fs_go.mp4

app/jobs/fs/download_received_message_job.rb Outdated Show resolved Hide resolved
app/models/concerns/pdf_visualization_operations.rb Outdated Show resolved Hide resolved
delivered_at: message.delivered_at
)

associated_message_draft.destroy if associated_message_draft
Copy link
Member

Choose a reason for hiding this comment

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

Nebude tu rovnaky problem so stracajucimi sa tagmi?

Copy link
Member Author

Choose a reason for hiding this comment

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

Bude, myslim na to, ale logiku toho by som vyladila v tom otvorenom PR najprv a potom to lahko preklopim aj sem. Nech to neriesime teraz na dvoch miestach.

end

def self.collapsed?
# TODO urcit podmienky: odoslana sprava s potvrdenkou by mohla byt collapsed
Copy link
Member

Choose a reason for hiding this comment

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

Kedze ta dorucenka je extremne dolezita pre nich, tak skor prave naopak.

Copy link
Member Author

Choose a reason for hiding this comment

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

Je to tu zle naformulovane, mala som na mysli, ze podanie by mohlo byt collapsed v pripade, ze uz prisla dorucenka. Toto su zatial rychle komentare v ramci draftu, doladim este.

app/models/message.rb Outdated Show resolved Hide resolved
}
</style>

<table class="min-w-full divide-y divide-gray-300">
Copy link
Member

Choose a reason for hiding this comment

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

Mas screen ako toto vyzera?

Copy link
Member Author

@luciajanikova luciajanikova Oct 23, 2024

Choose a reason for hiding this comment

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

image
a detaily su ukazane vo videu, ktore je prilozene v popise.

<td>
<b>
<time class="md:hidden" datetime="<%= message.delivered_at %>">
<%= ApplicationController.helpers.nice_datetime_with_time(message.delivered_at, keep_year: true) %>
Copy link
Member

Choose a reason for hiding this comment

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

Toto sa neda volat priamo cez nice_datetime_with_time ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nie, lebo to nevolame z controllera, tak nie su bezne dostupne veci vo view k dispozicii

def self.build_html_visualization(message)
return [ActionController::Base.new.render_to_string('fs/messages/_submission', layout: false, locals: { message: message }), build_html_visualization_from_form(message)].compact.join('<hr>') if message.outbox?

# TODO: Vieme aj lepsie identifikovat? Nejake dalsie typy v tejto kategorii neexistuju?
Copy link
Member Author

@luciajanikova luciajanikova Oct 23, 2024

Choose a reason for hiding this comment

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

Toto tu je otvorena vec. FS API v response vracia aj message_type, da sa identifikovat aj podla toho (ale tiez to je trochu len take hadanie, ked nemame nejaku dokumentaciu k tomu). Nevieme ako casto sa mozu zmenit bud tieto nazvy alebo message_type.
Samotna dorucenka si myslim, ze problem nie je (tam by som sa spolahla aj na message_type), ale tieto negativne verzie su narocnejsie. Nevieme ani kolko typov existuje.

<tr>
<th>Dôvod zmeny stavu podania:</th>
<td>
<b><!--TODO tato informacia z API neprichadza, nachadza sa to vsak vo vnutri, v XML (vyplnene to je napr. v pripade odmietnuteho podania). Parsovat/neparsovat, kde?--></b>
Copy link
Member Author

Choose a reason for hiding this comment

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

Tiez otvorena vec. Napr. v pripade nepodarenych podani, ktore sme skusali v zaciatkoch implementacie sme vdaka tomuto vycitali, kde bol problem v podani. Chyba bola uvedena v tomto policku na portali.
Je to vsak podla vsetkeho vyparsovane priamo z XML obsahu.

Copy link
Member Author

Choose a reason for hiding this comment

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

Toto tiez prosim @celuchmarek keby sa skusis este posprtat v tom, ci to nahodou nevieme ziskat jednoducho v response alebo to treba naozaj len parsovat.

Copy link
Member

Choose a reason for hiding this comment

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

písali sme na Slacku

<tr>
<th>Obdobie:</th>
<td>
<b><!--TODO zistit co tu byva vyplnene (zatial sme videli iba prazdne)--></b>
Copy link
Member Author

Choose a reason for hiding this comment

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

Toto asi bude potrebne overit s nejakym vacsim FS userom, nech zistime, co tu zvykne byt vyplnene.

Copy link
Member Author

Choose a reason for hiding this comment

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

@celuchmarek Jano spominal, ze k tomuto by sme mozno vedeli vycitat nejake info aj z XSDciek k response/WSDL. Vedel by si skusit popatrat?

Copy link
Member

Choose a reason for hiding this comment

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

V response toho môže byť viac. Všetky fieldy sú tam optional. Teraz máme v tom api iba tie, čo som dostával pri volaní, viem tam ale pomerne ľahko dohodiť všetky. Napr. obdobie je v popise API, takže pridáme do FS API a zistíme, či to aj z FS reálne vracia.

@luciajanikova luciajanikova marked this pull request as ready for review October 23, 2024 13:45
@luciajanikova luciajanikova requested a review from jsuchal October 23, 2024 13:45
@luciajanikova
Copy link
Member Author

Otestovane na podani & spatvzati podania.

@luciajanikova
Copy link
Member Author

Tu este je potrebne upravit implementaciu spracovania stiahnutej spravy podla zmien v #477.

@luciajanikova
Copy link
Member Author

Spravy sa oznacuju za precitane, len tie, ktore stiahneme. Takze get na cely zoznam sprav v priecinku neoznacuje nic za precitane.
Tym padom to nie je kriticke. @jsuchal

@luciajanikova
Copy link
Member Author

luciajanikova commented Nov 12, 2024

Za mna sme nevyhnutne blockery, ktore sme identifikovali odstranili. Co zostava otvorene:

  • Lepsie pomenovavanie potvrdeniek pri stahovani (teraz to je vzdy DeliveryReport)

Oznacovanie vlakien s potvrdenkou tagom vieme vyriesit pomocou automation. Rovnako je mozne nastavit automation tak, aby bol pridany tag na vlakno po stiahnuti potvrdenky. (aby bolo mozne filtrovat vlakna, kde uz potvrdenka prisla a tiez vlakna, v ktorych uz boli potrebne dokumenty stiahnute lokalne)

Problem este mame s nasadenim. Ten gem Grover, ktory pouzivame na generovanie PDFiek vyzera byt narocnejsie pouzit.
https://pptr.dev/troubleshooting#chrome-doesnt-launch-on-linux
https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
Pri tom by som asi potrebovala pomoc od Mareka, ak teda chceme zostat pri tomto gem. @jsuchal

@jsuchal
Copy link
Member

jsuchal commented Nov 12, 2024

Problem este mame s nasadenim. Ten gem Grover, ktory pouzivame na generovanie PDFiek vyzera byt narocnejsie pouzit.

@celuchmarek vyzera, ze tam treba dost vela libs ale teda asi staci skusit dockerfile obohatit

@celuchmarek
Copy link
Member

celuchmarek commented Nov 12, 2024

@luciajanikova @jsuchal ten Grover s Chromium som rozbehal pre Docker container na x86 archhitektúre (čiže aj náš cluster). Skúšal som na virtuálke, čo mám doma - vyrobilo mi to PDF z html stránky. Na Macu s arm64 mi to v dockeri nefunguje, ale to asi nevadí. Ten jeden pridaný ENV som už nastavil aj na gitlabe. Povedzte, či môže byť.

@jsuchal
Copy link
Member

jsuchal commented Nov 12, 2024

@luciajanikova tebe ten grover ide na macu?

@luciajanikova
Copy link
Member Author

luciajanikova commented Nov 12, 2024

@luciajanikova tebe ten grover ide na macu?

ano, ale mimo dockera

@@ -1,7 +1,8 @@
FROM ruby:3.3.0

# Install packages
RUN apt-get update && apt-get install -y build-essential nodejs libpq-dev npm fop=1:2.* libsaxon-java libsaxonb-java chromium
RUN apt-get update && apt-get install -y build-essential nodejs libpq-dev npm fop=1:2.* libsaxon-java libsaxonb-java chromium \
&& apt-get -y install libx11-xcb1 libxcomposite1 libasound2 libatk1.0-0 libatk-bridge2.0-0 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6
Copy link
Member Author

Choose a reason for hiding this comment

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

Este som sem dolozila podla https://ploi.io/documentation/server/how-to-install-puppeteer-on-ubuntu, nestacilo len chromium. Pozri prosim @celuchmarek, ci sme s tym ok.
Uz je to co potrebujeme funkcne takto.

Copy link
Member

Choose a reason for hiding this comment

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

Toto moze celkom nafuknut ten image ale teda skusme co to spravi.

Copy link
Member

Choose a reason for hiding this comment

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

čo už, aj tak má ten image už cez 3GB, takže už je to jedno.

@luciajanikova luciajanikova merged commit 4f81339 into main Nov 13, 2024
3 checks passed
@luciajanikova luciajanikova deleted the GO-128/download_messages_from_fs branch November 13, 2024 07:24
Comment on lines +8 to +9
# TODO ponastavovat v BetterUptime
BetterUptimeApi.ping_heartbeat('FS_SYNC')
Copy link
Member Author

Choose a reason for hiding this comment

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

@celuchmarek pridame heartbeat? Mozem skusit aj ja ponastavovat, ale povedz, aby som ti nebabrala do toho pripadne.

Copy link
Member

Choose a reason for hiding this comment

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

Jj, môžeš pridať a nastaviť. Todo comment vyhoď, to nastavíš hneď.

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.

3 participants