From 9e52358d57027e26277475866ec13db363a50d37 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 29 May 2016 20:03:00 +0200 Subject: [PATCH] Fixed html5 input type attribute for phone, it's tel (not phone). --- .../app/controllers/object_manager.coffee | 2 +- ...160217000001_object_manager_update_user.rb | 6 +- .../20160529000001_update_object_manager2.rb | 106 ++++++++++++++++++ db/seeds.rb | 6 +- 4 files changed, 113 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/app/controllers/object_manager.coffee b/app/assets/javascripts/app/controllers/object_manager.coffee index a400bbf1c..88927a093 100644 --- a/app/assets/javascripts/app/controllers/object_manager.coffee +++ b/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')( diff --git a/db/migrate/20160217000001_object_manager_update_user.rb b/db/migrate/20160217000001_object_manager_update_user.rb index e15dac3d4..a01fa3c29 100644 --- a/db/migrate/20160217000001_object_manager_update_user.rb +++ b/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', diff --git a/db/migrate/20160529000001_update_object_manager2.rb b/db/migrate/20160529000001_update_object_manager2.rb index 5917ec0c9..43612d8ce 100644 --- a/db/migrate/20160529000001_update_object_manager2.rb +++ b/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 diff --git a/db/seeds.rb b/db/seeds.rb index 190b739e6..da0064d9d 100644 --- a/db/seeds.rb +++ b/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',