From dc65e20659abbb96f502b4d414a11dedde047916 Mon Sep 17 00:00:00 2001 From: Mariam A Date: Thu, 9 May 2024 09:34:19 -0400 Subject: [PATCH] LTI-341: show default error msg if translation is missing (#304) * LTI-341: show default error msg if translation is missing * replace tab indentation with 2 spaces --------- Co-authored-by: Jesus Federico <168567934+jfedericobn@users.noreply.github.com> --- app/assets/images/favicon.ico | Bin 0 -> 2587 bytes app/controllers/rooms_controller.rb | 7 ++- app/javascript/stylesheets/application.scss | 1 + app/javascript/stylesheets/errors.scss | 9 ++++ app/views/layouts/application.html.erb | 1 + app/views/shared/_error.html.erb | 51 ++++++++++---------- config/locales/en.yml | 8 +++ 7 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 app/assets/images/favicon.ico diff --git a/app/assets/images/favicon.ico b/app/assets/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..737b8540813842b060a2531b47135e82813bca0c GIT binary patch literal 2587 zcmaJ@c|4SB8y-uRXt8E6yp8f9jG3{F$#RUDK^ep-l8!O+8WXcL^J<1DOA*p3l?avg zj>t|W+Y~vnR!D^Q(`FFbPR>l*_x(}d`+MK_d7k@sU)O!z%O6j=pO43)h58F&FxVn5 zPolqc1!SL!lJqZ#i+d|w;1DSY3gAXSLK+{0xiPrmAmGKOF+qQj#)#e84m!bL3M*LD zASj69ji+8V%UnTcd65?CsH(0LBK5LD@)Odn>dp-p(G6aR9zONNF@aBLeSF zB!7z~Jvk#IA&7@Zp@c%AwGeB~iX$-j&OihObUup* zvA7&S#z+h2#z4+UsnV}0uz5ddIf8Fxk`@dlqVZ5@Ya3Zg-yJEG|L@9X|L_(-{@{Q0 z{*+iijpczTe^9`U;nSs!i!hOe;^E!-APwU3sa$UK_bU2Dav`oDlFI|!1MC4a3XRU< z$PDIR5EKgDiz9$&96IPlbVf=!tXV7u-pvk2aI?kP+S_96&}b6Y(Sc+~w!vaa4vy|* z0?GC}mdK^Yut5&=9m|kn365wij)=ubv2H)b%7%f>lSU?jeAYIQLFRM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Fg@Ro=TTE>^t%$Z`8`{lMdMi1D9r8PP0~(3SO~+OwX$C%@ zD6q8IGT0T-wpd3)Y`siVY~kX>yF6@Dr1(D7W6jvbKP}j{Yg~AF?FW3UE}@-a1Ej@G zny;=%o~OLOb)eegRlEMXf;Fa_T1@i`{`hli4vM$Vo9NbzU#isI&3f_-a#y&>6#}J0 zY7A1LLezlmZuKY2;l41;IWr(5aWQCy*q zI1e?dGvYh5hlm6^__5CR_KQj8FGCU+bfxtjy09!buk6f;?T9Vxj>|VRadK&0@5Kij zlMO0V3PJT?>RP>mR*w|sfdpziBL^{D&D=c|-Z9km9P4J|LiYckW$8uj(iIyrkM-?~83EI7 zmje;K!&CB1F-C2EpRafWGmZ9mTN2U*7IAWFfVT5qb!pZo9_(J@#>$mqqq2l|FJjUw z9%XM0HK~u(y@0FIrKJT{MTK@{nf2A@T#N|FfTKUR-RvA%b4y`PtVS3Qj6nDkvdAX{ zl+4T#-L~55{Js}8hE^Jlv5#t~F8ln9n1Qc!>6GIP%wmHL4wpp?#m{3k^&i3scQfMZ zCMQ*U+Ye2N(hFTTv~(!Xjha`;vpW~{91TsfI#c^8)2pNyKEpeB@OIy|?UhK98gK=^ z#`4hUKhNs)Z?xJiu*x!bkj&2Sv*n~4dzvg?``$%j}<2uuDKD4;&G literal 0 HcmV?d00001 diff --git a/app/controllers/rooms_controller.rb b/app/controllers/rooms_controller.rb index e7e43f89..dc336191 100644 --- a/app/controllers/rooms_controller.rb +++ b/app/controllers/rooms_controller.rb @@ -257,7 +257,12 @@ def individual_recording def set_error(error, status, domain = 'room') @room = @user = nil - @error = { key: t("error.#{domain}.#{error}.code"), message: t("error.#{domain}.#{error}.message"), suggestion: t("error.#{domain}.#{error}.suggestion"), status: status } + @error = { + key: t("error.#{domain}.#{error}.code", default: t("error.#{domain}.default.code")), + message: t("error.#{domain}.#{error}.message", default: t("error.#{domain}.default.message")), + suggestion: t("error.#{domain}.#{error}.suggestion", default: t("error.#{domain}.default.suggestion")), + status: status, + } end def authenticate_user! diff --git a/app/javascript/stylesheets/application.scss b/app/javascript/stylesheets/application.scss index 58eb7266..1fa1f5ce 100644 --- a/app/javascript/stylesheets/application.scss +++ b/app/javascript/stylesheets/application.scss @@ -17,6 +17,7 @@ */ @import 'rooms'; +@import 'errors'; @import "tailwindcss/base"; @import "tailwindcss/components"; @import "tailwindcss/utilities"; diff --git a/app/javascript/stylesheets/errors.scss b/app/javascript/stylesheets/errors.scss index 4a4328cf..1c4a148c 100644 --- a/app/javascript/stylesheets/errors.scss +++ b/app/javascript/stylesheets/errors.scss @@ -19,3 +19,12 @@ // Place all the styles related to the errors controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ + +.error-code { + font-size: 8rem; + color: #263f88; +} + +.error-message { +font-size: 2rem; +} diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1d3cab86..ad23102c 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -23,6 +23,7 @@ <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> + <%= favicon_link_tag asset_path('favicon.ico') %> . %> - - - -
-

- <%= code %>
-

-
- <%= message %><%= message %> -
-
- <% if suggestion %> - <%= suggestion %> - <% end %> -
-
\ No newline at end of file +
+
+
+ +
+
+
+
+
+ <% if code %> +

+ <%= code %>
+

+ <% end %> +
+ <%= message %><%= message %> +
+
+ <% if suggestion %> + <%= suggestion %> + <% end %> +
+
+
+
+
diff --git a/config/locales/en.yml b/config/locales/en.yml index 7af258de..349a8033 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -182,6 +182,10 @@ en: message: "Unreachable resource" suggestion: "It seems that you are trying to access this resource using an LTI endpoint that is no longer supported. Try updating the endpoint o credentials for the external tool" bigbluebutton: + default: + code: "BigBlueButton error" + message: "BigBlueButton encountered an error" + suggestion: "Please try again later or contact technical support if the issue persists" invalidrequest: code: "BBBAPICallInvalid" message: "BBB API call invalid" @@ -191,6 +195,10 @@ en: message: "Connection error. Your URL is probably incorrect" suggestion: "Make sure that the BBB credentials are configured correctly" room: + default: + code: "Error" + message: "An unexpected error occured" + suggestion: "Please try again later or contact technical support if the issue persists" forbidden: code: "AccessForbidden" message: "The session has expired"