mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-21 15:54:22 +01:00
privacy option for fab-analytics
This commit is contained in:
parent
e7ec69e49e
commit
059096c2dd
@ -123,6 +123,11 @@ Application.Controllers.controller('SettingsController', ['$scope', '$filter', '
|
|||||||
value: (settingsPromise.display_name_enable === 'true')
|
value: (settingsPromise.display_name_enable === 'true')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.fabAnalytics = {
|
||||||
|
name: 'fab_analytics',
|
||||||
|
value: (settingsPromise.fab_analytics === 'true')
|
||||||
|
};
|
||||||
|
|
||||||
// By default, we display the currently published privacy policy
|
// By default, we display the currently published privacy policy
|
||||||
$scope.privacyPolicy = {
|
$scope.privacyPolicy = {
|
||||||
version: null,
|
version: null,
|
||||||
|
@ -996,35 +996,16 @@ angular.module('application.router', ['ui.router'])
|
|||||||
resolve: {
|
resolve: {
|
||||||
settingsPromise: ['Setting', function (Setting) {
|
settingsPromise: ['Setting', function (Setting) {
|
||||||
return Setting.query({
|
return Setting.query({
|
||||||
names: `['twitter_name', \
|
names: `['twitter_name', 'about_title', 'about_body', \
|
||||||
'about_title', \
|
'privacy_body', 'privacy_dpo', 'about_contacts', \
|
||||||
'about_body', \
|
'home_blogpost', 'machine_explications_alert', 'training_explications_alert', \
|
||||||
'privacy_body', \
|
'training_information_message', 'subscription_explications_alert', 'event_explications_alert', \
|
||||||
'privacy_dpo', \
|
'space_explications_alert', 'booking_window_start', 'booking_window_end', \
|
||||||
'about_contacts', \
|
'booking_move_enable', 'booking_move_delay', 'booking_cancel_enable', \
|
||||||
'home_blogpost', \
|
'booking_cancel_delay', 'main_color', 'secondary_color', \
|
||||||
'machine_explications_alert', \
|
'fablab_name', 'name_genre', 'reminder_enable', \
|
||||||
'training_explications_alert', \
|
'reminder_delay', 'visibility_yearly', 'visibility_others', \
|
||||||
'training_information_message', \
|
'display_name_enable', 'machines_sort_by', 'fab_analytics']` }).$promise;
|
||||||
'subscription_explications_alert', \
|
|
||||||
'event_explications_alert', \
|
|
||||||
'space_explications_alert', \
|
|
||||||
'booking_window_start', \
|
|
||||||
'booking_window_end', \
|
|
||||||
'booking_move_enable', \
|
|
||||||
'booking_move_delay', \
|
|
||||||
'booking_cancel_enable', \
|
|
||||||
'booking_cancel_delay', \
|
|
||||||
'main_color', \
|
|
||||||
'secondary_color', \
|
|
||||||
'fablab_name', \
|
|
||||||
'name_genre', \
|
|
||||||
'reminder_enable', \
|
|
||||||
'reminder_delay', \
|
|
||||||
'visibility_yearly', \
|
|
||||||
'visibility_others', \
|
|
||||||
'display_name_enable', \
|
|
||||||
'machines_sort_by']` }).$promise;
|
|
||||||
}],
|
}],
|
||||||
privacyDraftsPromise: ['Setting', function (Setting) { return Setting.get({ name: 'privacy_draft', history: true }).$promise; }],
|
privacyDraftsPromise: ['Setting', function (Setting) { return Setting.get({ name: 'privacy_draft', history: true }).$promise; }],
|
||||||
cguFile: ['CustomAsset', function (CustomAsset) { return CustomAsset.get({ name: 'cgu-file' }).$promise; }],
|
cguFile: ['CustomAsset', function (CustomAsset) { return CustomAsset.get({ name: 'cgu-file' }).$promise; }],
|
||||||
|
@ -26,5 +26,24 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-10 col-md-offset-1 m-t-lg">
|
||||||
|
<label for="is_recurrent" translate>{{ 'app.admin.settings.fab_analytics' }}</label>
|
||||||
|
<input bs-switch
|
||||||
|
ng-model="fabAnalytics.value"
|
||||||
|
id="is_recurrent"
|
||||||
|
type="checkbox"
|
||||||
|
class="form-control"
|
||||||
|
switch-on-text="{{ 'app.shared.buttons.yes' | translate }}"
|
||||||
|
switch-off-text="{{ 'app.shared.buttons.no' | translate }}"
|
||||||
|
switch-animate="true"/>
|
||||||
|
<p>
|
||||||
|
<span translate>{{ 'app.admin.settings.privacy.about_analytics' }}</span>
|
||||||
|
<a href="https://hub.fab-manager.com/privacy" target="_blank" translate>{{ 'app.admin.settings.privacy.read_more' }}</a>
|
||||||
|
</p>
|
||||||
|
<button name="button" class="btn btn-warning" ng-click="save(fabAnalytics)" translate>{{ 'app.shared.buttons.save' }}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -63,7 +63,8 @@ class Setting < ActiveRecord::Base
|
|||||||
accounting_Space_code
|
accounting_Space_code
|
||||||
accounting_Space_label
|
accounting_Space_label
|
||||||
hub_last_version
|
hub_last_version
|
||||||
hub_public_key] }
|
hub_public_key
|
||||||
|
fab_analytics] }
|
||||||
|
|
||||||
after_update :update_stylesheet, :notify_privacy_policy_changed if :value_changed?
|
after_update :update_stylesheet, :notify_privacy_policy_changed if :value_changed?
|
||||||
|
|
||||||
|
@ -32,6 +32,9 @@ class HealthService
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.stats
|
def self.stats
|
||||||
|
enable = Setting.find_by(name: 'fab_analytics')&.value
|
||||||
|
return false if enable == 'false'
|
||||||
|
|
||||||
require 'version'
|
require 'version'
|
||||||
require 'openssl'
|
require 'openssl'
|
||||||
require 'base64'
|
require 'base64'
|
||||||
@ -50,7 +53,7 @@ class HealthService
|
|||||||
}.to_json.to_s
|
}.to_json.to_s
|
||||||
|
|
||||||
key = Setting.find_by(name: 'hub_public_key')&.value
|
key = Setting.find_by(name: 'hub_public_key')&.value
|
||||||
return 'disabled' unless key
|
return false unless key
|
||||||
|
|
||||||
public_key = OpenSSL::PKey::RSA.new(key)
|
public_key = OpenSSL::PKey::RSA.new(key)
|
||||||
Base64.encode64(public_key.public_encrypt(stats))
|
Base64.encode64(public_key.public_encrypt(stats))
|
||||||
|
@ -946,6 +946,7 @@ fr:
|
|||||||
display_name: "Afficher le nom"
|
display_name: "Afficher le nom"
|
||||||
display_name_enable: "l'affichage du nom"
|
display_name_enable: "l'affichage du nom"
|
||||||
machines_sort_by: "l'odre d'affichage des machines"
|
machines_sort_by: "l'odre d'affichage des machines"
|
||||||
|
fab_analytics: "Fab Analytics"
|
||||||
elements_ordering: "Ordre d'affichage des éléments"
|
elements_ordering: "Ordre d'affichage des éléments"
|
||||||
machines_order: "Ordre des machines"
|
machines_order: "Ordre des machines"
|
||||||
display_machines_sorted_by: "Afficher les machines triées par"
|
display_machines_sorted_by: "Afficher les machines triées par"
|
||||||
@ -964,6 +965,8 @@ fr:
|
|||||||
publish_will_notify: "Publier une nouvelle version enverra une notification à l'ensemble des utilisateurs."
|
publish_will_notify: "Publier une nouvelle version enverra une notification à l'ensemble des utilisateurs."
|
||||||
publish: "Publier"
|
publish: "Publier"
|
||||||
users_notified: "Les utilisateurs de la plateforme seront notifiés de la mise à jour."
|
users_notified: "Les utilisateurs de la plateforme seront notifiés de la mise à jour."
|
||||||
|
about_analytics: "J'accepte de partager des données anonymes avec l'équipe de développement pour aider à améliorer Fab-Manager."
|
||||||
|
read_more: "Quelles informations collectons-nous ?"
|
||||||
|
|
||||||
open_api_clients:
|
open_api_clients:
|
||||||
add_new_client: "Créer un compte client"
|
add_new_client: "Créer un compte client"
|
||||||
|
@ -630,6 +630,12 @@ unless Setting.find_by(name: 'privacy_draft').try(:value)
|
|||||||
setting.save
|
setting.save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unless Setting.find_by(name: 'fab_analytics').try(:value)
|
||||||
|
setting = Setting.find_or_initialize_by(name: 'fab_analytics')
|
||||||
|
setting.value = 'true'
|
||||||
|
setting.save
|
||||||
|
end
|
||||||
|
|
||||||
if StatisticCustomAggregation.count.zero?
|
if StatisticCustomAggregation.count.zero?
|
||||||
# available reservations hours for machines
|
# available reservations hours for machines
|
||||||
machine_hours = StatisticType.find_by(key: 'hour', statistic_index_id: 2)
|
machine_hours = StatisticType.find_by(key: 'hour', statistic_index_id: 2)
|
||||||
|
@ -16,7 +16,7 @@ class Version
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.check_and_schedule
|
def self.check_and_schedule
|
||||||
return if Rails.env.development? && !ENV['FORCE_VERSION_CHECK']
|
return if (Rails.env.development? || Rails.env.test?) && ENV['FORCE_VERSION_CHECK'] != 'true'
|
||||||
|
|
||||||
VersionCheckWorker.perform_async
|
VersionCheckWorker.perform_async
|
||||||
# every sunday at 1:15am
|
# every sunday at 1:15am
|
||||||
|
Loading…
x
Reference in New Issue
Block a user