From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A834BB9084 for ; Thu, 7 Dec 2023 14:12:18 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 822ECFAF8 for ; Thu, 7 Dec 2023 14:11:48 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 7 Dec 2023 14:11:47 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id ACB814346A for ; Thu, 7 Dec 2023 14:11:47 +0100 (CET) From: Maximiliano Sandoval To: pve-devel@lists.proxmox.com Date: Thu, 7 Dec 2023 14:11:46 +0100 Message-Id: <20231207131146.274773-1-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.002 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH widget-toolkit] ui: repo status: Simplify logic for adding warnings X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Dec 2023 13:12:18 -0000 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 Signed-off-by: Maximiliano Sandoval --- 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