Skip to content

Commit

Permalink
updating feature checks
Browse files Browse the repository at this point in the history
  • Loading branch information
willdoran committed Mar 11, 2016
1 parent b99be4b commit 8c00079
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
4 changes: 3 additions & 1 deletion app/common/global/language-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ module.exports = [
'$rootScope',
'$translate',
'ConfigEndpoint',
'BootstrapConfig',
'Languages',
function (
$rootScope,
$translate,
ConfigEndpoint,
BootstrapConfig,
Languages
) {
var lang = 'en-US';
var lang = BootstrapConfig.language || 'en-US';

ConfigEndpoint.get({ id: 'site' }).$promise.then(function (site) {
lang = site.language ? site.language : 'en-US';
Expand Down
4 changes: 3 additions & 1 deletion app/setting/controllers/setting-datasources-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ function (
});
});

$scope.available_providers = Features.clientFeatures['data-providers'];
Features.loadFeatures().then(function (features) {
$scope.available_providers = features['data-providers'];
});
}];
4 changes: 3 additions & 1 deletion app/setting/controllers/setting-forms-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ function (
_,
Features
) {
$scope.formQuota = Features.getLimit('forms');
Features.loadFeatures().then(function () {
$scope.formQuota = Features.getLimit('forms');
});

$translate('nav.posts_and_entities').then(function (title) {
$scope.title = title;
Expand Down
6 changes: 3 additions & 3 deletions app/setting/directives/setting-data-import-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ function (
restrict: 'A',
link: function ($scope, $element, $attrs) {
$scope.formId;

$scope.csvEnabled = Features.isFeatureEnabled('data-import');

Features.loadFeatures().then(function () {
$scope.csvEnabled = Features.isFeatureEnabled('data-import');
});
$scope.importCSV = function () {
if (!$scope.fileContainer.file) {
$translate('notify.data_import.file_missing').then(function (message) {
Expand Down
5 changes: 3 additions & 2 deletions app/setting/directives/setting-editor-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ function (
$scope.fileContainer = {
file : null
};

$scope.isPrivateEnabled = Features.isFeatureEnabled('private');
Features.loadFeatures().then(function () {
$scope.isPrivateEnabled = Features.isFeatureEnabled('private');
});

$scope.site = ConfigEndpoint.get({ id: 'site' });
$scope.userSavedSettings = false;
Expand Down
6 changes: 3 additions & 3 deletions app/setting/directives/setting-roles-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ function (
};

$scope.refreshView();

$scope.rolesEnabled = Features.isFeatureEnabled('roles');

Features.loadFeatures().then(function () {
$scope.rolesEnabled = Features.isFeatureEnabled('roles');
});
$scope.checkIfLastAdmin = function () {
var admins = 0;
_.each($scope.roles, function (role) {
Expand Down

0 comments on commit 8c00079

Please sign in to comment.