|
|
|
@ -14,6 +14,7 @@ class Carto::Admin::MobileAppsController < Admin::AdminController
|
|
|
|
|
before_filter :login_required
|
|
|
|
|
before_filter :check_user_permissions
|
|
|
|
|
before_filter :initialize_cartodb_central_client
|
|
|
|
|
before_filter :get_viewed_user
|
|
|
|
|
before_filter :load_organization_notifications
|
|
|
|
|
before_filter :validate_id, only: [:show, :update, :destroy]
|
|
|
|
|
before_filter :load_mobile_app, only: [:show, :update]
|
|
|
|
@ -29,6 +30,7 @@ class Carto::Admin::MobileAppsController < Admin::AdminController
|
|
|
|
|
@mobile_apps = response[:mobile_apps].map { |a| Carto::MobileApp.new(a) }
|
|
|
|
|
@open_monthly_users = response[:monthly_users][:open]
|
|
|
|
|
@private_monthly_users = response[:monthly_users][:private]
|
|
|
|
|
@has_new_dashboard = @viewed_user.builder_enabled? && @viewed_user.has_feature_flag?('dashboard_migration')
|
|
|
|
|
rescue CartoDB::CentralCommunicationFailure => e
|
|
|
|
|
@mobile_apps = []
|
|
|
|
|
CartoDB::Logger.error(message: 'Error loading mobile apps from Central', exception: e)
|
|
|
|
@ -140,6 +142,11 @@ class Carto::Admin::MobileAppsController < Admin::AdminController
|
|
|
|
|
flash: { error: 'Unable to connect to license server. Try again in a moment.' })
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def get_viewed_user
|
|
|
|
|
username = CartoDB.extract_subdomain(request).strip.downcase
|
|
|
|
|
@viewed_user = User.where(username: username).first
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def get_default_avatar
|
|
|
|
|
if Cartodb.asset_path
|
|
|
|
|
"#{Cartodb.asset_path}/assets/unversioned/images/avatars/mobile_app_default_avatar.png"
|
|
|
|
|