five-two-nw-olivander 0.2.0.10 → 0.2.0.12

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: 2b9bf0db992977ea25a96b2782b638d482dc5c27333d2795f512496c306459ba
4
- data.tar.gz: dadf2e11e29a241abee39db51583771ab16d825a38f1a57426b7a3fcff44af57
3
+ metadata.gz: 53428f87f834a6688a74a6cf57a397a782a2db6564323e553bf2b6ee8bc2c5b7
4
+ data.tar.gz: 9c9806f86484aac3c3ae2ea0c507cec257c70441b9e8c75898a3357a410c9f38
5
5
  SHA512:
6
- metadata.gz: 344259001e8aab4349e3e27b65f7879c7600b14e6a3540933a2ac1b108e1b6ba439a4c593450176322a8dc1eaf16efd1b5cfc392039141ad80ed34d87bda6c92
7
- data.tar.gz: 36925ee8e38aa720174e0c99bdbf457c87e4374b8b0f2ac5bd50932cbbf0f3c21c88a6755721421bd97433ef6ad2bff6c2d45a1a93c91047f2a68c3c0618f8c9
6
+ metadata.gz: bbdfe42a7b0334f2d9982ce924a87705013a3a23efc028464aeb3939b4eada997e21ed58d6b32136de9189a09bf215329bab2ab4b75d046e4359c480fb26ef79
7
+ data.tar.gz: 2092202bf22b34e041d672ff7b407b7f7556b1b879f917d81ee153ebc8f6c507e5490af8e8a294a67a098130933abb1c69316ab39c1592ae77e0b47b1a1ae0b2
@@ -6,18 +6,19 @@ export default class extends Controller {
6
6
  var self = this
7
7
 
8
8
  $(".effective-datatable").on("draw.dt", function(e, dt, type, indexes) {
9
- var jsonCharts = dt.json.charts
10
- for (var chart in jsonCharts) {
11
- var chartkickChart = Chartkick.charts[chart]
12
- chartkickChart.updateData(self.transformData(jsonCharts[chart]))
13
- chartkickChart.redraw()
9
+ if (dt && dt.json && dt.json.charts) {
10
+ var jsonCharts = dt.json.charts
11
+ for (var chart in jsonCharts) {
12
+ var chartkickChart = Chartkick.charts[chart]
13
+ chartkickChart.updateData(self.transformData(jsonCharts[chart]))
14
+ chartkickChart.redraw()
15
+ }
14
16
  }
15
17
  });
16
18
  }
17
19
 
18
20
  transformData(chart) {
19
21
  var self = this
20
- console.log("let's transform some data")
21
22
  if (chart.as == 'LineChart') {
22
23
  // we don't know what to do
23
24
  return chart.data
@@ -6,9 +6,11 @@ export default class extends Controller {
6
6
  var self = this,
7
7
  el = self.element;
8
8
 
9
+ console.log('did we do anything')
9
10
  if (!$(el).hasClass("select2-hidden-accessible")) {
10
11
  $(el).select2({
11
12
  dropdownParent: $(el).parent(),
13
+ minimumInputLength: el.dataset.minimumInputLength || 0,
12
14
  tags: el.dataset.taggable == 'true',
13
15
  createTag: function (tag) {
14
16
  return {
@@ -20,8 +22,20 @@ export default class extends Controller {
20
22
  ajax: {
21
23
  url: el.dataset.collectionPath,
22
24
  delay: 250,
23
- minimumInputLength: 2,
24
25
  dataType: 'json',
26
+ data: function(params) {
27
+ console.log(params)
28
+ var hash = {
29
+ term: params.term,
30
+ _type: params._type,
31
+ }
32
+
33
+ if (el.dataset.tagParentId) {
34
+ hash[el.dataset.tagParentSearch] = el.dataset.tagParentId
35
+ }
36
+
37
+ return hash;
38
+ },
25
39
  processResults: function(data) {
26
40
  return { results: data.map(function(map) {
27
41
  return {
@@ -40,6 +54,7 @@ export default class extends Controller {
40
54
  data = new FormData()
41
55
  data.append("authenticity_token", document.querySelector('meta[name="csrf-token"]').content)
42
56
  data.append(el.dataset.tagFieldName, tag.text)
57
+ data.append(el.dataset.tagParentField, el.dataset.tagParentId)
43
58
  fetch(el.dataset.collectionPath, {
44
59
  method: 'POST',
45
60
  headers: {
@@ -8,5 +8,6 @@
8
8
  %link{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback' }
9
9
  = javascript_include_tag "https://www.gstatic.com/charts/loader.js"
10
10
  = stylesheet_link_tag "adminlte", "data-turbo-track": "reload"
11
+ = stylesheet_link_tag "application", "data-turbo-track": "reload"
11
12
  = javascript_include_tag "adminlte", "data-turbo-track": "reload"
12
13
  = javascript_importmap_tags
@@ -1,3 +1,3 @@
1
1
  module Olivander
2
- VERSION = '0.2.0.10'.freeze
2
+ VERSION = '0.2.0.12'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: five-two-nw-olivander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.10
4
+ version: 0.2.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Dennis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-27 00:00:00.000000000 Z
11
+ date: 2024-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chartkick