mno-enterprise-frontend 3.1.4 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/mno_enterprise/custom/views/registration.less +48 -2
- data/app/assets/stylesheets/mno_enterprise/variables.less +11 -2
- data/app/views/layouts/mno_enterprise/_common_cdn_lib_js.html.haml +5 -5
- data/app/views/mno_enterprise/provision/_select_organization.html.haml +15 -7
- data/lib/tasks/mnoe_frontend_tasks.rake +162 -59
- data/lib/tasks/mnoe_locales.rake +6 -2
- data/lib/tasks/templates/package.json +8 -0
- data/spec/lib/tasks/mnoe_locales_rake_spec.rb +7 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30cf6b31b2fe28b60f872763ba2d65950492782d
|
4
|
+
data.tar.gz: 07df8753d60b12908ebb6b60de274bf4f5f009c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66c2eff41f5988759adf2d5178e68edf324ec3b36eee659ad164b83e776f71d9a72ed64fbc86598800cba5d4734b625efd7b7445f71f9a1f878e1f4ff43cc878
|
7
|
+
data.tar.gz: 8c8c81eb6a52840c86bc098db0fea3d38ccfb670f921cea1e7248df773d8098826a403f1ebbcd969481b00b54d6a74bc92ce41d7add863c80b8c07ea68e92dc9
|
@@ -52,6 +52,7 @@
|
|
52
52
|
.login-box-wrapper .login-box {
|
53
53
|
padding: @login-box-padding;
|
54
54
|
background-color: @login-box-bg-color;
|
55
|
+
border-radius: @login-box-corners;
|
55
56
|
}
|
56
57
|
|
57
58
|
.login-box-wrapper .login-box .brand-logo when (isstring(@login-box-brand-logo-img)){
|
@@ -79,11 +80,56 @@
|
|
79
80
|
margin-left: auto;
|
80
81
|
margin-right: auto;
|
81
82
|
}
|
82
|
-
|
83
|
+
|
84
|
+
.login-box .sign-in-using {
|
85
|
+
color: @text-inverse-link-color;
|
86
|
+
margin-top: 5px;
|
87
|
+
}
|
88
|
+
.login-box .oauth-sso {
|
89
|
+
display: flex;
|
90
|
+
flex-direction: row-reverse;
|
91
|
+
justify-content: center;
|
92
|
+
align-items: center;
|
93
|
+
margin-top: 5px;
|
94
|
+
|
95
|
+
.omniauth i {
|
96
|
+
display: inline-block;
|
97
|
+
border-radius: 3px;
|
98
|
+
color: @login-box-oauth-text-color;
|
99
|
+
width: 25px;
|
100
|
+
height: 25px;
|
101
|
+
margin: 0 5px;
|
102
|
+
line-height: 25px;
|
103
|
+
text-align: center;
|
104
|
+
|
105
|
+
&.fa-facebook {
|
106
|
+
background: @login-box-oauth-bg-color-facebook;
|
107
|
+
}
|
108
|
+
&.fa-google {
|
109
|
+
background: @login-box-oauth-bg-color-google;
|
110
|
+
}
|
111
|
+
&.fa-linkedin {
|
112
|
+
background: @login-box-oauth-bg-color-linkedin;
|
113
|
+
}
|
114
|
+
}
|
115
|
+
.omniauth.intuit {
|
116
|
+
background: @login-box-oauth-bg-color-intuit;
|
117
|
+
height: 25px;
|
118
|
+
width: 50px;
|
119
|
+
display: inline-block;
|
120
|
+
margin: 0 5px;
|
121
|
+
border-radius: 3px;
|
122
|
+
background-position: 50%;
|
123
|
+
background-repeat: no-repeat;
|
124
|
+
background-size: 40px auto;
|
125
|
+
background-image: asset-url(@login-box-sso-intuit-logo);
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
83
129
|
.checkbox-section label {
|
84
130
|
font-weight: normal;
|
85
131
|
}
|
86
|
-
|
132
|
+
|
87
133
|
.login-box-wrapper .login-box .phone select.form-control {
|
88
134
|
height: 34px;
|
89
135
|
}
|
@@ -18,9 +18,12 @@
|
|
18
18
|
/*-----------------------------------------------------------------------*/
|
19
19
|
/* Login Page */
|
20
20
|
/*-----------------------------------------------------------------------*/
|
21
|
-
@login-bg-color: @bg-main-color;
|
22
|
-
@login-box-grid-position: { margin-top: 80px; .make-sm-column(4); .make-sm-column-offset(4); };
|
23
21
|
|
22
|
+
@login-bg-img: "mno_enterprise/login-background.jpg";
|
23
|
+
@login-bg-color: @bg-main-color;
|
24
|
+
@login-box-grid-position: { margin-top: 80px; .make-sm-column(4); .make-sm-column-offset(4); };
|
25
|
+
|
26
|
+
@login-box-corners: 0px;
|
24
27
|
@login-box-title-color: @decorator-main-color;
|
25
28
|
@login-box-title: { text-transform: uppercase; };
|
26
29
|
@login-box-title-display-box-arrow: false;
|
@@ -31,6 +34,12 @@
|
|
31
34
|
@login-box-brand-logo: { min-height: 61px; max-width: 160px; max-height: 130px; margin: 17px auto 5px auto; };
|
32
35
|
@login-box-btn-login: { width: 100%; };
|
33
36
|
|
37
|
+
@login-box-oauth-text-color: #fff;
|
38
|
+
@login-box-oauth-bg-color-facebook: #3b5998;
|
39
|
+
@login-box-oauth-bg-color-google: #dd4b39;
|
40
|
+
@login-box-oauth-bg-color-linkedin: #0074C4;
|
41
|
+
@login-box-oauth-bg-color-intuit: #fff;
|
42
|
+
|
34
43
|
/*-----------------------------------------------------------------------*/
|
35
44
|
/* Dashboard Layout */
|
36
45
|
/*-----------------------------------------------------------------------*/
|
@@ -1,14 +1,14 @@
|
|
1
1
|
- # JQuery
|
2
|
-
%script{ src: "//ajax.googleapis.com/ajax/libs/jquery/1.
|
2
|
+
%script{ src: "//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js" }
|
3
3
|
|
4
4
|
- # Angular
|
5
|
-
%script{ src: "//ajax.googleapis.com/ajax/libs/angularjs/1.
|
6
|
-
%script{ src: "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.
|
7
|
-
%script{ src: "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.
|
5
|
+
%script{ src: "//ajax.googleapis.com/ajax/libs/angularjs/1.5.9/angular.min.js" }
|
6
|
+
%script{ src: "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.9/angular-sanitize.min.js" }
|
7
|
+
%script{ src: "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.9/angular-route.min.js" }
|
8
8
|
%script{ src: "//cdnjs.cloudflare.com/ajax/libs/angular-poller/0.4.2/angular-poller.min.js"}
|
9
9
|
|
10
10
|
- # Jquery Modules
|
11
11
|
%script{ src: "//blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js" }
|
12
12
|
%script{ src: "//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" }
|
13
|
-
%script{ src: "//ajax.googleapis.com/ajax/libs/jqueryui/1.
|
13
|
+
%script{ src: "//ajax.googleapis.com/ajax/libs/jqueryui/1.12.4/jquery-ui.min.js" }
|
14
14
|
%script{ src: "//cdn.jsdelivr.net/g/json2@0.1,jquery.cookie@1.3.1,jquery.placeholder@2.0.7,lodash@3.10.1,momentjs@1.7.2,load-image@1.11.1,accounting.js@0.3.2"}
|
@@ -1,17 +1,25 @@
|
|
1
|
-
.banners
|
1
|
+
.banners
|
2
|
+
.spacer1
|
2
3
|
.container
|
3
4
|
.row
|
4
|
-
|
5
|
+
.col-md-6.text-center.col-md-offset-3
|
6
|
+
= image_tag 'mno_enterprise/main-logo.png', class: 'top-picture'
|
7
|
+
.row
|
8
|
+
.col-md-6.col-md-offset-3
|
9
|
+
.align-center
|
10
|
+
.spacer3
|
11
|
+
%h2= t('mno_enterprise.provision.select_organization.title')
|
5
12
|
.banners.promo
|
6
13
|
.container
|
7
14
|
.row
|
8
15
|
.col-md-6.col-md-offset-3
|
9
16
|
.align-center
|
10
|
-
%h3
|
11
|
-
%p
|
17
|
+
%h3= t('mno_enterprise.provision.select_organization.explanation')
|
18
|
+
%p= t('mno_enterprise.provision.select_organization.select')
|
12
19
|
= form_tag(new_provision_path, method: :get) do
|
13
20
|
- @apps.each do |app|
|
14
21
|
= hidden_field_tag 'apps[]', app
|
15
|
-
= select_tag :organization_id, options_for_select(@organizations.map { |o| [o.name, o.id]} )
|
16
|
-
|
17
|
-
|
22
|
+
= select_tag :organization_id, options_for_select(@organizations.map { |o| [o.name, o.id]} ), class: 'form-control'
|
23
|
+
.spacer1
|
24
|
+
= submit_tag t('mno_enterprise.provision.select_organization.submit'), class: 'btn btn-warning'
|
25
|
+
.spacer4
|
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'fileutils'
|
2
|
+
require 'erb'
|
3
|
+
require 'rake/clean'
|
2
4
|
|
3
5
|
#=============================================
|
4
6
|
# Enterprise Express Tasks
|
@@ -6,85 +8,109 @@ require 'fileutils'
|
|
6
8
|
# Enterprise Express related tasks
|
7
9
|
namespace :mnoe do
|
8
10
|
namespace :frontend do
|
11
|
+
# Default version
|
12
|
+
MNOE_ANGULAR_VERSION = "1.0.x"
|
13
|
+
IMPAC_ANGULAR_VERSION = "1.4.x"
|
14
|
+
|
15
|
+
# Final build
|
9
16
|
frontend_dist_folder = "public/dashboard"
|
17
|
+
# Local overrides
|
10
18
|
frontend_project_folder = 'frontend'
|
19
|
+
# Tmp build
|
11
20
|
frontend_tmp_folder = 'tmp/build/frontend'
|
12
|
-
|
13
|
-
|
21
|
+
# Frontend package
|
22
|
+
FRONTEND_PKG_FOLDER = 'node_modules/mno-enterprise-angular'
|
23
|
+
PKG_FILE = 'package.json'
|
14
24
|
# Use bundled gulp
|
15
|
-
|
25
|
+
gulp_cmd = "./node_modules/.bin/gulp"
|
16
26
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
27
|
+
## Helper methods
|
28
|
+
|
29
|
+
def render_template(template_file, output_file, binding = nil)
|
30
|
+
File.open(output_file, "w+") do |f|
|
31
|
+
f.write(ERB.new(File.read(template_file)).result(binding))
|
32
|
+
end
|
21
33
|
end
|
22
34
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
cp(bower_src, 'bower.json')
|
29
|
-
sh("bower install --quiet")
|
35
|
+
# Get yarn resolution for impac-angular
|
36
|
+
# This will need to be extended for multiple components later
|
37
|
+
def resolve_dependencies
|
38
|
+
yarn_lockfile = 'yarn.lock'
|
39
|
+
regexp = /^\s+resolved (.*impac-angular.*)$/
|
30
40
|
|
31
|
-
|
32
|
-
|
33
|
-
|
41
|
+
File.exist?(yarn_lockfile) || raise("No lockfile found. Run install first")
|
42
|
+
File.open(yarn_lockfile) { |file| file.find { |line| line =~ regexp } }
|
43
|
+
Regexp.last_match(1)
|
44
|
+
end
|
34
45
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
46
|
+
# Override the frontend bower.json with the locked versions
|
47
|
+
def override_frontend_dependencies
|
48
|
+
resolved_version = resolve_dependencies
|
49
|
+
unless resolved_version
|
50
|
+
puts "No impac-angular override. Skipping"
|
51
|
+
return
|
52
|
+
end
|
40
53
|
|
41
|
-
|
42
|
-
|
54
|
+
frontend_bower_file = File.join(FRONTEND_PKG_FOLDER, 'bower.json')
|
55
|
+
File.exist?(frontend_bower_file) || raise("Frontend bower file not found.")
|
43
56
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
57
|
+
# Override the bowerfile
|
58
|
+
bower_regexp = /"impac-angular": (".*")/
|
59
|
+
|
60
|
+
# TODO: refactor
|
61
|
+
IO.write(frontend_bower_file, File.open(frontend_bower_file) do |f|
|
62
|
+
f.read.gsub(bower_regexp) do |match|
|
63
|
+
match.gsub!(Regexp.last_match(1), resolved_version)
|
48
64
|
end
|
49
65
|
end
|
66
|
+
)
|
67
|
+
end
|
50
68
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
69
|
+
## Tasks
|
70
|
+
# TODO: replace with yarn install commands to get latest version
|
71
|
+
desc "Yarn package file"
|
72
|
+
file PKG_FILE do
|
73
|
+
# Binding values for the templates
|
74
|
+
app_name = Rails.root.basename
|
75
|
+
mnoe_angular_pkg = "git+https://git@github.com/maestrano/mno-enterprise-angular.git##{MNOE_ANGULAR_VERSION}"
|
76
|
+
impac_angular_pkg = "git+https://git@github.com/maestrano/impac-angular.git##{IMPAC_ANGULAR_VERSION}"
|
77
|
+
|
78
|
+
render_template(
|
79
|
+
File.join(File.expand_path(File.dirname(__FILE__)),'templates','package.json'),
|
80
|
+
PKG_FILE,
|
81
|
+
binding
|
82
|
+
)
|
83
|
+
end
|
56
84
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
font_src = File.join(File.expand_path(File.dirname(__FILE__)),'templates','font-faces.less')
|
85
|
+
desc "Setup the Enterprise Express frontend"
|
86
|
+
task :install do
|
87
|
+
Rake::Task['mnoe:frontend:install_frontend'].invoke
|
61
88
|
|
62
|
-
|
63
|
-
|
64
|
-
end
|
89
|
+
# Bootstrap frontend folder
|
90
|
+
Rake::Task['mnoe:frontend:bootstrap_override_folder'].invoke
|
65
91
|
|
66
92
|
# Build the frontend
|
67
|
-
Rake::Task['mnoe:frontend:
|
93
|
+
Rake::Task['mnoe:frontend:build'].invoke
|
68
94
|
#Rake::Task['assets:precompile'].invoke
|
69
95
|
end
|
70
96
|
|
71
|
-
desc "Rebuild the Enterprise Express frontend"
|
72
|
-
task :
|
97
|
+
desc "Build/Rebuild the Enterprise Express frontend"
|
98
|
+
task :build do
|
73
99
|
# Prepare the build folder
|
74
100
|
Rake::Task['mnoe:frontend:prepare_build_folder'].execute
|
75
101
|
|
76
102
|
# Build frontend using Gulp
|
77
103
|
Dir.chdir(frontend_tmp_folder) do
|
78
|
-
sh "
|
79
|
-
sh
|
80
|
-
sh "#{
|
104
|
+
sh "yarn install"
|
105
|
+
sh gulp_cmd
|
106
|
+
sh "#{gulp_cmd} less-concat"
|
81
107
|
end
|
82
108
|
|
83
109
|
# Ensure distribution folder exists
|
84
110
|
mkdir_p frontend_dist_folder
|
85
111
|
|
86
112
|
# Cleanup previously compiled files
|
87
|
-
Dir.glob("#{frontend_dist_folder}/{styles,scripts}
|
113
|
+
Dir.glob("#{frontend_dist_folder}/{styles,scripts}/*.{css,js}").each do |f|
|
88
114
|
rm_f f
|
89
115
|
end
|
90
116
|
|
@@ -94,6 +120,9 @@ namespace :mnoe do
|
|
94
120
|
# Copy bower_components to public (used by live previewer)
|
95
121
|
cp_r("#{frontend_tmp_folder}/bower_components","#{frontend_dist_folder}/")
|
96
122
|
|
123
|
+
# Generates locales
|
124
|
+
Rake::Task['mnoe:locales:generate'].invoke
|
125
|
+
|
97
126
|
# Clear tmp cache in development - recompile assets otherwise
|
98
127
|
if Rails.env.development? || Rails.env.test?
|
99
128
|
Rake::Task['tmp:cache:clear'].execute
|
@@ -102,7 +131,77 @@ namespace :mnoe do
|
|
102
131
|
end
|
103
132
|
end
|
104
133
|
|
105
|
-
|
134
|
+
# Alias to dist for backward compatibility
|
135
|
+
task dist: :build
|
136
|
+
|
137
|
+
desc "Update the frontend and rebuild it"
|
138
|
+
task update: :install_dependencies do
|
139
|
+
# Fetch new version of the packages
|
140
|
+
sh "yarn upgrade --ignore-scripts --ignore-engines"
|
141
|
+
|
142
|
+
# Cleanup
|
143
|
+
rm_rf "#{frontend_tmp_folder}/bower_components"
|
144
|
+
|
145
|
+
# Rebuild the frontend
|
146
|
+
Rake::Task['mnoe:frontend:build'].execute
|
147
|
+
end
|
148
|
+
|
149
|
+
# Install dependencies
|
150
|
+
task :install_dependencies do
|
151
|
+
unless system("which yarn")
|
152
|
+
puts 'Yarn executable was not detected in the system.'
|
153
|
+
puts 'Download Yarn at https://yarnpkg.com/en/docs/install'
|
154
|
+
raise
|
155
|
+
end
|
156
|
+
|
157
|
+
# Install required tools
|
158
|
+
sh("which bower || npm install -g bower")
|
159
|
+
end
|
160
|
+
|
161
|
+
# Create & populate the frontend override folder
|
162
|
+
task :bootstrap_override_folder do
|
163
|
+
# Create frontend override folder
|
164
|
+
mkdir_p(frontend_project_folder)
|
165
|
+
touch "#{frontend_project_folder}/.keep"
|
166
|
+
|
167
|
+
# Bootstrap override folder
|
168
|
+
# Replace relative image path by absolute path in the LESS files
|
169
|
+
mkdir_p("#{frontend_project_folder}/src/app/stylesheets")
|
170
|
+
['src/app/stylesheets/theme.less','src/app/stylesheets/variables.less'].each do |path|
|
171
|
+
next if File.exist?("#{frontend_project_folder}/#{path}")
|
172
|
+
|
173
|
+
# Generate file from template
|
174
|
+
cp("#{FRONTEND_PKG_FOLDER}/#{path}","#{frontend_project_folder}/#{path}")
|
175
|
+
|
176
|
+
# Replace image relative path
|
177
|
+
content = File.read("#{frontend_project_folder}/#{path}")
|
178
|
+
File.open("#{frontend_project_folder}/#{path}", 'w') do |f|
|
179
|
+
f << content.gsub("../images", File.join(frontend_dist_folder.gsub("public",""),"images"))
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Setup theme previewer working files so we can safely include
|
184
|
+
# them in main.less
|
185
|
+
['theme-previewer-tmp.less','theme-previewer-published.less'].each do |filename|
|
186
|
+
FileUtils.touch(File.join(Rails.root,"frontend/src/app/stylesheets/#{filename}"))
|
187
|
+
end
|
188
|
+
|
189
|
+
# Create custom fonts files so we can safely include them in main.less
|
190
|
+
frontend_font_folder = File.join(frontend_project_folder, 'src/fonts')
|
191
|
+
unless File.exist?(File.join(frontend_font_folder, 'font-faces.less'))
|
192
|
+
font_src = File.join(File.expand_path(File.dirname(__FILE__)),'templates','font-faces.less')
|
193
|
+
|
194
|
+
mkdir_p(frontend_font_folder)
|
195
|
+
cp(font_src, frontend_font_folder)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
task install_frontend: [:install_dependencies, PKG_FILE] do
|
200
|
+
# Fetch the packages
|
201
|
+
sh("yarn install --ignore-scripts --ignore-engines")
|
202
|
+
end
|
203
|
+
|
204
|
+
# Rebuild the Live Previewer Style
|
106
205
|
task :rebuild_previewer_style do
|
107
206
|
# Prepare the build folder
|
108
207
|
Rake::Task['mnoe:frontend:prepare_build_folder'].execute
|
@@ -119,34 +218,38 @@ namespace :mnoe do
|
|
119
218
|
# Copy bower_components to public (used by live previewer)
|
120
219
|
cp_r("#{frontend_tmp_folder}/bower_components","#{frontend_dist_folder}/")
|
121
220
|
|
221
|
+
# Generates locales
|
222
|
+
Rake::Task['mnoe:locales:generate'].invoke
|
223
|
+
|
122
224
|
# Clear tmp cache in development
|
123
225
|
if Rails.env.development? || Rails.env.test?
|
124
226
|
Rake::Task['tmp:cache:clear'].execute
|
125
227
|
end
|
126
228
|
end
|
127
229
|
|
128
|
-
|
230
|
+
# Reset the frontend build folder and apply local customisations
|
129
231
|
task :prepare_build_folder do
|
130
232
|
# Ensure frontend is downloaded
|
131
|
-
|
233
|
+
Rake::Task['mnoe:frontend:install_frontend'].invoke unless File.directory?(FRONTEND_PKG_FOLDER)
|
234
|
+
|
235
|
+
# Override frontend dependencies
|
236
|
+
puts "Locking frontend dependencies"
|
237
|
+
override_frontend_dependencies
|
132
238
|
|
133
239
|
# Reset tmp folder from mno-enterprise-angular source
|
134
240
|
rm_rf "#{frontend_tmp_folder}/src"
|
135
241
|
rm_rf "#{frontend_tmp_folder}/e2e"
|
136
242
|
mkdir_p frontend_tmp_folder
|
137
|
-
cp_r("#{
|
243
|
+
cp_r("#{FRONTEND_PKG_FOLDER}/.", "#{frontend_tmp_folder}/")
|
138
244
|
|
139
245
|
# Apply frontend customisations
|
140
|
-
cp_r("#{frontend_project_folder}/.","#{frontend_tmp_folder}/")
|
246
|
+
cp_r("#{frontend_project_folder}/.", "#{frontend_tmp_folder}/")
|
141
247
|
end
|
142
248
|
|
143
|
-
desc "
|
144
|
-
task :
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
# Rebuild the frontend
|
149
|
-
Rake::Task['mnoe:frontend:dist'].execute
|
249
|
+
desc "Remove all generated files"
|
250
|
+
task :clean do
|
251
|
+
clean = FileList[frontend_tmp_folder, frontend_dist_folder, FRONTEND_PKG_FOLDER, 'node_modules/.yarn-integrity']
|
252
|
+
Rake::Cleaner.cleanup_files(clean)
|
150
253
|
end
|
151
254
|
end
|
152
255
|
end
|
data/lib/tasks/mnoe_locales.rake
CHANGED
@@ -4,11 +4,15 @@
|
|
4
4
|
# Enterprise Express tasks related to locales management
|
5
5
|
namespace :mnoe do
|
6
6
|
namespace :locales do
|
7
|
-
|
7
|
+
locales_dist_folder = 'public/dashboard/locales'
|
8
|
+
locales_tmp_folder = 'tmp/build/frontend/src/locales'
|
8
9
|
|
9
10
|
desc "Generate JSON locales"
|
10
11
|
task :generate => :environment do
|
11
|
-
MnoEnterprise::Frontend::LocalesGenerator.new(
|
12
|
+
MnoEnterprise::Frontend::LocalesGenerator.new(locales_tmp_folder).generate_json
|
13
|
+
|
14
|
+
# Copy locales to public
|
15
|
+
cp_r("#{locales_tmp_folder}/.","#{locales_dist_folder}/")
|
12
16
|
end
|
13
17
|
end
|
14
18
|
end
|
@@ -9,17 +9,23 @@ describe 'mnoe:locales:generate' do
|
|
9
9
|
before do
|
10
10
|
allow(MnoEnterprise::Frontend::LocalesGenerator).to receive(:new) { generator }
|
11
11
|
allow(generator).to receive(:generate_json)
|
12
|
+
allow_any_instance_of(Rake::FileUtilsExt).to receive(:cp_r)
|
12
13
|
end
|
13
14
|
|
14
15
|
it { expect(subject.prerequisites).to include('environment') }
|
15
16
|
|
16
17
|
it 'creates a generator with the correct folder' do
|
17
18
|
subject.invoke
|
18
|
-
expect(MnoEnterprise::Frontend::LocalesGenerator).to have_received(:new).with('
|
19
|
+
expect(MnoEnterprise::Frontend::LocalesGenerator).to have_received(:new).with('tmp/build/frontend/src/locales')
|
19
20
|
end
|
20
21
|
|
21
22
|
it 'generates the locales' do
|
22
23
|
subject.invoke
|
23
24
|
expect(generator).to have_received(:generate_json)
|
24
25
|
end
|
26
|
+
|
27
|
+
it 'copies the locales to the public folder' do
|
28
|
+
expect_any_instance_of(Rake::FileUtilsExt).to receive(:cp_r).with('tmp/build/frontend/src/locales/.', 'public/dashboard/locales/')
|
29
|
+
subject.invoke
|
30
|
+
end
|
25
31
|
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.
|
4
|
+
version: 3.2.0
|
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-06-
|
12
|
+
date: 2017-06-14 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.
|
20
|
+
version: 3.2.0
|
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.
|
27
|
+
version: 3.2.0
|
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.
|
34
|
+
version: 3.2.0
|
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.
|
41
|
+
version: 3.2.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: less-rails
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -312,6 +312,7 @@ files:
|
|
312
312
|
- lib/tasks/mnoe_locales.rake
|
313
313
|
- lib/tasks/templates/bower.json
|
314
314
|
- lib/tasks/templates/font-faces.less
|
315
|
+
- lib/tasks/templates/package.json
|
315
316
|
- spec/controllers/mno_enterprise/auth/confirmations_controller_spec.rb
|
316
317
|
- spec/controllers/mno_enterprise/invoices_controller_spec.rb
|
317
318
|
- spec/controllers/mno_enterprise/webhook/o_auth_controller_spec.rb
|
@@ -340,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
340
341
|
version: '0'
|
341
342
|
requirements: []
|
342
343
|
rubyforge_project:
|
343
|
-
rubygems_version: 2.
|
344
|
+
rubygems_version: 2.6.8
|
344
345
|
signing_key:
|
345
346
|
specification_version: 4
|
346
347
|
summary: Maestrano Enterprise - Frontend
|