From 7cd99c533202bc460143e231d7277834b5e875a9 Mon Sep 17 00:00:00 2001 From: Adam Abdelaziz Date: Wed, 6 Sep 2017 14:39:34 -0400 Subject: [PATCH 01/18] Update locales --- core/config/locales/templates/dashboard/marketplace/en.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/core/config/locales/templates/dashboard/marketplace/en.yml b/core/config/locales/templates/dashboard/marketplace/en.yml index 3f9569ae9..da6f60737 100644 --- a/core/config/locales/templates/dashboard/marketplace/en.yml +++ b/core/config/locales/templates/dashboard/marketplace/en.yml @@ -122,3 +122,4 @@ en: companies_number: "Number of companies using the application" pricing: "Pricing" pricing_not_available: "pricing information not available" + no_review: "Rating not yet available" From 905b0642e74f8c877605b6a848f76378d34523b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Garde?= Date: Wed, 13 Sep 2017 15:27:01 +1000 Subject: [PATCH 02/18] [PF-183] Invoice template: add bank statement mention --- core/app/pdf/mno_enterprise/invoice_pdf.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/core/app/pdf/mno_enterprise/invoice_pdf.rb b/core/app/pdf/mno_enterprise/invoice_pdf.rb index fad0984bf..81c1c5850 100644 --- a/core/app/pdf/mno_enterprise/invoice_pdf.rb +++ b/core/app/pdf/mno_enterprise/invoice_pdf.rb @@ -247,6 +247,7 @@ def add_page_body @pdf.move_down 10 @pdf.indent(5) do @pdf.font_size(8) do + @pdf.text " The charges will appear as INV #{@data[:invoice_reference]} on your bank statement.", inline_format: true @pdf.text " Charges are all displayed in #{@data[:invoice_currency_name]} (#{@data[:invoice_currency]})", inline_format: true if @data[:invoice_fully_paid] @pdf.text " No credit card payments required for this invoice", inline_format: true From 10cd7100b55a83ec6caab9e46b6857775fd22626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Garde?= Date: Wed, 13 Sep 2017 15:42:41 +1000 Subject: [PATCH 03/18] [PF-183] fix(Invoice template): Wording Use "This charge" instead of "The charges" --- core/app/pdf/mno_enterprise/invoice_pdf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app/pdf/mno_enterprise/invoice_pdf.rb b/core/app/pdf/mno_enterprise/invoice_pdf.rb index 81c1c5850..dd9747cbd 100644 --- a/core/app/pdf/mno_enterprise/invoice_pdf.rb +++ b/core/app/pdf/mno_enterprise/invoice_pdf.rb @@ -247,7 +247,7 @@ def add_page_body @pdf.move_down 10 @pdf.indent(5) do @pdf.font_size(8) do - @pdf.text " The charges will appear as INV #{@data[:invoice_reference]} on your bank statement.", inline_format: true + @pdf.text " This charge will appear as INV #{@data[:invoice_reference]} on your bank statement.", inline_format: true @pdf.text " Charges are all displayed in #{@data[:invoice_currency_name]} (#{@data[:invoice_currency]})", inline_format: true if @data[:invoice_fully_paid] @pdf.text " No credit card payments required for this invoice", inline_format: true From 50502301b59e4baa882acda300b1e9c2ecd46ba6 Mon Sep 17 00:00:00 2001 From: Cesar Tonnoir Date: Wed, 13 Sep 2017 16:35:56 +1000 Subject: [PATCH 04/18] return all orgs as data_sources when the dashboard is a template --- .../models/mno_enterprise/impac/dashboard.rb | 7 +++--- .../mno_enterprise/impac/dashboard_spec.rb | 22 ++++++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/core/app/models/mno_enterprise/impac/dashboard.rb b/core/app/models/mno_enterprise/impac/dashboard.rb index 8843462a5..3360f5a31 100644 --- a/core/app/models/mno_enterprise/impac/dashboard.rb +++ b/core/app/models/mno_enterprise/impac/dashboard.rb @@ -1,7 +1,7 @@ module MnoEnterprise class Impac::Dashboard < BaseResource - attributes :full_name, :widgets_order, :settings, :organization_ids, :widgets_templates, :currency, :published + attributes :full_name, :widgets_order, :settings, :organization_ids, :widgets_templates, :currency, :published, :dashboard_type has_many :widgets, class_name: 'MnoEnterprise::Impac::Widget' has_many :kpis, class_name: 'MnoEnterprise::Impac::Kpi' @@ -21,10 +21,11 @@ def full_name self.name end - # Return all the organizations linked to this dashboard and to which - # the user has access + # Return all the organizations linked to this dashboard and to which the user has access + # If the dashboard is a template, return all the current user's organization def organizations(org_list = nil) if org_list + return org_list if dashboard_type == 'template' org_list.to_a.select { |e| self.organization_ids.include?(e.uid) } else MnoEnterprise::Organization.where('uid.in' => self.organization_ids).to_a diff --git a/core/spec/models/mno_enterprise/impac/dashboard_spec.rb b/core/spec/models/mno_enterprise/impac/dashboard_spec.rb index 914553085..642d97262 100644 --- a/core/spec/models/mno_enterprise/impac/dashboard_spec.rb +++ b/core/spec/models/mno_enterprise/impac/dashboard_spec.rb @@ -2,17 +2,14 @@ module MnoEnterprise RSpec.describe Impac::Dashboard, type: :model do - subject(:dashboard) { build(:impac_dashboard) } + let(:org1) { build(:organization) } + subject(:dashboard) { build(:impac_dashboard, organization_ids: [org1.uid]) } describe '#full_name' do subject { dashboard.full_name } it { is_expected.to eq(dashboard.name) } end - describe '#sorted_widgets' do - it 'is pending' - end - describe '#filtered_widgets_templates' do let(:templates) { [ @@ -42,5 +39,20 @@ module MnoEnterprise end end end + + describe '#organizations(orgs_list)' do + subject { dashboard.organizations(orgs_list) } + + let(:org2) { build(:organization) } + let(:orgs_list) { [org1, org2] } + + it { is_expected.to eq([org1]) } + + context 'when the dashboard is a template' do + let(:dashboard) { build(:impac_dashboard, organization_ids: [org1.uid], dashboard_type: 'template') } + + it { is_expected.to eq([org1, org2]) } + end + end end end From f2f973e27a1e19714cdc6f585febcde0ba21c6d5 Mon Sep 17 00:00:00 2001 From: hedudelgado Date: Wed, 13 Sep 2017 17:59:53 +0100 Subject: [PATCH 05/18] [MNOE-600] Fix size logo on invoice --- core/app/pdf/mno_enterprise/invoice_pdf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app/pdf/mno_enterprise/invoice_pdf.rb b/core/app/pdf/mno_enterprise/invoice_pdf.rb index b66860430..1183525cd 100644 --- a/core/app/pdf/mno_enterprise/invoice_pdf.rb +++ b/core/app/pdf/mno_enterprise/invoice_pdf.rb @@ -138,7 +138,7 @@ def add_page_header @pdf.repeat :all do @pdf.bounding_box([0, @pdf.bounds.top+@format[:header_size]], width: 540, height: @format[:footer_size]) do @pdf.float do - @pdf.image image_path('mno_enterprise/main-logo.png'), scale: 0.5 + @pdf.image image_path('mno_enterprise/main-logo.png'), scale: 0.25 end @pdf.move_down 52 @pdf.font_size(20) { @pdf.text "Monthly Invoice - #{@data[:period_month]}", style: :bold, align: :right } From 145bfb8ea9e7145d3c261f87a4f03b695e0de5b4 Mon Sep 17 00:00:00 2001 From: hedudelgado Date: Mon, 18 Sep 2017 14:18:06 +0100 Subject: [PATCH 06/18] [MNOE-600] Add fit logo within header --- core/app/pdf/mno_enterprise/invoice_pdf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app/pdf/mno_enterprise/invoice_pdf.rb b/core/app/pdf/mno_enterprise/invoice_pdf.rb index 1183525cd..f4be24dab 100644 --- a/core/app/pdf/mno_enterprise/invoice_pdf.rb +++ b/core/app/pdf/mno_enterprise/invoice_pdf.rb @@ -138,7 +138,7 @@ def add_page_header @pdf.repeat :all do @pdf.bounding_box([0, @pdf.bounds.top+@format[:header_size]], width: 540, height: @format[:footer_size]) do @pdf.float do - @pdf.image image_path('mno_enterprise/main-logo.png'), scale: 0.25 + @pdf.image image_path('mno_enterprise/main-logo.png'), :fit => [135, (@format[:footer_size])] end @pdf.move_down 52 @pdf.font_size(20) { @pdf.text "Monthly Invoice - #{@data[:period_month]}", style: :bold, align: :right } From 598c05b37070d8672b9b5fef85bbd4329247d571 Mon Sep 17 00:00:00 2001 From: Olivier Brisse Date: Tue, 3 Oct 2017 16:05:25 +1100 Subject: [PATCH 07/18] [MNOE-682] Add settings for intercom in Admin Panel --- .../mno_enterprise/install/templates/config/settings.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/lib/generators/mno_enterprise/install/templates/config/settings.yml b/core/lib/generators/mno_enterprise/install/templates/config/settings.yml index fc2536cf4..d338d1b49 100644 --- a/core/lib/generators/mno_enterprise/install/templates/config/settings.yml +++ b/core/lib/generators/mno_enterprise/install/templates/config/settings.yml @@ -71,6 +71,10 @@ admin_panel: enabled: true finance: enabled: true + # Ability to enable Intercom on the admin panel + # Intercom needs to be properly setup for the dashboard + intercom: + enabled: false impersonation: disabled: false staff: From 1d1437dab0403558d1efba28a2c13e82e2edbc65 Mon Sep 17 00:00:00 2001 From: Francois Gourichon Date: Wed, 4 Oct 2017 16:14:14 +1100 Subject: [PATCH 08/18] Authorize staff to manage app instances --- core/lib/mno_enterprise/concerns/models/ability.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/mno_enterprise/concerns/models/ability.rb b/core/lib/mno_enterprise/concerns/models/ability.rb index 6bd9b5404..72a5aaa02 100644 --- a/core/lib/mno_enterprise/concerns/models/ability.rb +++ b/core/lib/mno_enterprise/concerns/models/ability.rb @@ -144,7 +144,7 @@ def impac_abilities(user) # Abilities for admin user def admin_abilities(user) - if user.admin_role.to_s.casecmp('admin').zero? + if user.admin_role.to_s.casecmp('admin').zero? || user.admin_role.to_s.casecmp('staff').zero? can :manage_app_instances, MnoEnterprise::Organization end end From e41d9ebbe20b137ccbd7b0d104ffcc3c97bb7cc1 Mon Sep 17 00:00:00 2001 From: Olivier Brisse Date: Tue, 10 Oct 2017 15:54:09 +1100 Subject: [PATCH 09/18] [MNOE-658] Disallow Staff impersonation --- .../mno_enterprise/impersonate_controller.rb | 6 +++++- .../mno_enterprise/impersonate_controller_spec.rb | 13 +++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/api/app/controllers/mno_enterprise/impersonate_controller.rb b/api/app/controllers/mno_enterprise/impersonate_controller.rb index f6cab9add..750b12b7e 100644 --- a/api/app/controllers/mno_enterprise/impersonate_controller.rb +++ b/api/app/controllers/mno_enterprise/impersonate_controller.rb @@ -11,7 +11,11 @@ def create session[:impersonator_redirect_path] = params[:redirect_path].presence @user = MnoEnterprise::User.find(params[:user_id]) if @user.present? - impersonate(@user) + if @user.admin_role.present? + flash[:notice] = 'User is a staff member' + else + impersonate(@user) + end else flash[:notice] = "User doesn't exist" end diff --git a/api/spec/controllers/mno_enterprise/impersonate_controller_spec.rb b/api/spec/controllers/mno_enterprise/impersonate_controller_spec.rb index 873b4d83d..c3c16d67c 100644 --- a/api/spec/controllers/mno_enterprise/impersonate_controller_spec.rb +++ b/api/spec/controllers/mno_enterprise/impersonate_controller_spec.rb @@ -21,17 +21,26 @@ module MnoEnterprise end describe "#create" do + subject { get :create, user_id: user2.id } it do expect(controller.current_user.id).to eq(user.id) - get :create, user_id: user2.id + subject expect(controller.current_user.id).to eq(user2.id) end context 'with an organisation id in parameters' do - before { get :create, user_id: user.id, dhbRefId: 10 } + subject { get :create, user_id: user.id, dhbRefId: 10 } it { is_expected.to redirect_to('/dashboard/#!?dhbRefId=10') } end + + context 'when the user is a staff member' do + let(:user2) { build(:user, admin_role: 'staff') } + it do + subject + expect(controller).to set_flash[:notice].to('User is a staff member') + end + end end describe "#destroy" do From 8ba84c8fc5bb6c20301d005acb1222dd71a8fd90 Mon Sep 17 00:00:00 2001 From: Olivier Brisse Date: Wed, 11 Oct 2017 19:16:17 +1100 Subject: [PATCH 10/18] [MNOE-658] Expose admin_role to frontend --- .../jpi/v1/admin/base_resource/_member.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/api/app/views/mno_enterprise/jpi/v1/admin/base_resource/_member.json.jbuilder b/api/app/views/mno_enterprise/jpi/v1/admin/base_resource/_member.json.jbuilder index a6320d10d..031d7d43d 100644 --- a/api/app/views/mno_enterprise/jpi/v1/admin/base_resource/_member.json.jbuilder +++ b/api/app/views/mno_enterprise/jpi/v1/admin/base_resource/_member.json.jbuilder @@ -2,6 +2,7 @@ if member.is_a?(MnoEnterprise::User) json.uid member.uid json.entity 'User' json.role member.role(organization) if organization + json.admin_role member.admin_role status = case when member.confirmed? then 'active' From d5edba29e954b0c2a75179b76aef5e7350b26ec9 Mon Sep 17 00:00:00 2001 From: hedudelgado Date: Wed, 18 Oct 2017 09:57:36 +0100 Subject: [PATCH 11/18] [MNOE-563][MNOE-677] Add main_logo_white_bg on notifications and fix size --- core/app/helpers/mno_enterprise/image_helper.rb | 4 ++++ core/app/pdf/mno_enterprise/invoice_pdf.rb | 2 +- .../system_notifications/confirmation-instructions.html.erb | 2 +- .../system_notifications/delete-request-instructions.html.erb | 2 +- core/app/views/system_notifications/email-change.html.erb | 2 +- .../organization-invite-existing-user.html.erb | 2 +- .../organization-invite-new-user.html.erb | 2 +- core/app/views/system_notifications/password-change.html.erb | 2 +- .../system_notifications/reconfirmation-instructions.html.erb | 2 +- .../system_notifications/registration-instructions.html.erb | 2 +- .../system_notifications/reset-password-instructions.html.erb | 2 +- .../views/system_notifications/unlock-instructions.html.erb | 2 +- core/lib/mno_enterprise/smtp_client.rb | 2 ++ 13 files changed, 17 insertions(+), 11 deletions(-) diff --git a/core/app/helpers/mno_enterprise/image_helper.rb b/core/app/helpers/mno_enterprise/image_helper.rb index 8637d8835..037422ffa 100644 --- a/core/app/helpers/mno_enterprise/image_helper.rb +++ b/core/app/helpers/mno_enterprise/image_helper.rb @@ -28,5 +28,9 @@ def app_image_path(file_name) def engine_image_path(file_name) "#{MnoEnterprise::Engine.root}#{IMAGES_LOCATION}#{file_name}" end + + def fit_image + 'max-width: 150px; max-height: 150px;' + end end end diff --git a/core/app/pdf/mno_enterprise/invoice_pdf.rb b/core/app/pdf/mno_enterprise/invoice_pdf.rb index fad0984bf..0d7754adc 100644 --- a/core/app/pdf/mno_enterprise/invoice_pdf.rb +++ b/core/app/pdf/mno_enterprise/invoice_pdf.rb @@ -128,7 +128,7 @@ def add_page_header @pdf.repeat :all do @pdf.bounding_box([0, @pdf.bounds.top+@format[:header_size]], width: 540, height: @format[:footer_size]) do @pdf.float do - @pdf.image main_logo_white_bg_path(true), scale: 0.5 + @pdf.image main_logo_white_bg_path(true), :fit => [135, (@format[:footer_size])] end @pdf.move_down 52 @pdf.font_size(20) { @pdf.text "#{title} #{@data[:period_month]}", style: :bold, align: :right } diff --git a/core/app/views/system_notifications/confirmation-instructions.html.erb b/core/app/views/system_notifications/confirmation-instructions.html.erb index 62eebd658..6376563a1 100644 --- a/core/app/views/system_notifications/confirmation-instructions.html.erb +++ b/core/app/views/system_notifications/confirmation-instructions.html.erb @@ -6,7 +6,7 @@

- <%= image_tag('mno_enterprise/main-logo.png') %> + <%= image_tag(main_logo_white_bg_path, style: fit_image) %>

Hi <%= @info[:first_name] %>

diff --git a/core/app/views/system_notifications/delete-request-instructions.html.erb b/core/app/views/system_notifications/delete-request-instructions.html.erb index 43b888e23..49254fd1f 100644 --- a/core/app/views/system_notifications/delete-request-instructions.html.erb +++ b/core/app/views/system_notifications/delete-request-instructions.html.erb @@ -6,7 +6,7 @@

- <%= image_tag('mno_enterprise/main-logo.png') %> + <%= image_tag(main_logo_white_bg_path, style: fit_image) %>

Hi <%= @info[:first_name] %>

diff --git a/core/app/views/system_notifications/email-change.html.erb b/core/app/views/system_notifications/email-change.html.erb index f9ee3c4a9..08551f446 100644 --- a/core/app/views/system_notifications/email-change.html.erb +++ b/core/app/views/system_notifications/email-change.html.erb @@ -6,7 +6,7 @@

- <%= image_tag('mno_enterprise/main-logo.png') %> + <%= image_tag(main_logo_white_bg_path, style: fit_image) %>

Hi <%= @info[:first_name] %>

diff --git a/core/app/views/system_notifications/organization-invite-existing-user.html.erb b/core/app/views/system_notifications/organization-invite-existing-user.html.erb index ec518e087..ea85eb0f6 100644 --- a/core/app/views/system_notifications/organization-invite-existing-user.html.erb +++ b/core/app/views/system_notifications/organization-invite-existing-user.html.erb @@ -6,7 +6,7 @@

- <%= image_tag('mno_enterprise/main-logo.png') %> + <%= image_tag(main_logo_white_bg_path, style: fit_image) %>

Hi there,

diff --git a/core/app/views/system_notifications/organization-invite-new-user.html.erb b/core/app/views/system_notifications/organization-invite-new-user.html.erb index e11889370..b763d5664 100644 --- a/core/app/views/system_notifications/organization-invite-new-user.html.erb +++ b/core/app/views/system_notifications/organization-invite-new-user.html.erb @@ -6,7 +6,7 @@

- <%= image_tag('mno_enterprise/main-logo.png') %> + <%= image_tag(main_logo_white_bg_path, style: fit_image) %>

Hi there,

diff --git a/core/app/views/system_notifications/password-change.html.erb b/core/app/views/system_notifications/password-change.html.erb index 0ac84a973..14931a69e 100644 --- a/core/app/views/system_notifications/password-change.html.erb +++ b/core/app/views/system_notifications/password-change.html.erb @@ -6,7 +6,7 @@

- <%= image_tag('mno_enterprise/main-logo.png') %> + <%= image_tag(main_logo_white_bg_path, style: fit_image) %>

Hi <%= @info[:first_name] %>

diff --git a/core/app/views/system_notifications/reconfirmation-instructions.html.erb b/core/app/views/system_notifications/reconfirmation-instructions.html.erb index 6bd22c453..fef73ad1f 100644 --- a/core/app/views/system_notifications/reconfirmation-instructions.html.erb +++ b/core/app/views/system_notifications/reconfirmation-instructions.html.erb @@ -6,7 +6,7 @@

- <%= image_tag('mno_enterprise/main-logo.png') %> + <%= image_tag(main_logo_white_bg_path, style: fit_image) %>

Hi <%= @info[:first_name] %>

diff --git a/core/app/views/system_notifications/registration-instructions.html.erb b/core/app/views/system_notifications/registration-instructions.html.erb index 4805332f2..0695d3c27 100644 --- a/core/app/views/system_notifications/registration-instructions.html.erb +++ b/core/app/views/system_notifications/registration-instructions.html.erb @@ -6,7 +6,7 @@

- <%= image_tag('mno_enterprise/main-logo.png') %> + <%= image_tag(main_logo_white_bg_path, style: fit_image) %>

Hi there,

diff --git a/core/app/views/system_notifications/reset-password-instructions.html.erb b/core/app/views/system_notifications/reset-password-instructions.html.erb index b1e8aaa70..89c51c1fd 100644 --- a/core/app/views/system_notifications/reset-password-instructions.html.erb +++ b/core/app/views/system_notifications/reset-password-instructions.html.erb @@ -6,7 +6,7 @@

- <%= image_tag('mno_enterprise/main-logo.png') %> + <%= image_tag(main_logo_white_bg_path, style: fit_image) %>

Hi <%= @info[:first_name] %>

diff --git a/core/app/views/system_notifications/unlock-instructions.html.erb b/core/app/views/system_notifications/unlock-instructions.html.erb index da37e1871..bdc0b09c2 100644 --- a/core/app/views/system_notifications/unlock-instructions.html.erb +++ b/core/app/views/system_notifications/unlock-instructions.html.erb @@ -6,7 +6,7 @@

- <%= image_tag('mno_enterprise/main-logo.png') %> + <%= image_tag(main_logo_white_bg_path, style: fit_image) %>

Hi <%= @info[:first_name] %>

diff --git a/core/lib/mno_enterprise/smtp_client.rb b/core/lib/mno_enterprise/smtp_client.rb index f3ab3a098..955d37b48 100644 --- a/core/lib/mno_enterprise/smtp_client.rb +++ b/core/lib/mno_enterprise/smtp_client.rb @@ -3,6 +3,8 @@ module MnoEnterprise # Base class (instantiable) for SMTP adapter class SmtpClient < ActionMailer::Base + helper MnoEnterprise::ImageHelper + # Send SMTP template - terminal mailing part def deliver(template, from, to, vars={}, opts={}) @info = vars From c34ddecfb7611f22b799628b0ff006e5de5b086d Mon Sep 17 00:00:00 2001 From: hedudelgado Date: Wed, 18 Oct 2017 10:13:41 +0100 Subject: [PATCH 12/18] [MNOE-677] Add test for image helper and remove double quotations --- core/spec/helpers/image_helper_spec.rb | 45 +++++++++++++++----------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/core/spec/helpers/image_helper_spec.rb b/core/spec/helpers/image_helper_spec.rb index 3a2f58b76..c0b4c787b 100644 --- a/core/spec/helpers/image_helper_spec.rb +++ b/core/spec/helpers/image_helper_spec.rb @@ -3,67 +3,74 @@ module MnoEnterprise describe ImageHelper do - let(:folder) { "/app/assets/images/mno_enterprise" } + let(:folder) { '/app/assets/images/mno_enterprise' } let(:root) {"#{Rails.root}#{folder}"} let(:path_engine_main_logo) { "#{MnoEnterprise::Engine.root}#{folder}/main-logo.png" } let(:path_main_logo) { "#{root}/main-logo.png" } let(:path_main_logo_white) { "#{root}/main-logo-whitebg.png" } - describe "#main_logo_white_bg_path" do + describe '#main_logo_white_bg_path' do - context "when no logos exist" do + context 'when no logos exist' do - it "returns the engine main-logo filename" do - expect(helper.main_logo_white_bg_path).to match("mno_enterprise/main-logo.png") + it 'returns the engine main-logo filename' do + expect(helper.main_logo_white_bg_path).to match('mno_enterprise/main-logo.png') end - it "returns the engine main-logo full path" do + it 'returns the engine main-logo full path' do expect(helper.main_logo_white_bg_path(true)).to match(path_engine_main_logo) end end - context "when main-logo.png exists and main-logo-whitebg.png do not exist" do + context 'when main-logo.png exists and main-logo-whitebg.png do not exist' do before { allow(File).to receive(:exists?).with(path_main_logo_white).and_return(false) } before { allow(File).to receive(:exists?).with(path_main_logo).and_return(true) } - it "returns the main-logo filename" do - expect(helper.main_logo_white_bg_path).to match("mno_enterprise/main-logo.png") + it 'returns the main-logo filename' do + expect(helper.main_logo_white_bg_path).to match('mno_enterprise/main-logo.png') end - it "returns the main-logo full path" do + it 'returns the main-logo full path' do expect(helper.main_logo_white_bg_path(true)).to match(path_main_logo) end end - context "when main-logo-whitebg.png exists" do + context 'when main-logo-whitebg.png exists' do before { allow(File).to receive(:exists?).with(path_main_logo_white).and_return(true) } - it "returns the filename" do - expect(helper.main_logo_white_bg_path).to match("mno_enterprise/main-logo-whitebg.png") + it 'returns the filename' do + expect(helper.main_logo_white_bg_path).to match('mno_enterprise/main-logo-whitebg.png') end - it "returns the full path" do + it 'returns the full path' do expect(helper.main_logo_white_bg_path(true)).to match(path_main_logo_white) end end end - describe "#main_logo_path" do + describe '#main_logo_path' do - context "when there are no logos" do + context 'when there are no logos' do - it "returns the engines main-logo " do + it 'returns the engines main-logo' do expect(helper.main_logo_path).to match(path_engine_main_logo) end end - context "when main-logo.png exists" do + context 'when main-logo.png exists' do before { allow(File).to receive(:exists?).with(path_main_logo).and_return(true) } - it "returns the full path" do + it 'returns the full path' do expect(helper.main_logo_path).to match(path_main_logo) end end end + + describe '#fit_image' do + + it 'returns the style' do + expect(helper.fit_image).to match('max-width: 150px; max-height: 150px;') + end + end end end From 1e79a8989a768bf040cbc291cc0937c2f2592706 Mon Sep 17 00:00:00 2001 From: hedudelgado Date: Wed, 18 Oct 2017 10:17:01 +0100 Subject: [PATCH 13/18] Remove rocket syntax --- core/app/pdf/mno_enterprise/invoice_pdf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app/pdf/mno_enterprise/invoice_pdf.rb b/core/app/pdf/mno_enterprise/invoice_pdf.rb index 0d7754adc..3540b25d7 100644 --- a/core/app/pdf/mno_enterprise/invoice_pdf.rb +++ b/core/app/pdf/mno_enterprise/invoice_pdf.rb @@ -128,7 +128,7 @@ def add_page_header @pdf.repeat :all do @pdf.bounding_box([0, @pdf.bounds.top+@format[:header_size]], width: 540, height: @format[:footer_size]) do @pdf.float do - @pdf.image main_logo_white_bg_path(true), :fit => [135, (@format[:footer_size])] + @pdf.image main_logo_white_bg_path(true), fit: [135, (@format[:footer_size])] end @pdf.move_down 52 @pdf.font_size(20) { @pdf.text "#{title} #{@data[:period_month]}", style: :bold, align: :right } From 1cbdc092af82b57b70a316981287a8c6fac0346f Mon Sep 17 00:00:00 2001 From: hedudelgado Date: Fri, 20 Oct 2017 15:59:30 +0100 Subject: [PATCH 14/18] Fix terms of use not being displayed --- .../mno_enterprise/concerns/controllers/pages_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb b/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb index 6f9d97850..c420b6fcb 100644 --- a/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb +++ b/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb @@ -65,7 +65,9 @@ def terms ts = MnoEnterprise::App.order_by("updated_at.desc").first.try(:updated_at) @apps = if ts Rails.cache.fetch(['pages/terms/app-list', ts]) do - MnoEnterprise::App.order_by("name.ac").reject{|i| i.terms_url.blank?} + # Temp solution as translated fields can not be filtered or sorted + # MnoEnterprise::App.order_by("name.ac").reject{|i| i.terms_url.blank?} + MnoEnterprise::App.all.reject { |i| i.terms_url.blank? } end else [] From bf0def0dfe91fc61178c100378c11dbc0adf98fe Mon Sep 17 00:00:00 2001 From: hedudelgado Date: Mon, 6 Nov 2017 15:13:25 +0000 Subject: [PATCH 15/18] Add sort list of apps after fetch and spec --- .../concerns/controllers/pages_controller.rb | 2 +- .../mno_enterprise/pages_controller_spec.rb | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb b/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb index c420b6fcb..a0520bff7 100644 --- a/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb +++ b/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb @@ -67,7 +67,7 @@ def terms Rails.cache.fetch(['pages/terms/app-list', ts]) do # Temp solution as translated fields can not be filtered or sorted # MnoEnterprise::App.order_by("name.ac").reject{|i| i.terms_url.blank?} - MnoEnterprise::App.all.reject { |i| i.terms_url.blank? } + MnoEnterprise::App.all.reject { |i| i.terms_url.blank? }.sort! { |a,b| a.name.downcase <=> b.name.downcase } end else [] diff --git a/api/spec/controllers/mno_enterprise/pages_controller_spec.rb b/api/spec/controllers/mno_enterprise/pages_controller_spec.rb index 2cccee482..869a275dd 100644 --- a/api/spec/controllers/mno_enterprise/pages_controller_spec.rb +++ b/api/spec/controllers/mno_enterprise/pages_controller_spec.rb @@ -63,12 +63,23 @@ module MnoEnterprise end describe 'GET #terms' do - before { api_stub_for(get: "/apps", response: from_api([build(:app)])) } + let!(:app1) { build(:app, name: 'b') } + let!(:app2) { build(:app, name:'a') } + let!(:app3) { build(:app, name: 'c') } + + before do + Rails.cache.clear + api_stub_for(get: '/apps', response: from_api([app1, app2, app3])) + end subject { get :terms } before { subject } + it { expect(response).to be_success } + + it 'returns the apps in the correct alphabetical order' do + expect(assigns(:apps)).to eq([app2, app1, app3]) + end end - end end From f462a59bd45f40f60af9ef8ff0620e5cca79b0a1 Mon Sep 17 00:00:00 2001 From: hedudelgado Date: Tue, 7 Nov 2017 14:22:49 +0000 Subject: [PATCH 16/18] Change sorting apps method in terms --- api/lib/mno_enterprise/concerns/controllers/pages_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb b/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb index a0520bff7..e41c77108 100644 --- a/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb +++ b/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb @@ -67,7 +67,7 @@ def terms Rails.cache.fetch(['pages/terms/app-list', ts]) do # Temp solution as translated fields can not be filtered or sorted # MnoEnterprise::App.order_by("name.ac").reject{|i| i.terms_url.blank?} - MnoEnterprise::App.all.reject { |i| i.terms_url.blank? }.sort! { |a,b| a.name.downcase <=> b.name.downcase } + MnoEnterprise::App.all.reject{ |i| i.terms_url.blank? }.sort_by{ |a| a.name.downcase } end else [] From b39cdf6cde587fd410a7137f73a1a6a0f0a7038c Mon Sep 17 00:00:00 2001 From: Olivier Brisse Date: Thu, 9 Nov 2017 15:35:25 +1100 Subject: [PATCH 17/18] Preparing for 3.2.1 release --- CHANGELOG.md | 9 ++++++++- MNOE_VERSION | 2 +- core/lib/mno_enterprise/version.rb | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f2edc884..b8d3e28b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,14 @@ ## [Unreleased](https://github.com/maestrano/mno-enterprise/tree/master) -[Full Changelog](https://github.com/maestrano/mno-enterprise/compare/v3.2.0...HEAD) +[Full Changelog](https://github.com/maestrano/mno-enterprise/compare/v3.2.1...HEAD) + +## [v3.2.1](https://github.com/maestrano/mno-enterprise/tree/v3.2.1) (2017-11-09) +[Full Changelog](https://github.com/maestrano/mno-enterprise/compare/v3.2.0...v3.2.1) + +**Fixed bugs:** + +- \[MNOE-600\] Fix size logo on invoice [\#477](https://github.com/maestrano/mno-enterprise/pull/477) ([hedudelgado](https://github.com/hedudelgado)) ## [v3.2.0](https://github.com/maestrano/mno-enterprise/tree/v3.2.0) (2017-06-14) [Full Changelog](https://github.com/maestrano/mno-enterprise/compare/v3.1.4...v3.2.0) diff --git a/MNOE_VERSION b/MNOE_VERSION index 944880fa1..e4604e3af 100644 --- a/MNOE_VERSION +++ b/MNOE_VERSION @@ -1 +1 @@ -3.2.0 +3.2.1 diff --git a/core/lib/mno_enterprise/version.rb b/core/lib/mno_enterprise/version.rb index 9edfad03e..475673e84 100644 --- a/core/lib/mno_enterprise/version.rb +++ b/core/lib/mno_enterprise/version.rb @@ -1,3 +1,3 @@ module MnoEnterprise - VERSION = '3.2.0' + VERSION = '3.2.1' end From 643816b8d4b0d511e4acc36b8fd6295d8060834f Mon Sep 17 00:00:00 2001 From: Olivier Brisse Date: Thu, 9 Nov 2017 15:46:32 +1100 Subject: [PATCH 18/18] Preparing for 3.3.2 release --- CHANGELOG.md | 30 +++++++++++++++++++++++++++++- MNOE_VERSION | 2 +- core/lib/mno_enterprise/version.rb | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f34b54088..39cd394b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,35 @@ # Change Log ## [Unreleased](https://github.com/maestrano/mno-enterprise/tree/master) -[Full Changelog](https://github.com/maestrano/mno-enterprise/compare/v3.3.1...HEAD) +[Full Changelog](https://github.com/maestrano/mno-enterprise/compare/v3.3.2...HEAD) + +## [v3.3.2](https://github.com/maestrano/mno-enterprise/tree/v3.3.2) (2017-11-09) +[Full Changelog](https://github.com/maestrano/mno-enterprise/compare/v3.3.1...v3.3.2) + +**Implemented enhancements:** + +- \[MNOE-682\] Add Intercom to Admin Panel [\#513](https://github.com/maestrano/mno-enterprise/pull/513) ([ouranos](https://github.com/ouranos)) +- \[PF-183\] Invoice template: add bank statement mention [\#474](https://github.com/maestrano/mno-enterprise/pull/474) ([enizor](https://github.com/enizor)) +- Admin build: inject impac-angular dependency [\#412](https://github.com/maestrano/mno-enterprise/pull/412) ([ouranos](https://github.com/ouranos)) +- \[MNOE-570\] Storing the time of agreement to TOS [\#407](https://github.com/maestrano/mno-enterprise/pull/407) ([enizor](https://github.com/enizor)) +- Invoice PDF - Clarify payment processor [\#403](https://github.com/maestrano/mno-enterprise/pull/403) ([alachaum](https://github.com/alachaum)) +- \[PF-164\] Explain roles in invite modal [\#398](https://github.com/maestrano/mno-enterprise/pull/398) ([alexnoox](https://github.com/alexnoox)) +- Expose devise config in the frontend [\#384](https://github.com/maestrano/mno-enterprise/pull/384) ([ouranos](https://github.com/ouranos)) +- Expose impersonator admin\_role [\#383](https://github.com/maestrano/mno-enterprise/pull/383) ([ouranos](https://github.com/ouranos)) +- \[MNOE-447\] Dashboard templates management [\#312](https://github.com/maestrano/mno-enterprise/pull/312) ([ouranos](https://github.com/ouranos)) + +**Fixed bugs:** + +- \[MNOE-699\]\[MNOE-658\] Disallow Staff impersonation [\#545](https://github.com/maestrano/mno-enterprise/pull/545) ([ouranos](https://github.com/ouranos)) +- Fix terms of use not being displayed [\#542](https://github.com/maestrano/mno-enterprise/pull/542) ([hedudelgado](https://github.com/hedudelgado)) +- \[MNOE-563\]\[MNOE-677\] Add main\_logo\_white\_bg on notifications and fix size [\#536](https://github.com/maestrano/mno-enterprise/pull/536) ([hedudelgado](https://github.com/hedudelgado)) +- Authorize staff to manage app instances [\#514](https://github.com/maestrano/mno-enterprise/pull/514) ([fgourichon](https://github.com/fgourichon)) +- Fixes - Dashboard templates [\#475](https://github.com/maestrano/mno-enterprise/pull/475) ([cesar-tonnoir](https://github.com/cesar-tonnoir)) +- \[MNOE-587\]\[Bug\] Nan average rating [\#451](https://github.com/maestrano/mno-enterprise/pull/451) ([adamaziz15](https://github.com/adamaziz15)) +- Fix intermittent 500 errors on dashboard templates controller [\#427](https://github.com/maestrano/mno-enterprise/pull/427) ([cesar-tonnoir](https://github.com/cesar-tonnoir)) +- \[MNOE-643\] Add white logo on App loading page [\#419](https://github.com/maestrano/mno-enterprise/pull/419) ([ouranos](https://github.com/ouranos)) +- Fix marketplace cache when no apps [\#406](https://github.com/maestrano/mno-enterprise/pull/406) ([ouranos](https://github.com/ouranos)) +- \[MNOE-558\] Filter out rejected comments from feedbacks [\#385](https://github.com/maestrano/mno-enterprise/pull/385) ([adamaziz15](https://github.com/adamaziz15)) ## [v3.3.1](https://github.com/maestrano/mno-enterprise/tree/v3.3.1) (2017-07-24) [Full Changelog](https://github.com/maestrano/mno-enterprise/compare/v3.3.0...v3.3.1) diff --git a/MNOE_VERSION b/MNOE_VERSION index bea438e9a..477254331 100644 --- a/MNOE_VERSION +++ b/MNOE_VERSION @@ -1 +1 @@ -3.3.1 +3.3.2 diff --git a/core/lib/mno_enterprise/version.rb b/core/lib/mno_enterprise/version.rb index b4f05e1c9..5710fe336 100644 --- a/core/lib/mno_enterprise/version.rb +++ b/core/lib/mno_enterprise/version.rb @@ -1,3 +1,3 @@ module MnoEnterprise - VERSION = '3.3.1' + VERSION = '3.3.2' end