From 83a2657bd1500bcb78033b9e9191d0ad0e03fd04 Mon Sep 17 00:00:00 2001 From: Giga Chubinidze Date: Fri, 12 Jan 2024 03:10:11 +0400 Subject: [PATCH] Improvements of the SciNote Edit option in "Add-ons" [SCI-9962][SCI9760] --- .../packs/vue/scinote_edit_download.js | 9 ++ .../vue/shared/scinote_edit_download.vue | 100 ++++++++++++++++++ .../settings/account/addons/index.html.erb | 70 ++++-------- config/initializers/extends.rb | 2 + config/locales/en.yml | 6 +- config/webpack/webpack.config.js | 1 + 6 files changed, 133 insertions(+), 55 deletions(-) create mode 100644 app/javascript/packs/vue/scinote_edit_download.js create mode 100644 app/javascript/vue/shared/scinote_edit_download.vue diff --git a/app/javascript/packs/vue/scinote_edit_download.js b/app/javascript/packs/vue/scinote_edit_download.js new file mode 100644 index 000000000..ad7eabd15 --- /dev/null +++ b/app/javascript/packs/vue/scinote_edit_download.js @@ -0,0 +1,9 @@ +import { createApp } from 'vue/dist/vue.esm-bundler.js'; +import ScinoteEditDownload from '../../vue/shared/scinote_edit_download.vue'; +import { mountWithTurbolinks } from './helpers/turbolinks.js'; + + +const app = createApp({}); +app.component('ScinoteEditDownload', ScinoteEditDownload); +app.config.globalProperties.i18n = window.I18n; +mountWithTurbolinks(app, '#scinoteEditDownload'); diff --git a/app/javascript/vue/shared/scinote_edit_download.vue b/app/javascript/vue/shared/scinote_edit_download.vue new file mode 100644 index 000000000..f1f7f5d40 --- /dev/null +++ b/app/javascript/vue/shared/scinote_edit_download.vue @@ -0,0 +1,100 @@ + + + \ No newline at end of file diff --git a/app/views/users/settings/account/addons/index.html.erb b/app/views/users/settings/account/addons/index.html.erb index 68f58a22a..9871106d8 100644 --- a/app/views/users/settings/account/addons/index.html.erb +++ b/app/views/users/settings/account/addons/index.html.erb @@ -7,58 +7,6 @@

<%= t('users.settings.account.addons.title') %>

-
-
-
-
-

<%= t('users.settings.account.addons.desktop_app.title') %>

-

- <%= t('users.settings.account.addons..desktop_app.description') %> -


-
- <% if @user_agent =~ /Windows/ %> - <%= link_to '#', - class: 'btn btn-primary new-project-btn', - title: t('users.settings.account.addons.desktop_app.windows_button'), - remote: true do %> - - <% end %> -

<%= t('users.settings.account.addons.desktop_app.version') %> 5.16.5 (24419)

- <% elsif @user_agent =~ /Mac OS/ %> - <%= link_to '#', - class: 'btn btn-primary new-project-btn', - title: t('users.settings.account.addons.desktop_app.macos_button'), - remote: true do %> - - <% end %> -

<%= t('users.settings.account.addons.desktop_app.version') %> 5.16.5 (24419)

- <% else %> -
-
- <%= link_to '#', - class: 'btn btn-primary new-project-btn', - title: t('users.settings.account.addons.desktop_app.macos_button'), - remote: true do %> - - <% end %> -

<%= t('users.settings.account.addons.desktop_app.version') %> 5.16.5 (24419)

-
-
- <%= link_to '#', - class: 'btn btn-primary new-project-btn ml-2', - title: t('users.settings.account.addons.desktop_app.windows_button'), - remote: true do %> - - <% end %> -

<%= t('users.settings.account.addons.desktop_app.version') %> 5.16.5 (24419)

-
-
- <% end %> -
-
-
-
-

<%= t('users.settings.account.addons.scinote_addons') %>

@@ -68,6 +16,22 @@
+
+
+
+
+
+

<%= t('users.settings.account.addons.desktop_app.title') %>

+

+ <%= t('users.settings.account.addons.desktop_app.description') %> +


+
+ +
+
+
+
+

<%= t('users.settings.account.addons.label_printers') %>

@@ -117,3 +81,5 @@
+ +<%= javascript_include_tag "vue_scinote_edit_download", nonce: true %> diff --git a/config/initializers/extends.rb b/config/initializers/extends.rb index 3247672cb..5924070a9 100644 --- a/config/initializers/extends.rb +++ b/config/initializers/extends.rb @@ -605,6 +605,8 @@ class Extends *.nr-data.net www.recaptcha.net/ www.gstatic.com/recaptcha/ + extras.scinote.net + https://www.scinote.net ) if Constants::ASSET_SYNC_URL && EXTERNAL_SERVICES.exclude?(Constants::ASSET_SYNC_URL) diff --git a/config/locales/en.yml b/config/locales/en.yml index e6eb5ee3e..f4e26e0f7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2754,11 +2754,11 @@ en: description: 'Print labels of custom styles and sizes in seconds flat from your PC or Mac via your Zebra printer connected via USB, Internet or LAN.' details: 'Details' desktop_app: - title: 'SciNote File Editor desktop app' - description: 'Download the SciNote File Editor desktop app to automatically edit files using locally installed software' + title: 'SciNote Edit' + description: 'Download the SciNote Edit desktop app to automatically edit files using locally installed software.' macos_button: 'Download for macOS' windows_button: 'Download for Windows' - version: 'Version' + version: 'Version %{version}' label_printer: fluics_printer: "FLUICS Print: Label printers" zebra_printer: 'Zebra label printers' diff --git a/config/webpack/webpack.config.js b/config/webpack/webpack.config.js index 12a4d9e76..42ccf40be 100644 --- a/config/webpack/webpack.config.js +++ b/config/webpack/webpack.config.js @@ -47,6 +47,7 @@ const entryList = { vue_user_preferences: './app/javascript/packs/vue/user_preferences.js', vue_components_manage_stock_value_modal: './app/javascript/packs/vue/manage_stock_value_modal.js', vue_legacy_datetime_picker: './app/javascript/packs/vue/legacy/datetime_picker.js', + vue_scinote_edit_download: './app/javascript/packs/vue/scinote_edit_download.js' } // Engine pack loading based on https://github.com/rails/webpacker/issues/348#issuecomment-635480949