Skip to content

Commit

Permalink
Merge pull request #3993 from camptocamp/merge23
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'origin/2.3'
  • Loading branch information
sbrunner committed Jun 28, 2018
2 parents ea634c3 + d8128c5 commit f359d96
Show file tree
Hide file tree
Showing 55 changed files with 259 additions and 172 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Makefile* text whitespace=indent-with-non-tab,tabwidth=2 eol=lf
*.gif binary
*.ico binary
*.enc binary
*.cur binary
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ To check before create a new issue:
* I am using the latest minor version of the major version (`x.y.last`).
* I create one issue per subject (do not put more than one thing in the same issue).

For commiters:
For committers:

* I have assigned a blue and a green label.
* I have assigned a milestone.
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
/contribs/gmf/fonts/gmf-icons.woff
/contribs/gmf/fonts/FontAwesome*
/contribs/gmf/fonts/fontawesome*
/contribs/gmf/cursors/*.cur
/contribs/gmf/examples/https.js
/test/spec/templatecache.js
/test/spec/gmftemplatecache.js
Expand Down
37 changes: 20 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ NGEO_EXAMPLES_JS_FILES := $(NGEO_EXAMPLES_HTML_FILES:.html=.js)

GMF_PARTIALS_FILES := $(shell find contribs/gmf/src/ -name *.html)
GMF_JS_FILES := $(shell find contribs/gmf/src/ -type f -name '*.js')
GMF_ALL_SRC_FILES := $(shell find contribs/gmf/src/ -type f) $(NGEO_ALL_SRC_FILES)
GMF_ALL_SRC_FILES := $(shell find contribs/gmf/src/ -type f) $(shell find contribs/gmf/cursors/ -type f) $(NGEO_ALL_SRC_FILES)
GMF_TEST_JS_FILES := $(shell find contribs/gmf/test/ -type f -name '*.js')
GMF_EXAMPLES_HTML_FILES := $(shell ls -1 contribs/gmf/examples/*.html)
GMF_EXAMPLES_JS_FILES := $(GMF_EXAMPLES_HTML_FILES:.html=.js)
Expand Down Expand Up @@ -110,8 +110,8 @@ help:
@echo "- test Run the test suite"
@echo "- test-debug Run the test suite in the browser"
@echo "- clean Remove generated files"
@echo "- cleanall Remove all the build artefacts"
@echo "- cleanallcache Remove all the build artefacts and the extra caches (npm and pip)"
@echo "- cleanall Remove all the build artifacts"
@echo "- cleanallcache Remove all the build artifacts and the extra caches (npm and pip)"
@echo
@echo "Secondary targets:"
@echo
Expand All @@ -124,7 +124,7 @@ help:
apidoc: .build/apidoc

.PHONY: check
check: lint check-examples-checker check-examples test examples-hosted-apps
check: lint spell check-examples-checker check-examples test examples-hosted-apps

.PHONY: check-examples-checker
check-example-checker: $(CHECK_EXAMPLE_CHECKER)
Expand All @@ -140,6 +140,14 @@ lint-extra:
if [ "`git grep @fileoverview src contribs`" != "" ]; then echo "Using @fileoverview breaks the documentation main page"; false; fi
if [ "`git grep @example src contribs`" != "" ]; then echo "We don't use @example to have the example in the description"; false; fi

.PHONY: spell
spell: .build/python-venv.timestamp
$(PY_VENV_BIN)/codespell --quiet-level=2 --ignore-words=spell-ignore-words.txt \
$(shell find -name 'node_modules' -prune -or -name '.build' -prune -or -name '.git' -prune \
-or -name '__pycache__' -prune -or -name 'build' -prune \
-or \( -type f -and -not -name '*.png' -and -not -name '*.mo' -and -not -name '*.po*' -and -not -name '*_translation' \
-and -not -name 'themescapabilities.js' -and -not -name 'themes.js' -and -not -name 'prettify.js' \) -print)

.PHONY: eslint
eslint: .build/eslint.timestamp

Expand All @@ -153,7 +161,7 @@ eof-newline:

.PHONY: test
test: .build/node_modules.timestamp
./node_modules/karma/bin/karma start karma-conf.js --single-run
THEME=mobile ./node_modules/karma/bin/karma start karma-conf.js --single-run
@echo "\nFull coverage report in: .build/coverage/lcov-report"

.PHONY: test-debug
Expand All @@ -171,7 +179,7 @@ serve-ngeo: .build/node_modules.timestamp $(FONTAWESOME_WEBFONT) $(ANGULAR_LOCAL

.PHONY: serve-gmf
serve-gmf: .build/node_modules.timestamp $(FONTAWESOME_WEBFONT) $(ANGULAR_LOCALES_FILES)
npm run serve-gmf-examples
THEME=mobile npm run serve-gmf-examples

.PHONY: serve-gmf-apps-desktop
serve-gmf-apps-desktop: .build/node_modules.timestamp $(FONTAWESOME_WEBFONT) $(ANGULAR_LOCALES_FILES)
Expand All @@ -183,11 +191,11 @@ serve-gmf-apps-desktopalt: .build/node_modules.timestamp $(FONTAWESOME_WEBFONT)

.PHONY: serve-gmf-apps-mobile
serve-gmf-apps-mobile: .build/node_modules.timestamp $(FONTAWESOME_WEBFONT) $(ANGULAR_LOCALES_FILES)
APP=mobile npm run serve-gmf-apps
APP=mobile npm THEME=mobile run serve-gmf-apps

.PHONY: serve-gmf-apps-mobilealt
serve-gmf-apps-mobilealt: .build/node_modules.timestamp $(FONTAWESOME_WEBFONT) $(ANGULAR_LOCALES_FILES)
APP=mobile_alt npm run serve-gmf-apps
APP=mobile_alt THEME=mobile npm run serve-gmf-apps

.PHONY: serve-gmf-apps-oeedit
serve-gmf-apps-oeedit: .build/node_modules.timestamp $(FONTAWESOME_WEBFONT) $(ANGULAR_LOCALES_FILES)
Expand All @@ -214,7 +222,7 @@ examples-hosted-ngeo: .build/examples-ngeo.timestamp .build/examples-hosted/inde
examples-hosted-gmf: .build/examples-gmf.timestamp .build/examples-hosted/contribs/gmf/index.html

.build/examples-gmf.timestamp: $(GMF_ALL_SRC_FILES) $(WEBPACK_CONFIG_FILES) .build/node_modules.timestamp
npm run build-gmf-examples
THEME=mobile npm run build-gmf-examples
touch $@

.PHONY: examples-hosted-apps
Expand All @@ -223,8 +231,8 @@ examples-hosted-apps: .build/gmf-apps.timestamp .build/examples-hosted-gmf-apps-
.build/gmf-apps.timestamp: $(GMF_APPS_ALL_SRC_FILES) $(WEBPACK_CONFIG_FILES) .build/node_modules.timestamp
APP=desktop THEME=desktop npm run build-gmf-apps
APP=desktop_alt THEME=desktop_alt npm run build-gmf-apps
APP=mobile npm run build-gmf-apps
APP=mobile_alt npm run build-gmf-apps
APP=mobile THEME=mobile npm run build-gmf-apps
APP=mobile_alt THEME=mobile npm run build-gmf-apps
APP=oeedit THEME=desktop npm run build-gmf-apps
APP=oeview THEME=desktop npm run build-gmf-apps
touch $@
Expand All @@ -246,8 +254,7 @@ gh-pages: .build/python-venv.timestamp

.build/examples-hosted-gmf-apps-deps.timestamp: \
$(addprefix contribs/gmf/build/gmf-, $(addsuffix .json, $(LANGUAGES))) \
$(addprefix contribs/gmf/build/angular-locale_, $(addsuffix .js, $(LANGUAGES))) \
$(addprefix contribs/gmf/cursors/,grab.cur grabbing.cur)
$(addprefix contribs/gmf/build/angular-locale_, $(addsuffix .js, $(LANGUAGES)))
mkdir -p .build/examples-hosted/contribs/gmf
# We need the files for each app
# To simplify processing, we first copy them in gmfappsdeps directory, then from there to each app
Expand Down Expand Up @@ -338,10 +345,6 @@ contribs/gmf/build/angular-locale_%.js: package.json
rm -rf $@
./node_modules/.bin/jsdoc -c $< --destination $@

.PRECIOUS: contribs/gmf/cursors/%.cur
contribs/gmf/cursors/%.cur: contribs/gmf/cursors/%.png
convert $< $@


# i18n

Expand Down
8 changes: 4 additions & 4 deletions buildtools/check-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ page.onAlert = function(msg) {
};
page.onResourceError = function(resourceError) {
if (resourceError.url.includes('tile.openstreetmap.org')) {
console.warn('Ignoring ressource error from OpenStreetMap');
console.warn('Ignoring resource error from OpenStreetMap');
} else if (resourceError.url.includes('https://maps.googleapis.com/maps/api/js')) {
console.warn('Ignoring ressource error from Google');
console.warn('Ignoring resource error from Google');
} else if (resourceError.url.includes('https://csi.gstatic.com/')) {
console.warn('Ignoring ressource error from Google static');
} else if (resourceError.errorCode >= 300) {
console.warn('Ignoring resource error from Google static');
} else if (resourceError.errorCode >= 400) {
console.log('Resource error: ' + resourceError.errorCode + ', ' + resourceError.url);
exitCode = 2;
}
Expand Down
3 changes: 2 additions & 1 deletion buildtools/webpack.commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const LessPluginAutoprefix = require('less-plugin-autoprefix');
const devMode = process.env.NODE_ENV !== 'production'

const themes = {
'mobile': '"~gmf/controllers/mobile-theme.less"',
'desktop': '"~gmf/controllers/desktop-theme.less"',
'desktop_alt': '"' + path.resolve('contribs/gmf/apps/desktop_alt/less/theme.less') + '"',
}
Expand Down Expand Up @@ -127,7 +128,7 @@ const cssLessLoaderConfigs = [
new LessPluginAutoprefix()
],
modifyVars: {
'THEME': themes[theme],
'THEME': themes[theme] ? themes[theme] : theme,
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions contribs/gmf/apps/desktop/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import appBase from '../appmodule.js';
import ngeoProjEPSG2056 from 'ngeo/proj/EPSG2056.js';
import ngeoProjEPSG21781 from 'ngeo/proj/EPSG21781.js';
import * as olBase from 'ol/index.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

if (!window.requestAnimationFrame) {
alert('Your browser is not supported, please update it or use another one. You will be redirected.\n\n'
Expand Down Expand Up @@ -97,6 +99,14 @@ const exports = function($scope, $injector) {
gettextCatalog.getString('Add a theme');
gettextCatalog.getString('Add a sub theme');
gettextCatalog.getString('Add a layer');

if ($injector.has('sentryUrl')) {
const options = $injector.has('sentryOptions') ? $injector.get('sentryOptions') : undefined;
const raven = new Raven();
raven.config($injector.get('sentryUrl'), options)
.addPlugin(RavenPluginsAngular)
.install();
}
};

olBase.inherits(exports, gmfControllersAbstractDesktopController);
Expand Down
10 changes: 10 additions & 0 deletions contribs/gmf/apps/desktop_alt/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import ngeoRoutingModule from 'ngeo/routing/module.js';
import ngeoProjEPSG2056 from 'ngeo/proj/EPSG2056.js';
import ngeoProjEPSG21781 from 'ngeo/proj/EPSG21781.js';
import * as olBase from 'ol/index.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

if (!window.requestAnimationFrame) {
alert('Your browser is not supported, please update it or use another one. You will be redirected.\n\n'
Expand Down Expand Up @@ -127,6 +129,14 @@ const exports = function($scope, $injector, ngeoFile, gettext, $q) {
* @export
*/
this.bgOpacityOptions = 'Test aus Olten';

if ($injector.has('sentryUrl')) {
const options = $injector.has('sentryOptions') ? $injector.get('sentryOptions') : undefined;
const raven = new Raven();
raven.config($injector.get('sentryUrl'), options)
.addPlugin(RavenPluginsAngular)
.install();
}
};

olBase.inherits(exports, gmfControllersAbstractDesktopController);
Expand Down
9 changes: 9 additions & 0 deletions contribs/gmf/apps/mobile/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import appBase from '../appmodule.js';
import ngeoProjEPSG2056 from 'ngeo/proj/EPSG2056.js';
import ngeoProjEPSG21781 from 'ngeo/proj/EPSG21781.js';
import * as olBase from 'ol/index.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

if (!window.requestAnimationFrame) {
alert('Your browser is not supported, please update it or use another one. You will be redirected.\n\n'
Expand Down Expand Up @@ -56,6 +58,13 @@ const exports = function($scope, $injector) {
*/
this.searchCoordinatesProjections = [ngeoProjEPSG21781, ngeoProjEPSG2056, 'EPSG:4326'];

if ($injector.has('sentryUrl')) {
const options = $injector.has('sentryOptions') ? $injector.get('sentryOptions') : undefined;
const raven = new Raven();
raven.config($injector.get('sentryUrl'), options)
.addPlugin(RavenPluginsAngular)
.install();
}
};

olBase.inherits(exports, gmfControllersAbstractMobileController);
Expand Down
9 changes: 9 additions & 0 deletions contribs/gmf/apps/mobile_alt/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import olStyleFill from 'ol/style/Fill.js';
import olStyleRegularShape from 'ol/style/RegularShape.js';
import olStyleStroke from 'ol/style/Stroke.js';
import olStyleStyle from 'ol/style/Style.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

if (!window.requestAnimationFrame) {
alert('Your browser is not supported, please update it or use another one. You will be redirected.\n\n'
Expand Down Expand Up @@ -93,6 +95,13 @@ const exports = function($scope, $injector) {
})
});

if ($injector.has('sentryUrl')) {
const options = $injector.has('sentryOptions') ? $injector.get('sentryOptions') : undefined;
const raven = new Raven();
raven.config($injector.get('sentryUrl'), options)
.addPlugin(RavenPluginsAngular)
.install();
}
};

olBase.inherits(exports, gmfControllersAbstractMobileController);
Expand Down
10 changes: 10 additions & 0 deletions contribs/gmf/apps/oeedit/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import * as olBase from 'ol/index.js';
import olCollection from 'ol/Collection.js';
import olLayerVector from 'ol/layer/Vector.js';
import olSourceVector from 'ol/source/Vector.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

if (!window.requestAnimationFrame) {
alert('Your browser is not supported, please update it or use another one. You will be redirected.\n\n'
Expand Down Expand Up @@ -206,6 +208,14 @@ const exports = function($scope, $injector, $timeout) {
gettextCatalog.getString('Add a theme');
gettextCatalog.getString('Add a sub theme');
gettextCatalog.getString('Add a layer');

if ($injector.has('sentryUrl')) {
const options = $injector.has('sentryOptions') ? $injector.get('sentryOptions') : undefined;
const raven = new Raven();
raven.config($injector.get('sentryUrl'), options)
.addPlugin(RavenPluginsAngular)
.install();
}
};

olBase.inherits(exports, gmfControllersAbstractDesktopController);
Expand Down
10 changes: 10 additions & 0 deletions contribs/gmf/apps/oeview/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import appBase from '../appmodule.js';
import ngeoProjEPSG2056 from 'ngeo/proj/EPSG2056.js';
import ngeoProjEPSG21781 from 'ngeo/proj/EPSG21781.js';
import * as olBase from 'ol/index.js';
import Raven from 'raven-js/src/raven.js';
import RavenPluginsAngular from 'raven-js/plugins/angular.js';

if (!window.requestAnimationFrame) {
alert('Your browser is not supported, please update it or use another one. You will be redirected.\n\n'
Expand Down Expand Up @@ -97,6 +99,14 @@ const exports = function($scope, $injector) {
gettextCatalog.getString('Add a theme');
gettextCatalog.getString('Add a sub theme');
gettextCatalog.getString('Add a layer');

if ($injector.has('sentryUrl')) {
const options = $injector.has('sentryOptions') ? $injector.get('sentryOptions') : undefined;
const raven = new Raven();
raven.config($injector.get('sentryUrl'), options)
.addPlugin(RavenPluginsAngular)
.install();
}
};

olBase.inherits(exports, gmfControllersAbstractDesktopController);
Expand Down
Binary file removed contribs/gmf/cursors/Grab_hand_animation_2sec.gif
Binary file not shown.
Binary file added contribs/gmf/cursors/grab.cur
Binary file not shown.
Binary file removed contribs/gmf/cursors/grab.png
Binary file not shown.
Binary file added contribs/gmf/cursors/grabbing.cur
Binary file not shown.
Binary file removed contribs/gmf/cursors/grabbing.png
Binary file not shown.
4 changes: 2 additions & 2 deletions contribs/gmf/examples/datepicker.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<ngeo-date-picker time="ctrl.wmsTimeRangeMode" on-date-selected="ctrl.onDateRangeSelected(time)"></ngeo-date-picker>
</li>
<li style="margin-top: 50px">
Date formated for a WMS request (resolution set on 'day'):
Date formatted for a WMS request (resolution set on 'day'):
<pre>
{{ctrl.rangeValue}}
</pre>
Expand All @@ -23,7 +23,7 @@
<ngeo-date-picker time="ctrl.wmsTimeValueMode" on-date-selected="ctrl.onDateSelected(time)"></ngeo-date-picker>
</li>
<li style="margin-top: 50px">
Date formated for a WMS request (resolution set on 'month'):
Date formatted for a WMS request (resolution set on 'month'):
<pre>
{{ctrl.value}}
</pre>
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/examples/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<button class="btn btn-primary" data-toggle="button" ng-click="ctrl.toggleDrawLineActive()">Draw a line</button>

<p id="desc">This example shows how to use the <code>gmf-profile</code>.
The draw tool and hover feedback on the map are completely independant of
The draw tool and hover feedback on the map are completely independent of
the gmf-profile components. This profile relies on the ngeo.profile (d3) and
ngeo.ProfileDirective. It passes a custom css through the optional
gmf-profile-options attribute</p>
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/examples/timeslider.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<gmf-time-slider gmf-time-slider-time="ctrl.wmsTimeRangeMode" gmf-time-slider-on-date-selected="ctrl.onDateRangeSelected(time)"></gmf-time-slider>
</li>
<li style="margin-top: 50px">
Date formated for a WMS request (resolution set on 'day'):
Date formatted for a WMS request (resolution set on 'day'):
<pre>
{{ctrl.sliderRangeValue}}
</pre>
Expand All @@ -29,7 +29,7 @@
<gmf-time-slider gmf-time-slider-time="ctrl.wmsTimeValueMode" gmf-time-slider-on-date-selected="ctrl.onDateSelected(time)"></gmf-time-slider>
</li>
<li style="margin-top: 50px">
Date formated for a WMS request (resolution set on 'year'):
Date formatted for a WMS request (resolution set on 'year'):
<pre>
{{ctrl.sliderValue}}
</pre>
Expand Down
Loading

0 comments on commit f359d96

Please sign in to comment.