diff --git a/app/assets/javascripts/angular/directives/components/toolbar.js b/app/assets/javascripts/angular/directives/components/toolbar.js index 8aaafcb661..cda07f991a 100644 --- a/app/assets/javascripts/angular/directives/components/toolbar.js +++ b/app/assets/javascripts/angular/directives/components/toolbar.js @@ -33,7 +33,6 @@ angular.module('openproject.uiComponents') return { restrict: 'EA', link: function(scope, element, attributes) { - scope.hideWorkPackageDetails = true; // temporarily disable work package details links } }; }); diff --git a/app/assets/javascripts/angular/directives/work_packages/work-packages-table-directive.js b/app/assets/javascripts/angular/directives/work_packages/work-packages-table-directive.js index fe60426419..ceedcb75a7 100644 --- a/app/assets/javascripts/angular/directives/work_packages/work-packages-table-directive.js +++ b/app/assets/javascripts/angular/directives/work_packages/work-packages-table-directive.js @@ -31,7 +31,8 @@ angular.module('openproject.workPackages.directives') .directive('workPackagesTable', [ 'I18n', 'WorkPackagesTableService', - function(I18n, WorkPackagesTableService){ + 'flags', + function(I18n, WorkPackagesTableService, flags){ return { restrict: 'E', @@ -86,7 +87,11 @@ angular.module('openproject.workPackages.directives') } }); - scope.hideWorkPackageDetails = true; // temporarily disable work package details links + scope.$watch(function() { + return flags.isOn('detailsView'); + }, function(detailsEnabled) { + scope.hideWorkPackageDetails = !detailsEnabled; + }); } }; }]); diff --git a/app/assets/javascripts/angular/openproject-app.js b/app/assets/javascripts/angular/openproject-app.js index 7560e9d3ca..e402932f98 100644 --- a/app/assets/javascripts/angular/openproject-app.js +++ b/app/assets/javascripts/angular/openproject-app.js @@ -116,7 +116,8 @@ var openprojectApp = angular.module('openproject', [ 'openproject.timeEntries', 'ngAnimate', 'ngSanitize', - 'truncate' + 'truncate', + 'feature-flags' ]); window.appBasePath = jQuery('meta[name=app_base_path]').attr('content') || ''; @@ -139,8 +140,11 @@ openprojectApp .run([ '$http', 'ConfigurationService', - function($http, ConfigurationService){ + 'flags', + function($http, ConfigurationService, flags) { $http.defaults.headers.common.Accept = 'application/json'; ConfigurationService.addConfiguration('accessibilityMode', OpenProject.Helpers.accessibilityModeEnabled()); + + flags.set($http.get('/javascripts/feature-flags.json')); }]); diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index 3be3e31acc..93eaf3df8b 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -64,6 +64,7 @@ //= require angular-ui-date/src/date //= require angular-sanitize //= require angular-truncate/dist/angular-truncate +//= require angular-feature-flags/dist/featureFlags.js //= require ng-context-menu diff --git a/bower.json b/bower.json index cf0f83427d..8024abc9e0 100644 --- a/bower.json +++ b/bower.json @@ -18,6 +18,7 @@ "angular-modal": "~0.3.0", "angular-sanitize": "~1.2.14", "angular-truncate": "latest", + "angular-feature-flags": "mjt01/angular-feature-flags", "jquery-migrate": "~1.2.1", "momentjs": "~2.6.0", "moment-timezone": "~0.0.6", diff --git a/public/javascripts/feature-flags.json b/public/javascripts/feature-flags.json new file mode 100644 index 0000000000..7df0933397 --- /dev/null +++ b/public/javascripts/feature-flags.json @@ -0,0 +1,8 @@ +[ + { + "key": "detailsView", + "active": false, + "name": "Details View", + "description": "Displays details for individual work packages." + } +] diff --git a/public/templates/work_packages.html b/public/templates/work_packages.html index 80cca689dc..9a0f9f45e2 100644 --- a/public/templates/work_packages.html +++ b/public/templates/work_packages.html @@ -22,7 +22,7 @@ {{ I18n.t('js.toolbar.filter') }} -