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.4.1

This commit is contained in:
Sylvain 2020-05-12 20:32:07 +02:00
commit 574b27774f
8 changed files with 27 additions and 7 deletions

View File

@ -1,5 +1,13 @@
# Changelog Fab-manager
## v4.4.1 2020 May 12
- Prevent VersionCheckWorker from polluting the sidekiq stack in development
- Fix a bug: the subscription page is not available
- Fix a bug: users promoted to the administrator role are not in the admin group
- Fix a bug: menu separators are not visible
- [TODO DEPLOY] `rails fablab:maintenance:rebuild_stylesheet`
## v4.4.0 2020 May 12
- Manager: a new role between the member and the administrator

View File

@ -183,7 +183,7 @@ Application.Controllers.controller('PlansIndexController', ['$scope', '$rootScop
for (let plan of plansPromise) {
if (plan.group_id === group.id) {
groupObj.plans.push(plan);
if (!plan.disabled) { groupplansClassifiedByGroupObj.actives++; }
if (!plan.disabled) { groupObj.actives++; }
}
}
$scope.plansClassifiedByGroup.push(groupObj);

View File

@ -118,7 +118,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs',
* Switch the user's view from the reservation agenda to the plan subscription
*/
$scope.showPlans = function () {
// first, we ensure that a user was selected (admin) or logged (member)
// first, we ensure that a user was selected (admin/manager) or logged (member)
const isSelectedUser = Object.keys($scope.user).length > 0;
// all slots are in future
const areFutureSlots = _.every($scope.events.reserved, function(s) {

View File

@ -41,7 +41,7 @@
</div>
</div>
<div class="cta-button" ng-if="!ctrl.member || ctrl.member.role == 'member' || (ctrl.member.role == 'manager' && ctrl.member.id === currentUser.id)">
<div class="cta-button" ng-if="isAuthorized('member') || (isAuthorized('manager') && ctrl.member.id === currentUser.id)">
<button class="btn btn-default rounded" ng-click="selectPlan(plan)" ng-if="ctrl.member.subscribed_plan.id != plan.id" ng-disabled="ctrl.member.subscribed_plan" ng-class="{ 'bg-yellow': selectedPlan==plan }">
<span ng-if="ctrl.member" translate>{{ 'app.public.plans.i_choose_that_plan' }}</span>
<span ng-if="!ctrl.member" translate>{{ 'app.public.plans.i_subscribe_online' }}</span>
@ -53,7 +53,7 @@
</div>
<div class="cta-button" ng-if="isAuthorized('admin') || (ctrl.member.role == 'manager' && ctrl.member.id != currentUser.id)">
<div class="cta-button" ng-if="isAuthorized('admin') || (isAuthorized('manager') && ctrl.member.id != currentUser.id)">
<button class="btn btn-default rounded" ng-click="selectPlan(plan)" ng-class="{ 'bg-yellow': selectedPlan==plan }" ng-disabled="!ctrl.member">
<span translate>{{ 'app.public.plans.i_choose_that_plan' }}</span>
</button>

View File

@ -219,6 +219,9 @@ class API::MembersController < API::ApiController
@member.remove_role ex_role
@member.add_role params[:role]
# if the new role is 'admin', then change the group to the admins group
@member.update_attributes(group_id: Group.find_by(slug: 'admins').id) if params[:role] == 'admin'
NotificationCenter.call type: 'notify_user_role_update',
receiver: @member,
attached_object: @member

View File

@ -1,4 +1,5 @@
<% fablab_name = Setting.find_by(name: 'fablab_name').value %>
<% fablab_gender = Setting.find_by(name: 'name_genre').value %>
<% primary_color = Stylesheet.primary %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
@ -39,7 +40,7 @@
<tr>
<td>
<p>
<%= _t(".see_you_later", {GENDER:Setting.find_by(name: 'name_genre').value})
<%= _t(".see_you_later", { GENDER:fablab_gender })
# messageFormat
%> <a href="<%= root_url %>" style="color:<%=primary_color%>"> <%=fablab_name%></a>.</p>
<p><%= t(".sincerely") %><br><%= t(".signature") %></p>

View File

@ -6,7 +6,15 @@ class VersionCheckWorker
def perform
require 'fab_hub'
res = FabHub.fab_manager_version_check
begin
res = FabHub.fab_manager_version_check
rescue Errno::ECONNREFUSED => e
if Rails.env.development?
puts "Unable to check the version, maybe FabHub is not running: #{e}"
return
end
end
setting_ver = Setting.find_or_initialize_by(name: 'hub_last_version')
value = {

View File

@ -1,6 +1,6 @@
{
"name": "fab-manager",
"version": "4.4.0",
"version": "4.4.1",
"description": "Fab-manager 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",