Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge remote-tracking branch 'origin/2.3' #4401

Merged
merged 24 commits into from
Nov 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ed8cc68
Profile webpack build
sbrunner Nov 8, 2018
9d31b27
Add HardSourceWebpackPlugin
sbrunner Nov 8, 2018
779cd0a
Merge pull request #4365 from camptocamp/HardSourceWebpackPlugin
sbrunner Nov 8, 2018
4555611
Be able to configure bable an uglify cache directory
sbrunner Nov 8, 2018
1f746fe
Merge pull request #4366 from camptocamp/cache-directory
sbrunner Nov 8, 2018
d7484f0
Emit authenticationrequired even when layertree is empty
arnaud-morvan Nov 8, 2018
53529c2
Avoid empty string in groupLayersArray as it result in emitting authe…
arnaud-morvan Nov 8, 2018
a3946d4
Merge pull request #4368 from camptocamp/authenticationrequired_layer…
arnaud-morvan Nov 9, 2018
f693876
Fix error message modal dialog in editFeatureComponent
arnaud-morvan Nov 13, 2018
8507961
Fix CVE-2018-18074
sbrunner Nov 14, 2018
b043948
Merge pull request #4381 from camptocamp/CVE-2018-18074
sbrunner Nov 14, 2018
a3840a1
Merge remote-tracking branch 'origin/2.2' into 2.3
sbrunner Nov 14, 2018
09b1afc
Merge pull request #4382 from camptocamp/merge22
sbrunner Nov 14, 2018
67de0d5
703 - Set print layer zIndex to -200
adube Nov 15, 2018
85eb6c0
Fix only null layer
sbrunner Nov 8, 2018
3b94f64
Merge pull request #4387 from adube/v2_3-703-print-bg-layer
adube Nov 19, 2018
f33ef9c
Merge pull request #4388 from camptocamp/profile-null
sbrunner Nov 20, 2018
3266af9
search: remove hard coding of mobile interface (breaks other interfac…
jwkaltz Nov 20, 2018
00fe9fd
Merge remote-tracking branch 'origin/2.2' into 2.3
sbrunner Nov 21, 2018
167b714
IE11 distored layer images - backport #4230
kalbermattenm Nov 21, 2018
f6bbae7
Merge pull request #4398 from camptocamp/merge22
sbrunner Nov 21, 2018
f8dff72
Merge pull request #4399 from kalbermattenm/backport_pr4230
sbrunner Nov 21, 2018
0ca6a05
Merge pull request #4376 from camptocamp/fix_edit_feature_modal
arnaud-morvan Nov 21, 2018
bf5d5c9
Merge remote-tracking branch 'origin/2.3'
sbrunner Nov 22, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 100 additions & 98 deletions buildtools/webpack.commons.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const webpack = require('webpack');
const SassPlugin = require('./webpack.plugin.js');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');

const devMode = process.env.NODE_ENV !== 'production';

Expand All @@ -23,38 +24,6 @@ const babelPresets = [['@babel/preset-env', {
'loose': true,
}]];

const ngeoRule = {
test: /\/ngeo\/(?!node_modules\/).*\.js$/,
use: {
loader: 'babel-loader',
options: {
babelrc: false,
comments: false,
cacheDirectory: true,
presets: babelPresets,
plugins: ['@camptocamp/babel-plugin-angularjs-annotate'],
}
}
};


const otherRule = {
test: /\/node_modules\/(?!ngeo\/|angular\/).*\.js$/,
use: {
loader: 'babel-loader',
options: {
babelrc: false,
comments: false,
cacheDirectory: true,
presets: babelPresets,
plugins: [
'@babel/plugin-syntax-object-rest-spread',
'@babel/plugin-transform-spread',
]
}
}
};

const angularRule = {
test: require.resolve('angular'),
use: {
Expand Down Expand Up @@ -107,76 +76,109 @@ const svgRule = {
]
};

const config = function(hardSourceConfig, babelLoaderCacheDirectory) {

const config = {
context: path.resolve(__dirname, '../'),
devtool: 'source-map',
output: {
path: path.resolve(__dirname, '../dist/')
},
module: {
rules: [
angularRule,
typeaheadRule,
cssRule,
sassRule,
htmlRule,
svgRule,
ngeoRule,
otherRule,
]
},
plugins: [
providePlugin,
new SassPlugin({
filename: devMode ? '[name].css' : '[name].[hash:6].css',
assetname: '[name].[hash:6].[ext]',
//tempfile: '/tmp/t.scss',
blacklistedChunks: ['commons'],
filesOrder: (chunk, chunksFiles) => {
const files = chunksFiles.commons
? chunksFiles[chunk.name].concat(chunksFiles.commons)
: chunksFiles[chunk.name];
files.sort((f1, f2) => {
for (const reg of [
'/apps/',
'/controllers/',
'/vars.scss',
'/vars_only.scss',
'/common_dependencies.scss',
]) {
if (f1.indexOf(reg) >= 0) {
return -1;
}
if (f2.indexOf(reg) >= 0) {
return 1;
}
}
return 0;
});
return files;
const ngeoRule = {
test: /\/ngeo\/(?!node_modules\/).*\.js$/,
use: {
loader: 'babel-loader',
options: {
babelrc: false,
comments: false,
cacheDirectory: babelLoaderCacheDirectory,
presets: babelPresets,
plugins: ['@camptocamp/babel-plugin-angularjs-annotate'],
}
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /node_modules\/moment\/src\/lib\/locale$/),
],
resolve: {
modules: [
'../node_modules'
}
};
const otherRule = {
test: /\/node_modules\/(?!ngeo\/|angular\/).*\.js$/,
use: {
loader: 'babel-loader',
options: {
babelrc: false,
comments: false,
cacheDirectory: babelLoaderCacheDirectory,
presets: babelPresets,
plugins: [
'@babel/plugin-syntax-object-rest-spread',
'@babel/plugin-transform-spread',
]
}
}
};

return {
context: path.resolve(__dirname, '../'),
devtool: 'source-map',
output: {
path: path.resolve(__dirname, '../dist/')
},
module: {
rules: [
angularRule,
typeaheadRule,
cssRule,
sassRule,
htmlRule,
svgRule,
ngeoRule,
otherRule,
]
},
plugins: [
providePlugin,
new SassPlugin({
filename: devMode ? '[name].css' : '[name].[hash:6].css',
assetname: '[name].[hash:6].[ext]',
//tempfile: '/tmp/t.scss',
blacklistedChunks: ['commons'],
filesOrder: (chunk, chunksFiles) => {
const files = chunksFiles.commons
? chunksFiles[chunk.name].concat(chunksFiles.commons)
: chunksFiles[chunk.name];
files.sort((f1, f2) => {
for (const reg of [
'/apps/',
'/controllers/',
'/vars.scss',
'/vars_only.scss',
'/common_dependencies.scss',
]) {
if (f1.indexOf(reg) >= 0) {
return -1;
}
if (f2.indexOf(reg) >= 0) {
return 1;
}
}
return 0;
});
return files;
}
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /node_modules\/moment\/src\/lib\/locale$/),
new HardSourceWebpackPlugin(hardSourceConfig || {}),
],
mainFields: ['jsnext:main', 'main'],
alias: {
'ngeo/test': path.resolve(__dirname, '../test/spec'),
'gmf/test': path.resolve(__dirname, '../contribs/gmf/test/spec'),
'ngeo': path.resolve(__dirname, '../src'),
'gmf': path.resolve(__dirname, '../contribs/gmf/src'),
'goog/asserts': path.resolve(__dirname, '../src/goog.asserts.js'),
'goog/asserts.js': path.resolve(__dirname, '../src/goog.asserts.js'),
'jsts': 'jsts/org/locationtech/jts',
'olcs': 'ol-cesium/src/olcs',
'jquery-ui/datepicker': 'jquery-ui/ui/widgets/datepicker', // For angular-ui-date
'proj4': 'proj4/lib',
resolve: {
modules: [
'../node_modules'
],
mainFields: ['jsnext:main', 'main'],
alias: {
'ngeo/test': path.resolve(__dirname, '../test/spec'),
'gmf/test': path.resolve(__dirname, '../contribs/gmf/test/spec'),
'ngeo': path.resolve(__dirname, '../src'),
'gmf': path.resolve(__dirname, '../contribs/gmf/src'),
'goog/asserts': path.resolve(__dirname, '../src/goog.asserts.js'),
'goog/asserts.js': path.resolve(__dirname, '../src/goog.asserts.js'),
'jsts': 'jsts/org/locationtech/jts',
'olcs': 'ol-cesium/src/olcs',
'jquery-ui/datepicker': 'jquery-ui/ui/widgets/datepicker', // For angular-ui-date
'proj4': 'proj4/lib',
}
}
}
};
};

module.exports = {
Expand Down
64 changes: 33 additions & 31 deletions buildtools/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,37 @@ const resourcesRule = {
}
};

module.exports = {
mode: 'production',
output: {
filename: '[name].[chunkhash:6].js'
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
],
module: {
rules: [
resourcesRule,
]
},
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: true,
uglifyOptions: {
compress: false
}
})
]
},
resolve: {
alias: {
'goog/asserts': path.resolve(__dirname, '../src/goog.asserts.prod.js'),
'goog/asserts.js': path.resolve(__dirname, '../src/goog.asserts.prod.js'),
}
},
module.exports = function(UglifyJsPluginCache) {
return {
mode: 'production',
output: {
filename: '[name].[chunkhash:6].js'
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
],
module: {
rules: [
resourcesRule,
]
},
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: UglifyJsPluginCache,
parallel: true,
sourceMap: true,
uglifyOptions: {
compress: false
}
})
]
},
resolve: {
alias: {
'goog/asserts': path.resolve(__dirname, '../src/goog.asserts.prod.js'),
'goog/asserts.js': path.resolve(__dirname, '../src/goog.asserts.prod.js'),
}
},
};
};
4 changes: 2 additions & 2 deletions contribs/gmf/src/editing/editFeatureComponent.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ <h4 class="modal-title">
</ngeo-modal>
<ngeo-modal ng-model="efCtrl.showServerError">
<div class="modal-header">{{'Server error.' | translate}}</div>
<div class="modal-body">{{$parent.efCtrl.serverErrorType}}<br>
{{$parent.efCtrl.serverErrorMessage || ('Unexpected server error.' | translate)}}</div>
<div class="modal-body">{{efCtrl.serverErrorType}}<br>
{{efCtrl.serverErrorMessage || ('Unexpected server error.' | translate)}}</div>
</ngeo-modal>
</div>
2 changes: 0 additions & 2 deletions contribs/gmf/src/layertree/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
class="gmf-layertree-layer-icon gmf-layertree-no-layer-icon"
><%=require('gmf/icons/dot.svg')%></a>

</a>

<a
href
ng-click="::gmfLayertreeCtrl.toggleActive(layertreeCtrl)"
Expand Down
5 changes: 4 additions & 1 deletion contribs/gmf/src/permalink/Permalink.js
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,9 @@ exports.prototype.initLayers_ = function() {
this.$timeout_(() => {
if (!this.gmfTreeManager_ || !this.gmfTreeManager_.rootCtrl) {
// we don't have any layertree
if (authenticationRequired && this.user_.role_id === null) {
this.rootScope_.$broadcast('authenticationrequired', {url: initialUri});
}
return;
}
// Enable the layers and set the opacity
Expand Down Expand Up @@ -1010,7 +1013,7 @@ exports.prototype.initLayers_ = function() {
exports.ParamPrefix.TREE_GROUP_LAYERS + treeCtrl.node.name
);
if (groupLayers !== undefined) {
const groupLayersArray = groupLayers.split(',');
const groupLayersArray = groupLayers == '' ? [] : groupLayers.split(',');
treeCtrl.traverseDepthFirst((treeCtrl) => {
if (treeCtrl.node.children === undefined) {
const enable = olArray.includes(groupLayersArray, treeCtrl.node.name);
Expand Down
1 change: 1 addition & 0 deletions contribs/gmf/src/print/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ exports.Controller_ = class {
server.imageType,
server.type
);
layer.setZIndex(-200);
} else {
console.error('Missing ogcServer:', server_name);
}
Expand Down
14 changes: 14 additions & 0 deletions contribs/gmf/src/profile/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,20 @@ exports.Controller_.prototype.getJsonProfile_ = function() {
exports.Controller_.prototype.getProfileDataSuccess_ = function(resp) {
const profileData = resp.data['profile'];
if (profileData instanceof Array) {
const nonempty_layers = [];
for (const d of profileData) {
for (const v in d['values']) {
if (nonempty_layers.indexOf(v) < 0 && d['values'][v] !== null) {
nonempty_layers.push(v);
}
}
}

this.profileOptions.linesConfiguration = {};
for (const layer of nonempty_layers) {
this.profileOptions.linesConfiguration[layer] = this.linesConfiguration_[layer];
}

this.profileData = profileData;
}
};
Expand Down
2 changes: 1 addition & 1 deletion karma-conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var isDebug = process.argv.some(function(argument) {

const webpackMerge = require('webpack-merge');
const commons = require('./buildtools/webpack.commons');
let webpackConfig = commons.config;
let webpackConfig = commons.config();
webpackConfig = webpackMerge(webpackConfig, require('./buildtools/webpack.dev'));
webpackConfig = webpackMerge(webpackConfig, {
devtool: 'inline-source-map',
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"serve-gmf-examples": "DEV_SERVER=1 TARGET=gmf-examples webpack-dev-server --https --cert=private.crt --key=private.key --port 3000 --mode development --progress --watch --bail --debug",
"serve-gmf-apps": "DEV_SERVER=1 TARGET=gmf-apps webpack-dev-server --https --cert=private.crt --key=private.key --port 3000 --mode development --progress --watch --bail --debug",
"serve-api": "webpack-dev-server --content-base api/dist/ --config buildtools/webpack.api.js --https --cert=private.crt --key=private.key --port 3000 --mode development --progress --watch --bail --debug",
"build-gmf-apps-profile": "TARGET=gmf-apps webpack --profile --json > profile.json",
"typecheck": "tsc --pretty",
"doc": "typedoc --module system --target ES6 --name ngeo --out apidoc src/ contribs/gmf/src/"
},
Expand Down Expand Up @@ -79,6 +80,7 @@
"file-saver": "2.0.0",
"floatthead": "2.1.2",
"fs-extra": "7.0.1",
"hard-source-webpack-plugin": "0.6.12",
"html-webpack-include-assets-plugin": "1.0.6",
"html-webpack-plugin": "3.2.0",
"istanbul-instrumenter-loader": "3.0.1",
Expand Down
Loading