redmine_extensions 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f546239fc57393520a159c44ce22ff11a15065869488f1e65aafb8890d3f0ac
4
- data.tar.gz: 8b1c89f27696a4013e95d9f6f1bf6ba87035af404bc78b3d323b27c94e508c3c
3
+ metadata.gz: 83a259a0df79f133ef83c0d83a97867065e72ba53718b6021f4ea4f199350300
4
+ data.tar.gz: 498ecf0ad2f97992ecb43b5e9f08af3e8d7dd6e73260b1bf6539e1cce8c7f21b
5
5
  SHA512:
6
- metadata.gz: d74ef572956e79c8c1ebb38d5db34ee3f812b52879b351fa10fd8e7126f7bac4b71caaa2b44f19e0f8fdc3c47a24f8bbfd6e39e022d2b68aa631c51a96f55c14
7
- data.tar.gz: 57e51045f7038976950067078965bfc1a5c0bef1a0c1391150af94c8ef4fd9388f895417e120b41248078331de5bf12a44e7c49a456a0dd293efb8185e8432e9
6
+ metadata.gz: fadd35b5ab3c6ebfd7254b760ddbf17cd56a39fc3de03a673d15e7e2dda50ae83c4469a1e5f4d6264e87733284097d619c2181724021b8ebadf0f9d591f98f28
7
+ data.tar.gz: e7a1aaca2e52ec55f08178b5526aae5f82d155582683359c4f853ee7d0c3d13c79603949371cc333310d14d0af939d35d990124093ecfdef3dfeb478568dd1ee
data/README.md CHANGED
@@ -6,9 +6,13 @@
6
6
 
7
7
  [![Gem Version](https://badge.fury.io/rb/redmine_extensions.svg)](http://badge.fury.io/rb/redmine_extensions)
8
8
 
9
+
10
+ ⚠️ This gem currently not working with Redmine at all.
11
+
12
+ ---
9
13
  This gem provides an extended funcionality for a Redmine project
10
14
 
11
- ## Provided funcionalities
15
+ ## Provided functionalities
12
16
  * EasySetting - per project settings
13
17
  * Redmine Plugin Generator
14
18
  * Redmine Entity Generator
@@ -14,7 +14,7 @@ module RedmineExtensions
14
14
 
15
15
  # -------= Rendering and presenting methods =-------
16
16
 
17
- def present(model, options={}, &block)
17
+ def present(model, options = {}, &block)
18
18
  if model.is_a?(RedmineExtensions::BasePresenter)
19
19
  presenter = model.update_options(options.merge(view_context: self))
20
20
  else
@@ -36,7 +36,7 @@ module RedmineExtensions
36
36
  'style="display:none"'.html_safe if !toggle_button_expanded?(uniq_id, user, default)
37
37
  end
38
38
 
39
- def url_to_entity(entity, options={})
39
+ def url_to_entity(entity, options = {})
40
40
  m = "url_to_#{entity.class.name.underscore}".to_sym
41
41
  if respond_to?(m)
42
42
  send(m, entity, options)
@@ -88,7 +88,7 @@ module RedmineExtensions
88
88
  render(:partial => 'easy_entity_assignments/assignments_container', :locals => {
89
89
  :entity => entity,
90
90
  :query => query, :project => project,
91
- :entities => entities, :entities_count => entities_count, :options => options})
91
+ :entities => entities, :entities_count => entities_count, :options => options })
92
92
  end
93
93
 
94
94
  def entity_css_icon(entity_or_entity_class)
@@ -117,7 +117,7 @@ module RedmineExtensions
117
117
  else
118
118
  content_or_options_with_block
119
119
  end
120
- html_options.reverse_merge!({type:'application/javascript'})
120
+ html_options.reverse_merge!({ type: 'application/javascript' })
121
121
  priority = html_options.delete(:priority) || 0
122
122
  content = " EasyGem.schedule.late(function(){#{content} }, #{priority});"
123
123
 
@@ -140,29 +140,16 @@ module RedmineExtensions
140
140
  javascript_tag content.html_safe, html_options
141
141
  end
142
142
 
143
- def get_jasmine_tags
144
- ActiveSupport::Deprecation.warn "jasmine will be removed from redmine_extensions"
145
-
146
- tags = params[:jasmine]
147
- return [] if tags == 'true'
148
- if tags.is_a?(String)
149
- [tags.to_sym]
150
- elsif tags.is_a?(Array)
151
- tags.map &:to_sym
152
- else
153
- []
154
- end
155
- end
156
-
157
143
  def easy_avatar_url(user = nil)
144
+ return avatar_url(user) if respond_to?(:avatar_url)
145
+
158
146
  user ||= User.current
159
- result = if Setting.gravatar_enabled?
147
+ if Setting.gravatar_enabled?
160
148
  options = { ssl: (request&.ssl?), default: Setting.gravatar_default }
161
- email = nil
162
- if user.respond_to?(:mail)
163
- email = user.mail
149
+ email = if user.respond_to?(:mail)
150
+ user.mail
164
151
  elsif user.to_s =~ %r{<(.+?)>}
165
- email = $1
152
+ $1
166
153
  end
167
154
  email ? gravatar_url(email, options) : ''
168
155
  elsif user.easy_avatar_url.present?
@@ -170,7 +157,6 @@ module RedmineExtensions
170
157
  elsif user.respond_to?(:easy_avatar) && (av = user.easy_avatar).present? && (img_url = av.image.url(:small))
171
158
  get_easy_absolute_uri_for(img_url).to_s
172
159
  end
173
- result
174
160
  end
175
161
 
176
162
  # ==== Options
@@ -183,13 +169,14 @@ module RedmineExtensions
183
169
  # * <tt>remember: false</tt> - This disable remember function of toggle container
184
170
  # ** Aliases for this options are: ajax_call
185
171
  #
186
- def render_module_easy_box(id, heading, options = {}, &block) # with fallback to old
172
+ def render_module_easy_box(id, heading, options = {}, &block)
173
+ # with fallback to old
187
174
  options[:toggle] = true unless options.key?(:toggle)
188
175
  options[:remember] = options.delete(:ajax_call) if options.key?(:ajax_call)
189
176
  options[:collapsible] = !options.delete(:no_expander) if options.key?(:no_expander)
190
177
 
191
178
  renderer = EasyBoxRenderer.new(self, id, heading, options)
192
- renderer.content = capture {yield renderer}
179
+ renderer.content = capture { yield renderer }
193
180
 
194
181
  renderer.render
195
182
  end
@@ -250,8 +237,9 @@ module RedmineExtensions
250
237
  end
251
238
 
252
239
  def render
253
- view.render({partial: 'common/collapsible_module_layout', locals: {renderer: self, content: content}} )
240
+ view.render({ partial: 'common/collapsible_module_layout', locals: { renderer: self, content: content } })
254
241
  end
242
+
255
243
  private
256
244
 
257
245
  def css_classes
@@ -260,9 +248,9 @@ module RedmineExtensions
260
248
  @css_classes = css_class
261
249
  else
262
250
  @css_classes = {
263
- container: css_class,
264
- heading: css_class,
265
- content: css_class
251
+ container: css_class,
252
+ heading: css_class,
253
+ content: css_class
266
254
  }
267
255
  end
268
256
  end
@@ -303,7 +291,7 @@ module RedmineExtensions
303
291
 
304
292
  content_tag(:span, class: 'easy-multiselect-tag-container', data: { cy: "container_old_autocomplete--#{name}" }) do
305
293
  search_field_tag('', '', (options[:html_options] || {}).merge(id: options[:id], data: { cy: "search_old_autocomplete--#{name}" })) +
306
- late_javascript_tag("$('##{options[:id]}').easymultiselect({multiple: #{options[:multiple]}, rootElement: #{options[:rootElement].to_json}, inputName: '#{name}', preload: #{options[:preload]}, combo: #{options[:combo]}, source: #{source}, selected: #{selected_values.to_json}, select_first_value: #{options[:select_first_value]}, load_immediately: #{options[:load_immediately]}, autocomplete_options: #{(options[:jquery_auto_complete_options]||{}).to_json} });")
294
+ late_javascript_tag("$('##{options[:id]}').easymultiselect({multiple: #{options[:multiple]}, rootElement: #{options[:rootElement].to_json}, inputName: '#{name}', preload: #{options[:preload]}, combo: #{options[:combo]}, source: #{source}, selected: #{selected_values.to_json}, select_first_value: #{options[:select_first_value]}, load_immediately: #{options[:load_immediately]}, autocomplete_options: #{(options[:jquery_auto_complete_options] || {}).to_json} });")
307
295
  end
308
296
  end
309
297
 
@@ -326,7 +314,7 @@ module RedmineExtensions
326
314
  # <input type="hidden" name="issue[tag_ids][]" value="#{@issue.tag_ids.second}" />
327
315
  # ...(wraping service tags end)
328
316
  # </span>
329
- def autocomplete_field(object_name, method, choices, options={}, html_options={})
317
+ def autocomplete_field(object_name, method, choices, options = {}, html_options = {})
330
318
  Tags::AutocompleteField.new(object_name, method, self, choices, options, html_options).render
331
319
  end
332
320
 
@@ -1,22 +1,4 @@
1
1
  <% content_for :header_tags do %>
2
- <%=
3
- if params['combine_by_pipeline'].nil?
4
- if Rails.env.development? && ENV['DART'] == '1'
5
- javascript_include_tag('dart/localhost', plugin: plugin, defer: true)
6
- else
7
- javascript_include_tag("#{plugin}.dart", defer: true)
8
- end
9
- else
10
- if params['combine_by_pipeline'] == 'false'
11
- #javascript_include_tag('dart/debug', plugin: plugin, defer: true)
12
- if ENV['DART'] == '1'
13
- javascript_include_tag('dart/localhost', plugin: plugin, defer: true)
14
- end
15
- else
16
- javascript_include_tag("#{plugin}.dart", defer: true)
17
- end
18
- end
19
- %>
20
2
 
21
3
  <%
22
4
  standard_lang_files = [
@@ -87,6 +69,6 @@
87
69
 
88
70
  %>
89
71
  <script>
90
- window.frontEndCommons = "<%= escape_javascript(front_end_commons.to_json.html_safe) %>";
72
+ window.frontEndCommons = "<%= j(front_end_commons.to_json.html_safe) %>";
91
73
  </script>
92
74
  <% end %>
@@ -1,4 +1,4 @@
1
- class CreateEasySettings < RedmineExtensions::Migration
1
+ class CreateEasySettings < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  if table_exists?(:easy_settings)
4
4
  add_column(:easy_settings, :type, :string, null: true) unless column_exists?(:easy_settings, :type)
@@ -1,4 +1,4 @@
1
- class CreateEntityAssignments < RedmineExtensions::Migration
1
+ class CreateEntityAssignments < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  unless table_exists?(:easy_entity_assignments)
4
4
  create_table :easy_entity_assignments do |t|
@@ -1,4 +1,4 @@
1
- class RemoveForeignKeyFromEasySettings < RedmineExtensions::Migration
1
+ class RemoveForeignKeyFromEasySettings < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  begin
4
4
  remove_foreign_key :easy_settings, :projects
@@ -24,7 +24,7 @@
24
24
  <hr />
25
25
  <%%= render partial: 'redmine_extensions/custom_field_rows', locals: { custom_field_values: @<%= model_name_underscored %>.visible_custom_field_values } %>
26
26
  <%- end -%>
27
- <%%= call_hook(:view_<%= model_name_pluralize_underscored %>_show_details_bottom, :<%= model_name_underscored%>: @<%= model_name_underscored %>) %>
27
+ <%%= call_hook(:view_<%= model_name_pluralize_underscored %>_show_details_bottom, <%= model_name_underscored%>: @<%= model_name_underscored %>) %>
28
28
  </table>
29
29
  <%- if description_column? -%>
30
30
  <%% if !@<%= model_name_underscored %>.<%= description_column %>.blank? %>
@@ -22,10 +22,6 @@ module RedmineExtensions
22
22
  if config.respond_to?(:assets)
23
23
  config.assets.precompile << 'redmine_extensions/applications.js'
24
24
  config.assets.precompile << 'redmine_extensions/blocking.js'
25
- unless Rails.env.production?
26
- config.assets.precompile << 'redmine_extensions/jasmine_lib/jasmine_lib.js'
27
- config.assets.precompile << 'redmine_extensions/jasmine.css'
28
- end
29
25
  end
30
26
  end
31
27
 
@@ -1,10 +1,6 @@
1
1
  module RedmineExtensions
2
2
  class Hooks < Redmine::Hook::ViewListener
3
3
 
4
- if Rails.env.development?
5
- render_on :view_layouts_base_body_bottom, partial: 'redmine_extensions/development_mode'
6
- end
7
-
8
4
  if defined?(EasyExtensions)
9
5
  if EasyExtensions.try(:deferred_js)
10
6
 
@@ -23,9 +19,6 @@ module RedmineExtensions
23
19
  context[:template].require_asset('redmine_extensions/application')
24
20
  end
25
21
  end
26
- if Rails.env.development? || Rails.env.test?
27
- render_on :view_layouts_base_html_head, partial: 'redmine_extensions/jasmine'
28
- end
29
22
  else
30
23
  ### JAVASCRIPTS IN REDMINE ###
31
24
  def view_layouts_base_html_head(context = {})
@@ -42,8 +35,7 @@ module RedmineExtensions
42
35
  javascript_include_tag('redmine_extensions/easy_togglers') +
43
36
  javascript_include_tag('redmine_extensions/jquery.entityarray') +
44
37
  javascript_include_tag('redmine_extensions/render_polyfill') +
45
- javascript_include_tag('redmine_extensions/redmine_extensions') +
46
- (context[:controller].send(:render_to_string, partial: 'redmine_extensions/jasmine') if Rails.env.development? || Rails.env.test?)
38
+ javascript_include_tag('redmine_extensions/redmine_extensions')
47
39
  end
48
40
  end
49
41
 
@@ -6,4 +6,4 @@ module RedmineExtensions
6
6
  class Migration < ActiveRecord::Migration
7
7
  end
8
8
  end
9
- end
9
+ end
@@ -1,5 +1,5 @@
1
1
  module RedmineExtensions
2
2
 
3
- VERSION = '0.5.1'
3
+ VERSION = '0.6.0'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Easy Software Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-28 00:00:00.000000000 Z
11
+ date: 2022-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -46,17 +46,10 @@ files:
46
46
  - app/assets/javascripts/redmine_extensions/blocking_utils.js
47
47
  - app/assets/javascripts/redmine_extensions/easy_togglers.js
48
48
  - app/assets/javascripts/redmine_extensions/event_bus.js
49
- - app/assets/javascripts/redmine_extensions/jasmine_lib/boot.js
50
- - app/assets/javascripts/redmine_extensions/jasmine_lib/jasmine_helper.js
51
- - app/assets/javascripts/redmine_extensions/jasmine_lib/jasmine_lib.js
52
- - app/assets/javascripts/redmine_extensions/jasmine_tests/extend.js
53
- - app/assets/javascripts/redmine_extensions/jasmine_tests/jasmine_tests.js
54
- - app/assets/javascripts/redmine_extensions/jasmine_tests/modules.js
55
49
  - app/assets/javascripts/redmine_extensions/jquery.entityarray.js
56
50
  - app/assets/javascripts/redmine_extensions/redmine_extensions.js
57
51
  - app/assets/javascripts/redmine_extensions/render_polyfill.js
58
52
  - app/assets/stylesheets/redmine_extensions/application.css
59
- - app/assets/stylesheets/redmine_extensions/jasmine.css
60
53
  - app/controllers/easy_settings_controller.rb
61
54
  - app/helpers/redmine_extensions/application_helper.rb
62
55
  - app/helpers/redmine_extensions/rendering_helper.rb
@@ -80,8 +73,6 @@ files:
80
73
  - app/views/easy_queries/_settings.html.erb
81
74
  - app/views/easy_settings/edit.html.erb
82
75
  - app/views/redmine_extensions/_custom_field_rows.html.erb
83
- - app/views/redmine_extensions/_development_mode.html.erb
84
- - app/views/redmine_extensions/_jasmine.html.erb
85
76
  - config/locales/cs.yml
86
77
  - config/locales/en.yml
87
78
  - config/routes.rb
@@ -199,14 +190,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
190
  - !ruby/object:Gem::Version
200
191
  version: '0'
201
192
  requirements: []
202
- rubygems_version: 3.2.33
193
+ rubygems_version: 3.3.9
203
194
  signing_key:
204
195
  specification_version: 4
205
196
  summary: Redmine Extensions is set of useful features for Redmine. Main focus is on
206
197
  development helpers, but many users can find it helpfull
207
198
  test_files:
208
- - spec/factories/easy_settings.rb
199
+ - spec/spec_helper.rb
209
200
  - spec/init_rails.rb
210
201
  - spec/models/easy_setting_spec.rb
211
202
  - spec/presenters/easy_settings/params_wrapper_spec.rb
212
- - spec/spec_helper.rb
203
+ - spec/factories/easy_settings.rb
@@ -1,153 +0,0 @@
1
- /*
2
- Copyright (c) 2008-2018 Pivotal Labs
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining
5
- a copy of this software and associated documentation files (the
6
- "Software"), to deal in the Software without restriction, including
7
- without limitation the rights to use, copy, modify, merge, publish,
8
- distribute, sublicense, and/or sell copies of the Software, and to
9
- permit persons to whom the Software is furnished to do so, subject to
10
- the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be
13
- included in all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- */
23
- /**
24
- Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
25
-
26
- If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
27
-
28
- The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
29
-
30
- [jasmine-gem]: http://github.com/pivotal/jasmine-gem
31
- */
32
-
33
- (function() {
34
-
35
- /**
36
- * ## Require &amp; Instantiate
37
- *
38
- * Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
39
- */
40
- window.jasmine = jasmineRequire.core(jasmineRequire);
41
-
42
- /**
43
- * Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
44
- */
45
- jasmineRequire.html(jasmine);
46
-
47
- /**
48
- * Create the Jasmine environment. This is used to run all specs in a project.
49
- */
50
- var env = jasmine.getEnv();
51
-
52
- /**
53
- * ## The Global Interface
54
- *
55
- * Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
56
- */
57
- var jasmineInterface = jasmineRequire.interface(jasmine, env);
58
-
59
- /**
60
- * Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
61
- */
62
- extend(window, jasmineInterface);
63
-
64
- /**
65
- * ## Runner Parameters
66
- *
67
- * More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
68
- */
69
-
70
- var queryString = new jasmine.QueryString({
71
- getWindowLocation: function() { return window.location; }
72
- });
73
-
74
- var filterSpecs = !!queryString.getParam("spec");
75
-
76
- var stoppingOnSpecFailure = queryString.getParam("failFast");
77
- env.stopOnSpecFailure(stoppingOnSpecFailure);
78
-
79
- var throwingExpectationFailures = queryString.getParam("throwFailures");
80
- env.throwOnExpectationFailure(throwingExpectationFailures);
81
-
82
- var random = queryString.getParam("random");
83
- env.randomizeTests(false);
84
- if (random !== undefined && random !== "") {
85
- env.randomizeTests(random);
86
- }
87
-
88
- var seed = queryString.getParam("seed");
89
- if (seed) {
90
- env.seed(seed);
91
- }
92
-
93
- /**
94
- * ## Reporters
95
- * The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
96
- */
97
- var htmlReporter = new jasmine.HtmlReporter({
98
- env: env,
99
- navigateWithNewParam: function(key, value) { return queryString.navigateWithNewParam(key, value); },
100
- addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
101
- getContainer: function() { return document.body; },
102
- createElement: function() { return document.createElement.apply(document, arguments); },
103
- createTextNode: function() { return document.createTextNode.apply(document, arguments); },
104
- timer: new jasmine.Timer(),
105
- filterSpecs: filterSpecs
106
- });
107
-
108
- /**
109
- * The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
110
- */
111
- env.addReporter(jasmineInterface.jsApiReporter);
112
- env.addReporter(htmlReporter);
113
-
114
- /**
115
- * Filter which specs will be run by matching the start of the full name against the `spec` query param.
116
- */
117
- var specFilter = new jasmine.HtmlSpecFilter({
118
- filterString: function() { return queryString.getParam("spec"); }
119
- });
120
-
121
- env.specFilter = function(spec) {
122
- return specFilter.matches(spec.getFullName());
123
- };
124
-
125
- /**
126
- * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
127
- */
128
- window.setTimeout = window.setTimeout;
129
- window.setInterval = window.setInterval;
130
- window.clearTimeout = window.clearTimeout;
131
- window.clearInterval = window.clearInterval;
132
-
133
- /**
134
- * ## Execution
135
- *
136
- * Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
137
- */
138
- var currentWindowOnload = window.onload;
139
-
140
- jasmine.jasmineStart = function() {
141
- htmlReporter.initialize();
142
- env.execute();
143
- };
144
-
145
- /**
146
- * Helper function for readability above.
147
- */
148
- function extend(destination, source) {
149
- for (var property in source) destination[property] = source[property];
150
- return destination;
151
- }
152
-
153
- }());
@@ -1,292 +0,0 @@
1
- (function () {
2
- var getQueryString = function () {
3
- var query_string = {};
4
- var query = window.location.search.substring(1);
5
- var vars = query.split("&");
6
- for (var i = 0; i < vars.length; i++) {
7
- var pair = vars[i].split("=");
8
- // If first entry with this name
9
- if (typeof query_string[pair[0]] === "undefined") {
10
- query_string[pair[0]] = decodeURIComponent(pair[1]);
11
- // If second entry with this name
12
- } else if (typeof query_string[pair[0]] === "string") {
13
- query_string[pair[0]] = [query_string[pair[0]], decodeURIComponent(pair[1])];
14
- // If third or later entry with this name
15
- } else {
16
- query_string[pair[0]].push(decodeURIComponent(pair[1]));
17
- }
18
- }
19
- return query_string;
20
- };
21
- var setQueryTestNames = function () {
22
- var params = getQueryString();
23
- var requestedTests = params["jasmine"] || params["jasmine[]"] || params["jasmine%5B%5D"];
24
- if (requestedTests === "true") return;
25
- var names = data.tags;
26
- if (typeof requestedTests === "string") {
27
- names[requestedTests] = true;
28
- } else if (requestedTests instanceof Array) {
29
- for (var i = 0; i < requestedTests.length; i++) {
30
- var name = requestedTests[i];
31
- names[name] = true;
32
- }
33
- } else {
34
- throw "Wrong type of jasmine value - \"" + requestedTests + "\" is not true|string|Array.<String>";
35
- }
36
- };
37
-
38
- function isDescendantOrSame(parent, child) {
39
- while (child != null) {
40
- if (child === parent) {
41
- return true;
42
- }
43
- child = child.parentNode;
44
- }
45
- return false;
46
- }
47
-
48
- function notifyOfResult() {
49
- EasyGem.schedule.require(function () {
50
- var fail = window.jsApiReporter.specs().some(function (spec) {
51
- return spec.failedExpectations.length;
52
- });
53
- var logo = document.getElementById("logo") || document.getElementsByTagName("h1")[0];
54
- logo.classList.add("logo-jasmine");
55
- logo.classList.add("logo-jasmine--" + (fail ? "fail" : "pass"));
56
- var link = document.createElement('link');
57
- link.rel = 'shortcut icon';
58
- if (fail) {
59
- link.href = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAACBj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dGUAMjAxOC0wNi0yMVQwODozMTo0NS0wNzowMJVtVyEAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTgtMDYtMjFUMDg6MzE6NDUtMDc6MDDkMO+dAAAAAElFTkSuQmCC";
62
- }
63
- Array.prototype.slice.call(document.querySelectorAll("[type='image/x-icon']")).forEach(function (link) {
64
- link.parentElement.removeChild(link);
65
- });
66
- document.head.appendChild(link);
67
- }, function () {
68
- return window.jsApiReporter.finished
69
- });
70
- }
71
-
72
- /**
73
- *
74
- * @param {Element} element
75
- * @return {string}
76
- */
77
- function identifyElement(element) {
78
- var result = "null";
79
- var first = true;
80
- var itemString;
81
- while (element) {
82
- if (element.id) {
83
- return "#" + element.id + (first ? "" : " > " + result);
84
- }
85
- var elClasses = element.className.trim().replace(/\s+/g, ".");
86
- if (elClasses) elClasses = "." + elClasses;
87
- itemString = element.tagName.toLowerCase() + elClasses;
88
- if (first) {
89
- first = false;
90
- result = itemString;
91
- } else {
92
- result = itemString + " > " + result;
93
- }
94
- element = element.parentElement;
95
- }
96
- return result;
97
- }
98
-
99
- var data = {
100
- _locks: [],
101
- _timeout: null,
102
- tags: {}
103
- };
104
- var start = function () {
105
- if (new Date() - data._timeout > 5000) {
106
- throw "JasmineHelper timeout";
107
- }
108
- if (data._locks.length) {
109
- setTimeout(start, 400);
110
- return;
111
- }
112
- notifyOfResult();
113
- jasmine.jasmineStart();
114
- };
115
- window.jasmineHelper = {
116
- data: data,
117
- /**
118
- * prevent execution of Jasmine until [name] lock have been unlocked
119
- * @param {String} name
120
- */
121
- lock: function (name) {
122
- if (data._locks.indexOf(name) === -1) {
123
- data._locks.push(name);
124
- }
125
- },
126
- /**
127
- * unlock [name] lock, so execution of Jasmine can proceed
128
- * @param {String} name
129
- */
130
- unlock: function (name) {
131
- var index = data._locks.indexOf(name);
132
- if (index !== -1) {
133
- data._locks.splice(index, 1);
134
- }
135
- },
136
- /**
137
- * unlock [name] lock if [prerequisite] is fulfilled
138
- * @param {String} name
139
- * @param {Function} prerequisite
140
- */
141
- unlockOnPass: function (name, prerequisite) {
142
- EasyGem.schedule.require(function () {
143
- jasmineHelper.unlock(name);
144
- }, prerequisite);
145
- },
146
- parseResult: function () {
147
- var specs = window.jsApiReporter.specs();
148
- var shortReport = "";
149
- var report = "";
150
- var allPassed = true;
151
- var result = "";
152
- for (var i = 0; i < specs.length; i++) {
153
- var spec = specs[i];
154
- if (spec.status === "passed") {
155
- shortReport += ".";
156
- } else if (spec.status === "pending") {
157
- shortReport += "O";
158
- } else {
159
- allPassed = false;
160
- shortReport += "X";
161
- report += "__TEST " + spec.fullName + "______\n";
162
- for (var j = 0; j < spec.failedExpectations.length; j++) {
163
- var fail = spec.failedExpectations[j];
164
- var split = fail.stack.split("\n");
165
- result += window.location + "\n";
166
- report += " " + fail.message + "\n";
167
- for (var k = 1; k < split.length; k++) {
168
- if (split[k].indexOf("/jasmine_lib/") > -1) continue;
169
- report += split[k] + "\n";
170
- }
171
- }
172
- }
173
- }
174
- if (allPassed) {
175
- return "success";
176
- }
177
- result += " RESULTS: " + shortReport + "\n" + report;
178
- //$("#content").text(result.replace("\n", "<br>"));
179
- return result;
180
- },
181
- /**
182
- * Create mouseEvent of [type] at client position, so it can be triggered by method dispatchEvent(element)
183
- * @param {String} type
184
- * @param {int} pageX
185
- * @param {int} pageY
186
- * @param {{ctrlKey?:boolean,metaKey?:boolean,altKey?:boolean,shiftKey?:boolean,button?:int,bubble?:boolean,detail?:int,screenX?:int,screenY?:int}} [options]
187
- * @return {{dispatchEvent:Function}}
188
- */
189
- mouseEvent: function (type, pageX, pageY, options) {
190
- var evt;
191
- options = options || {};
192
- EasyGem.extend(options, {
193
- bubbles: true,
194
- cancelable: (type !== "mousemove"),
195
- view: window,
196
- clientX: pageX - document.body.scrollLeft - document.documentElement.scrollLeft,
197
- clientY: pageY - document.body.scrollTop - document.documentElement.scrollTop
198
- });
199
- if (window.MouseEvent) {
200
- evt = new MouseEvent(type, options);
201
- } else if (typeof(document.createEvent) === "function") {
202
- evt = document.createEvent("MouseEvents");
203
- evt.initMouseEvent(type,
204
- options.bubbles, options.cancelable, options.view, options.detail,
205
- options.screenX, options.screenY, options.clientX, options.clientY,
206
- options.ctrlKey, options.altKey, options.shiftKey, options.metaKey,
207
- options.button, document.body.parentNode);
208
- }
209
- evt.dispatchEvent = function (el) {
210
- if (el.dispatchEvent) {
211
- el.dispatchEvent(this);
212
- } else if (el.fireEvent) {
213
- el.fireEvent('on' + type, this);
214
- }
215
- return this;
216
- };
217
- return evt;
218
- },
219
- /**
220
- * Triggers mouseEvent of [type] at the center of [element]
221
- * @param {string|Element|jQuery} element - can be HTMLElement, selector or jQuery element
222
- * @param {string} type
223
- * @param {{ctrlKey?:boolean,metaKey?:boolean,altKey?:boolean,shiftKey?:boolean,button?:int,bubble?:boolean,detail?:int,screenX?:int,screenY?:int}} [options]
224
- */
225
- mouseEventOn: function (element, type, options) {
226
- if (typeof element === "string") {
227
- element = document.querySelector(element);
228
- } else if (element instanceof window.jQuery) {
229
- element = element[0];
230
- }
231
- if (!element) throw new Error("missing element");
232
- element.scrollIntoView({block: "center", behavior: "instant"});
233
- var box = element.getBoundingClientRect();
234
- var pointX = (box.left + box.right) / 2;
235
- var pointY = (box.top + box.bottom) / 2;
236
- var target = document.elementFromPoint(pointX, pointY);
237
- if (!isDescendantOrSame(element, target)) {
238
- throw new Error(identifyElement(element) + " is covered by " + identifyElement(target) + ", can't be clicked");
239
- }
240
- return this.mouseEvent(type, pointX, pointY, options).dispatchEvent(element);
241
- },
242
- /**
243
- * Trigger click mouseEvent on [element]
244
- * @param {string|Element|jQuery} element - can be HTMLElement, selector or jQuery element
245
- * @param {{ctrlKey?:boolean,metaKey?:boolean,altKey?:boolean,shiftKey?:boolean,button?:int,bubble?:boolean,detail?:int,screenX?:int,screenY?:int}} [options]
246
- */
247
- clickOn: function (element, options) {
248
- return this.mouseEventOn(element, "click", options);
249
- },
250
- hasTag: function (tag) {
251
- return data.tags[tag];
252
- },
253
- initPageMatchers: function () {
254
- jasmine.addMatchers(pageMatchers);
255
- }
256
- };
257
- setQueryTestNames();
258
-
259
- var pageMatchers = {
260
- toExistsOnPage: function (/*utils, customEqualityTesters*/) {
261
- return {
262
- compare: function (selector) {
263
- var pass = $(selector).length;
264
- if (pass) {
265
- return {pass: true, message: "Expected " + selector + " not to be present on page"};
266
- }
267
- return {pass: false, message: "Expected " + selector + " to be present on page"};
268
- }
269
- };
270
- },
271
- toExistsTimes: function (/*utils, customEqualityTesters*/) {
272
- return {
273
- compare: function (selector, expected) {
274
- var count = $(selector).length;
275
- var pass = count === expected;
276
- if (pass) {
277
- return {pass: true, message: "Expected " + selector + " not to be present on page " + expected + "-times"};
278
- }
279
- return {
280
- pass: false,
281
- message: "Expected " + selector + " to be present on page " + expected + "-times, not " + count + "-times"
282
- };
283
- }
284
- };
285
- }
286
- };
287
-
288
- EasyGem.schedule.late(function () {
289
- data._timeout = new Date();
290
- start();
291
- }, -100);
292
- })();
@@ -1,3 +0,0 @@
1
- //= require ./boot.js
2
- //= require ./jasmine_helper.js
3
- //= require ../jasmine_tests/jasmine_tests
@@ -1,32 +0,0 @@
1
- describe("EasyGem.extend",function () {
2
- var target = {
3
- array: ["a", "b"],
4
- c: {f: 5, t: 8, arr: [{a: 7, b: 3}]},
5
- f: [5, 6, 7]
6
- };
7
- var source = {
8
- array: ["c"],
9
- c: {f: 6, g: 5, arr: [{v: 1, b: 2}, {ff: 1}]},
10
- k: {a: "g"}
11
- };
12
- it("shallow",function () {
13
- var e1 = {
14
- array: ["c"],
15
- c: {f: 6, g: 5, arr: [{v: 1, b: 2}, {ff: 1}]},
16
- f: [5, 6, 7],
17
- k: {a: "g"}
18
- };
19
- var r1 = EasyGem.extend(JSON.parse(JSON.stringify(target)), JSON.parse(JSON.stringify(source)));
20
- expect(r1).toEqual(e1);
21
- });
22
- it("deep",function () {
23
- var e2 = {
24
- array: ["c", "b"],
25
- c: {f: 6, g: 5, t: 8, arr: [{a: 7, v: 1, b: 2}, {ff: 1}]},
26
- f: [5, 6, 7],
27
- k: {a: "g"}
28
- };
29
- var r2 = EasyGem.extend(true,JSON.parse(JSON.stringify(target)), JSON.parse(JSON.stringify(source)));
30
- expect(r2).toEqual(e2);
31
- });
32
- });
@@ -1 +0,0 @@
1
- //= require_directory
@@ -1,164 +0,0 @@
1
- describe("Modules", function () {
2
- var nameCounter = 0;
3
-
4
- function getName() {
5
- return "jasmine_test_" + (nameCounter++);
6
- }
7
-
8
- function defineOptionModule(moduleName, context) {
9
- EasyGem.module.module(moduleName, function () {
10
- return function () {
11
- context.add.apply(context, arguments);
12
- }
13
- });
14
- }
15
-
16
- function defineCallbackModule(moduleName, context) {
17
- EasyGem.module.module(moduleName, function () {
18
- return {
19
- add: function () {
20
- context.add.apply(context, arguments);
21
- }
22
- };
23
- });
24
- }
25
-
26
- function resolveModules() {
27
- EasyGem.module.setUrl("", null);
28
- }
29
-
30
- beforeEach(function () {
31
- this.counter = 1;
32
- var self = this;
33
- this.count = function () {
34
- self.counter++;
35
- };
36
- this.add = function (add) {
37
- for (var i = 0; i < arguments.length; i++) {
38
- self.counter += arguments[i];
39
- }
40
- };
41
- });
42
- describe("simple", function () {
43
- it("works with option", function () {
44
- var moduleName = getName();
45
- defineOptionModule(moduleName, this);
46
- expect(this.counter).toEqual(1);
47
- EasyGem.loadModule(moduleName, 5);
48
- expect(this.counter).toEqual(6);
49
- });
50
- it("works with callback", function () {
51
- var moduleName = getName();
52
- defineCallbackModule(moduleName, this);
53
- expect(this.counter).toEqual(1);
54
- EasyGem.loadModule(moduleName, function (module) {
55
- module.add(5);
56
- });
57
- expect(this.counter).toEqual(6);
58
- });
59
- it("works with multiple options", function () {
60
- var moduleName = getName();
61
- defineOptionModule(moduleName, this);
62
- expect(this.counter).toEqual(1);
63
- EasyGem.loadModule(moduleName, 5, 9);
64
- expect(this.counter).toEqual(15);
65
- });
66
- it("works with multiple options - loadModules", function () {
67
- var moduleName = getName();
68
- defineOptionModule(moduleName, this);
69
- expect(this.counter).toEqual(1);
70
- EasyGem.loadModules([moduleName], 5, 9);
71
- expect(this.counter).toEqual(15);
72
- });
73
- });
74
- describe("complex", function () {
75
- describe("handle define after request", function () {
76
- it("option", function () {
77
- var moduleName = getName();
78
- expect(this.counter).toEqual(1);
79
- EasyGem.loadModule(moduleName, 8);
80
- expect(this.counter).toEqual(1);
81
- defineOptionModule(moduleName, this);
82
- resolveModules();
83
- expect(this.counter).toEqual(9);
84
- });
85
- it("callback", function () {
86
- var moduleName = getName();
87
- expect(this.counter).toEqual(1);
88
- EasyGem.loadModule(moduleName, function (module) {
89
- module.add(3);
90
- });
91
- expect(this.counter).toEqual(1);
92
- defineCallbackModule(moduleName, this);
93
- resolveModules();
94
- expect(this.counter).toEqual(4);
95
- });
96
- });
97
- describe("parts", function () {
98
- it("define first", function () {
99
- var moduleName = getName();
100
- var self = this;
101
- EasyGem.module.part(moduleName, [], function () {
102
- this.add = function (option) {
103
- self.add(option);
104
- }
105
- });
106
- EasyGem.module.part(moduleName, function () {
107
- this.addDouble = function (option) {
108
- self.add(option * 2);
109
- }
110
- });
111
- expect(this.counter).toEqual(1);
112
- EasyGem.loadModule(moduleName, function (module) {
113
- module.add(3);
114
- module.addDouble(2);
115
- });
116
- expect(this.counter).toEqual(8);
117
- });
118
- it("request first", function () {
119
- var moduleName = getName();
120
- var self = this;
121
- EasyGem.loadModule(moduleName, function (module) {
122
- module.add(3);
123
- module.addDouble(2);
124
- });
125
- expect(this.counter).toEqual(1);
126
- EasyGem.module.part(moduleName, [], function () {
127
- this.add = function (option) {
128
- self.add(option);
129
- }
130
- });
131
- expect(this.counter).toEqual(1);
132
- EasyGem.module.part(moduleName, function () {
133
- this.addDouble = function (option) {
134
- self.add(option * 2);
135
- }
136
- });
137
- resolveModules();
138
- expect(this.counter).toEqual(8);
139
- });
140
- });
141
- it("handle complex tree", function () {
142
- var moduleName = getName();
143
- var subModuleName1 = getName();
144
- var subModuleName2 = getName();
145
- EasyGem.module.module(moduleName, [subModuleName1, subModuleName2], function (sub1, sub2) {
146
- this.sub1 = sub1;
147
- this.sub2 = sub2;
148
- });
149
- expect(this.counter).toEqual(1);
150
- EasyGem.loadModule(moduleName, function (module) {
151
- module.sub1(2);
152
- module.sub2.add(3);
153
- });
154
- resolveModules();
155
- expect(this.counter).toEqual(1);
156
- defineOptionModule(subModuleName1, this);
157
- resolveModules();
158
- expect(this.counter).toEqual(1);
159
- defineCallbackModule(subModuleName2, this);
160
- resolveModules();
161
- expect(this.counter).toEqual(6);
162
- });
163
- });
164
- });
@@ -1,35 +0,0 @@
1
- .jasmine-specs {
2
- margin: 0;
3
- }
4
-
5
- .jasmine_html-reporter {
6
- margin-left: 100px;
7
- margin-right: 100px;
8
- }
9
-
10
- .logo-jasmine {
11
- width: 60px;
12
- font-size: 0;
13
- text-align: center;
14
- color: white;
15
- background-color: #fe7d99;
16
- font-weight: normal;
17
- }
18
-
19
- .logo-jasmine--pass {
20
- background-color: #01c8a9;
21
- }
22
-
23
- .logo-jasmine:before {
24
- content: '\2620';
25
- font-size: 40px;
26
- }
27
-
28
- .logo-jasmine--pass:before {
29
- content: '\2705';
30
- }
31
-
32
- .logo-jasmine * {
33
- height: 0 !important;
34
- background-image: none !important;
35
- }
@@ -1,33 +0,0 @@
1
- <% if RedmineExtensions::PatchManager.reloadable_patches_applied > 1 %>
2
- <div class="patches-applied">
3
- <i class="icon icon-reload"></i> Patches applied (<%= RedmineExtensions::PatchManager.reloadable_patches_applied %>x)
4
- </div>
5
-
6
- <style>
7
- .patches-applied {
8
- position: fixed;
9
- bottom: 0;
10
- left: 0;
11
- padding: 2px 10px;
12
- background: #f44336;
13
- border-top: 1px solid #b71c1c;
14
- border-right: 1px solid #b71c1c;
15
- animation: patches-applied-pulse 2s 5;
16
- color: #fff;
17
- z-index: 9999999;
18
- }
19
-
20
- @keyframes patches-applied-pulse {
21
- 0% {
22
- box-shadow: 0 0 0 0 rgba(229, 115, 115, 0.4);
23
- }
24
- 70% {
25
- box-shadow: 0 0 0 20px rgba(229, 115, 115, 0);
26
- }
27
- 100% {
28
- box-shadow: 0 0 0 0 rgba(229, 115, 115, 0);
29
- }
30
- }
31
- </style>
32
- <% end %>
33
-
@@ -1,9 +0,0 @@
1
- <% ActiveSupport::Deprecation.warn "Jasmine will be removed from redmine_extensions in next version" %>
2
-
3
- <% if params[:jasmine] %>
4
- <script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.1.0/jasmine.js"></script>
5
- <script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.1.0/jasmine-html.js"></script>
6
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.1.0/jasmine.css">
7
- <%= javascript_include_tag('redmine_extensions/jasmine_lib/jasmine_lib.js') %>
8
- <%= stylesheet_link_tag('redmine_extensions/jasmine.css') %>
9
- <% end %>