tramway-admin 4.1.2.1 → 5.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: b0baab938ac5a7920ed5c7919a4f42b400930d3d376d9abfa1afe22778a77f04
4
- data.tar.gz: d59c6b03855039f153274c16398002a49283dd6f056249cc3ad66e355f6984d5
3
+ metadata.gz: c2b26ed193b916d9041c27df7818850630e53ddd5867ac5ce658c002bfcf23e6
4
+ data.tar.gz: 2b2bd839eff52907661a96b378e6073d564e9b354db06b7c4de0a58166260c34
5
5
  SHA512:
6
- metadata.gz: 13932bd78438d8db5e8d9dac2cd0e75aeadb9193e0f78dbe3b449525580f84f7040b14a3a4b70c2ff444233c989a05db12c5a6aa241dde28bd11b0ca525a0d4f
7
- data.tar.gz: dfb5da92d991cc3312f289c13f760482ee1437c807fb0235b264d32380e2b2ce57e9d2af6abe3dd3d908bd5a1bc566649548cf93f69e1ca83127f3a1e078a706
6
+ metadata.gz: 2d8d83f628fad98569b8965b19669b21739a6e50f3db84d9b30cf99742e1e91048716f822b9be5d1159e20bb17867be55ecbc61208b95ad441ae85e8dc4b864a
7
+ data.tar.gz: 329007a4d71ca1d20410900db2fc710e5dab3688c9fb97e3a99400052fe6698eb2375b64e452645a2750818bae7a265f52d81655c7f46ae040dd6fb8c93e00d3
data/README.md CHANGED
@@ -13,7 +13,6 @@ gem 'tramway-admin'
13
13
  gem 'tramway-user'
14
14
  gem 'bcrypt'
15
15
  gem 'haml-rails'
16
- gem 'selectize-rails'
17
16
  gem 'bootstrap'
18
17
  gem 'jquery-rails'
19
18
  gem 'copyright_mafa'
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NavbarHelper
4
+ def click_on_dropdown(text)
5
+ first('ul.navbar-nav li.nav-item.dropdown a.nav-link.dropdown-toggle', text: text, visible: true).click
6
+ end
7
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TramwayHelpers
4
+ def click_on_association_delete_button(object)
5
+ delete_path = ::Tramway::Admin::Engine.routes.url_helpers.record_path(
6
+ object.id,
7
+ model: object.class
8
+ )
9
+ row = find("td[colspan='2'] td a[href='#{delete_path}']").parent_node(level: 2)
10
+ row.find('td button.delete[type="submit"]').click
11
+ end
12
+
13
+ def click_on_tab(text)
14
+ find('li.nav-item a.nav-link', text: text).click
15
+ end
16
+
17
+ def click_on_table_item(text)
18
+ find('table td a', text: text).click
19
+ end
20
+
21
+ def click_on_delete_button(object)
22
+ delete_path = ::Tramway::Admin::Engine.routes.url_helpers.record_path(
23
+ object.id,
24
+ model: object.class
25
+ )
26
+ form = find("form[action='#{delete_path}']")
27
+ form.find('button[type="submit"]').click
28
+ end
29
+
30
+ def fill_in_ckeditor(name, with:)
31
+ id = name.gsub(']', '').split('[').join('_')
32
+ content = with.to_json # convert to a safe javascript string
33
+ page.execute_script <<-SCRIPT
34
+ CKEDITOR.instances['#{id}'].setData(#{content});
35
+ $('textarea##{id}').text(#{content});
36
+ SCRIPT
37
+ end
38
+
39
+ def fill_in_datepicker(name, with:)
40
+ return unless with.present?
41
+
42
+ input = find("input[name=#{name.gsub('[', '\[').gsub(']', '\]')}]")
43
+ input.click
44
+
45
+ find('td.day', text: /^#{with.day}$/, match: :first).click
46
+ end
47
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Admin
5
- VERSION = '4.1.2.1'
5
+ VERSION = '5.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2.1
4
+ version: '5.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-08 00:00:00.000000000 Z
11
+ date: 2022-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tramway-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.3.2
19
+ version: '5.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 4.1.3.2
26
+ version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tramway-auth
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -134,20 +134,6 @@ dependencies:
134
134
  - - ">="
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
- - !ruby/object:Gem::Dependency
138
- name: selectize-rails
139
- requirement: !ruby/object:Gem::Requirement
140
- requirements:
141
- - - ">="
142
- - !ruby/object:Gem::Version
143
- version: '0'
144
- type: :runtime
145
- prerelease: false
146
- version_requirements: !ruby/object:Gem::Requirement
147
- requirements:
148
- - - ">="
149
- - !ruby/object:Gem::Version
150
- version: '0'
151
137
  - !ruby/object:Gem::Dependency
152
138
  name: smart_buttons
153
139
  requirement: !ruby/object:Gem::Requirement
@@ -309,6 +295,8 @@ files:
309
295
  - lib/tramway/admin/record_routes_helper.rb
310
296
  - lib/tramway/admin/records_models.rb
311
297
  - lib/tramway/admin/singleton_models.rb
298
+ - lib/tramway/admin/spec/helpers/navbar_helper.rb
299
+ - lib/tramway/admin/spec/helpers/tramway_helpers.rb
312
300
  - lib/tramway/admin/tramway_model_helper.rb
313
301
  - lib/tramway/admin/version.rb
314
302
  - lib/tramway/admin/welcome_page_actions.rb