public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit] ui: repo status: Simplify logic for adding warnings
Date: Thu,  7 Dec 2023 14:11:46 +0100	[thread overview]
Message-ID: <20231207131146.274773-1-m.sandoval@proxmox.com> (raw)

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





             reply	other threads:[~2023-12-07 13:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 13:11 Maximiliano Sandoval [this message]
2024-02-19 12:46 ` Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231207131146.274773-1-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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