Skip to content

Commit

Permalink
Merge pull request #1 from ZakarFin/mvt
Browse files Browse the repository at this point in the history
Merged develop and resolved conflicts
  • Loading branch information
jheijari authored Mar 28, 2019
2 parents a3894b4 + ade3032 commit 84dbd10
Show file tree
Hide file tree
Showing 176 changed files with 1,692 additions and 683 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ src/**
resources/**
packages/**
node_modules/**
node_modules.bak/**
locale/**
libraries/**
dist/**
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
"__webpack_public_path__": false
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaVersion": 9,
"sourceType": "module"
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
function (roleModel) {
return Backbone.Collection.extend({

// Reference to this collection's model.
// Reference to this collection's model.
model: roleModel,

getRoles: function () {
Expand Down
2 changes: 1 addition & 1 deletion bundles/admin/admin-hierarchical-layerlist/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ Oskari.clazz.define('Oskari.admin.bundle.admin.HierarchicalLayerListBundleInstan
xhr = null;
var successCount = resp.success.length;
var failCount = Object.keys(resp.error).length;
content.append('<br><br><span>' + loc('recheckAllSucceeded', {success: successCount, fail: failCount}) + '<span>');
content.append('<br><br><span>' + loc('recheckAllSucceeded', { success: successCount, fail: failCount }) + '<span>');
tool.removeClass('active');
},
error: function (xhr, status, error) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { Button } from './Button';
import {StyledButton} from './StyledButton';
import { StyledButton } from './StyledButton';

const defaultText = 'My text';
const defaultProps = {};
Expand Down
2 changes: 1 addition & 1 deletion bundles/admin/admin-layereditor/instance.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {LayerEditorFlyout} from './view/Flyout';
import { LayerEditorFlyout } from './view/Flyout';
const BasicBundle = Oskari.clazz.get('Oskari.BasicBundle');

Oskari.clazz.defineES('Oskari.admin.admin-layereditor.instance',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import React from 'react';
import PropTypes from 'prop-types';
import {List} from '../../components/List';
import {List, ListItem} from '../../components/List';

export class LayerCapabilitiesListing extends React.Component {
getItem (item) {
return (
<span onClick={() => this.props.onSelect(item)}>{item.name}</span>
<ListItem onClick={() => this.props.onSelect(item)}>
{item.name}
</ListItem>
);
}
render () {
return (
<div>
<List dataSource={this.props.capabilities.map(item => this.getItem(item))}></List>
<List dataSource={this.props.capabilities} renderItem={item => this.getItem(item)}></List>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class StateHandler {
return this.loading;
}
getLayer () {
return {...this.layer};
return { ...this.layer };
}
getCapabilities () {
return this.capabilities || [];
Expand Down
4 changes: 2 additions & 2 deletions bundles/admin/admin/DefaultViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ Oskari.clazz.define('Oskari.admin.bundle.admin.DefaultViews', function (locale,
__showGenericErrorSave: function (id) {
this.instance.showMessage(
this.locale.notifications.errorTitle,
_.template(this.locale.notifications.errorUpdating)({id: id}));
_.template(this.locale.notifications.errorUpdating)({ id: id }));
},

__viewSaved: function (id, data) {
this.instance.showMessage(
this.locale.notifications.successTitle,
_.template(this.locale.notifications.viewUpdated)({id: id}));
_.template(this.locale.notifications.viewUpdated)({ id: id }));
},

/**
Expand Down
2 changes: 1 addition & 1 deletion bundles/admin/admin/Flyout.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Oskari.clazz.define('Oskari.admin.bundle.admin.GenericAdminFlyout',
* request to handle
*/
handleRequest: function (core, request) {
this.addTab({'title': request.getTitle(), 'content': request.getContent(), 'priority': request.getPriority(), 'id': request.getId()});
this.addTab({ 'title': request.getTitle(), 'content': request.getContent(), 'priority': request.getPriority(), 'id': request.getId() });
}
}, {
'extend': ['Oskari.userinterface.extension.DefaultFlyout']
Expand Down
2 changes: 1 addition & 1 deletion bundles/admin/admin/request/AddTabRequestHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Oskari.clazz.define('Oskari.mapframework.bundle.admin.request.AddTabRequestHandl
* request to handle
*/
handleRequest: function (core, request) {
this.flyout.addTab({'title': request.getTitle(), 'content': request.getContent(), 'priority': request.getPriority(), 'id': request.getId()});
this.flyout.addTab({ 'title': request.getTitle(), 'content': request.getContent(), 'priority': request.getPriority(), 'id': request.getId() });
}
}, {
/**
Expand Down
2 changes: 1 addition & 1 deletion bundles/admin/metrics/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Oskari.clazz.define('Oskari.admin.bundle.metrics.MetricsAdminBundleInstance',
content.append('Error loading metrics');
},
success: function (response) {
content.tree({'data': me.formatData(response)});
content.tree({ 'data': me.formatData(response) });
}
});
if (sandbox.hasHandler('Admin.AddTabRequest')) {
Expand Down
4 changes: 2 additions & 2 deletions bundles/catalogue/metadatacatalogue/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ Oskari.clazz.define(
dropdownDef,
emptyOption,
newOption,
renderCoverageButton = (_.filter(dataFields, {'field': 'coverage'}).length > 0),
renderCoverageButton = (_.filter(dataFields, { 'field': 'coverage' }).length > 0),
checkboxChange = function () {
me._updateOptions(advancedContainer);
};
Expand Down Expand Up @@ -1079,7 +1079,7 @@ Oskari.clazz.define(
if (action.callback && typeof action.callback === 'function') {
// Bind action click to bindCallbackTo if bindCallbackTo param exist
callbackElement = actionElement.first();
callbackElement.css({'cursor': 'pointer'}).on('click', {metadata: row}, function (event) {
callbackElement.css({ 'cursor': 'pointer' }).on('click', { metadata: row }, function (event) {
action.callback(event.data.metadata);
});
}
Expand Down
6 changes: 3 additions & 3 deletions bundles/catalogue/metadatacatalogue/instance.ol2.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ Oskari.clazz.define(
dropdownDef,
emptyOption,
newOption,
renderCoverageButton = (_.filter(dataFields, {'field': 'coverage'}).length > 0),
renderCoverageButton = (_.filter(dataFields, { 'field': 'coverage' }).length > 0),
checkboxChange = function () {
me._updateOptions(advancedContainer);
};
Expand Down Expand Up @@ -718,7 +718,7 @@ Oskari.clazz.define(
this.selectionPlugin = Oskari.clazz.create('Oskari.mapframework.bundle.featuredata2.plugin.MapSelectionPlugin', config, me.sandbox);
mapModule.registerPlugin(this.selectionPlugin);
mapModule.startPlugin(this.selectionPlugin);
this.selectionPlugin.startDrawing({drawMode: 'square'});
this.selectionPlugin.startDrawing({ drawMode: 'square' });
},

/**
Expand Down Expand Up @@ -1037,7 +1037,7 @@ Oskari.clazz.define(
// Set action callback
if (action.callback && typeof action.callback === 'function') {
callbackElement = actionElement.first();
callbackElement.css({'cursor': 'pointer'}).on('click', {metadata: row}, function (event) {
callbackElement.css({ 'cursor': 'pointer' }).on('click', { metadata: row }, function (event) {
action.callback(event.data.metadata);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
Oskari.clazz.define('Oskari.catalogue.bundle.metadatacatalogue.request.AddSearchResultActionRequest',

/**
/**
* @method create called automatically on construction
* @static
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
Oskari.clazz.define('Oskari.catalogue.bundle.metadatacatalogue.service.MetadataOptionService',

/**
/**
* @method create called automatically on construction
* @static
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
Oskari.clazz.define('Oskari.catalogue.bundle.metadatacatalogue.service.MetadataSearchService',

/**
/**
* @method create called automatically on construction
* @static
*
Expand Down
2 changes: 1 addition & 1 deletion bundles/catalogue/metadataflyout/Flyout.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Oskari.clazz.define('Oskari.catalogue.bundle.metadataflyout.Flyout',
}
}
}
me.instance.state = {current: allMetadata};
me.instance.state = { current: allMetadata };
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Oskari.clazz.define('Oskari.mapframework.bundle.coordinatetool.plugin.Coordinate
popupTitle = loc('display.popup.title'),
popupContent = me._templates.popupContent.clone(),
crs = me.getMapModule().getProjection(),
crsDefaultText = loc('display.crs.default', {crs: crs}),
crsDefaultText = loc('display.crs.default', { crs: crs }),
popupName = 'xytoolpopup',
popupLocation,
isMobile = Oskari.util.isMobile(),
Expand Down Expand Up @@ -315,7 +315,7 @@ Oskari.clazz.define('Oskari.mapframework.bundle.coordinatetool.plugin.Coordinate
var topOffsetElement = jQuery('div.mobileToolbarDiv');
me._popup.addClass('coordinatetool__popup');
me._popup.addClass('mobile-popup');
me._popup.setColourScheme({'bgColour': '#e6e6e6'});
me._popup.setColourScheme({ 'bgColour': '#e6e6e6' });

// hide mouse coordinates
popupContent.find('.mousecoordinates-div').hide();
Expand Down
4 changes: 1 addition & 3 deletions bundles/framework/divmanazer/component/Chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ Oskari.clazz.define('Oskari.userinterface.component.Chart', function () {
options.colors = options.colors || this._options.colors;
if (typeof options.colors === 'string') {
options.colors = [options.colors];
} else if (options.colors) {
options.colors = options.colors;
}
},
chartIsInitialized: function () {
Expand Down Expand Up @@ -184,7 +182,7 @@ Oskari.clazz.define('Oskari.userinterface.component.Chart', function () {
.ticks(Math.min(10, tickTarget))
.tickSizeInner(-this.dimensions.height() + this.dimensions.xAxisOffset)
.tickSizeOuter(0)
.tickFormat(function (d) { return me.loc('graph.tick', {value: d}); });
.tickFormat(function (d) { return me.loc('graph.tick', { value: d }); });
},
/**
* initializes the chart skeleton without any specific line or bar options
Expand Down
12 changes: 6 additions & 6 deletions bundles/framework/divmanazer/component/FileInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ Oskari.clazz.define('Oskari.userinterface.component.FileInput', function (option
message = this.loc('fileInput.invalidType');
if (Array.isArray(allowedExtensions) && allowedExtensions.length > 0) {
allowedExtensions = '.' + allowedExtensions.join(', .');
message += '<br>' + this.loc('fileInput.allowedExtensions', {allowedExtensions: allowedExtensions});
message += '<br>' + this.loc('fileInput.allowedExtensions', { allowedExtensions: allowedExtensions });
}
this._showPopup(this.loc('fileInput.error'), message);
}
// if max file size is defined check that file isn't too large
if (opts.maxFileSize && file.size > opts.maxFileSize * 1048576) {
valid = false;
this._showPopup(this.loc('fileInput.error'), this.loc('fileInput.fileSize', {size: opts.maxFileSize}));
this._showPopup(this.loc('fileInput.error'), this.loc('fileInput.fileSize', { size: opts.maxFileSize }));
}
return valid;
},
Expand Down Expand Up @@ -238,10 +238,10 @@ Oskari.clazz.define('Oskari.userinterface.component.FileInput', function (option

if (opts.allowMultipleFiles === true) {
allowMultiple = 'multiple';
fileUpload = this.loc('fileInput.fileUpload', {files: 2});
fileUpload = this.loc('fileInput.fileUpload', { files: 2 });
} else {
allowMultiple = '';
fileUpload = this.loc('fileInput.fileUpload', {files: 1});
fileUpload = this.loc('fileInput.fileUpload', { files: 1 });
}

if (this.isAdvancedUpload) {
Expand Down Expand Up @@ -319,7 +319,7 @@ Oskari.clazz.define('Oskari.userinterface.component.FileInput', function (option
var tooltip;
if (Array.isArray(allowedExtensions) && allowedExtensions.length !== 0) {
allowedExtensions = '.' + allowedExtensions.join(', .');
tooltip = this.loc('fileInput.allowedExtensions', {allowedExtensions: allowedExtensions});
tooltip = this.loc('fileInput.allowedExtensions', { allowedExtensions: allowedExtensions });
elem.prop('title', tooltip);
}
},
Expand All @@ -333,7 +333,7 @@ Oskari.clazz.define('Oskari.userinterface.component.FileInput', function (option
},
// TODO should these be in different place
exportToFile: function (data, filename, type) {
var blob = new Blob([data], {type: type});
var blob = new Blob([data], { type: type });
if (window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveBlob(blob, filename);
} else {
Expand Down
22 changes: 11 additions & 11 deletions bundles/framework/divmanazer/component/FilterDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Oskari.clazz.define('Oskari.userinterface.component.FilterDialog',
* @param {boolean} activate
*/
_toggleClickedFeaturesSelection: function (container, enable, check) {
container.find('#analyse-clicked-features').prop({'checked': check, 'disabled': !enable});
container.find('#analyse-clicked-features').prop({ 'checked': check, 'disabled': !enable });
},
/**
* Toggles the filter by geometry radios of the filter dialog popup.
Expand All @@ -297,13 +297,13 @@ Oskari.clazz.define('Oskari.userinterface.component.FilterDialog',
if (!enable) {
check = false;
}
container.find('#analyse-filter-by-geometry').prop({'checked': check, 'disabled': !enable});
container.find('#analyse-filter-by-geometry').prop({ 'checked': check, 'disabled': !enable });
if (check) {
container.find('input[name="filter-by-geometry"]').prop({'disabled': !enable});
container.find('input[name="filter-by-geometry"]').prop({ 'disabled': !enable });
// check the first option.
container.find('#analyse-filter-by-geometry-intersect').prop({'checked': check, 'disabled': !enable});
container.find('#analyse-filter-by-geometry-intersect').prop({ 'checked': check, 'disabled': !enable });
} else {
container.find('input[name="filter-by-geometry"]').prop({'checked': check, 'disabled': true});
container.find('input[name="filter-by-geometry"]').prop({ 'checked': check, 'disabled': true });
}
},
/**
Expand All @@ -315,8 +315,8 @@ Oskari.clazz.define('Oskari.userinterface.component.FilterDialog',
* @param {boolean} activate
*/
_toggleBBOXSelection: function (container, check) {
container.find('div.bbox-on').find('input[name=analysis-filter-radio]').prop({'checked': check});
container.find('div.bbox-off').find('input[name=analysis-filter-radio]').prop({'checked': false});
container.find('div.bbox-on').find('input[name=analysis-filter-radio]').prop({ 'checked': check });
container.find('div.bbox-off').find('input[name=analysis-filter-radio]').prop({ 'checked': false });
},
/**
* Toggles the property selections of the filter dialog popup.
Expand All @@ -329,13 +329,13 @@ Oskari.clazz.define('Oskari.userinterface.component.FilterDialog',
bboxOFF = filterContentBBOX.find('div.bbox-off').find('input[name=analysis-filter-radio]').is(':checked');
if (bboxOFF) {
valuesSelection.find('div.values-additional-info').html(this.loc.values.info.bboxOff);
valuesSelection.find('div.filter-by-values-container').css({'display': 'block'});
valuesSelection.find('div.filter-by-values-container').css({ 'display': 'block' });
} else if (filterByGeometryChecked) {
valuesSelection.find('div.values-additional-info').html(this.loc.values.info.filterByGeometrySelected);
valuesSelection.find('div.filter-by-values-container').css({'display': 'none'});
valuesSelection.find('div.filter-by-values-container').css({ 'display': 'none' });
} else {
valuesSelection.find('div.values-additional-info').html('');
valuesSelection.find('div.filter-by-values-container').css({'display': 'block'});
valuesSelection.find('div.filter-by-values-container').css({ 'display': 'block' });
}
},
/**
Expand All @@ -362,7 +362,7 @@ Oskari.clazz.define('Oskari.userinterface.component.FilterDialog',
this._toggleFilterByGeometrySelection(filterByGeometryDiv, selectedTemporaryFeatures, false);
} else if (values.noBBOX) {
this._toggleBBOXSelection(bboxDiv, false);
bboxDiv.find('div.bbox-off').find('input[name=analysis-filter-radio]').prop({'checked': true});
bboxDiv.find('div.bbox-off').find('input[name=analysis-filter-radio]').prop({ 'checked': true });
this._toggleClickedFeaturesSelection(clickedFeaturesDiv, clickedFeatures, false);
this._toggleFilterByGeometrySelection(filterByGeometryDiv, selectedTemporaryFeatures, false);
// no previous selections (bbox or no bbox, ) and no selected features -> select bbox by default.
Expand Down
2 changes: 1 addition & 1 deletion bundles/framework/divmanazer/component/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ Oskari.clazz.define('Oskari.userinterface.component.Grid',
if (renderer) {
value = renderer(value, data);
} else if (typeof value === 'number') {
value = me._loc('Grid.cellValue', {value: value});
value = me._loc('Grid.cellValue', { value: value });
}
cell.append(value);
row.append(cell);
Expand Down
2 changes: 1 addition & 1 deletion bundles/framework/divmanazer/component/GridPaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Oskari.clazz.category(
}
};

var visibleCols = Array.apply(null, {length: groupCols}).map(Number.call, Number);
var visibleCols = Array.apply(null, { length: groupCols }).map(Number.call, Number);

// Get visible cols and shows them
// If page is first then show only first cols
Expand Down
Loading

0 comments on commit 84dbd10

Please sign in to comment.