five-two-nw-olivander 0.2.0.8 → 0.2.0.9

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: d898798155655b25246bd5f3ed6db6527749b8626ccb877ad09ad49c4461cf16
4
- data.tar.gz: e034cbc59cd38d51d5dd3d82cf628db6ba5ecb935af80fb118575f16a57d0b7d
3
+ metadata.gz: d03db809e6a048326facbf9b2af1d2a41b97ed6931c338a931e923ce092687e0
4
+ data.tar.gz: 2f879a0e932ce2732c3a595b3ede5e3c76767c8e69d2ebe50afbfa38793c5d7a
5
5
  SHA512:
6
- metadata.gz: 3d48968d12e4474b5800451cdfea383c2dd90c22d636887ab12c0d0147a1c6519a41267ab58d90a400986dda16043eea7596825dfc9ef389cac79819f4fc4d7e
7
- data.tar.gz: 72e4e087d0bed9d5fed3c709ba15d37e411da184eb76d4e1ccba6443b678ff3980eb7fa71a13cd0624ca989b7ddf75d18e6fea1f415753942d8a3375c3f57b55
6
+ metadata.gz: 5f50ce97f66bd83cc7f79e8c17debfeb371be45abf09aed81e722c95cf220a7641e3ccbdf67bd87e139e8c96c7a6595028bb3865e65f160f961d24e84fe574f5
7
+ data.tar.gz: c036f2874e20c609005eb82143899b7ce2c61dc178e016ba6240d02df763025af0c3e634019219c2827695d875f67ae197ecc36be2f7dc10afda44c2a752a879
@@ -3,12 +3,9 @@ import { Controller } from "@hotwired/stimulus"
3
3
  // Connects to data-controller="input-control-association"
4
4
  export default class extends Controller {
5
5
  connect() {
6
- console.log('setting up select2')
7
6
  var self = this,
8
7
  el = self.element;
9
8
 
10
- console.log(el.dataset)
11
-
12
9
  if (!$(el).hasClass("select2-hidden-accessible")) {
13
10
  $(el).select2({
14
11
  dropdownParent: $(el).parent(),
@@ -36,7 +33,6 @@ export default class extends Controller {
36
33
  }
37
34
  }
38
35
  }).on('select2:select', function (e) {
39
-
40
36
  let tag = e.params.data;
41
37
  if (tag.isNew === true)
42
38
  {
@@ -1,16 +1,17 @@
1
- - @resource.class.resource_field_groups.select{ |x| x.editable }.each do |rfg|
2
- %h3= resource_field_group_label(@resource.class, rfg.key) unless rfg.key == :default
3
- - rfg.sections.each do |section|
4
- .row
5
- - section.fields.each do |field|
6
- %div{ class: section.column_class }
7
- - if association?(field)
8
- - collection = collection_for(field)
9
- - if one_through?(field)
10
- = @f.input field.sym, collection: [collection].flatten, disabled: !field.editable, input_html: { data: association_data_hash_for(field) }, selected: collection
11
- - else
12
- = @f.association field.sym, collection: [collection].flatten, disabled: !field.editable, input_html: { data: association_data_hash_for(field) }
13
- - elsif boolean?(field)
14
- = @f.input field.sym, disabled: !field.editable, as: field.type.to_sym, input_html: { data: { controller: "input-control-#{field.type}" } }, wrapper: :checkbox
15
- - else
16
- = @f.input field.sym, disabled: !field.editable, as: field.type.to_sym, input_html: { rows: 10, data: { controller: "input-control-#{field.type}" } }
1
+ %div{ data: { controller: "#{@resource.class.name.underscore.gsub('_', '-').gsub('/', '--')}-form" } }
2
+ - @resource.class.resource_field_groups.select{ |x| x.editable }.each do |rfg|
3
+ %h3= resource_field_group_label(@resource.class, rfg.key) unless rfg.key == :default
4
+ - rfg.sections.each do |section|
5
+ .row
6
+ - section.fields.each do |field|
7
+ %div{ class: section.column_class }
8
+ - if association?(field)
9
+ - collection = collection_for(field)
10
+ - if one_through?(field)
11
+ = @f.input field.sym, collection: [collection].flatten, disabled: !field.editable, input_html: { data: association_data_hash_for(field) }, selected: collection
12
+ - else
13
+ = @f.association field.sym, collection: [collection].flatten, disabled: !field.editable, input_html: { data: association_data_hash_for(field) }
14
+ - elsif boolean?(field)
15
+ = @f.input field.sym, disabled: !field.editable, as: field.type.to_sym, input_html: { data: { controller: "input-control-#{field.type}" } }
16
+ - else
17
+ = @f.input field.sym, disabled: !field.editable, as: field.type.to_sym, input_html: { rows: 10, data: { controller: "input-control-#{field.type}" } }
@@ -24,7 +24,6 @@ class Olivander::Components::ResourceFormComponent < ViewComponent::Base
24
24
 
25
25
  def taggable?(field)
26
26
  method_key = "#{field.sym}_taggable?"
27
- puts method_key
28
27
  return false unless @resource.class.respond_to?(method_key)
29
28
 
30
29
  @resource.class.send(method_key)
@@ -1,3 +1,3 @@
1
1
  module Olivander
2
- VERSION = '0.2.0.8'.freeze
2
+ VERSION = '0.2.0.9'.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.8
4
+ version: 0.2.0.9
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-22 00:00:00.000000000 Z
11
+ date: 2024-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chartkick