From 2c887e5de3ee75fd7f397b87e9c7f919c5713afc Mon Sep 17 00:00:00 2001 From: ahmed-mgd Date: Thu, 12 Dec 2024 16:23:07 -0500 Subject: [PATCH 1/5] Add system apps caption translation --- apps/dashboard/config/locales/en.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/config/locales/en.yml b/apps/dashboard/config/locales/en.yml index d1ade2a84..5e37ebd24 100644 --- a/apps/dashboard/config/locales/en.yml +++ b/apps/dashboard/config/locales/en.yml @@ -84,7 +84,8 @@ en:
%{exception_message}

Stack trace:

%{exception_trace}
- apps_system_apps_title: "System Apps" + apps_system_apps_title: "System Apps" # Not used anywhere + system_apps_caption: "System Installed App" shell_app_title: "%{cluster_title} Shell Access" From 99bf2d9ac8b7b23ede0680704492193d63ea1369 Mon Sep 17 00:00:00 2001 From: ahmed-mgd Date: Thu, 12 Dec 2024 16:37:06 -0500 Subject: [PATCH 2/5] Use I18n for caption --- apps/dashboard/app/apps/sys_router.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/app/apps/sys_router.rb b/apps/dashboard/app/apps/sys_router.rb index 9a4457d35..93abe5939 100644 --- a/apps/dashboard/app/apps/sys_router.rb +++ b/apps/dashboard/app/apps/sys_router.rb @@ -42,7 +42,7 @@ def owner end def caption - "System Installed App" + I18n.t('dashboard.system_apps_caption') end def category From cb0b4fd25f8a7a541694c44edd0101a16f3bf332 Mon Sep 17 00:00:00 2001 From: ahmed-mgd Date: Thu, 12 Dec 2024 16:43:57 -0500 Subject: [PATCH 3/5] Refactor caption and category instance variables into methods --- apps/dashboard/app/apps/dev_router.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/dashboard/app/apps/dev_router.rb b/apps/dashboard/app/apps/dev_router.rb index 4eb88f443..477eca9b8 100644 --- a/apps/dashboard/app/apps/dev_router.rb +++ b/apps/dashboard/app/apps/dev_router.rb @@ -1,12 +1,10 @@ # The router class for all development apps. class DevRouter - attr_reader :name, :owner, :caption, :category + attr_reader :name, :owner def initialize(name, owner=OodSupport::Process.user.name) @name = name.to_s @owner = owner - @caption = I18n.t('dashboard.development_apps_caption') - @category = "Sandbox Apps" end # Get array of apps for specified owner @@ -38,6 +36,14 @@ def type :dev end + def caption + I18n.t('dashboard.development_apps_caption') + end + + def category + "Sandbox Apps" + end + def url "/pun/dev/#{name}" end From a39a5dde801e5ab94488a00709ef32309ebf6689 Mon Sep 17 00:00:00 2001 From: ahmed-mgd Date: Mon, 16 Dec 2024 17:43:05 -0500 Subject: [PATCH 4/5] Restore dev_router.rb --- apps/dashboard/app/apps/dev_router.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/apps/dashboard/app/apps/dev_router.rb b/apps/dashboard/app/apps/dev_router.rb index 477eca9b8..4eb88f443 100644 --- a/apps/dashboard/app/apps/dev_router.rb +++ b/apps/dashboard/app/apps/dev_router.rb @@ -1,10 +1,12 @@ # The router class for all development apps. class DevRouter - attr_reader :name, :owner + attr_reader :name, :owner, :caption, :category def initialize(name, owner=OodSupport::Process.user.name) @name = name.to_s @owner = owner + @caption = I18n.t('dashboard.development_apps_caption') + @category = "Sandbox Apps" end # Get array of apps for specified owner @@ -36,14 +38,6 @@ def type :dev end - def caption - I18n.t('dashboard.development_apps_caption') - end - - def category - "Sandbox Apps" - end - def url "/pun/dev/#{name}" end From 0a9127b647c9731d4eb87901311924e8eadd62ad Mon Sep 17 00:00:00 2001 From: ahmed-mgd Date: Mon, 16 Dec 2024 17:57:05 -0500 Subject: [PATCH 5/5] Refactor sys_router.rb to match dev_router.rb --- apps/dashboard/app/apps/sys_router.rb | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/apps/dashboard/app/apps/sys_router.rb b/apps/dashboard/app/apps/sys_router.rb index 93abe5939..08fcbf256 100644 --- a/apps/dashboard/app/apps/sys_router.rb +++ b/apps/dashboard/app/apps/sys_router.rb @@ -1,6 +1,6 @@ # The router class for all system apps. class SysRouter - attr_reader :name + attr_reader :name, :owner, :caption, :category #TODO: consider making SysRouter a subclass of # OodAppkit::Url @@ -23,6 +23,9 @@ def self.apps def initialize(name) @name = name.to_s + @owner = :sys + @caption = I18n.t('dashboard.system_apps_caption') + @category = "" end def token @@ -37,18 +40,6 @@ def type :sys end - def owner - :sys - end - - def caption - I18n.t('dashboard.system_apps_caption') - end - - def category - "" - end - def url "/pun/sys/#{name}" end