cm-admin 3.0.3 → 3.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92c1ac381c7141e2801cb3f7fe4910054b334a23e7ccde418eaa399cf00cd97a
4
- data.tar.gz: 53c22100fca22f60e04c750fa23b8cb3132d225e8f9854242b258f054aa345c7
3
+ metadata.gz: 5a4959d23e72acb3973b23cd3c275cc64545fa0d99a899d6315df73026fd889d
4
+ data.tar.gz: dd2daf0d768d1dc01409383c1966905975bfdead82aa126909228ec9b88e90dc
5
5
  SHA512:
6
- metadata.gz: cc716f2b0f3ae3eedd90366398f5c4d6951e4deb04b8dfe5b3a260f98ef6d47293e03a14bd7d848c9367c1a5a22c266f1fd49ca4818c8249104cb5cf9acb0506
7
- data.tar.gz: befabc92fca92618d6a7d743fa28ae44c133364d5827cce882012e96768013fa030a91ef06d2aa8a370aa020bfc6a50002d3e2ea2ae3d92eb59a2c55bc6ec1bd
6
+ metadata.gz: b323940b77edf010dd5079c53f2a17b5334c8e005f430a27097f9597e827343f5ab9342452a74060f9703d9c3ac7010454bdb99ace1353cf5679749a98f82cb3
7
+ data.tar.gz: 412ff6701ea7ec48b982c8ee011fed1728ae9ac48334b80e7ca5b6f20f5a8d48d95d3f4f3c2ddbd3a945578b1baa84df4ecf026586ede4fb46783338abb20b2d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (3.0.3)
4
+ cm-admin (3.0.4)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -18,7 +18,7 @@ var CmFilter = {
18
18
 
19
19
  // Main method which will structure the existing filter values with the newly
20
20
  // applied filter. Send and receive the value from the backend.
21
- var getFilteredData = function(filterType, filterValue, filterColumn=null) {
21
+ var getFilteredData = function(filterType, filterValue, filterColumn=null, sortData=null) {
22
22
  let sortColumn = $('[data-behaviour="sort-column"]').val();
23
23
  let sortDirection = $('[data-behaviour="sort-direction"]:checked').val();
24
24
 
@@ -86,6 +86,13 @@ var getFilteredData = function(filterType, filterValue, filterColumn=null) {
86
86
  } else {
87
87
  $('.cm-index-page__table-container').html(data);
88
88
  }
89
+ if (sortData) {
90
+ const dropdownElement = document.querySelector('[data-behaviour="sort-button-toggle"]');
91
+ if (dropdownElement) {
92
+ const dropdown = new bootstrap.Dropdown(dropdownElement);
93
+ dropdown.show();
94
+ }
95
+ }
89
96
  },
90
97
  error: function(jqxhr, textStatus, errorThrown) {
91
98
  console.log(errorThrown, textStatus);
@@ -353,7 +360,7 @@ $(document).on('click', '[data-behaviour="selected-chip"]', function(e) {
353
360
  })
354
361
 
355
362
  $(document).on("change", '[data-behaviour="sort-column"], [data-behaviour="sort-direction"]', function (e) {
356
- getFilteredData(null, null, null);
363
+ getFilteredData(null, null, null, true);
357
364
  });
358
365
 
359
366
  $(document).on("click", '[data-behaviour="reset-sort"]', function (e) {
@@ -3,7 +3,7 @@ class FileImport < ApplicationRecord
3
3
 
4
4
  belongs_to :added_by, polymorphic: true
5
5
 
6
- enum status: { in_progress: 0, success: 1, failed: 2 }
6
+ enum :status, { in_progress: 0, success: 1, failed: 2 }
7
7
 
8
8
  has_one_attached :import_file
9
9
 
@@ -1,7 +1,7 @@
1
1
  - sort_column = params[:sort_column] || model.default_sort_column
2
2
  - sort_direction = params[:sort_direction] || model.default_sort_direction
3
3
  .dropdown
4
- button.sort-button data-bs-toggle="dropdown"
4
+ button.sort-button data-bs-toggle="dropdown" data-bs-auto-close="outside" data-behaviour="sort-button-toggle"
5
5
  - if sort_column.present?
6
6
  span
7
7
  - if sort_direction == 'asc'
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '3.0.3'
2
+ VERSION = '3.0.4'
3
3
  end
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: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: exe
16
16
  cert_chain: []
17
- date: 2024-10-23 00:00:00.000000000 Z
17
+ date: 2024-10-24 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: caxlsx_rails