kenui 2.0.0 → 3.0.1

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: 3c8a6b179e7f786b15d3e04dbba38c7235ab3cb60757ff59ba68c7a023e27a5a
4
- data.tar.gz: 4ce591e59fefc88597ddf89cc4f473e57631122759f497d2c36cc8ca76b99c06
3
+ metadata.gz: 07c6ab4803bceb1b57b9e779ff604a5f9fd73b450f2e2666ec0d4c6f2ece25ce
4
+ data.tar.gz: 46d28c638825cc58d562071de44193d4d021c4f91e5d001d93f2dfee1ffa4472
5
5
  SHA512:
6
- metadata.gz: 1a72ee101a918da7439f7175bee6427ca11bff78d2e6c42409fd7d8f27ce6d254a4a13418549b8b1ad60f42c417bddc775bb25548d41876fa4fd115e0ba14e83
7
- data.tar.gz: d0cd73a637903c45fd18c7e0e53d8e0553703cb20a692e1e767a7700019caf06eff51afab9f3422c41d9c0a95c710d512456d281a8154804204ff4d98d6cc7ed
6
+ metadata.gz: 3bf1da2f201568cf8b442f5b09a402892cb2c8ee4829799c72a712d591d0cd4c36ae7f30de64ac3c933d5c947cdc397f0c5774e0ac17dc8a003520f9a1e3041a
7
+ data.tar.gz: c0848fc66f76febddc63ae5eeea9976ef36767984a4698e9b347ed0d49296fe7110a763fa89f805515729786c4e36ccd22cfd57f77f13d066ef867f6f29fff61
data/README.md CHANGED
@@ -8,10 +8,11 @@ Kill Bill compatibility
8
8
  -----------------------
9
9
 
10
10
  | Kenui version | Kill Bill version |
11
- | ------------: | ----------------: |
12
- | 0.1.x | 0.18.z |
13
- | 1.x.y | 0.20.z |
14
- | 2.x.y | 0.22.z |
11
+ |--------------:|------------------:|
12
+ | 0.1.x | 0.18.z |
13
+ | 1.x.y | 0.20.z |
14
+ | 2.x.y | 0.22.z |
15
+ | 3.x.y | 0.24.z |
15
16
 
16
17
  Getting Started
17
18
  ---------------
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require 'bundler/setup'
3
5
  rescue LoadError
@@ -14,14 +16,11 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
16
  rdoc.rdoc_files.include('lib/**/*.rb')
15
17
  end
16
18
 
17
- APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
19
+ APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
18
20
  load 'rails/tasks/engine.rake'
19
21
 
20
-
21
22
  load 'rails/tasks/statistics.rake'
22
23
 
23
-
24
-
25
24
  require 'bundler/gem_tasks'
26
25
 
27
26
  require 'rake/testtask'
@@ -32,5 +31,4 @@ Rake::TestTask.new(:test) do |t|
32
31
  t.verbose = false
33
32
  end
34
33
 
35
-
36
34
  task default: :test
@@ -1,2 +1,3 @@
1
- //= link_directory ../javascripts/kenui .js
2
- //= link_directory ../stylesheets/kenui .css
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
@@ -11,7 +11,6 @@
11
11
  // about supported directives.
12
12
  //
13
13
  //= require jquery
14
- //= require twitter/bootstrap
15
14
  //= require dataTables/jquery.dataTables
16
15
  //= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
17
16
  //= require kenui/kenui
@@ -11,4 +11,3 @@
11
11
  // about supported directives.
12
12
  //
13
13
  //= require_tree .
14
-
@@ -15,5 +15,4 @@
15
15
  *= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
16
16
  *= require font-awesome
17
17
  *= require kenui/email_notifications
18
- *= require bootstrap_and_overrides
19
18
  */
@@ -1,7 +1,3 @@
1
- /*
2
- *= require twitter-bootstrap-static/bootstrap
3
- */
4
-
5
1
  /* Override Bootstrap 3 font locations */
6
2
  @font-face {
7
3
  font-family: 'Glyphicons Halflings';
@@ -1,8 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kenui
2
4
  class EmailNotificationsController < Kenui::EngineController
3
-
4
5
  def index
5
- @record_total = (KillBillClient::Model::Account.find_in_batches(nil,nil,false,false,options_for_klient) || []).size
6
+ @record_total = (KillBillClient::Model::Account.find_in_batches(nil, nil, false, false, options_for_klient) || []).size
6
7
  end
7
8
 
8
9
  # get account list, no sorting
@@ -13,13 +14,13 @@ module Kenui
13
14
  record_total = (params[:record_total] || 100).to_i
14
15
  data = []
15
16
 
16
- if search_key.present?
17
- rows = KillBillClient::Model::Account.find_in_batches_by_search_key(search_key, offset, limit, false, false, options_for_klient)
18
- else
19
- rows = KillBillClient::Model::Account.find_in_batches(offset, limit, false, false, options_for_klient)
20
- end
17
+ rows = if search_key.present?
18
+ KillBillClient::Model::Account.find_in_batches_by_search_key(search_key, offset, limit, false, false, options_for_klient)
19
+ else
20
+ KillBillClient::Model::Account.find_in_batches(offset, limit, false, false, options_for_klient)
21
+ end
21
22
 
22
- account_ids = rows.map { |account| account.account_id }
23
+ account_ids = rows.map(&:account_id)
23
24
  email_notifications_configuration = Kenui::EmailNotificationService.get_configurations(account_ids, options_for_klient)
24
25
 
25
26
  rows.each do |row|
@@ -36,12 +37,12 @@ module Kenui
36
37
  view_context.link_to('<i class="fa fa-cog" aria-hidden="true"></i>'.html_safe,
37
38
  '#configureEmailNotification',
38
39
  data: { name: row.name, account_id: row.account_id,
39
- events: events, toggle: 'modal', target: '#configureEmailNotification'})
40
+ events: events, toggle: 'modal', target: '#configureEmailNotification' })
40
41
  ]
41
42
  end
42
43
 
43
44
  respond_to do |format|
44
- format.json { render json: { data: data, recordsTotal: record_total, recordsFiltered: record_total} }
45
+ format.json { render json: { data: data, recordsTotal: record_total, recordsFiltered: record_total } }
45
46
  end
46
47
  end
47
48
 
@@ -49,16 +50,16 @@ module Kenui
49
50
  data = Kenui::EmailNotificationService.get_events_to_consider(options_for_klient)
50
51
 
51
52
  respond_to do |format|
52
- format.json { render json: { data: data} }
53
+ format.json { render json: { data: data } }
53
54
  end
54
55
  end
55
56
 
56
57
  def configuration
57
58
  account_id = params.require(:account_id)
58
- data = Kenui::EmailNotificationService.get_configuration_per_account(account_id,options_for_klient)
59
+ data = Kenui::EmailNotificationService.get_configuration_per_account(account_id, options_for_klient)
59
60
 
60
61
  respond_to do |format|
61
- format.json { render json: { data: data} }
62
+ format.json { render json: { data: data } }
62
63
  end
63
64
  end
64
65
 
@@ -68,7 +69,7 @@ module Kenui
68
69
  is_success, message = Kenui::EmailNotificationService.set_configuration_per_account(configuration[:account_id],
69
70
  configuration[:event_types],
70
71
  'kenui', nil, nil,
71
- options_for_klient )
72
+ options_for_klient)
72
73
 
73
74
  if is_success
74
75
  flash[:notice] = message
@@ -77,6 +78,5 @@ module Kenui
77
78
  end
78
79
  redirect_to email_notifications_path
79
80
  end
80
-
81
81
  end
82
82
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kenui
2
4
  module ApplicationHelper
3
5
  end
@@ -1,11 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kenui
2
4
  # class where email notification services resides
3
5
  class EmailNotificationService < KillBillClient::Model::Resource
4
-
5
6
  KILLBILL_EMAIL_NOTIFICATION_PREFIX = '/plugins/killbill-email-notifications/v1'
6
7
 
7
8
  class << self
8
-
9
9
  def get_events_to_consider(options = {})
10
10
  path = "#{KILLBILL_EMAIL_NOTIFICATION_PREFIX}/eventsToConsider"
11
11
  response = KillBillClient::API.get path, {}, options
@@ -14,11 +14,11 @@ module Kenui
14
14
 
15
15
  def get_configurations(account_ids, options = {})
16
16
  path = "#{KILLBILL_EMAIL_NOTIFICATION_PREFIX}/accounts"
17
- response = KillBillClient::API.get path, {:kbAccountId => account_ids}, options
17
+ response = KillBillClient::API.get path, { kbAccountId: account_ids }, options
18
18
 
19
19
  JSON.parse(response.body).map(&:symbolize_keys)
20
- rescue => e
21
- return false, e.message.to_s
20
+ rescue StandardError => e
21
+ [false, e.message.to_s]
22
22
  end
23
23
 
24
24
  def get_configuration_per_account(account_id, options = {})
@@ -26,8 +26,8 @@ module Kenui
26
26
  response = KillBillClient::API.get path, {}, options
27
27
 
28
28
  JSON.parse(response.body).map(&:symbolize_keys)
29
- rescue => e
30
- return false, e.message.to_s
29
+ rescue StandardError => e
30
+ [false, e.message.to_s]
31
31
  end
32
32
 
33
33
  def set_configuration_per_account(account_id, event_types, user = 'kenui', reason = nil, comment = nil, options = {})
@@ -39,23 +39,21 @@ module Kenui
39
39
 
40
40
  KillBillClient::API.post path, event_types, {}, options.merge(more_options)
41
41
 
42
- return true, "Email notifications for account #{account_id} was successfully updated"
43
- rescue => e
44
- return false, e.message.to_s
42
+ [true, "Email notifications for account #{account_id} was successfully updated"]
43
+ rescue StandardError => e
44
+ [false, e.message.to_s]
45
45
  end
46
46
 
47
47
  def email_notification_plugin_available?(options = nil)
48
-
49
48
  # inquire if the plugin is listening
50
49
  path = KILLBILL_EMAIL_NOTIFICATION_PREFIX
51
50
  KillBillClient::API.get path, nil, options
52
51
 
53
- return true, nil
52
+ [true, nil]
54
53
  # Response error if email notification plugin is not listening
55
54
  rescue KillBillClient::API::ResponseError => e
56
- return false, e.message.to_s
55
+ [false, e.message.to_s]
57
56
  end
58
-
59
57
  end
60
58
  end
61
- end
59
+ end
data/config/routes.rb CHANGED
@@ -1,8 +1,9 @@
1
- Kenui::Engine.routes.draw do
1
+ # frozen_string_literal: true
2
2
 
3
+ Kenui::Engine.routes.draw do
3
4
  root to: 'email_notifications#index'
4
5
 
5
- resources :email_notifications, :only => [:index]
6
+ resources :email_notifications, only: [:index]
6
7
 
7
8
  scope '/email_notifications' do
8
9
  match '/pagination' => 'email_notifications#pagination', :via => :get, :as => 'email_notification_pagination'
data/lib/kenui/engine.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Dependencies
2
4
  #
3
5
  # Sigh. Rails autoloads the gems specified in the Gemfile and nothing else.
@@ -7,7 +9,6 @@
7
9
  require 'jquery-rails'
8
10
  require 'jquery-datatables-rails'
9
11
  require 'font-awesome-rails'
10
- require 'twitter-bootstrap-rails'
11
12
  require 'killbill_client'
12
13
 
13
14
  module Kenui
data/lib/kenui/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kenui
2
- VERSION = '2.0.0'
4
+ VERSION = '3.0.1'
3
5
  end
data/lib/kenui.rb CHANGED
@@ -1,20 +1,22 @@
1
- require "kenui/engine"
1
+ # frozen_string_literal: true
2
+
3
+ require 'kenui/engine'
2
4
 
3
5
  module Kenui
4
6
  mattr_accessor :current_tenant_user
5
7
  mattr_accessor :layout
6
8
 
7
- self.current_tenant_user = lambda { |session, user|
8
- {:username => 'admin',
9
- :password => 'password',
10
- :session_id => nil,
11
- :api_key => KillBillClient.api_key,
12
- :api_secret => KillBillClient.api_secret}
9
+ self.current_tenant_user = lambda { |_session, _user|
10
+ { username: 'admin',
11
+ password: 'password',
12
+ session_id: nil,
13
+ api_key: KillBillClient.api_key,
14
+ api_secret: KillBillClient.api_secret }
13
15
  }
14
16
 
15
- def self.config(&block)
17
+ def self.config
16
18
  {
17
- :layout => layout || 'kenui/layouts/kenui_application',
19
+ layout: layout || 'kenui/layouts/kenui_application'
18
20
  }
19
21
  end
20
22
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # desc "Explaining what the task does"
2
3
  # task :kenui do
3
4
  # # Task goes here
metadata CHANGED
@@ -1,59 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kenui
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-21 00:00:00.000000000 Z
11
+ date: 2023-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '5.1'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '5.1'
27
- - !ruby/object:Gem::Dependency
28
- name: jquery-rails
14
+ name: font-awesome-rails
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
- - - "~>"
17
+ - - ">="
32
18
  - !ruby/object:Gem::Version
33
- version: '4.3'
19
+ version: '0'
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - "~>"
24
+ - - ">="
39
25
  - !ruby/object:Gem::Version
40
- version: '4.3'
26
+ version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: jquery-datatables-rails
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '3.3'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.3'
55
- - !ruby/object:Gem::Dependency
56
- name: twitter-bootstrap-rails
57
29
  requirement: !ruby/object:Gem::Requirement
58
30
  requirements:
59
31
  - - ">="
@@ -67,41 +39,27 @@ dependencies:
67
39
  - !ruby/object:Gem::Version
68
40
  version: '0'
69
41
  - !ruby/object:Gem::Dependency
70
- name: font-awesome-rails
42
+ name: jquery-rails
71
43
  requirement: !ruby/object:Gem::Requirement
72
44
  requirements:
73
45
  - - "~>"
74
46
  - !ruby/object:Gem::Version
75
- version: '4.7'
47
+ version: 4.5.1
76
48
  type: :runtime
77
49
  prerelease: false
78
50
  version_requirements: !ruby/object:Gem::Requirement
79
51
  requirements:
80
52
  - - "~>"
81
53
  - !ruby/object:Gem::Version
82
- version: '4.7'
54
+ version: 4.5.1
83
55
  - !ruby/object:Gem::Dependency
84
56
  name: killbill-client
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '3.2'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '3.2'
97
- - !ruby/object:Gem::Dependency
98
- name: sqlite3
99
57
  requirement: !ruby/object:Gem::Requirement
100
58
  requirements:
101
59
  - - ">="
102
60
  - !ruby/object:Gem::Version
103
61
  version: '0'
104
- type: :development
62
+ type: :runtime
105
63
  prerelease: false
106
64
  version_requirements: !ruby/object:Gem::Requirement
107
65
  requirements:
@@ -109,47 +67,33 @@ dependencies:
109
67
  - !ruby/object:Gem::Version
110
68
  version: '0'
111
69
  - !ruby/object:Gem::Dependency
112
- name: rake
70
+ name: rails
113
71
  requirement: !ruby/object:Gem::Requirement
114
72
  requirements:
115
- - - ">="
73
+ - - "~>"
116
74
  - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
75
+ version: '7.0'
76
+ type: :runtime
119
77
  prerelease: false
120
78
  version_requirements: !ruby/object:Gem::Requirement
121
79
  requirements:
122
- - - ">="
80
+ - - "~>"
123
81
  - !ruby/object:Gem::Version
124
- version: '0'
82
+ version: '7.0'
125
83
  - !ruby/object:Gem::Dependency
126
- name: listen
84
+ name: sass-rails
127
85
  requirement: !ruby/object:Gem::Requirement
128
86
  requirements:
129
87
  - - ">="
130
88
  - !ruby/object:Gem::Version
131
89
  version: '0'
132
- type: :development
90
+ type: :runtime
133
91
  prerelease: false
134
92
  version_requirements: !ruby/object:Gem::Requirement
135
93
  requirements:
136
94
  - - ">="
137
95
  - !ruby/object:Gem::Version
138
96
  version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: json
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: 1.8.6
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: 1.8.6
153
97
  description: Rails UI plugin for the Email notification plugin.
154
98
  email: killbilling-users@googlegroups.com
155
99
  executables: []
@@ -178,10 +122,11 @@ files:
178
122
  - lib/kenui/engine.rb
179
123
  - lib/kenui/version.rb
180
124
  - lib/tasks/kenui_tasks.rake
181
- homepage: http://www.killbill.io
125
+ homepage: https://killbill.io
182
126
  licenses:
183
127
  - MIT
184
- metadata: {}
128
+ metadata:
129
+ rubygems_mfa_required: 'true'
185
130
  post_install_message:
186
131
  rdoc_options: []
187
132
  require_paths:
@@ -197,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
142
  - !ruby/object:Gem::Version
198
143
  version: '0'
199
144
  requirements: []
200
- rubygems_version: 3.0.6
145
+ rubygems_version: 3.4.10
201
146
  signing_key:
202
147
  specification_version: 4
203
148
  summary: Kill Bill Email Notification UI mountable engine