Skip to content

Commit

Permalink
fix credo
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek committed Oct 28, 2024
1 parent 6dcd0c7 commit 7b58500
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 55 deletions.
18 changes: 11 additions & 7 deletions lib/mindwendel/services/storage_service.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@ defmodule Mindwendel.Services.StorageService do
{:ok, response} ->
case response.status_code do
200 ->
case Vault.decrypt(response.body) do
{:ok, decrypted_file} ->
{:ok, decrypted_file}

{:error, error_message} ->
{:error, "Issue while decrypting file: #{inspect(error_message)}"}
end
decrypt_response_body(response.body)

_ ->
Logger.error(
Expand Down Expand Up @@ -82,6 +76,16 @@ defmodule Mindwendel.Services.StorageService do
end
end

defp decrypt_response_body(body) do
case Vault.decrypt(body) do
{:ok, decrypted_file} ->
{:ok, decrypted_file}

{:error, error_message} ->
{:error, "Issue while decrypting file: #{inspect(error_message)}"}
end
end

defp bucket_name do
System.fetch_env!("OBJECT_STORAGE_BUCKET")
end
Expand Down
32 changes: 16 additions & 16 deletions priv/gettext/de/LC_MESSAGES/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ msgstr "Möchtest du die Idee löschen?"
msgid "Attention: This will delete the brainstorming with all belonging ideas and other associated records to it. This cant be undone"
msgstr "Achtung: Hiermit löschst du das Brainstorming und alle dazugehörigen Ideen. Diese Aktion kann nicht rückgängig gemacht werden."

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:56
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:58
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:53
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:55
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:16
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:18
#, elixir-autogen, elixir-format
Expand Down Expand Up @@ -95,7 +95,7 @@ msgstr "Export als HTML"
msgid "Got stuck? Try inspirational teasers!"
msgstr "Keine Ideen? Hier gibts Gedankenanstöße!"

#: lib/mindwendel_web/live/idea_live/form_component.ex:104
#: lib/mindwendel_web/live/idea_live/form_component.ex:106
#, elixir-autogen, elixir-format
msgid "Idea created successfully"
msgstr "Idee erstellt"
Expand All @@ -110,7 +110,7 @@ msgstr "Neues Brainstorming"
msgid "New idea"
msgstr "Neue Idee"

#: lib/mindwendel_web/live/lane_live/index_component.html.heex:253
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:250
#, elixir-autogen, elixir-format
msgid "No ideas brainstormed"
msgstr "Bisher keine Ideen vorhanden"
Expand All @@ -120,7 +120,7 @@ msgstr "Bisher keine Ideen vorhanden"
msgid "Proceed to your brainstorming"
msgstr "Weiter zu deinem Brainstorming"

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:61
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:58
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:21
#, elixir-autogen, elixir-format
msgid "Save"
Expand All @@ -131,7 +131,7 @@ msgstr "Speichern"
msgid "Save this link to update / delete your brainstorming later on:"
msgstr "Speichere diesen Link, um das Brainstorming zukünftig zu bearbeiten oder zu löschen"

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:60
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:57
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:20
#, elixir-autogen, elixir-format
msgid "Saving..."
Expand Down Expand Up @@ -195,7 +195,7 @@ msgid "Username"
msgstr "Nutzername"

#: lib/mindwendel_web/controllers/admin/brainstorming_html/export.html.heex:3
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:175
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:172
#, elixir-autogen, elixir-format
msgid "By"
msgstr "Von"
Expand Down Expand Up @@ -414,7 +414,7 @@ msgstr "Name"
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:26
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:28
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:112
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:274
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:271
#, elixir-autogen, elixir-format
msgid "New lane"
msgstr "Neue Spalte"
Expand Down Expand Up @@ -448,7 +448,7 @@ msgstr "Spalte aktualisiert"

#: lib/mindwendel_web/live/lane_live/index_component.html.heex:10
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:13
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:258
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:255
#, elixir-autogen, elixir-format, fuzzy
msgid "Add idea"
msgstr "Neue Idee"
Expand All @@ -458,7 +458,7 @@ msgstr "Neue Idee"
msgid "Default lane"
msgstr "Eine Spalte"

#: lib/mindwendel_web/live/lane_live/index_component.html.heex:269
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:266
#, elixir-autogen, elixir-format
msgid "No lanes available"
msgstr "Keine Spalten vorhanden"
Expand All @@ -473,7 +473,7 @@ msgstr "Idee bearbeiten"
msgid "Delete idea"
msgstr "Löschen"

#: lib/mindwendel_web/live/idea_live/form_component.ex:75
#: lib/mindwendel_web/live/idea_live/form_component.ex:77
#, elixir-autogen, elixir-format, fuzzy
msgid "Idea updated"
msgstr "Idee aktualisiert"
Expand All @@ -488,23 +488,23 @@ msgstr "Erlaubte Dateiformate: JPG/PNG/PDF"
msgid "Additional Attachment"
msgstr "Zusätzlicher Anhang"

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:44
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:166
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:41
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:163
#, elixir-autogen, elixir-format
msgid "No filename"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.ex:143
#: lib/mindwendel_web/live/idea_live/form_component.ex:145
#, elixir-autogen, elixir-format
msgid "File type is not allowed"
msgstr "Dateityp nicht erlaubt"

#: lib/mindwendel_web/live/idea_live/form_component.ex:141
#: lib/mindwendel_web/live/idea_live/form_component.ex:143
#, elixir-autogen, elixir-format
msgid "The selected file is too large"
msgstr "Datei ist zu groß"

#: lib/mindwendel_web/live/idea_live/form_component.ex:142
#: lib/mindwendel_web/live/idea_live/form_component.ex:144
#, elixir-autogen, elixir-format
msgid "Too many files selected"
msgstr "Zu viele Dateien ausgewählt"
32 changes: 16 additions & 16 deletions priv/gettext/default.pot
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ msgstr ""
msgid "Attention: This will delete the brainstorming with all belonging ideas and other associated records to it. This cant be undone"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:56
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:58
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:53
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:55
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:16
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:18
#, elixir-autogen, elixir-format
Expand Down Expand Up @@ -94,7 +94,7 @@ msgstr ""
msgid "Got stuck? Try inspirational teasers!"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.ex:104
#: lib/mindwendel_web/live/idea_live/form_component.ex:106
#, elixir-autogen, elixir-format
msgid "Idea created successfully"
msgstr ""
Expand All @@ -109,7 +109,7 @@ msgstr ""
msgid "New idea"
msgstr ""

#: lib/mindwendel_web/live/lane_live/index_component.html.heex:253
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:250
#, elixir-autogen, elixir-format
msgid "No ideas brainstormed"
msgstr ""
Expand All @@ -119,7 +119,7 @@ msgstr ""
msgid "Proceed to your brainstorming"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:61
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:58
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:21
#, elixir-autogen, elixir-format
msgid "Save"
Expand All @@ -130,7 +130,7 @@ msgstr ""
msgid "Save this link to update / delete your brainstorming later on:"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:60
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:57
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:20
#, elixir-autogen, elixir-format
msgid "Saving..."
Expand Down Expand Up @@ -194,7 +194,7 @@ msgid "Username"
msgstr ""

#: lib/mindwendel_web/controllers/admin/brainstorming_html/export.html.heex:3
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:175
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:172
#, elixir-autogen, elixir-format
msgid "By"
msgstr ""
Expand Down Expand Up @@ -413,7 +413,7 @@ msgstr ""
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:26
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:28
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:112
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:274
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:271
#, elixir-autogen, elixir-format
msgid "New lane"
msgstr ""
Expand Down Expand Up @@ -447,7 +447,7 @@ msgstr ""

#: lib/mindwendel_web/live/lane_live/index_component.html.heex:10
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:13
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:258
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:255
#, elixir-autogen, elixir-format
msgid "Add idea"
msgstr ""
Expand All @@ -457,7 +457,7 @@ msgstr ""
msgid "Default lane"
msgstr ""

#: lib/mindwendel_web/live/lane_live/index_component.html.heex:269
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:266
#, elixir-autogen, elixir-format
msgid "No lanes available"
msgstr ""
Expand All @@ -472,7 +472,7 @@ msgstr ""
msgid "Delete idea"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.ex:75
#: lib/mindwendel_web/live/idea_live/form_component.ex:77
#, elixir-autogen, elixir-format
msgid "Idea updated"
msgstr ""
Expand All @@ -487,23 +487,23 @@ msgstr ""
msgid "Additional Attachment"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:44
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:166
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:41
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:163
#, elixir-autogen, elixir-format
msgid "No filename"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.ex:143
#: lib/mindwendel_web/live/idea_live/form_component.ex:145
#, elixir-autogen, elixir-format
msgid "File type is not allowed"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.ex:141
#: lib/mindwendel_web/live/idea_live/form_component.ex:143
#, elixir-autogen, elixir-format
msgid "The selected file is too large"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.ex:142
#: lib/mindwendel_web/live/idea_live/form_component.ex:144
#, elixir-autogen, elixir-format
msgid "Too many files selected"
msgstr ""
32 changes: 16 additions & 16 deletions priv/gettext/en/LC_MESSAGES/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ msgstr ""
msgid "Attention: This will delete the brainstorming with all belonging ideas and other associated records to it. This cant be undone"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:56
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:58
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:53
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:55
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:16
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:18
#, elixir-autogen, elixir-format
Expand Down Expand Up @@ -95,7 +95,7 @@ msgstr ""
msgid "Got stuck? Try inspirational teasers!"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.ex:104
#: lib/mindwendel_web/live/idea_live/form_component.ex:106
#, elixir-autogen, elixir-format
msgid "Idea created successfully"
msgstr ""
Expand All @@ -110,7 +110,7 @@ msgstr ""
msgid "New idea"
msgstr ""

#: lib/mindwendel_web/live/lane_live/index_component.html.heex:253
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:250
#, elixir-autogen, elixir-format
msgid "No ideas brainstormed"
msgstr ""
Expand All @@ -120,7 +120,7 @@ msgstr ""
msgid "Proceed to your brainstorming"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:61
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:58
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:21
#, elixir-autogen, elixir-format
msgid "Save"
Expand All @@ -131,7 +131,7 @@ msgstr ""
msgid "Save this link to update / delete your brainstorming later on:"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:60
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:57
#: lib/mindwendel_web/live/lane_live/form_component.html.heex:20
#, elixir-autogen, elixir-format
msgid "Saving..."
Expand Down Expand Up @@ -195,7 +195,7 @@ msgid "Username"
msgstr ""

#: lib/mindwendel_web/controllers/admin/brainstorming_html/export.html.heex:3
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:175
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:172
#, elixir-autogen, elixir-format
msgid "By"
msgstr ""
Expand Down Expand Up @@ -414,7 +414,7 @@ msgstr ""
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:26
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:28
#: lib/mindwendel_web/live/brainstorming_live/show.html.heex:112
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:274
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:271
#, elixir-autogen, elixir-format
msgid "New lane"
msgstr ""
Expand Down Expand Up @@ -448,7 +448,7 @@ msgstr ""

#: lib/mindwendel_web/live/lane_live/index_component.html.heex:10
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:13
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:258
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:255
#, elixir-autogen, elixir-format, fuzzy
msgid "Add idea"
msgstr ""
Expand All @@ -458,7 +458,7 @@ msgstr ""
msgid "Default lane"
msgstr ""

#: lib/mindwendel_web/live/lane_live/index_component.html.heex:269
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:266
#, elixir-autogen, elixir-format
msgid "No lanes available"
msgstr ""
Expand All @@ -473,7 +473,7 @@ msgstr ""
msgid "Delete idea"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.ex:75
#: lib/mindwendel_web/live/idea_live/form_component.ex:77
#, elixir-autogen, elixir-format, fuzzy
msgid "Idea updated"
msgstr ""
Expand All @@ -488,23 +488,23 @@ msgstr ""
msgid "Additional Attachment"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.html.heex:44
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:166
#: lib/mindwendel_web/live/idea_live/form_component.html.heex:41
#: lib/mindwendel_web/live/lane_live/index_component.html.heex:163
#, elixir-autogen, elixir-format
msgid "No filename"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.ex:143
#: lib/mindwendel_web/live/idea_live/form_component.ex:145
#, elixir-autogen, elixir-format
msgid "File type is not allowed"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.ex:141
#: lib/mindwendel_web/live/idea_live/form_component.ex:143
#, elixir-autogen, elixir-format
msgid "The selected file is too large"
msgstr ""

#: lib/mindwendel_web/live/idea_live/form_component.ex:142
#: lib/mindwendel_web/live/idea_live/form_component.ex:144
#, elixir-autogen, elixir-format
msgid "Too many files selected"
msgstr ""

0 comments on commit 7b58500

Please sign in to comment.