Better version info communication and administration

This commit is contained in:
2014-10-06 17:18:41 +02:00
parent a57e9e2341
commit eba3500311
7 changed files with 34 additions and 4 deletions
@@ -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 auth_token = Qstorage.getItem('auth_token')
if options.data
options.data += "&auth_token=#{auth_token}"
options.data += "&auth_token=#{auth_token}&app_version=#{$app_version}"
else
options.data = "auth_token=#{auth_token}"
options.data = "auth_token=#{auth_token}&app_version=#{$app_version}"
if options.type.toUpperCase() == 'POST'
if auth_token = Qstorage.getItem('auth_token')
if options.data
@@ -39,9 +39,10 @@ Ember.$.ajaxPrefilter (options) ->
if options.data[0] == '{' || options.data[0] == '[' # json
object = JSON.parse(options.data)
object.auth_token = auth_token
object.app_version = $app_version
options.data = JSON.stringify(object)
else
options.data += "&auth_token=#{auth_token}"
options.data += "&auth_token=#{auth_token}&app_version=#{$app_version}"
else
options.data.auth_token = auth_token
else
@@ -16,3 +16,8 @@
.alert-box.alert= submission_error
else
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
border-top: 1px solid #ccc
margin-top: 1em
padding-top: 0.5em
.feedback-received
+alert($bg: $info-color)
.technical-information-container
border-top: 1px solid #ccc
margin-top: 1em
padding-top: 0.5em
margin-bottom: 1em
+4
View File
@@ -46,6 +46,10 @@ module ApplicationHelper
end
end
def app_version
File.read(Rails.root.join('config/version')).strip
end
def are_you_sure?(record = nil)
t('helpers.links.are_you_sure')
end
@@ -13,6 +13,7 @@ html lang="en"
var $data_host = 'http://data.mozo.bar';
var $event_host = '#{Qwaiter.event_host}';
var $assets_path = './assets/';
var $app_version = '#{app_version}';
var $user_feedback_path = 'http://feedback.mozo.bar/user_feedback';
var Qstorage = window.localStorage;
Qstorage.setItem('root_url', '##root_url##');
@@ -25,6 +26,7 @@ html lang="en"
var $data_host = null;
var $event_host = '#{Qwaiter.event_host}';
var $assets_path = '/assets/';
var $app_version = '#{app_version}';
var $user_feedback_path = 'http://feedback.mozo.bar/user_feedback';
var Qstorage = window.localStorage;
#{user_dynamic_data_host};
@@ -38,6 +40,7 @@ html lang="en"
var $data_host = null;
var $event_host = '#{Qwaiter.event_host}';
var $assets_path = '/assets/';
var $app_version = '#{app_version}';
var $user_feedback_path = '/user_feedback';
var Qstorage = window.localStorage;
#{user_dynamic_data_host};
+9 -1
View File
@@ -9,6 +9,8 @@ APP_ROOT="#{HOME}/Documents/workspace/mozo"
APP_ASSET_ROOT="#{APP_ROOT}/www/assets"
app_config_path = File.join(APP_ROOT, 'config.xml')
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
new_version = File.read("config/version").strip.to_version
version_increased = false
@@ -16,7 +18,10 @@ while new_version <= current_version
version_increased = true
new_version = new_version.bump(:tiny)
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`
`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;
# QWAITER_MOBILE_EXPORT=yes RAILS_ENV=user_app TEST_HOST=$1 bundle exec rails runner bin/build_mobile_app.rb;
`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_index_html_path, 'w+'){ |f| f.puts app_index_html.sub('##APP_VERSION##', new_version.to_s) }