@@ -35,6 +35,7 @@ const MAP_ERROR = 'MAP_ERROR';
3535const SAVE_ALL = 'SAVE_ALL' ;
3636const DISPLAY_METADATA_EDIT = 'DISPLAY_METADATA_EDIT' ;
3737const RESET_UPDATING = 'RESET_UPDATING' ;
38+ const SAVING_MAP = 'SAVING_MAP' ;
3839const SAVE_MAP = 'SAVE_MAP' ;
3940const PERMISSIONS_LIST_LOADING = 'PERMISSIONS_LIST_LOADING' ;
4041const PERMISSIONS_LIST_LOADED = 'PERMISSIONS_LIST_LOADED' ;
@@ -325,9 +326,21 @@ function saveMap(map, resourceId) {
325326 map
326327 } ;
327328}
329+ /**
330+ * Performed before start saving a new map
331+ * @memberof actions.maps
332+ * @param {object } metadata
333+ * @return {action } type SAVING_MAP action
334+ */
335+ function savingMap ( metadata ) {
336+ return {
337+ type : SAVING_MAP ,
338+ metadata
339+ } ;
340+ }
328341
329342/**
330- * performed when want to disaplay /hide the metadata editing window
343+ * performed when want to display /hide the metadata editing window
331344 * @memberof actions.maps
332345 * @param {boolean } displayMetadataEditValue true to display, false to hide
333346 * @return {action } type `DISPLAY_METADATA_EDIT`, with the arguments as they are named
@@ -591,12 +604,12 @@ function createThumbnail(map, metadataMap, nameThumbnail, dataThumbnail, categor
591604}
592605
593606/**
594- * Save all the metadata and thubnail , if needed.
607+ * Save all the metadata and thumbnail , if needed.
595608 * @memberof actions.maps
596609 * @param {object } map the map object
597610 * @param {object } metadataMap metadata for the map
598- * @param {string } nameThumbnail the name for the thubnail
599- * @param {string } dataThumbnail the data to save for the thubnail
611+ * @param {string } nameThumbnail the name for the thumbnail
612+ * @param {string } dataThumbnail the data to save for the thumbnail
600613 * @param {string } categoryThumbnail the category for the thumbnails
601614 * @param {number } resourceIdMap the id of the map
602615 * @param {object } [options] options for the request
@@ -673,6 +686,7 @@ function deleteThumbnail(resourceId, resourceIdMap, options, reset) {
673686 */
674687function createMap ( metadata , content , thumbnail , options ) {
675688 return ( dispatch ) => {
689+ dispatch ( savingMap ( metadata ) ) ;
676690 GeoStoreApi . createResource ( metadata , content , "MAP" , options ) . then ( ( response ) => {
677691 let resourceId = response . data ;
678692 if ( thumbnail && thumbnail . data ) {
@@ -898,6 +912,7 @@ module.exports = {
898912 ATTRIBUTE_UPDATED ,
899913 PERMISSIONS_UPDATED ,
900914 SAVE_MAP ,
915+ SAVING_MAP ,
901916 THUMBNAIL_ERROR ,
902917 PERMISSIONS_LIST_LOADING ,
903918 PERMISSIONS_LIST_LOADED ,
@@ -944,6 +959,7 @@ module.exports = {
944959 permissionsLoading,
945960 permissionsLoaded,
946961 attributeUpdated,
962+ savingMap,
947963 saveMap,
948964 thumbnailError,
949965 createMap,
0 commit comments