Skip to content

Commit

Permalink
Extend success message after enabling monitoring
Browse files Browse the repository at this point in the history
The message hinting the user to open the required ports and pointing to
the documentation was added.

Signed-off-by: Witek Bedyk <witold.bedyk@suse.com>
  • Loading branch information
witekest committed Aug 2, 2023
1 parent 48225fd commit 02fee60
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import com.suse.manager.maintenance.MaintenanceManager;
import com.suse.manager.model.maintenance.MaintenanceSchedule;
import com.suse.manager.webui.services.pillar.MinionPillarManager;
import com.suse.manager.webui.utils.UserPreferenceUtils;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -296,9 +297,10 @@ private boolean applyAddonEntitlementChanges(HttpServletRequest request,

log.debug("adding entitlement success msg");
if (ConfigDefaults.get().isDocAvailable()) {
createSuccessMessage(request,
createMessage(request,
"system.entitle.added." + e.getLabel(),
s.getId().toString());
s.getId().toString(),
GlobalInstanceHolder.USER_PREFERENCE_UTILS.getDocsLocale(user));
}
else {
createSuccessMessage(request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9061,7 +9061,7 @@ Alternatively, you will want to download &lt;strong&gt;Incremental Channel Conte
</context-group>
</trans-unit>
<trans-unit id="system.entitle.added.monitoring_entitled" xml:space="preserve">
<source>&lt;strong&gt;Monitoring&lt;/strong&gt; type has been applied.&lt;br/&gt;&lt;strong&gt;Note:&lt;/strong&gt; Since you added the Monitoring system type we automatically assigned the Prometheus Exporters formula to the system. Please apply the &lt;a href="/rhn/manager/systems/details/highstate?sid={0}"&gt;Highstate&lt;/a&gt; in order to install and enable the Prometheus metrics exporters.</source>
<source>&lt;strong&gt;Monitoring&lt;/strong&gt; type has been applied.&lt;br/&gt;&lt;strong&gt;Note:&lt;/strong&gt; Since you added the Monitoring system type we automatically assigned the Prometheus Exporters formula to the system. Please apply the &lt;a href="/rhn/manager/systems/details/highstate?sid={0}"&gt;Highstate&lt;/a&gt; in order to install and enable the Prometheus metrics exporters.&lt;br/&gt;&lt;strong&gt;Note:&lt;/strong&gt; Please make sure to open the &lt;a href="/docs/{1}/installation-and-upgrade/ports.html#_external_client_ports">required network ports&lt;/a&gt; for all installed exporters.</source>
<context-group name="ctx">
<context context-type="sourcefile">/rhn/systems/details/Overview.do</context>
</context-group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ public String getDocsLocale(PageContext pageContext) {
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
User user = new RequestContext(request).getCurrentUser();

return getDocsLocale(user);
}

/**
* Get the user's configured documentation locale. If no user is available return the config default
*
* @param user the current user
* @return the users documentation locale
*/
public String getDocsLocale(User user) {
if (isUserAuthenticated(user)) {
String locale = user.getPreferredDocsLocale();
if (locale != null) {
Expand Down
1 change: 1 addition & 0 deletions java/spacewalk-java.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Extend success message after adding monitoring property (bsc#1212168)
- show error message in action result even on parser error
- cache debian package metadata snippets in DB
- Fixed a bug that caused the tab Autoinstallation to hide when clicking on Power
Expand Down

0 comments on commit 02fee60

Please sign in to comment.