Browse Source

Fixed html5 input type attribute for phone, it's tel (not phone).

Martin Edenhofer 8 years ago
parent
commit
9e52358d57

+ 1 - 1
app/assets/javascripts/app/controllers/object_manager.coffee

@@ -64,7 +64,7 @@ class Items extends App.ControllerContent
 
     itemsToChange = []
     for item in App.ObjectManagerAttribute.search(sortBy: 'object')
-      if item.to_create is true || item.to_delete is true
+      if item.to_create is true || item.to_delete is true || item.to_migrate is true || item.to_config is true
         itemsToChange.push item
 
     @html App.view('object_manager/index')(

+ 3 - 3
db/migrate/20160217000001_object_manager_update_user.rb

@@ -216,7 +216,7 @@ class ObjectManagerUpdateUser < ActiveRecord::Migration
       display: 'Phone',
       data_type: 'input',
       data_option: {
-        type: 'phone',
+        type: 'tel',
         maxlength: 100,
         null: true,
         item_class: 'formGroup--halfSize',
@@ -251,7 +251,7 @@ class ObjectManagerUpdateUser < ActiveRecord::Migration
       display: 'Mobile',
       data_type: 'input',
       data_option: {
-        type: 'phone',
+        type: 'tel',
         maxlength: 100,
         null: true,
         item_class: 'formGroup--halfSize',
@@ -286,7 +286,7 @@ class ObjectManagerUpdateUser < ActiveRecord::Migration
       display: 'Fax',
       data_type: 'input',
       data_option: {
-        type: 'phone',
+        type: 'tel',
         maxlength: 100,
         null: true,
         item_class: 'formGroup--halfSize',

+ 106 - 0
db/migrate/20160529000001_update_object_manager2.rb

@@ -6,5 +6,111 @@ class UpdateObjectManager2 < ActiveRecord::Migration
     add_column :object_manager_attributes, :to_config, :boolean, null: false, default: false
     add_column :object_manager_attributes, :data_option_new, :string, limit: 8000, null: true, default: false
 
+    UserInfo.current_user_id = 1
+    ObjectManager::Attribute.add(
+      force: true,
+      object: 'User',
+      name: 'phone',
+      display: 'Phone',
+      data_type: 'input',
+      data_option: {
+        type: 'tel',
+        maxlength: 100,
+        null: true,
+        item_class: 'formGroup--halfSize',
+      },
+      editable: false,
+      active: true,
+      screens: {
+        signup: {},
+        invite_agent: {},
+        invite_customer: {},
+        edit: {
+          '-all-' => {
+            null: true,
+          },
+        },
+        view: {
+          '-all-' => {
+            shown: true,
+          },
+        },
+      },
+      to_create: false,
+      to_migrate: false,
+      to_delete: false,
+      position: 600,
+    )
+
+    ObjectManager::Attribute.add(
+      force: true,
+      object: 'User',
+      name: 'mobile',
+      display: 'Mobile',
+      data_type: 'input',
+      data_option: {
+        type: 'tel',
+        maxlength: 100,
+        null: true,
+        item_class: 'formGroup--halfSize',
+      },
+      editable: false,
+      active: true,
+      screens: {
+        signup: {},
+        invite_agent: {},
+        invite_customer: {},
+        edit: {
+          '-all-' => {
+            null: true,
+          },
+        },
+        view: {
+          '-all-' => {
+            shown: true,
+          },
+        },
+      },
+      to_create: false,
+      to_migrate: false,
+      to_delete: false,
+      position: 700,
+    )
+
+    ObjectManager::Attribute.add(
+      force: true,
+      object: 'User',
+      name: 'fax',
+      display: 'Fax',
+      data_type: 'input',
+      data_option: {
+        type: 'tel',
+        maxlength: 100,
+        null: true,
+        item_class: 'formGroup--halfSize',
+      },
+      editable: false,
+      active: true,
+      screens: {
+        signup: {},
+        invite_agent: {},
+        invite_customer: {},
+        edit: {
+          '-all-' => {
+            null: true,
+          },
+        },
+        view: {
+          '-all-' => {
+            shown: true,
+          },
+        },
+      },
+      to_create: false,
+      to_migrate: false,
+      to_delete: false,
+      position: 800,
+    )
+
   end
 end

+ 3 - 3
db/seeds.rb

@@ -3194,7 +3194,7 @@ ObjectManager::Attribute.add(
   display: 'Phone',
   data_type: 'input',
   data_option: {
-    type: 'phone',
+    type: 'tel',
     maxlength: 100,
     null: true,
     item_class: 'formGroup--halfSize',
@@ -3229,7 +3229,7 @@ ObjectManager::Attribute.add(
   display: 'Mobile',
   data_type: 'input',
   data_option: {
-    type: 'phone',
+    type: 'tel',
     maxlength: 100,
     null: true,
     item_class: 'formGroup--halfSize',
@@ -3264,7 +3264,7 @@ ObjectManager::Attribute.add(
   display: 'Fax',
   data_type: 'input',
   data_option: {
-    type: 'phone',
+    type: 'tel',
     maxlength: 100,
     null: true,
     item_class: 'formGroup--halfSize',