motor-admin 0.1.41 → 0.1.42
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/lib/generators/motor/templates/install.rb +10 -10
- data/lib/motor/build_schema/find_display_column.rb +32 -30
- data/lib/motor/version.rb +1 -1
- data/ui/dist/{main-0ef3be65da8d3b0dbabb.css.gz → main-05401628fabd32884fa6.css.gz} +0 -0
- data/ui/dist/{main-0ef3be65da8d3b0dbabb.js.gz → main-05401628fabd32884fa6.js.gz} +0 -0
- data/ui/dist/manifest.json +5 -5
- metadata +4 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 6b5c8de183eb4dca0deba15c13f4e17a5cd4b6042ba2aa72e69e4056f0dd07bb
         | 
| 4 | 
            +
              data.tar.gz: 5696598a4d1a461fb401b6bd6b9036dbe8ac8d31ce71d8e19edabb0e68b4fa91
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 05e81845c5be4540e7062b945b7ca21a51c197a6c540da1ce747fc478f8105e4e80b375bcf708a1e2b634fffe732c6024fa0626a77baaddfc99eb8bdbdcc6d4e
         | 
| 7 | 
            +
              data.tar.gz: 581692e4333bdcde696190897b810206cc7cc222d8a82796d8ba098130b76801b843e6a72b791ba0b8a1aca1686ed88cb14c5c0161953f21273628ae811c55c5
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
         | 
| 2 2 | 
             
              def self.up
         | 
| 3 | 
            -
                create_table :motor_queries | 
| 3 | 
            +
                create_table :motor_queries do |t|
         | 
| 4 4 | 
             
                  t.column :name, :string, null: false
         | 
| 5 5 | 
             
                  t.column :description, :string
         | 
| 6 6 | 
             
                  t.column :sql_body, :string, null: false
         | 
| @@ -18,7 +18,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi | |
| 18 18 | 
             
                          where: 'deleted_at IS NULL'
         | 
| 19 19 | 
             
                end
         | 
| 20 20 |  | 
| 21 | 
            -
                create_table :motor_dashboards | 
| 21 | 
            +
                create_table :motor_dashboards do |t|
         | 
| 22 22 | 
             
                  t.column :title, :string, null: false
         | 
| 23 23 | 
             
                  t.column :description, :string
         | 
| 24 24 | 
             
                  t.column :preferences, :string, null: false, default: '{}'
         | 
| @@ -35,7 +35,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi | |
| 35 35 | 
             
                          where: 'deleted_at IS NULL'
         | 
| 36 36 | 
             
                end
         | 
| 37 37 |  | 
| 38 | 
            -
                create_table :motor_forms | 
| 38 | 
            +
                create_table :motor_forms do |t|
         | 
| 39 39 | 
             
                  t.column :name, :string, null: false
         | 
| 40 40 | 
             
                  t.column :description, :string
         | 
| 41 41 | 
             
                  t.column :api_path, :string, null: false
         | 
| @@ -54,7 +54,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi | |
| 54 54 | 
             
                          where: 'deleted_at IS NULL'
         | 
| 55 55 | 
             
                end
         | 
| 56 56 |  | 
| 57 | 
            -
                create_table :motor_resources | 
| 57 | 
            +
                create_table :motor_resources do |t|
         | 
| 58 58 | 
             
                  t.column :name, :string, null: false, index: { unique: true }
         | 
| 59 59 | 
             
                  t.column :preferences, :string, null: false, default: '{}'
         | 
| 60 60 |  | 
| @@ -63,7 +63,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi | |
| 63 63 | 
             
                  t.index :updated_at
         | 
| 64 64 | 
             
                end
         | 
| 65 65 |  | 
| 66 | 
            -
                create_table :motor_configs | 
| 66 | 
            +
                create_table :motor_configs do |t|
         | 
| 67 67 | 
             
                  t.column :key, :string, null: false, index: { unique: true }
         | 
| 68 68 | 
             
                  t.column :value, :string, null: false, default: '{}'
         | 
| 69 69 |  | 
| @@ -72,7 +72,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi | |
| 72 72 | 
             
                  t.index :updated_at
         | 
| 73 73 | 
             
                end
         | 
| 74 74 |  | 
| 75 | 
            -
                create_table :motor_alerts | 
| 75 | 
            +
                create_table :motor_alerts do |t|
         | 
| 76 76 | 
             
                  t.references :query, null: false, foreign_key: { to_table: :motor_queries }, index: true
         | 
| 77 77 | 
             
                  t.column :name, :string, null: false
         | 
| 78 78 | 
             
                  t.column :description, :string
         | 
| @@ -92,7 +92,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi | |
| 92 92 | 
             
                          where: 'deleted_at IS NULL'
         | 
| 93 93 | 
             
                end
         | 
| 94 94 |  | 
| 95 | 
            -
                create_table :motor_alert_locks | 
| 95 | 
            +
                create_table :motor_alert_locks do |t|
         | 
| 96 96 | 
             
                  t.references :alert, null: false, foreign_key: { to_table: :motor_alerts }
         | 
| 97 97 | 
             
                  t.column :lock_timestamp, :string, null: false
         | 
| 98 98 |  | 
| @@ -101,7 +101,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi | |
| 101 101 | 
             
                  t.index %i[alert_id lock_timestamp], unique: true
         | 
| 102 102 | 
             
                end
         | 
| 103 103 |  | 
| 104 | 
            -
                create_table :motor_tags | 
| 104 | 
            +
                create_table :motor_tags do |t|
         | 
| 105 105 | 
             
                  t.column :name, :string, null: false
         | 
| 106 106 |  | 
| 107 107 | 
             
                  t.timestamps
         | 
| @@ -111,7 +111,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi | |
| 111 111 | 
             
                          unique: true
         | 
| 112 112 | 
             
                end
         | 
| 113 113 |  | 
| 114 | 
            -
                create_table :motor_taggable_tags | 
| 114 | 
            +
                create_table :motor_taggable_tags do |t|
         | 
| 115 115 | 
             
                  t.references :tag, null: false, foreign_key: { to_table: :motor_tags }, index: true
         | 
| 116 116 | 
             
                  t.column :taggable_id, :integer, null: false
         | 
| 117 117 | 
             
                  t.column :taggable_type, :string, null: false
         | 
| @@ -121,7 +121,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi | |
| 121 121 | 
             
                          unique: true
         | 
| 122 122 | 
             
                end
         | 
| 123 123 |  | 
| 124 | 
            -
                create_table :motor_audits | 
| 124 | 
            +
                create_table :motor_audits do |t|
         | 
| 125 125 | 
             
                  t.column :auditable_id, :integer
         | 
| 126 126 | 
             
                  t.column :auditable_type, :string
         | 
| 127 127 | 
             
                  t.column :associated_id, :integer
         | 
| @@ -3,35 +3,37 @@ | |
| 3 3 | 
             
            module Motor
         | 
| 4 4 | 
             
              module BuildSchema
         | 
| 5 5 | 
             
                module FindDisplayColumn
         | 
| 6 | 
            -
                  DISPLAY_NAMES =  | 
| 7 | 
            -
                     | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
             | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 17 | 
            -
             | 
| 18 | 
            -
             | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 32 | 
            -
             | 
| 33 | 
            -
             | 
| 34 | 
            -
                   | 
| 6 | 
            +
                  DISPLAY_NAMES = Set.new(
         | 
| 7 | 
            +
                    %w[
         | 
| 8 | 
            +
                      name
         | 
| 9 | 
            +
                      full_name
         | 
| 10 | 
            +
                      fullname
         | 
| 11 | 
            +
                      last_name
         | 
| 12 | 
            +
                      lastname
         | 
| 13 | 
            +
                      first_name
         | 
| 14 | 
            +
                      firstname
         | 
| 15 | 
            +
                      fname
         | 
| 16 | 
            +
                      lname
         | 
| 17 | 
            +
                      sname
         | 
| 18 | 
            +
                      company
         | 
| 19 | 
            +
                      domain
         | 
| 20 | 
            +
                      title
         | 
| 21 | 
            +
                      phone
         | 
| 22 | 
            +
                      phone_number
         | 
| 23 | 
            +
                      email
         | 
| 24 | 
            +
                      phone
         | 
| 25 | 
            +
                      filename
         | 
| 26 | 
            +
                      file_name
         | 
| 27 | 
            +
                      url
         | 
| 28 | 
            +
                      make
         | 
| 29 | 
            +
                      brand
         | 
| 30 | 
            +
                      manufacturer
         | 
| 31 | 
            +
                      model
         | 
| 32 | 
            +
                      address
         | 
| 33 | 
            +
                    ]
         | 
| 34 | 
            +
                  ).freeze
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                  DISPLAY_NAME_REGEXP = Regexp.new(Regexp.union(DISPLAY_NAMES.to_a).source, Regexp::IGNORECASE)
         | 
| 35 37 |  | 
| 36 38 | 
             
                  module_function
         | 
| 37 39 |  | 
| @@ -42,7 +44,7 @@ module Motor | |
| 42 44 | 
             
                  end
         | 
| 43 45 |  | 
| 44 46 | 
             
                  def select_column_name(column_names)
         | 
| 45 | 
            -
                    name   =  | 
| 47 | 
            +
                    name   = column_names.find { |column_name| column_name.in?(DISPLAY_NAMES) }
         | 
| 46 48 | 
             
                    name ||= column_names.find { |column_name| column_name.match?(DISPLAY_NAME_REGEXP) }
         | 
| 47 49 |  | 
| 48 50 | 
             
                    name
         | 
    
        data/lib/motor/version.rb
    CHANGED
    
    
| Binary file | 
| Binary file | 
    
        data/ui/dist/manifest.json
    CHANGED
    
    | @@ -5,9 +5,9 @@ | |
| 5 5 | 
             
              "fonts/ionicons.ttf?v=3.0.0-alpha.3": "fonts/ionicons.ttf",
         | 
| 6 6 | 
             
              "fonts/ionicons.woff2?v=3.0.0-alpha.3": "fonts/ionicons.woff2",
         | 
| 7 7 | 
             
              "fonts/ionicons.woff?v=3.0.0-alpha.3": "fonts/ionicons.woff",
         | 
| 8 | 
            -
              "main- | 
| 9 | 
            -
              "main- | 
| 10 | 
            -
              "main- | 
| 11 | 
            -
              "main.css": "main- | 
| 12 | 
            -
              "main.js": "main- | 
| 8 | 
            +
              "main-05401628fabd32884fa6.css.gz": "main-05401628fabd32884fa6.css.gz",
         | 
| 9 | 
            +
              "main-05401628fabd32884fa6.js.LICENSE.txt": "main-05401628fabd32884fa6.js.LICENSE.txt",
         | 
| 10 | 
            +
              "main-05401628fabd32884fa6.js.gz": "main-05401628fabd32884fa6.js.gz",
         | 
| 11 | 
            +
              "main.css": "main-05401628fabd32884fa6.css",
         | 
| 12 | 
            +
              "main.js": "main-05401628fabd32884fa6.js"
         | 
| 13 13 | 
             
            }
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: motor-admin
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.42
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Pete Matsyburka
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2021-05- | 
| 11 | 
            +
            date: 2021-05-17 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activerecord-filter
         | 
| @@ -242,8 +242,8 @@ files: | |
| 242 242 | 
             
            - lib/motor/tasks/motor.rake
         | 
| 243 243 | 
             
            - lib/motor/version.rb
         | 
| 244 244 | 
             
            - ui/dist/fonts/ionicons.woff2
         | 
| 245 | 
            -
            - ui/dist/main- | 
| 246 | 
            -
            - ui/dist/main- | 
| 245 | 
            +
            - ui/dist/main-05401628fabd32884fa6.css.gz
         | 
| 246 | 
            +
            - ui/dist/main-05401628fabd32884fa6.js.gz
         | 
| 247 247 | 
             
            - ui/dist/manifest.json
         | 
| 248 248 | 
             
            homepage:
         | 
| 249 249 | 
             
            licenses:
         |