1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

Merge branch 'dev' for release 4.2.3

This commit is contained in:
Sylvain 2019-10-22 14:46:27 +02:00
commit d5b9491316
8 changed files with 28 additions and 9 deletions

View File

@ -1,5 +1,11 @@
# Changelog Fab Manager
## v4.2.3 2019 October 22
- Ability to set the default view in project gallery: openLab or local
- Fix a bug: admins can't edit members projects
- [TODO DEPLOY] add the `OPENLAB_DEFAULT` environment variable (see [doc/environment.md](doc/environment.md#OPENLAB_DEFAULT) for configuration details)
## v4.2.2 2019 October 22
- Fix a bug: PostgreSQL upgrade script won't run on some systems

View File

@ -376,7 +376,7 @@ Application.Controllers.controller('ProjectsController', ['$scope', '$state', 'P
if ($location.$$search.whole_network === 'f') {
$scope.openlab.searchOverWholeNetwork = false;
} else {
$scope.openlab.searchOverWholeNetwork = $scope.openlab.projectsActive || false;
$scope.openlab.searchOverWholeNetwork = ($scope.openlab.projectsActive && Fablab.openlabDefault) || false;
}
return $scope.triggerSearch();
};
@ -452,7 +452,7 @@ Application.Controllers.controller('EditProjectController', ['$rootScope', '$sco
// Form action on the above URL
$scope.method = 'put';
// Retrieve the project's details, if an error occured, redirect the user to the projects list page
// Retrieve the project's details, if an error occurred, redirect the user to the projects list page
$scope.project = projectPromise;
$scope.matchingMembers = $scope.project.project_users.map(function (u) {
@ -470,7 +470,7 @@ Application.Controllers.controller('EditProjectController', ['$rootScope', '$sco
const initialize = function () {
CSRF.setMetaTags();
if ($scope.project.author_id !== $rootScope.currentUser.id && $scope.project.user_ids.indexOf($rootScope.currentUser.id) === -1) {
if ($scope.project.author_id !== $rootScope.currentUser.id && $scope.project.user_ids.indexOf($rootScope.currentUser.id) === -1 && $scope.currentUser.role !== 'admin') {
$state.go('app.public.projects_show', { id: $scope.project.slug });
console.error('[EditProjectController::initialize] user is not allowed')
}

View File

@ -16,10 +16,10 @@
<script type="text/javascript">
var Fablab = Fablab || {};
Fablab.withoutPlans = ('<%= Rails.application.secrets.fablab_without_plans %>' == 'true');
Fablab.withoutSpaces = ('<%= Rails.application.secrets.fablab_without_spaces %>' != 'false');
Fablab.withoutOnlinePayment = ('<%= Rails.application.secrets.fablab_without_online_payments %>' == 'true');
Fablab.withoutInvoices = ('<%= Rails.application.secrets.fablab_without_invoices %>' == 'true');
Fablab.withoutPlans = ('<%= Rails.application.secrets.fablab_without_plans %>' === 'true');
Fablab.withoutSpaces = ('<%= Rails.application.secrets.fablab_without_spaces %>' !== 'false');
Fablab.withoutOnlinePayment = ('<%= Rails.application.secrets.fablab_without_online_payments %>' === 'true');
Fablab.withoutInvoices = ('<%= Rails.application.secrets.fablab_without_invoices %>' === 'true');
Fablab.disqusShortname = "<%= Rails.application.secrets.disqus_shortname %>";
Fablab.defaultHost = "<%= Rails.application.secrets.default_host %>";
Fablab.gaId = "<%= Rails.application.secrets.google_analytics_id %>";
@ -43,6 +43,7 @@
Fablab.d3DateFormat = "<%= Rails.application.secrets.d3_date_format %>";
Fablab.uibDateFormat = "<%= Rails.application.secrets.uib_date_format %>";
Fablab.openlabProjectsActive = <%= Rails.application.secrets.openlab_app_secret.present? %>;
Fablab.openlabDefault = ('<%= Rails.application.secrets.openlab_default %>' !== 'false');
<% if Rails.application.secrets.openlab_app_id.present? %>
Fablab.openlabAppId = "<%= Rails.application.secrets.openlab_app_id %>";
<% end %>

View File

@ -75,9 +75,10 @@ D3_DATE_FORMAT: '%d/%m/%y'
UIB_DATE_FORMAT: 'dd/MM/yyyy'
EXCEL_DATE_FORMAT: 'dd/mm/yyyy'
# OpenProjects
# OpenLab Projects
OPENLAB_APP_SECRET:
OPENLAB_APP_ID:
OPENLAB_DEFAULT: 'true'
# do not change this URL
OPENLAB_BASE_URI: 'https://openprojects.fab-manager.com'

View File

@ -37,6 +37,7 @@ development:
elasticsearch_language_analyzer: <%= ENV["ELASTICSEARCH_LANGUAGE_ANALYZER"] %>
openlab_app_secret: <%= ENV["OPENLAB_APP_SECRET"] %>
openlab_app_id: <%= ENV["OPENLAB_APP_ID"] %>
openlab_default: <%= ENV["OPENLAB_DEFAULT"] %>
openlab_base_uri: <%= ENV["OPENLAB_BASE_URI"] %>
navinum_api_login: <%= ENV["NAVINUM_API_LOGIN"] %>
navinum_api_password: <%= ENV["NAVINUM_API_PASSWORD"] %>
@ -78,6 +79,7 @@ test:
elasticsearch_language_analyzer: french
openlab_app_secret:
openlab_app_id:
openlab_default:
openlab_base_uri:
navinum_api_login:
navinum_api_password:
@ -127,6 +129,7 @@ staging:
elasticsearch_language_analyzer: <%= ENV["ELASTICSEARCH_LANGUAGE_ANALYZER"] %>
openlab_app_secret: <%= ENV["OPENLAB_APP_SECRET"] %>
openlab_app_id: <%= ENV["OPENLAB_APP_ID"] %>
openlab_default: <%= ENV["OPENLAB_DEFAULT"] %>
openlab_base_uri: <%= ENV["OPENLAB_BASE_URI"] %>
google_analytics_id: <%= ENV["GA_ID"] %>
navinum_api_login: <%= ENV["NAVINUM_API_LOGIN"] %>
@ -179,6 +182,7 @@ production:
elasticsearch_language_analyzer: <%= ENV["ELASTICSEARCH_LANGUAGE_ANALYZER"] %>
openlab_app_secret: <%= ENV["OPENLAB_APP_SECRET"] %>
openlab_app_id: <%= ENV["OPENLAB_APP_ID"] %>
openlab_default: <%= ENV["OPENLAB_DEFAULT"] %>
openlab_base_uri: <%= ENV["OPENLAB_BASE_URI"] %>
google_analytics_id: <%= ENV["GA_ID"] %>
navinum_api_login: <%= ENV["NAVINUM_API_LOGIN"] %>

View File

@ -331,6 +331,12 @@ It allows you to display a shared projects gallery and to share your projects wi
OPENLAB_APP_ID, OPENLAB_APP_SECRET
Send an email to **contact@fab-manager.com** to get your OpenLab client's credentials.
<a name="OPENLAB_DEFAULT"></a>
OPENLAB_DEFAULT
When set to false, the default display will be the local projects when browsing the projects gallery.
If not set or set to true, the projects from the OpenLab repository will be shown first.
<a name="OPENLAB_BASE_URI"></a>
OPENLAB_BASE_URI

View File

@ -61,6 +61,7 @@ EXCEL_DATE_FORMAT=dd/mm/yyyy
OPENLAB_APP_SECRET=
OPENLAB_APP_ID=
OPENLAB_DEFAULT='true'
OPENLAB_BASE_URI=https://openprojects.fab-manager.com
NAVINUM_API_LOGIN=

View File

@ -1,6 +1,6 @@
{
"name": "fab-manager",
"version": "4.2.2",
"version": "4.2.3",
"description": "FabManager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.",
"keywords": [
"fablab",