Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed #1138 : style names encoded #1139

Merged
merged 2 commits into from
Oct 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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