Skip to content

Commit

Permalink
fixed #1138 : style name encoded properly (#1139)
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 authored and offtherailz committed Oct 13, 2016
1 parent 0bf0dc3 commit 99c274d
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions web/client/actions/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const applyPlaceholders = function(preset, model) {
return assign({}, preset, {
changes: assign({}, preset.changes, {
target: assign({}, preset.changes.target, {
dataStore: assign(preset.changes.target.dataStore, {
dataStore: assign({}, preset.changes.target.dataStore, {
name: replaceTargetWorkspace(preset.changes.target.dataStore.name)
})
})
Expand Down Expand Up @@ -646,7 +646,6 @@ function dismissWorkspaceCreationStatus() {
/** UPLOAD **/
function uploadImportFiles(geoserverRestURL, importId, files, presets) {
return (dispatch, getState) => {
let state = getState();
dispatch(loading({importId: importId, uploadingFiles: files}));
let progressOpts = {
progress: (progressEvent) => {
Expand All @@ -657,7 +656,8 @@ function uploadImportFiles(geoserverRestURL, importId, files, presets) {
let tasks = response && response.data && response.data.tasks || response && response.data && [response.data.task];
dispatch(fileUploaded(files));
dispatch(importTaskCreated(importId, tasks));
let impState = getState().importer;
let state = getState();
let impState = state.importer;
if (impState && impState.selectedImport && impState.selectedImport.id === importId && tasks && tasks.length > 1) {
dispatch(loadImport(geoserverRestURL, importId));
}
Expand Down
2 changes: 1 addition & 1 deletion web/client/api/geoserver/Styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const assign = require('object-assign');

var Api = {
saveStyle: function(geoserverBaseUrl, styleName, body, options) {
let url = geoserverBaseUrl + "styles/" + styleName;
let url = geoserverBaseUrl + "styles/" + encodeURI(styleName);
let opts = assign({}, options);
opts.headers = assign({}, opts.headers, {"Content-Type": "application/vnd.ogc.sld+xml"});
return axios.put(url, body, opts);
Expand Down
10 changes: 5 additions & 5 deletions web/client/components/file/FileUploader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* LICENSE file in the root directory of this source tree.
*/
const React = require('react');

const {round} = require('lodash');
const {Message, DateFormat} = require('../I18N/I18N');
const Spinner = require('react-spinkit');
const {Glyphicon, ProgressBar, Table, Alert} = require('react-bootstrap');
Expand Down Expand Up @@ -58,8 +58,8 @@ const FileUploader = React.createClass({
},
renderProgress(uploading) {
if (uploading && uploading.progress) {
let precent = (uploading.progress * 100).toFixed(2);
return <ProgressBar key="progressbar" striped now={precent} label={`${precent}%`}/>;
let percent = round(uploading.progress * 100, 2);
return <ProgressBar key="progressbar" striped now={percent} label={`${percent}%`}/>;
}

},
Expand All @@ -74,8 +74,8 @@ const FileUploader = React.createClass({
</tr>
</thead>
<tbody>
{this.state.fileList && this.state.fileList.map((file) =>
(<tr>
{this.state.fileList && this.state.fileList.map((file, index) =>
(<tr key={"row_" + index}>
<td key="name">{file.name}</td>
<td key="size">{this.humanFileSize(file.size)}</td>
<td key="type">{file.type}</td>
Expand Down
12 changes: 6 additions & 6 deletions web/client/reducers/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const {

const assign = require('object-assign');

// constant used to reset the state only if the importer tool is passed to the reducer
// see case: MANAGER_ITEM_SELECTED
const importerTool = "importer";

/******************************************************************************/
/* UTILITY FUNCTIONS **********************************************************/
/******************************************************************************/
Expand Down Expand Up @@ -131,11 +135,7 @@ function updateImportTaskLoadingStatus(state, action, loading = true) {
/* REDUCER ********************************************************************/
/******************************************************************************/

const initialState = {
importerTool: "importer"
};

function importer(state = initialState, action) {
function importer(state = {}, action) {
switch (action.type) {
case IMPORTS_LOADING: {
if (!action.details) {
Expand All @@ -152,7 +152,7 @@ function importer(state = initialState, action) {
return state;
case MANAGER_ITEM_SELECTED: {
const toolId = action.toolId;
if (toolId === state.importerTool) {
if (toolId === importerTool) {
return assign({}, state, {
loadingError: null,
imports: state.imports,
Expand Down
4 changes: 2 additions & 2 deletions web/client/translations/data.en-US
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,9 @@
"create": "Create",
"createWS": "create a new workspace: ",
"target": "target workspace: ",
"failure": "Error creating workspace: {statusWS}",
"success": "Workspace {statusWS} successfully created",
"select": "Select TargetWorkspace",
"success": "Error creating workspace: {statusWS}",
"failure": "Workspace {statusWS} successfully created",
"new": "New workspace name..."
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions web/client/translations/data.fr-FR
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@
"create": "Créer",
"createWS": "créer un nouvel espace de travail: ",
"target": "cible espace de travail: ",
"success": "Erreur de création espace de travail: {statusWS}",
"failure": "Espace de travail {statusWS} créé avec succès",
"failure": "Erreur de création espace de travail: {statusWS}",
"success": "Espace de travail {statusWS} créé avec succès",
"select": "Sélectionnez l'espace de travail cible",
"new": "Nom..."
},
Expand Down
4 changes: 2 additions & 2 deletions web/client/translations/data.it-IT
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,8 @@
"create": "Crea",
"createWS": "Crea un nuovo workspace: ",
"target": "Workspace di destinazione: ",
"success": "Errore durante la creazione del workspace: {statusWS}",
"failure": "Workspace {statusWS} creato correttamente",
"failure": "Errore durante la creazione del workspace: {statusWS}",
"success": "Workspace {statusWS} creato correttamente",
"select": "Seleziona il workspace di destinazione",
"new": "Nome del workspace..."
},
Expand Down

0 comments on commit 99c274d

Please sign in to comment.