Skip to content

Commit

Permalink
C125 Features Porting (#3607)
Browse files Browse the repository at this point in the history
* annotations updates for Openlayers (#2612)

* Annotations improvements for openlayers

* removed point in card preview

* Improved compatibility of openlayers DrawSupport between all the involved functionalities: QueryBuilder, FeatureEditor, Annotations (#2624)

* Fix Reproject Geometries drawsupport OL (#2627)

* Fix Reproject Geometries drawsupport OL

* fixed also reprojetion when editing

* Closes  geosolutions-it/austrocontrol-C125#12 (#2628)

* Closes  geosolutions-it/austrocontrol-C125#45

* Fixed translation

* Added test and fixed typo

* Added action test

* Fix on Mauro's comment

* Closes geosolutions-it/austrocontrol-C125#13 (#2633)

* Closes geosolutions-it/austrocontrol-C125#13

* Load annotations accept any valide geoJson file

* Added missing translations

* C125 annotations (#2647)

* Closes geosolutions-it/austrocontrol-C125#26

* Fixes on Mauro's comment

* Fixed split search pattern

* Fixes #2608: custom mapOptions are not saved with maps (#2609)

* Added current annotation export Closes geosolutions-it/austrocontrol-C125#12 (#2688)

* Align master to c125_annotations (#2706)

* Fix documentation issue (#2606)

* Fixes #2608: custom mapOptions are not saved with maps (#2609)

* Fix #2592 reorganized text widget into 1 page (#2614)

* Fixed sidegrid css  for different screen resolutions (#2616)

Fix #2593

* Fixes #2542 Custom template for GetFeatureInfo  (#2591)

* (Partial) Chinese language translation (#2643)

* add the Chinese langu

* Fixed chinese language implementation

* Added onlink handler to openlayers overlay layer (#2644)

* Fix #2623. Implemented table widget (#2635)

 - Externalized VirtualScroll functionalities to be reused
 - implemented wfsTable enhancer to support auto-data
   fetch/update with virtual scroll
 - Added to RequestBuilder sortBy and propertyName support
 - Add wfs to observable to reuse streams
 - Provided a getLayerJSONFeature (to extend) for a more rational usage
   of parameters ( old requests had to manage
   filterObj was containing sort and pagination options)
 - Set widgetContainer to be traggable only by header
   ( the cursor now changes where the widget is draggable)
 - Add sortable and defaultWidth options to FeatureGrid editor enhancer
 - Add support for columns resize, memorization and reset
 - tabular view of attribute selection

* Closes geosolutions-it/austrocontrol-C125#26 (#2632)

* Closes geosolutions-it/austrocontrol-C125#26

* Fixes on Mauro's comment

* Fixed split search pattern

* Counter widget (#2645)

* Fixes #2547: upgraded openlayers to 4.6.4 (#2646)

* Fixes #2547: upgraded openlayers to 4.6.4

* Fix for tests

* MousePosition degrees template via plugin props (#2648)

* MousePosition degrees template via plugin props

* Removed unused import

*  Fix #2615. Avoid widgets clear while saving (#2649)

* Fixes #2665 Add an action to force resize of Map component (#2666)

* Austro#31# (#2683)

* Fixes #2638

* Fixes #2639

* Fixes #2640

* Fixes #2569: upgrade of leaflet version to 1.3.1 (and related dependencies) (#2671)

* Fixing leaflet randomly failing test (#2697)

* Closes #2637 (#2698)

* Fixes #2703: openalayers WMTS layers ignore initial visibility (#2704)

* 2626 updates measure tool (#2701)

* Fix #2626 Updated measure tool

* revert on test file

* Made some changes, added arcs on leaflet

* made length formula and showlabel configurable

* fixed default config, added documentation

* fixed reducer default

* Fix #2709 minor fixes to annotations and measure tool (#2710)

* Fix #2531 notes (#2716)

* Added circles on annotation (#2724)

* Fix Circle draw/edit in annotation

* fixed a typo and a boolean condition

* Fixed some bugs / added improvements on circle annotation

* fixed test

* Fix translate interactions on openlayers and other issues on 2709 (#2753)

* Fix Translate iteractions on openlayers

* Restored default values on close, fixed style of quill editor

* fix tests

* removed unused code in less annotations

* C125 annotations (#2751)

* Fix issue on editing style in vector import

* Fixed style of loaded vector layers

* fixes on Matteo's comments

* Fixed lint error

* C125 annotations (#2757)

* Fix issue on editing style in vector import

* Fixed style of loaded vector layers

* fixes on Matteo's comments

* Fixed lint error

* Fixes #16

* Fixed test

* Fixed typo

* Removed unused var

* fix #2709 annotations editor layout (#2897)

* 49 great circle annotations (#2875)

* fix #49 maintain great circle in annotations

* clean up code

* fix #2879 add highlight for text annotations (#2880)

* Fix #2858 change label for annotations text style (#2860)

* Fixed color style in pdf print (#2792)

* Fixed color style in pdf print

* Tinycolor version

# Conflicts:
#	web/client/utils/PrintUtils.js

* Include printing fixes from master and fix the color of line vector when printing (#2919)

* Fixed color style in pdf print (#2792)

* Fixed color style in pdf print

* Tinycolor version

# Conflicts:
#	web/client/utils/PrintUtils.js

* Fixes #29018: quick fix to printing styles of vector

* Align master on c125_annotations branch (#2923)

* Fix #2602 loader spinner on file import

* Fixes #2741: set openlayers single tile wms layers default ratio to 1 (#2742)

* Fixed #2626 fixed leaflet measure tool (#2730)

* Fixed #2626 fixed leaflet measure tool

* added some comments to document changes

* improved implementation

* added more tests

* Fix #2746 leaflet drawing of linestring (#2747)

* fix leaflet override

* fixed with retrocompatibility

* Fixed binding of overridden functions

* Croatian language translation (#2755)

* Fixes #2748: leaflet draw issues (#2752)

* Fixes #2748: leaflet draw issues

* Additional fix for measures

* Removed bootstrap overlay trigger (#2734)

* Fix #2661 First implementation of map widget (#2721)

* Fixes #2021: limit list of srs saved in layers from catalog to the ones supported by the current mapstore2 instance (#2756)

* Update README.md

Add instructions to test MapStore2 using Docker containers

* Fixes #2760: integrated printing service (#2761)

* Added missing files for printing (#2762)

* Removed duplicated and mismatching in version libraries from geostore and mapfish-print (#2763)

* Fixes #2631: usage of mapping libraries (#2739)

* Fixes #2631: usage of mapping libraries

* Fixed switching to 3d mode

* Improved sidecard/sidegrid styles and structures (#2764)

* Quick fix to embedded map style (#2766)

* Fix #2754 Add map widget layer's editing (#2767)

* Croatian language translation - update (#2776)

* Fix #2778 Embedded doesn't work  (#2779)

* Added embedded mode in standard app

* Removed map layout reducers/epics

* Fixed leaflet-draw inclusion in share api template (#2782)

* Connect to #2662 Geodashboard single connection support (#2780)

* Improved widgets dependencies system

* Support for single map connection

* removed test for old map sync switches

* Add support for map sync (#2783)

* Fix #2775 Styles misalignment in BorderLayout component (#2785)

* Multiple map connection support (#2791)

* Fixes #1506 OpenLayers and Leaflet vector different default styles  (#2771)

* Fix #2662. Add widget connections and colors (#2793)

* Improved suggestion when the user can not create a widget (#2795)

* Charts builder improvements (#2796)

* Fixed color style in pdf print (#2792)

* Fixed color style in pdf print

* Tinycolor version

* Fix #2798 search clickable (#2800)

* fix #2798 make clickable search in home

* remove unneeded configuration

* update spinner style dinamically and fix example icon

* Add back buttons to dashboard and map widgets (#2801)

* Add empty state to featuregrid widget (#2802)

* Fix #2787 Panels hide the feature info marker (#2788)

* Merge pull request #1 from geosolutions-it/master (#2805)

* translation data.zh-ZH

* Modify spelling mistakes

* Fixed #2809. Moved utility function in the proper place (#2810)

* Fixed layout of counter widget (#2804)

* Add empty map to map selector (#2813)

* Fix #2794 Force update of map widget position on save (#2814)

* Fix #2807 and add a tool to create chart from feature grid (#2808)

* Fix #2807 and add a tool to create chart from feature grid

* add a flag for disabling chart creation from feature grid

* fix feature grid toolbar test

* update flag used to show char in feature grid

* Exclude google background from widgets (#2817)

* Fix #2812 parseInitialState function  (#2818)

* fix #2812 update parsing of initialState in localConfig.json

* update parsing method

* add documentation and test

* update documentation

* add default in toChangesMap and add a test for empty arrays

* Fix #2790 improved wizard messages (#2819)

* Fixes #2815: elevation support in MousePosition, through elevation layers (#2816)

* fix #2807 back interaction from widget to feature grid (#2821)

* Fix #2803 add popover overlay to the sync tool in feature grid (#2829)

* Fix #2696 map rotation style for openlayers (#2820)

* fix #2696 aligned style of map rotation tool for ol

* disable map rotation on openlayers

* fix require of maplayout selector (#2834)

* Fix #2798 change configuration and make search icon clickable and configurable (#2831)

* Fix #2825. Improved messages in case of no attributes layer (#2833)

* Fixes #2827 Add featured maps plugin (#2828)

* #2827 Minor fixes (#2836)

* Fix #2660 implemented first version of save functionalities for dashboard (#2832)

* Fix #2773. First rules-editor implementation (#2845)

* Fixes #2824: enable elevation layer only for cesium or when mouseposition is enabled (#2841)

* fix #2803 synch popover defaults (#2847)

* fix #2825 interactions between featuregrid anche chart wizard (#2846)

* Removed github link from navbar (#2839)

* fix #2852 dev build fails (#2853)

* Fix #2610 clipped long descriptions of catalog cards (#2830)

* Fix #2664 Implemented browsing functionality for dashboards (#2854)

* First  version of GeoDashboard browsing

  - Has a first abstraction of resources browser. can be reused in maps
 - Still to implement delete and effective link to dashboard

* WIP for dashboard browsing

Still missing:
 - i18n and tests
 - link to the contents
 - titles of tabs  with parenthesis
 - tests
 - fix issues with geostore

* Finalized code for dashboard browser

 - Missing translations and tests

* Add sample category for dashboards

* Fixed groups retrival by admin user

* add some tests

* Add unit tests

* Add i18n

* Fixed confirm dialog test

* Improved empty view style

* Fixed test's context not restored properly

* add tests for geostore observables

* Fix #2825. Fixed error message for layers with no attributes (#2855)

* Fix #2563: Fixed unnecessary details request on Map open (#2849)

* Update data.it-IT

* Fixes #2700  Toolbar icon for 3D map (#2850)

* Minor fixes to localized strings (#2869)

* Changed create map/dashboard buttons (#2871)

* Fix #2843 and Fix #2659. Fixed resize issues on dashboard and map widgets (#2868)

* Added GeoFence admin icon (#2873)

* Fix #2856 Legend action plugin (#2857)

* Added details editor styles filters and  attributes (#2867)

* Fix #2876 Cross layer filter doesn't work if layer has localized title (#2877)

* Changed MapStore 2 strings  to Mapstore (#2882)

- All translation files, html
 - Readme.md Doc pages, pom.xml and package.json still have MapStore 2

* Connected to #2885. Temporary disabled video from detail sheet (#2886)

* Fix #2842. Add legend widget (#2884)

* Fix #2859 Escape special XML chars for title and description (#2887)

* fix #2888 switch to correct 2d mode (#2889)

* Added area editor (#2891)

* Fix #2892. Remove authkey from dashboard layers (#2894)

* Fixed home button position (#2895)

* Fix #2862. Add geofence icon to the manager menu (#2899)

* Fix #2663. Add edit and view mode to the dashboard (#2901)

* Fix #2903. Add support to hide spatial and cross layer filter (#2904)

* fix #2696 map rotation disables correctly (#2905)

* fix #2861 layer metadata layout (#2863)

* fix #2864 properties row viewer (#2865)

* Fix #2898 TOC moves down if Measure tool and print are opened (#2900)

* fix #2711 remove arc layer when toggling length measure tool (#2902)

* RuleEditor Layers filter always enabled (#2907)

* Showing spatial filter selection area when FeatureGrid is open (#2906)

* Moved icons for firefox/ie support (#2912)

* Modify SaveLayer in order to take the custom origin of a wms layer (#2917)

* Modify SaveLayer in order to take the custom origin of a wms layer in account (tilegrid config)

* update maputils tests

* Fixed a couple of typos in merge

* fix failing tests

* Fix #2951 circle draw and styles annotations (#2952)

* Fix #2951 circle draw and styles annotations

* fix styler components

* Support for time dimension (#2968)

* Support for TOC indicators (#2974)

* 2984 upload coordinates editor for annotations (#2988)

* Wip annotations coord editor

* wip coord editor

* wip coord editor

* wip

* wip

* wip

* wip

* Wip 04-06-2018

* wip coord form

* wip tests

* wip adding tests

* added an epic test

* Add some epics test for annotations

* fix a problem with polygons and empty coord while dragging

* Fixed edit problem

* other fixes

* move default text annotation in proper location and other fixes

* Fix #2990 solve problem to import/export and print for annotation (#2994)

* Fix #2990 solve problem to import/export and print for annotation
* fix 2990 and other bugs
* fix test
* simplified configuration

* Fix #2987 wrong ol default style for linestrings (green 1 -> blue 3) (#2991)

* fixed #2990 custom styles plus tests (#2998)

* Fix #2984 Update coordinate editor and bugfixing (#3003)

* Fix #2984 Update coordinate editor and bugfixing

* clear highlight when coordinate row is invalid

* Support for import / export map (branch c125_annotation) (#3004)

* Work in progress for c125-1

* Implemented map loading

* Fix #1 add import export functionalities

* renamed also epic to mapexport

* fixed translations

* Add aeronautical degree in the annotation coordinate editor (#3005)

* Wip aeronautical degree

* switch format and conversion enhancer

* WIP on degree format

* add tests

* removed wrong change

* fix test

* wip, various fixes

* solved issue with seconds step

* bug fix for marker and circle and reproject with bad data

* various bugfix

* fix style circle

* Fix default constraints, validation of center for the Circle

* FIX STYLE DRAG DROP AERONAUTICAL (#3006)

* Fix bugs of coordinate editor for annotations (#3012)

* Fix bugs of coordinate editor for annotations

* remove a comment

* removed center point when the Circle is highlighted

* Fix #1. Imcreased drag zone opacity to 0.75

* Re arranged strings and items in burger menu

* Update data.en-US

* Support for external close action for identify (#3027)

* Fix c125_75 Aeronautical Coordinate issues (#3030)

* Fix #73 Fix #76 Fix #77 Fix #80 Fix #81 various issue on c125 project (#3024)

* Add unit of measure to circle annotation radius (#3033)

* add authenticationRule to support browser credentials (i.e. Cookies). (#2995)

This enables cookies to be sent to the receiving service.

* Fix c125/89.  GFI and annotations fixes (#3035)

* Fix #3045 parsing of provider for tileProvider (#3054) (#3055)

* Fix #88 update default print style (#3065)

* Add 4 decimals, text annotations and print style (#3082)

* Fix #92 #93 and #88 add 4 decimals, text annotations and print style

* fix annotations text editor, fix gitignore for project

* fix text font on firefox, updated tests

* Fix #108, align master and other fixes, leaflet included

* Update annotation vector styler (#3504)

* Fix #3525 add possibility to save and load mapInfo configuration (#3536)

* Fix #3525 add possibility to save and load map info configuration
* add default in mapInfo reducer for when loading map configuration
* clean up duplicated state management, improve identify doc

* remove shapefile codebase in favor of mapimport

* disable options in searchBar

* fixed toolbars and moved components in proper folders

* fix some test

* fix path require mapInfo (#3553)

* Fix update symbol style in annotation styler panel (#3571)

* fix blink when rendering annotations
* drawsupport style update mitigation.
* clean up canvas code
* Fix style update for features in style editor
* fix test set style, draw support replace logic, feature code style clean up
* rename set style epic for annotations, remove a commented code

* fix remove annotation epic test

* add comments for confirm remove epic annotation test

* Solved lint issues

* fixed lint

* Restored #3525 and removed duplications

* Fixed lint

* Fix #3523 Fix #3548 Fix problems with coordinate editor for the search and GFI tools (#3606)

* Fix problems with coordinate editor for the search and GFI tools

* also fix some problem with loading and displaying annotations with leaflet
* especially with text and the multiple draw of same ft.
* also updated limit stroek width for symbols

* Fix #3601 measure updates (#3610)

* fix #3601 measurement with coordinate editor

* this will add some changes to the measurement components.
* there will be two ways of rendering measure panel, a side panel with coord editor
* and a modal without it

* Align master over c125_annotations

* Align master over c125_annotations

* fix bugs on Print for distance measure (#3613)

* fix typo in import mapInfo selector

* fix toc utils test

* Adding tests for increasing coverage on c125_annotations branch and other fixes (#3628)

* wip increasing tests and coverage
* add epic test
* add test ol measurement support
* add test ol measure support
* add ol drawsupport tests
* add test ol draw support circle click
* add more tests for drawsupport and measuresupport (ol)
* add tests drawsupport ol
* add more tests drawSupport ol
* add tests for openlayers components
* Fix #3601 problems on area and bearing
* update ol Feature lifecycle
* fix invalid area problem
* removed comment
* add tests for measurement and coordinate editor fixes
* reafctor the way coords are handled for measure coord editor, add related tests
* this has been done in order to avoid to make validation
* inside MeasurementSupport. validation before drawing is done
* via a selector

* Fix #3617. Add feature zoomTo and highlight to Identify (#3635)

* Fix circular dependencies on c125_annotations branch (#3636)

* Fixed circular dependencies
* moved forceselection to a utils file
* fix travis build

* Fix #3617 minor bug fixes and improvements (#3662)

* 3548 fix ui drag menu for coordinate editor (c125_annotations) (#3667)

* Search tool changes to format menu , search icon always visible (#3670)

* Fixed default lon to east in aeronautical format (#3672)

* Align OL measure number format of tooltip to measure panel's one (#3673)

* Fixed onMouseLeave console.log error

* Fixed tests

* Solved IE identify navigation buttons issue

* Fix coordinate editor exceed maxDegrees issue

* FeatureInfo coordinates in aeronautical format (#3676)

* Fix #3685 print support for dashed stroke (#3686)

* Fix #139 print support for dashed stroke
* fix lint error

* Fix #3685 update dashStrokestyle property (#3689)

* fixed tests

* fix tests, firefox behaves differently on stroke-width

* restore shapefile plugin

* fix lint error
  • Loading branch information
offtherailz authored and Tobia Di Pisa committed May 30, 2019
1 parent 50c18da commit 7edadab
Show file tree
Hide file tree
Showing 272 changed files with 27,754 additions and 3,705 deletions.
3 changes: 2 additions & 1 deletion build/docma-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"web/client/selectors/featuregrid.js",
"web/client/selectors/floatinglegend.js",
"web/client/selectors/map.js",
"web/client/selectors/mapinfo.js",
"web/client/selectors/mapInfo.js",
"web/client/selectors/maplayout.js",
"web/client/selectors/maptype.js",
"web/client/selectors/tutorial.js",
Expand All @@ -163,6 +163,7 @@
"web/client/reducers/featuregrid.js",
"web/client/reducers/globeswitcher.js",
"web/client/reducers/floatinglegend.js",
"web/client/reducers/mapInfo.js",
"web/client/reducers/maps.js",
"web/client/reducers/maptype.js",
"web/client/reducers/notifications.js",
Expand Down
20 changes: 19 additions & 1 deletion docs/developer-guide/local-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,33 @@ Inside defaultState you can set lengthFormula, showLabel, uom:
<br>For the unit you can choose between:
- unit length values : ft, m, km, mi, nm standing for feets, meters, kilometers, miles, nautical miles
- unit area values : sqft, sqm, sqkm, sqmi, sqnm standing for square feets, square meters, square kilometers, square miles, square nautical miles
- Customize the style for the start/endPoint for the measure features. You can set *startEndPoint* to:
- false if you want to disable it
- true (defaults will be used)
- object for customizing styles by placing *startPointOptions* and/or *endPointOptions*<br>
- You can either change the radius or set the fillColor or decide to apply this customization to the first and second-last point for polygons<br>
For lineString endPointOptions refers to the last point of the polyline

example:<br>
Example:<br>
```
"measurement": {
"lengthFormula": "vincenty",
"showLabel": true,
"uom": {
"length": {"unit": "m", "label": "m"},
"area": {"unit": "sqm", "label": "m²"}
},
"startEndPoint": {
"startPointOptions": {
"radius": 3,
"fillColor": "green",
"applyToPolygon": false
},
"endPointOptions": {
"radius": 3,
"fillColor": "red",
"applyToPolygon": false
}
}
}
```
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@
"//": "replace react-sortable-items with official on npm when it will support React 15",
"dependencies": {
"@carnesen/redux-add-action-listener-enhancer": "0.0.1",
"@mapbox/geojsonhint": "2.0.1",
"@mapbox/togeojson": "0.16.0",
"@turf/bbox": "4.1.0",
"@turf/center": "5.1.5",
"@turf/great-circle": "5.1.5",
"@turf/inside": "4.1.0",
"@turf/line-intersect": "4.1.0",
Expand Down Expand Up @@ -148,8 +150,8 @@
"react-copy-to-clipboard": "5.0.0",
"react-data-grid": "5.0.4",
"react-data-grid-addons": "5.0.4",
"react-dnd": "2.4.0",
"react-dnd-html5-backend": "2.4.1",
"react-dnd": "2.6.0",
"react-dnd-html5-backend": "2.6.0",
"react-dock": "0.2.4",
"react-dom": "15.6.2",
"react-draggable": "2.2.6",
Expand Down
155 changes: 148 additions & 7 deletions web/client/actions/__tests__/annotations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ const {
HIGHLIGHT,
CLEAN_HIGHLIGHT,
FILTER_ANNOTATIONS,
addText, ADD_TEXT,
CHANGE_FORMAT, changeFormat,
changedProperties, CHANGED_PROPERTIES,
toggleUnsavedStyleModal, TOGGLE_STYLE_MODAL,
startDrawing, START_DRAWING,
toggleUnsavedChangesModal, TOGGLE_CHANGES_MODAL,
setUnsavedStyle, UNSAVED_STYLE,
setUnsavedChanges, UNSAVED_CHANGES,
editAnnotation,
removeAnnotation,
confirmRemoveAnnotation,
Expand All @@ -53,12 +61,25 @@ const {
filterAnnotations,
closeAnnotations,
confirmCloseAnnotations,
cancelCloseAnnotations
cancelCloseAnnotations,
DOWNLOAD, download,
CHANGED_SELECTED, changeSelected,
SET_INVALID_SELECTED, setInvalidSelected,
TOGGLE_GEOMETRY_MODAL, toggleUnsavedGeometryModal,
RESET_COORD_EDITOR, resetCoordEditor,
CHANGE_RADIUS, changeRadius,
CHANGE_TEXT, changeText,
CONFIRM_DELETE_FEATURE, confirmDeleteFeature,
OPEN_EDITOR, openEditor,
TOGGLE_DELETE_FT_MODAL, toggleDeleteFtModal,
ADD_NEW_FEATURE, addNewFeature,
LOAD_ANNOTATIONS, loadAnnotations,
UPDATE_SYMBOLS, updateSymbols
} = require('../annotations');

describe('Test correctness of the annotations actions', () => {
it('edit annotation', (done) => {
const result = editAnnotation('1', 'Point');
const result = editAnnotation('1');
expect(result).toExist();
expect(isFunction(result)).toBe(true);
result((action) => {
Expand All @@ -75,6 +96,9 @@ describe('Test correctness of the annotations actions', () => {
properties: {
id: '1',
name: 'myannotation'
},
geometry: {
type: "Point"
}
}]
}]
Expand All @@ -87,22 +111,94 @@ describe('Test correctness of the annotations actions', () => {
expect(result.type).toEqual(REMOVE_ANNOTATION);
expect(result.id).toEqual('1');
});

it('openEditor annotation', () => {
const result = openEditor('1');
expect(result.type).toEqual(OPEN_EDITOR);
expect(result.id).toEqual('1');
});
it('addNewFeature', () => {
const result = addNewFeature();
expect(result.type).toEqual(ADD_NEW_FEATURE);
});
it('confirmDeleteFeature', () => {
const result = confirmDeleteFeature();
expect(result.type).toEqual(CONFIRM_DELETE_FEATURE);
});
it('toggleDeleteFtModal', () => {
const result = toggleDeleteFtModal();
expect(result.type).toEqual(TOGGLE_DELETE_FT_MODAL);
});
it('changeSelected', () => {
const coordinates = [1, 2];
const radius = 0;
const text = "text";
const result = changeSelected(coordinates, radius, text);
expect(result.type).toEqual(CHANGED_SELECTED);
expect(result.coordinates).toEqual(coordinates);
expect(result.radius).toEqual(radius);
expect(result.text).toEqual(text);
});
it('setInvalidSelected', () => {
const errorFrom = "text";
const coordinates = [1, 2];
const result = setInvalidSelected(errorFrom, coordinates);
expect(result.type).toEqual(SET_INVALID_SELECTED);
expect(result.errorFrom).toEqual(errorFrom);
expect(result.coordinates).toEqual(coordinates);
});
it('addText', () => {
const result = addText();
expect(result.type).toEqual(ADD_TEXT);
});
it('changeFormat', () => {
const format = "decimal";
const result = changeFormat(format);
expect(result.type).toEqual(CHANGE_FORMAT);
expect(result.format).toEqual(format);
});
it('confirm remove annotation', () => {
const result = confirmRemoveAnnotation('1');
expect(result.type).toEqual(CONFIRM_REMOVE_ANNOTATION);
expect(result.id).toEqual('1');
});

it('changedProperties', () => {
const field = "desc";
const value = "desc value";
const result = changedProperties(field, value);
expect(result.type).toEqual(CHANGED_PROPERTIES);
expect(result.field).toEqual(field);
expect(result.value).toEqual(value);
});
it('cancel remove annotation', () => {
const result = cancelRemoveAnnotation();
expect(result.type).toEqual(CANCEL_REMOVE_ANNOTATION);
});

it('setUnsavedChanges', () => {
const result = setUnsavedChanges(true);
expect(result.type).toEqual(UNSAVED_CHANGES);
expect(result.unsavedChanges).toEqual(true);
});
it('setUnsavedStyle', () => {
const result = setUnsavedStyle(true);
expect(result.type).toEqual(UNSAVED_STYLE);
expect(result.unsavedStyle).toEqual(true);
});
it('cancel edit annotation', () => {
const result = cancelEditAnnotation();
expect(result.type).toEqual(CANCEL_EDIT_ANNOTATION);
});
it('startDrawing', () => {
const result = startDrawing();
expect(result.type).toEqual(START_DRAWING);
});
it('toggleUnsavedChangesModal', () => {
const result = toggleUnsavedChangesModal();
expect(result.type).toEqual(TOGGLE_CHANGES_MODAL);
});
it('toggleUnsavedStyleModal', () => {
const result = toggleUnsavedStyleModal();
expect(result.type).toEqual(TOGGLE_STYLE_MODAL);
});

it('save annotation', () => {
const result = saveAnnotation('1', {
Expand Down Expand Up @@ -168,9 +264,8 @@ describe('Test correctness of the annotations actions', () => {
});

it('creates new annotation', () => {
const result = newAnnotation('Point');
const result = newAnnotation();
expect(result.type).toEqual(NEW_ANNOTATION);
expect(result.featureType).toEqual('Point');
});

it('highlights annotation', () => {
Expand Down Expand Up @@ -200,8 +295,54 @@ describe('Test correctness of the annotations actions', () => {
expect(result.type).toEqual(CONFIRM_CLOSE_ANNOTATIONS);
});

it('changeRadius', () => {
const radius = "";
const components = "";
const result = changeRadius(radius, components);
expect(result.components).toEqual(components);
expect(result.radius).toEqual(radius);
expect(result.type).toEqual(CHANGE_RADIUS);
});
it('changeText', () => {
const text = "";
const components = "";
const result = changeText(text, components);
expect(result.type).toEqual(CHANGE_TEXT);
expect(result.text).toEqual(text);
expect(result.components).toEqual(components);
});

it('toggleUnsavedGeometryModal', () => {
const result = toggleUnsavedGeometryModal();
expect(result.type).toEqual(TOGGLE_GEOMETRY_MODAL);
});
it('resetCoordEditor', () => {
const result = resetCoordEditor();
expect(result.type).toEqual(RESET_COORD_EDITOR);
});

it('cancel close annotations', () => {
const result = cancelCloseAnnotations();
expect(result.type).toEqual(CANCEL_CLOSE_ANNOTATIONS);
});
it('download annotations', () => {
const result = download();
expect(result.type).toEqual(DOWNLOAD);
});
it('updateSymbols', () => {
const symbols = [{name: "symbol1"}, {name: "symbol2"}];
let result = updateSymbols(symbols);
expect(result.type).toEqual(UPDATE_SYMBOLS);
expect(result.symbols.length).toEqual(2);
expect(result.symbols[0].name).toEqual(symbols[0].name);

result = updateSymbols();
expect(result.symbols.length).toEqual(0);
});
it('load annotations', () => {
const result = loadAnnotations([]);
expect(result.type).toEqual(LOAD_ANNOTATIONS);
expect(result.features).toExist();
expect(result.override).toBe(false);
});
});
20 changes: 20 additions & 0 deletions web/client/actions/__tests__/draw-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,26 @@ describe('Test correctness of the draw actions', () => {
expect(retval.features).toExist();
expect(retval.features).toBe(features);
});
it('Test geometryChanged features, owner, enableEdit, textChanged', () => {
const features = [{
geometry: {
type: "Point",
coordinates: []
}
}];
const owner = "annotations";
const enableEdit = true;
const textChanged = false;
const retval = geometryChanged(features, owner, enableEdit, textChanged);

expect(retval).toExist();
expect(retval.type).toBe(GEOMETRY_CHANGED);
expect(retval.features).toExist();
expect(retval.features).toBe(features);
expect(retval.owner).toBe(owner);
expect(retval.enableEdit).toBe(enableEdit);
expect(retval.textChanged).toBe(textChanged);
});
it('Test drawStopped action creator', () => {
const retval = drawStopped();
expect(retval).toExist();
Expand Down
23 changes: 22 additions & 1 deletion web/client/actions/__tests__/mapInfo-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var {
GET_VECTOR_INFO,
TOGGLE_MAPINFO_STATE,
UPDATE_CENTER_TO_MARKER,
TOGGLE_EMPTY_MESSAGE_GFI, toggleEmptyMessageGFI,
changeMapInfoState,
newMapInfoRequest,
purgeMapInfoResults,
Expand All @@ -27,7 +28,9 @@ var {
toggleMapInfoState,
updateCenterToMarker,
TOGGLE_SHOW_COORD_EDITOR, toggleShowCoordinateEditor,
CHANGE_FORMAT, changeFormat
CHANGE_FORMAT, changeFormat,
CHANGE_PAGE, changePage,
TOGGLE_HIGHLIGHT_FEATURE, toggleHighlightFeature
} = require('../mapInfo');

describe('Test correctness of the map actions', () => {
Expand Down Expand Up @@ -102,6 +105,10 @@ describe('Test correctness of the map actions', () => {
expect(retval.type).toBe(UPDATE_CENTER_TO_MARKER);
expect(retval.status).toBe('enabled');
});
it('toggleEmptyMessageGFI', () => {
const retval = toggleEmptyMessageGFI();
expect(retval.type).toBe(TOGGLE_EMPTY_MESSAGE_GFI);
});
it('toggleShowCoordinateEditor', () => {
const showCoordinateEditor = true;
const retval = toggleShowCoordinateEditor(showCoordinateEditor);
Expand All @@ -114,4 +121,18 @@ describe('Test correctness of the map actions', () => {
expect(retval.type).toBe(CHANGE_FORMAT);
expect(retval.format).toBe(format);
});
it('toggleHighlightFeature', () => {
const retVal = toggleHighlightFeature(true);
expect(retVal).toExist();
expect(retVal.type).toBe(TOGGLE_HIGHLIGHT_FEATURE);
expect(toggleHighlightFeature().enabled).toBeFalsy();
expect(toggleHighlightFeature(true).enabled).toBe(true);
});
it('changePage', () => {
const retVal = changePage(true);
expect(retVal).toExist();
expect(retVal.type).toBe(CHANGE_PAGE);
expect(changePage().index).toBeFalsy();
expect(changePage(1).index).toBe(1);
});
});
20 changes: 20 additions & 0 deletions web/client/actions/__tests__/mapexport-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2018, GeoSolutions Sas.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/

const expect = require('expect');
const { exportMap, EXPORT_MAP} = require('../mapexport');

describe('mapExport actions', () => {

it('exportMap', () => {
const action = exportMap();
expect(action).toExist();
expect(action.type).toBe(EXPORT_MAP);
expect(action.format).toBe("mapstore2");
});
});
Loading

0 comments on commit 7edadab

Please sign in to comment.