Mailinglist Archive: yast-commit (1809 mails)

< Previous Next >
[yast-commit] <web-client> network : retrieve the bug reporting url from the vendor settings. Need to clarify
  • From: Duncan Mac-Vicar P <dmacvicar@xxxxxxx>
  • Date: Mon, 31 Aug 2009 00:51:14 +0200
  • Message-id: <E1MjDJW-0001GH-9j@xxxxxxxxxxxxxxxx>
ref: refs/heads/network
commit 2c05a540a1332772a821d6ab4d2d84f9f724962c
Author: Duncan Mac-Vicar P <dmacvicar@xxxxxxx>
Date: Mon Aug 31 00:51:14 2009 +0200

retrieve the bug reporting url from the vendor settings. Need to clarify
what to do as default.

Also, get rid of the bubble and use standard jquery.ui dialog
---
.../app/controllers/application_controller.rb | 14 ++++++++++++
.../app/views/shared/_exception_trap.html.erb | 22 ++++++++++++-------
webclient/app/views/shared/exception_trap.html.erb | 2 +-
3 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/webclient/app/controllers/application_controller.rb
b/webclient/app/controllers/application_controller.rb
index 6197576..d66d802 100644
--- a/webclient/app/controllers/application_controller.rb
+++ b/webclient/app/controllers/application_controller.rb
@@ -1,5 +1,6 @@
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
+require 'open-uri'

class ApplicationController < ActionController::Base
layout 'main'
@@ -23,6 +24,19 @@ class ApplicationController < ActionController::Base

def exception_trap(e)
logger.error "***" + e.to_s
+
+ # get the vendor settings
+ begin
+ settings_url =
YaST::ServiceResource::Session.site.merge("/vendor_settings/bugzilla_url.json")
+ @bug_url = ActiveSupport::JSON.decode(open(settings_url).read)
+ rescue Exception => e
+ @bug_url =
"https://bugzilla.novell.com/enter_bug.cgi?classification=7340&product=openSUSE+11.2&submit=Use+This+Product&component=WebYaST&format=guided";
+ # there was a problem or the setting does not exist
+ # Here we should handle this always as an error
+ # the service should return a sane default if the
+ # url is not configured
+ logger.warn "Can't get vendor bug reporting url, Using Novell"
+ end

# for ajax request render a different template, much less verbose
if request.xhr?
diff --git a/webclient/app/views/shared/_exception_trap.html.erb
b/webclient/app/views/shared/_exception_trap.html.erb
index 3e53577..be67075 100644
--- a/webclient/app/views/shared/_exception_trap.html.erb
+++ b/webclient/app/views/shared/_exception_trap.html.erb
@@ -5,19 +5,25 @@
$(document).ready(
function() {
$('#error-<%= error_id %>-balloon-content').hide();
- $('#error-<%= error_id %>-details-link').click(
- $('#error-<%= error_id %>-details-link').bt({
- contentSelector: "$('#error-<%= error_id %>-balloon-content').html()",
- trigger: 'click',
- positions: ['left', 'right', 'bottom']
- }));
- $('#error-<%= error_id %>-show-backtrace-link').click(function() {
$('#error-<%= error_id %>-backtrace').hide();$(this).next().show();return
false; });
+ $('#error-<%= error_id %>-balloon-content').dialog(
+ {
+ bgiframe: true,
+ autoOpen: false,
+ height: 300,
+ modal: true
+ });
+
+ $('#error-<%= error_id %>-details-link').click( function() {
+ $('#error-<%= error_id %>-balloon-content').dialog('open');
+ });
+ $('#error-<%= error_id %>-show-backtrace-link').click(function() {
$('#error-<%= error_id %>-backtrace').hide();$('#error-<%= error_id
%>-backtrace').show();return false; });
});
+
</script>

<div id="error-<%= error_id %>-balloon-content">
<p><strong>Error message:</strong>: <%= error.message %></p>
- <p><a
href="https://bugzilla.novell.com/enter_bug.cgi?classification=7340&product=openSUSE+11.2&submit=Use+This+Product&component=WebYaST&format=guided";>Report
bug</a></p>
+ <p><a href="<%= @bug_url %>">Report bug</a></p>
<p><a href="#" id="error-<%= error_id %>-show-backtrace-link">Show
details</a>
<pre id="error-<%= error_id %>-backtrace" style="display: none"><%=
(error.nil? || error.backtrace.nil? || error.backtrace.blank?) ? "No
information available" : error.backtrace.join("\n") %></pre>
</div>
diff --git a/webclient/app/views/shared/exception_trap.html.erb
b/webclient/app/views/shared/exception_trap.html.erb
index cb673fd..e79d7ee 100644
--- a/webclient/app/views/shared/exception_trap.html.erb
+++ b/webclient/app/views/shared/exception_trap.html.erb
@@ -13,7 +13,7 @@ $(document).ready(function() {

<p><pre><%= h error.to_s %></pre></p>

-<p>Please <a
href="https://bugzilla.novell.com/enter_bug.cgi?classification=7340&product=openSUSE+11.2&submit=Use+This+Product&component=WebYaST&format=guided";>Report
a bug so we can fix the problem!.</a> Don't forget to include the bug
details.</p>
+<p>Please <a href="<%= @bug_url %>">Report a bug so we can fix the
problem!.</a> Don't forget to include the bug details.</p>

<a href="#" id="details-link">Show details...</a>

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages