public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH widget-toolkit] ui: repo status: Simplify logic for adding warnings
@ 2023-12-07 13:11 Maximiliano Sandoval
  2024-02-19 12:46 ` Fiona Ebner
  0 siblings, 1 reply; 2+ messages in thread
From: Maximiliano Sandoval @ 2023-12-07 13:11 UTC (permalink / raw)
  To: pve-devel

The strings were hard to translate and required some tricks like passing
'Ceph ' as an argument. The `/main` part was also removed to simplify
the flow and UX.

Suggested-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 src/node/APTRepositories.js | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/node/APTRepositories.js b/src/node/APTRepositories.js
index 4e74da2..9dfd588 100644
--- a/src/node/APTRepositories.js
+++ b/src/node/APTRepositories.js
@@ -489,33 +489,31 @@ Ext.define('Proxmox.node.APTRepositories', {
 		addWarn(gettext('Detected mixed suites before upgrade'));
 	    }
 
-	    let productionReadyCheck = (repos, type, noSubAlternateName) => {
+	    let productionReadyCheck = (repos, name) => {
 		if (!activeSubscription && repos.enterprise) {
 		    addWarn(Ext.String.format(
-			gettext('The {0}enterprise repository is enabled, but there is no active subscription!'),
-			type,
+			gettext('The {0} enterprise repository is enabled, but there is no active subscription!'),
+			name,
 		    ));
 		}
 
 		if (repos.nosubscription) {
 		    addWarn(Ext.String.format(
-			gettext('The {0}no-subscription{1} repository is not recommended for production use!'),
-			type,
-			noSubAlternateName,
+			gettext('The {0} no-subscription repository is not recommended for production use!'),
+			name,
 		    ));
 		}
 
 		if (repos.test) {
 		    addWarn(Ext.String.format(
-			gettext('The {0}test repository may pull in unstable updates and is not recommended for production use!'),
-			type,
+			gettext('The {0} test repository may pull in unstable updates and is not recommended for production use!'),
+			name,
 		    ));
 		}
 	    };
 
-	    productionReadyCheck({ enterprise, nosubscription, test }, '', '');
-	    // TODO drop alternate 'main' name when no longer relevant
-	    productionReadyCheck(cephRepos, 'Ceph ', '/main');
+	    productionReadyCheck({ enterprise, nosubscription, test }, vm.get('product'));
+	    productionReadyCheck(cephRepos, 'Ceph');
 
 	    if (errors.length > 0) {
 		text = gettext('Fatal parsing error for at least one repository');
-- 
2.39.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-19 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-07 13:11 [pve-devel] [PATCH widget-toolkit] ui: repo status: Simplify logic for adding warnings Maximiliano Sandoval
2024-02-19 12:46 ` Fiona Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal