cm-admin 4.4.6 → 4.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +16 -2
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/cm_admin/application.js +1 -1
- data/app/assets/javascripts/cm_admin/kanban.js +31 -29
- data/app/assets/javascripts/cm_admin/shared_scaffolds.js +5 -0
- data/app/controllers/cm_admin/resource_controller.rb +1 -1
- data/app/views/cm_admin/main/_kanban.html.slim +2 -2
- data/lib/cm_admin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f200f0b81773d02d7dd472b90c0dcdc124cd3797e7a09b06cef05b42b597132
|
4
|
+
data.tar.gz: 31ebaa25c7016f262697e52f76bc695db07595286d8ac088175390d09eea1ffe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a655ebbf63906cd67dd83f3e2a68eaff22c1d215a4e6b0eb1ea7e05b471ccb24907a65552236ca893161fa64979cb03c825d4b922637de73124fb601174df8d3
|
7
|
+
data.tar.gz: 9ebfab98bc9321b20141765412dbb229e6c994195a3f82de0c1420c423bea0fe6790aaaaf57147a92a9c850713e051f471e49f35e9d64f5e1d31a470fab6268a
|
data/.github/workflows/test.yml
CHANGED
@@ -7,6 +7,10 @@ jobs:
|
|
7
7
|
if: "!contains(github.event.head_commit.message, '[skip-tests]')"
|
8
8
|
runs-on: ubuntu-latest
|
9
9
|
|
10
|
+
strategy:
|
11
|
+
matrix:
|
12
|
+
rails-version: ["7.1", "7.2", "8.0"]
|
13
|
+
|
10
14
|
services:
|
11
15
|
postgres:
|
12
16
|
image: postgres:17
|
@@ -28,10 +32,16 @@ jobs:
|
|
28
32
|
|
29
33
|
- name: Install dependencies
|
30
34
|
working-directory: feature-app
|
31
|
-
|
35
|
+
env:
|
36
|
+
RAILS_TEST_VERSION: ${{ matrix.rails-version }}
|
37
|
+
run: |
|
38
|
+
bundle install
|
39
|
+
bundle exec appraisal install
|
32
40
|
|
33
41
|
- name: Set up database
|
34
42
|
working-directory: feature-app
|
43
|
+
env:
|
44
|
+
RAILS_TEST_VERSION: ${{ matrix.rails-version }}
|
35
45
|
run: |
|
36
46
|
cp config/database.yml.ci config/database.yml
|
37
47
|
RAILS_ENV=test bundle exec rails db:create
|
@@ -39,8 +49,12 @@ jobs:
|
|
39
49
|
|
40
50
|
- name: Precompile assets
|
41
51
|
working-directory: feature-app
|
52
|
+
env:
|
53
|
+
RAILS_TEST_VERSION: ${{ matrix.rails-version }}
|
42
54
|
run: RAILS_ENV=test bundle exec rails assets:precompile
|
43
55
|
|
44
56
|
- name: Run RSpec tests
|
45
57
|
working-directory: feature-app
|
46
|
-
|
58
|
+
env:
|
59
|
+
RAILS_TEST_VERSION: ${{ matrix.rails-version }}
|
60
|
+
run: bundle exec appraisal rails-${{ matrix.rails-version }} rspec
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import "./scaffolds.js";
|
2
2
|
import "./shared_scaffolds.js";
|
3
3
|
|
4
|
+
import "./kanban.js";
|
4
5
|
import "./bulk_actions.js";
|
5
6
|
import "./cocoon.js";
|
6
7
|
import "./exports.js";
|
@@ -8,5 +9,4 @@ import "./filters.js";
|
|
8
9
|
import "./form_validation.js";
|
9
10
|
import "./quick_search.js";
|
10
11
|
import "./custom.js";
|
11
|
-
import "./kanban.js";
|
12
12
|
import "./custom_action";
|
@@ -1,30 +1,32 @@
|
|
1
|
-
$(document).on(
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
})
|
1
|
+
$(document).on("turbo:load", function() {
|
2
|
+
$(document).on('click', "[data-action='kanban-show-more']", function(e) {
|
3
|
+
e.preventDefault();
|
4
|
+
var page = $(this).data('page') + 1
|
5
|
+
var query_string = window.location.search
|
6
|
+
$.ajax('/admin/batch_order_items' + query_string, {
|
7
|
+
type: "GET",
|
8
|
+
data: {
|
9
|
+
page: page,
|
10
|
+
per_page: $(this).data('per-page'),
|
11
|
+
view_type: 'kanban'
|
12
|
+
},
|
13
|
+
success: function (data) {
|
14
|
+
apply_response_to_board(data.table.data);
|
15
|
+
$("[data-action='kanban-show-more']").data('page', page)
|
16
|
+
if (data.table.paging.next_page == false) {
|
17
|
+
$("[data-action='kanban-show-more']").addClass('disabled')
|
18
|
+
}
|
19
|
+
$("[data-action='kanban-show-more']").data('page', page)
|
20
|
+
},
|
21
|
+
error: function (jqxhr, textStatus, errorThrown) {
|
22
|
+
alert("Something went wrong. Please try again later.\n" + errorThrown);
|
23
|
+
},
|
24
|
+
});
|
25
|
+
})
|
25
26
|
|
26
|
-
function apply_response_to_board(json_data) {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
}
|
27
|
+
function apply_response_to_board(json_data) {
|
28
|
+
$.each(json_data, function(key, value) {
|
29
|
+
$('.' + key + " [data-section='kanban-cards']").append(value)
|
30
|
+
});
|
31
|
+
}
|
32
|
+
});
|
@@ -72,6 +72,11 @@ $(document).on("click", '[data-behaviour="offcanvas"]', function (e) {
|
|
72
72
|
});
|
73
73
|
});
|
74
74
|
|
75
|
+
// Select2 focus on open
|
76
|
+
$(document).on("select2:open", () => {
|
77
|
+
document.querySelector(".select2-search__field").focus();
|
78
|
+
});
|
79
|
+
|
75
80
|
$(document).on("click", '[data-bs-dismiss="offcanvas"]', function (e) {
|
76
81
|
$(document).off("submit", "[data-is-drawer-form='true']");
|
77
82
|
});
|
@@ -386,7 +386,7 @@ module CmAdmin
|
|
386
386
|
group_record_count = final_data.group(params[:kanban_column_name] || @current_action.kanban_attr[:column_name]).count
|
387
387
|
per_page = params[:per_page] || 20
|
388
388
|
page = params[:page] || 1
|
389
|
-
max_page = (group_record_count.values.max.to_i / per_page.to_f).ceil
|
389
|
+
max_page = (group_record_count.reject { |k, _v| k.nil? }.values.max.to_i / per_page.to_f).ceil
|
390
390
|
filtered_result.paging['next_page'] = (page.to_i < max_page)
|
391
391
|
filtered_result.column_count = group_record_count.reject { |key, _value| key.blank? }
|
392
392
|
|
@@ -6,11 +6,11 @@
|
|
6
6
|
.kanban-list__header
|
7
7
|
p = column_name.to_s.titleize
|
8
8
|
p.counter = @ar_object.column_count[column_name].to_i
|
9
|
-
.cards
|
9
|
+
.cards data-section='kanban-cards'
|
10
10
|
= @ar_object.data[column_name]
|
11
11
|
|
12
12
|
.pagination-bar.kanban-pagination
|
13
|
-
.btn.btn-primary.kanban-show-more data-page=1 Show more
|
13
|
+
.btn.btn-primary.kanban-show-more data-action='kanban-show-more' data-page=1 Show more
|
14
14
|
/ = render partial: 'cm_admin/main/show_as_drawer'
|
15
15
|
|
16
16
|
= export_modal(@model)
|
data/lib/cm_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cm-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.4.
|
4
|
+
version: 4.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
- Austin
|
14
14
|
bindir: exe
|
15
15
|
cert_chain: []
|
16
|
-
date: 2025-01-
|
16
|
+
date: 2025-01-17 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: caxlsx_rails
|