Page MenuHomeGRNET

No OneTemporary

File Metadata

Created
Sun, Aug 10, 7:03 AM
diff --git a/app/views/application/_jira.html.erb b/app/views/application/_jira.html.erb
new file mode 100644
index 0000000..a72055c
--- /dev/null
+++ b/app/views/application/_jira.html.erb
@@ -0,0 +1,21 @@
+<% if current_user && Archiving.settings[:jira_src] %>
+ <script type="text/javascript" src="<%= Archiving.settings[:jira_src] %>"></script>
+ <script type="text/javascript">
+ $(function(){
+ window.ATL_JQ_PAGE_PROPS = $.extend(window.ATL_JQ_PAGE_PROPS, {
+
+ // ==== custom trigger function ====
+ triggerFunction : function( showCollectorDialog ) {
+ $('#atlwdg-trigger').on( 'click', function(e) {
+ e.preventDefault();
+ showCollectorDialog();
+ });
+ },
+ // ==== we add the code below to set the field values ====
+ fieldValues: {
+ '<%= Rails.application.secrets.jira_custom_field_name %>':'<%= Rails.application.secrets.jira_custom_field_value %>',
+ }
+ });
+ });
+ </script>
+<% end %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 0097ed5..dfdfdc6 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -1,35 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Archiving</title>
<%= stylesheet_link_tag 'application', media: 'all' %>
<!--[if lt IE 9]>
<%= javascript_include_tag 'html5shiv.min' %>
<![endif]-->
<%= javascript_include_tag 'application' %>
<%= csrf_meta_tags %>
</head>
<body>
<%= render "shared/nav" %>
<div class="container-fluid main-container">
<div class="row">
<div class="col-xs-12">
<%= flash_messages %>
<%= yield %>
-
- <% if current_user %>
- <script type="text/javascript"
- src="https://tts.grnet.gr/jira/s/0d8377abaee87897fb536fce0d7ee820-T/en_US-xvtzbt/6346/19/1.4.16/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=en-US&collectorId=7e9ca8be">
- </script>
- <% end %>
</div> <!-- /layout-col -->
</div> <!-- /layout-row -->
</div> <!-- /container -->
<%= render 'shared/footer' %>
+ <%= render 'jira' %>
</body>
</html>
diff --git a/config/initializers/00_settings.rb b/config/initializers/00_settings.rb
index 775871e..a93ef02 100644
--- a/config/initializers/00_settings.rb
+++ b/config/initializers/00_settings.rb
@@ -1,17 +1,25 @@
bacula_yml = YAML.load_file(Rails.root.join('config', 'bacula.yml'))[Rails.env].symbolize_keys
Archiving.settings director_name: bacula_yml[:director]
Archiving.settings default_pool: bacula_yml[:pool]
Archiving.settings quota_checker: bacula_yml[:quota_checker]
Archiving.settings vima_oauth_enabled: true
Archiving.settings institutional_authentication_enabled: true
Archiving.settings okeanos_authentication_enabled: false
Archiving.settings default_sender: 'admin@archiving.grnet.gr'
Archiving.settings temp_db_retention: 3.days
Archiving.settings skip_host_fetch_time_period: 1.month
Archiving.settings mail_settings: YAML::load(File.open("#{Rails.root}/config/mailer.yml"))[Rails.env].symbolize_keys
Archiving.settings client_quota: 100.megabytes
+
+jira_src = Rails.application.secrets.jira_src
+jira_field = Rails.application.secrets.jira_custom_field_name
+jira_value = Rails.application.secrets.jira_custom_field_value
+
+if jira_src && jira_field && jira_value
+ Archiving.settings jira_src: jira_src
+end
diff --git a/config/secrets.yml.sample b/config/secrets.yml.sample
index 7b50621..d00bf97 100644
--- a/config/secrets.yml.sample
+++ b/config/secrets.yml.sample
@@ -1,30 +1,33 @@
# Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.
development:
secret_key_base: something
oauth2_vima_client_id: something
oauth2_vima_secret: something
sentry_dsn: the_https_key_for_sentry
salt: something
+ jira_src: the_collector_src
+ jira_custom_field_name: customfield_XXXX
+ jira_custom_field_value: XXXXXX
test:
secret_key_base: 2308355d12d4fdb078d943719229f3fb3f07ade7a2bad418cce6f69d7b741aedeb7f84627fcfddc4eca9ae9812d9c6dc915ab50df39d42c2d2dc3eb0be844306
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: something
oauth2_vima_client_id: something
oauth2_vima_secret: something
sentry_dsn: the_https_key_for_sentry
salt: something

Event Timeline