Better version info communication and administration
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
Ember.Handlebars.helper 'version', ->
|
||||||
|
new Handlebars.SafeString $app_version
|
||||||
@@ -29,9 +29,9 @@ Ember.$.ajaxPrefilter (options) ->
|
|||||||
if options.type.toUpperCase() == 'GET'
|
if options.type.toUpperCase() == 'GET'
|
||||||
if auth_token = Qstorage.getItem('auth_token')
|
if auth_token = Qstorage.getItem('auth_token')
|
||||||
if options.data
|
if options.data
|
||||||
options.data += "&auth_token=#{auth_token}"
|
options.data += "&auth_token=#{auth_token}&app_version=#{$app_version}"
|
||||||
else
|
else
|
||||||
options.data = "auth_token=#{auth_token}"
|
options.data = "auth_token=#{auth_token}&app_version=#{$app_version}"
|
||||||
if options.type.toUpperCase() == 'POST'
|
if options.type.toUpperCase() == 'POST'
|
||||||
if auth_token = Qstorage.getItem('auth_token')
|
if auth_token = Qstorage.getItem('auth_token')
|
||||||
if options.data
|
if options.data
|
||||||
@@ -39,9 +39,10 @@ Ember.$.ajaxPrefilter (options) ->
|
|||||||
if options.data[0] == '{' || options.data[0] == '[' # json
|
if options.data[0] == '{' || options.data[0] == '[' # json
|
||||||
object = JSON.parse(options.data)
|
object = JSON.parse(options.data)
|
||||||
object.auth_token = auth_token
|
object.auth_token = auth_token
|
||||||
|
object.app_version = $app_version
|
||||||
options.data = JSON.stringify(object)
|
options.data = JSON.stringify(object)
|
||||||
else
|
else
|
||||||
options.data += "&auth_token=#{auth_token}"
|
options.data += "&auth_token=#{auth_token}&app_version=#{$app_version}"
|
||||||
else
|
else
|
||||||
options.data.auth_token = auth_token
|
options.data.auth_token = auth_token
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -16,3 +16,8 @@
|
|||||||
.alert-box.alert= submission_error
|
.alert-box.alert= submission_error
|
||||||
else
|
else
|
||||||
button.submit-feedback-button.button{action "submitFeedback"}= t 'about.feedback.submit'
|
button.submit-feedback-button.button{action "submitFeedback"}= t 'about.feedback.submit'
|
||||||
|
|
||||||
|
.technical-information-container.row: .large-12.columns
|
||||||
|
.row.version
|
||||||
|
.large-3.medium-3.small-4.columns: strong=t 'about.version'
|
||||||
|
.large-9.medium-9.small-8.columns= version
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
.feedback-container
|
.feedback-container
|
||||||
border-top: 1px solid #ccc
|
border-top: 1px solid #ccc
|
||||||
margin-top: 1em
|
margin-top: 1em
|
||||||
|
padding-top: 0.5em
|
||||||
.feedback-received
|
.feedback-received
|
||||||
+alert($bg: $info-color)
|
+alert($bg: $info-color)
|
||||||
|
|
||||||
|
.technical-information-container
|
||||||
|
border-top: 1px solid #ccc
|
||||||
|
margin-top: 1em
|
||||||
|
padding-top: 0.5em
|
||||||
|
margin-bottom: 1em
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ module ApplicationHelper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def app_version
|
||||||
|
File.read(Rails.root.join('config/version')).strip
|
||||||
|
end
|
||||||
|
|
||||||
def are_you_sure?(record = nil)
|
def are_you_sure?(record = nil)
|
||||||
t('helpers.links.are_you_sure')
|
t('helpers.links.are_you_sure')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ html lang="en"
|
|||||||
var $data_host = 'http://data.mozo.bar';
|
var $data_host = 'http://data.mozo.bar';
|
||||||
var $event_host = '#{Qwaiter.event_host}';
|
var $event_host = '#{Qwaiter.event_host}';
|
||||||
var $assets_path = './assets/';
|
var $assets_path = './assets/';
|
||||||
|
var $app_version = '#{app_version}';
|
||||||
var $user_feedback_path = 'http://feedback.mozo.bar/user_feedback';
|
var $user_feedback_path = 'http://feedback.mozo.bar/user_feedback';
|
||||||
var Qstorage = window.localStorage;
|
var Qstorage = window.localStorage;
|
||||||
Qstorage.setItem('root_url', '##root_url##');
|
Qstorage.setItem('root_url', '##root_url##');
|
||||||
@@ -25,6 +26,7 @@ html lang="en"
|
|||||||
var $data_host = null;
|
var $data_host = null;
|
||||||
var $event_host = '#{Qwaiter.event_host}';
|
var $event_host = '#{Qwaiter.event_host}';
|
||||||
var $assets_path = '/assets/';
|
var $assets_path = '/assets/';
|
||||||
|
var $app_version = '#{app_version}';
|
||||||
var $user_feedback_path = 'http://feedback.mozo.bar/user_feedback';
|
var $user_feedback_path = 'http://feedback.mozo.bar/user_feedback';
|
||||||
var Qstorage = window.localStorage;
|
var Qstorage = window.localStorage;
|
||||||
#{user_dynamic_data_host};
|
#{user_dynamic_data_host};
|
||||||
@@ -38,6 +40,7 @@ html lang="en"
|
|||||||
var $data_host = null;
|
var $data_host = null;
|
||||||
var $event_host = '#{Qwaiter.event_host}';
|
var $event_host = '#{Qwaiter.event_host}';
|
||||||
var $assets_path = '/assets/';
|
var $assets_path = '/assets/';
|
||||||
|
var $app_version = '#{app_version}';
|
||||||
var $user_feedback_path = '/user_feedback';
|
var $user_feedback_path = '/user_feedback';
|
||||||
var Qstorage = window.localStorage;
|
var Qstorage = window.localStorage;
|
||||||
#{user_dynamic_data_host};
|
#{user_dynamic_data_host};
|
||||||
|
|||||||
+9
-1
@@ -9,6 +9,8 @@ APP_ROOT="#{HOME}/Documents/workspace/mozo"
|
|||||||
APP_ASSET_ROOT="#{APP_ROOT}/www/assets"
|
APP_ASSET_ROOT="#{APP_ROOT}/www/assets"
|
||||||
app_config_path = File.join(APP_ROOT, 'config.xml')
|
app_config_path = File.join(APP_ROOT, 'config.xml')
|
||||||
app_config = File.read(app_config_path)
|
app_config = File.read(app_config_path)
|
||||||
|
app_index_html_path = File.join(APP_ASSET_ROOT, 'index.html')
|
||||||
|
app_index_html = File.read(app_index_html_path)
|
||||||
current_version = app_config.match(/version="([\.\d]+)"/)[1].to_version
|
current_version = app_config.match(/version="([\.\d]+)"/)[1].to_version
|
||||||
new_version = File.read("config/version").strip.to_version
|
new_version = File.read("config/version").strip.to_version
|
||||||
version_increased = false
|
version_increased = false
|
||||||
@@ -16,7 +18,10 @@ while new_version <= current_version
|
|||||||
version_increased = true
|
version_increased = true
|
||||||
new_version = new_version.bump(:tiny)
|
new_version = new_version.bump(:tiny)
|
||||||
end
|
end
|
||||||
puts "Increasing version value to #{new_version}".colorize(:red) if version_increased
|
if version_increased
|
||||||
|
puts "Increasing version value to #{new_version}".colorize(:red)
|
||||||
|
File.open("config/version", 'w+'){|f| f.puts new_version.to_s }
|
||||||
|
end
|
||||||
|
|
||||||
`spring stop`
|
`spring stop`
|
||||||
`rm -rf #{APP_ASSET_ROOT}`
|
`rm -rf #{APP_ASSET_ROOT}`
|
||||||
@@ -53,4 +58,7 @@ puts "Increasing version value to #{new_version}".colorize(:red) if version_incr
|
|||||||
# rm -rf public/assets/frames;
|
# rm -rf public/assets/frames;
|
||||||
# QWAITER_MOBILE_EXPORT=yes RAILS_ENV=user_app TEST_HOST=$1 bundle exec rails runner bin/build_mobile_app.rb;
|
# QWAITER_MOBILE_EXPORT=yes RAILS_ENV=user_app TEST_HOST=$1 bundle exec rails runner bin/build_mobile_app.rb;
|
||||||
`rm -rf public/assets`
|
`rm -rf public/assets`
|
||||||
|
|
||||||
|
# Set app versions
|
||||||
File.open(app_config_path, 'w+'){|f| f.puts app_config.sub(%[version="#{current_version}"], %[version="#{new_version}"])}
|
File.open(app_config_path, 'w+'){|f| f.puts app_config.sub(%[version="#{current_version}"], %[version="#{new_version}"])}
|
||||||
|
File.open(app_index_html_path, 'w+'){ |f| f.puts app_index_html.sub('##APP_VERSION##', new_version.to_s) }
|
||||||
|
|||||||
Reference in New Issue
Block a user