mno-enterprise-frontend 3.3.1 → 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b627be5a83f12bb9b6e6bfcde051fd49aee4b356
4
- data.tar.gz: f7eed0fe69d2f9e2a1b2cf4bd0d4a730eabda616
3
+ metadata.gz: 062c00ed02c8c9f493d108b224f941cb967ef28c
4
+ data.tar.gz: a6a130c7bf655737bcd48931bebaa1a472521707
5
5
  SHA512:
6
- metadata.gz: 4c8687b06fd8540a147e446b5dab543ea4aca73442c367b40c021609ca6732231a73a857a98730c7e3a534f44dfc33f50a097b22c025562168f6516701384c99
7
- data.tar.gz: 988cec782af69a201537ba098cda940b9348325144a29bc33d584e8dcb04305b24241f3154f1047c695a54bfa9a4159a1cba994aff0a7acfa7da77ebf247e994
6
+ metadata.gz: 172b1dab46d005ba870cff96b8a69e241b6c1b4aec47471e6afc88765e9196ea06484d03ac59026d0074f4ec4cd928f307409f4ab2bd882f4822cd4fffc1f293
7
+ data.tar.gz: e938dfd24d6fe5815f26436765bbc82297ffbd4c27ab53c151ff96132cd0b46ebefa95362a3afbccc3be830419e6a1bb3f18408121d0d13ef19355de7defd8ed
@@ -1,13 +1,10 @@
1
1
  <div>
2
2
 
3
- <div class="spacer3 hidden-xs hidden-sm"></div>
4
-
5
- <div class='align-center'>
6
- <img ng-src="{{assetPath['mno_enterprise/main-logo.png']}}">
7
- <div class="spacer2"></div>
3
+ <div class='text-center' style="margin-top: 45px">
4
+ <img ng-src="{{assetPath['mno_enterprise/main-logo-whitebg.png'] || assetPath['mno_enterprise/main-logo.png']}}">
8
5
 
9
6
  <!-- Status Details -->
10
- <div ng-switch on="currentStatus()">
7
+ <div ng-switch on="currentStatus()" style="margin-top: 30px">
11
8
  <div ng-switch-when='online'>
12
9
  <h3 class='mgreen'>Redirecting to {{appInstance.name}}</h3>
13
10
  <h4 class='muted'>You will be automatically redirected in {{redirectionCounter}}s (or click the link below)</h4>
@@ -28,6 +28,29 @@ namespace :mnoe do
28
28
  end
29
29
  end
30
30
 
31
+ # Override the frontend bower.json with the locked versions
32
+ def override_admin_dependencies
33
+ resolved_version = resolve_dependencies
34
+ unless resolved_version
35
+ puts "No impac-angular override. Skipping"
36
+ return
37
+ end
38
+
39
+ frontend_bower_file = File.join(ADMIN_PANEL_PKG_FOLDER, 'bower.json')
40
+ File.exist?(frontend_bower_file) || raise("Frontend bower file not found.")
41
+
42
+ # Override the bowerfile
43
+ bower_regexp = /"impac-angular": (".*")/
44
+
45
+ # TODO: refactor
46
+ IO.write(frontend_bower_file, File.open(frontend_bower_file) do |f|
47
+ f.read.gsub(bower_regexp) do |match|
48
+ match.gsub!(Regexp.last_match(1), resolved_version)
49
+ end
50
+ end
51
+ )
52
+ end
53
+
31
54
  desc 'Setup the Enterprise Express Admin Panel'
32
55
  task :install do
33
56
  Rake::Task['mnoe:admin:add_package'].invoke
@@ -146,6 +169,10 @@ namespace :mnoe do
146
169
  # Ensure frontend is downloaded
147
170
  Rake::Task['mnoe:admin:install_frontend'].invoke unless File.directory?(ADMIN_PANEL_PKG_FOLDER)
148
171
 
172
+ # Override frontend dependencies
173
+ puts "Locking frontend dependencies"
174
+ override_admin_dependencies
175
+
149
176
  # Reset tmp folder from mnoe-admin-panel source
150
177
  rm_rf "#{admin_panel_tmp_folder}/src"
151
178
  rm_rf "#{admin_panel_tmp_folder}/e2e"
@@ -2,60 +2,77 @@ require 'rails_helper'
2
2
 
3
3
  module MnoEnterprise
4
4
  module Auth
5
-
5
+
6
6
  describe ConfirmationsController, type: :controller do
7
7
  render_views
8
8
  routes { MnoEnterprise::Engine.routes }
9
9
  before { request.env["devise.mapping"] = Devise.mappings[:user] } #bypass devise router
10
-
11
-
10
+
11
+
12
12
  let(:user) { build(:user) }
13
13
  let(:new_email) { user.email + '.au' }
14
14
  let(:email_params) {{ filter: { email: user.email }, limit: 1 }}
15
15
  let(:new_email_params) {{ filter: { email: new_email }, limit: 1 }}
16
-
16
+
17
17
  before { allow(MnoEnterprise::User).to receive(:find_for_confirmation).with(any_args).and_return(user) }
18
-
18
+
19
19
  before { api_stub_for(get: "/users", params: email_params, respond_with: []) }
20
20
  before { api_stub_for(get: "/users", respond_with: [user]) }
21
21
  before { api_stub_for(get: "/org_invites", respond_with: []) }
22
22
  before { api_stub_for(get: "/users/#{user.id}/organizations", respond_with: []) }
23
-
23
+
24
24
  before { api_stub_for(put: "/users/#{user.id}", respond_with: user) }
25
-
26
-
25
+
26
+
27
27
  describe 'GET #show' do
28
28
  subject { get :show, confirmation_token: user.confirmation_token }
29
-
29
+
30
30
  describe 'confirmed user confirming new email address' do
31
31
  before { user.unconfirmed_email = new_email }
32
-
32
+
33
33
  before { subject }
34
34
  it { expect(user.email).to eq(new_email) }
35
35
  it { expect(response).to redirect_to(root_path) }
36
36
  end
37
-
37
+
38
38
  describe 'unconfirmed user' do
39
+
40
+ let(:tos_accepted_at) { nil }
41
+ before { user.meta_data[:tos_accepted_at] = tos_accepted_at }
42
+
39
43
  before { user.confirmed_at = nil }
40
44
  before { subject }
41
45
  it { expect(response.code).to eq('200') }
42
46
  it { expect(assigns(:confirmation_token)).to eq(user.confirmation_token) }
47
+
48
+ context 'when TOS accepted' do
49
+ let(:tos_accepted_at) { 1.days.ago }
50
+ it 'does not show the TOS checkbox' do
51
+ expect(response.body).not_to include('id="tos"')
52
+ end
53
+ end
54
+
55
+ context 'when TOS not accepted' do
56
+ it 'shows the TOS checkbox' do
57
+ expect(response.body).to include('id="tos"')
58
+ end
59
+ end
43
60
  end
44
61
  end
45
-
62
+
46
63
  describe 'PATCH #finalize' do
47
64
  let(:previous_url) { nil }
48
65
  let(:user_params) {{ name: 'Robert', surname: 'Jack', password: 'somepassword', confirmation_token: user.confirmation_token }}
49
66
  subject { patch :finalize, user: user_params }
50
-
67
+
51
68
  before { session[:previous_url] = previous_url }
52
-
69
+
53
70
  describe 'confirmed user' do
54
71
  before { subject }
55
72
  it { expect(user.name).to_not eq(user_params[:name]) }
56
73
  it { expect(response).to redirect_to(root_path) }
57
74
  end
58
-
75
+
59
76
  describe 'unconfirmed user' do
60
77
  before { user.confirmed_at = nil }
61
78
  before { subject }
@@ -63,13 +80,13 @@ module MnoEnterprise
63
80
  it { expect(user.surname).to eq(user_params[:surname]) }
64
81
  it { expect(user.password).to eq(user_params[:password]) }
65
82
  it { expect(response).to redirect_to(MnoEnterprise.router.dashboard_path) }
66
-
83
+
67
84
  describe 'with previous url' do
68
85
  let(:previous_url) { "/some/redirection" }
69
86
  it { expect(response).to redirect_to(previous_url) }
70
87
  end
71
88
  end
72
-
89
+
73
90
  describe 'invalid confirmation token ' do
74
91
  let(:user_with_errors) { obj = MnoEnterprise::User.new; obj.errors[:base] << "Invalid confirmation token"; obj }
75
92
  before { allow(MnoEnterprise::User).to receive(:find_for_confirmation).with(any_args).and_return(user_with_errors) }
@@ -79,6 +96,6 @@ module MnoEnterprise
79
96
  end
80
97
  end
81
98
  end
82
-
99
+
83
100
  end
84
101
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mno-enterprise-frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Lachaume
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-07-24 00:00:00.000000000 Z
12
+ date: 2017-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mno-enterprise-core
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 3.3.1
20
+ version: 3.3.2
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 3.3.1
27
+ version: 3.3.2
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: mno-enterprise-api
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 3.3.1
34
+ version: 3.3.2
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 3.3.1
41
+ version: 3.3.2
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: less-rails
44
44
  requirement: !ruby/object:Gem::Requirement