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 #1096 : updated translations and added some tooltips #1110

Merged
merged 1 commit into from
Oct 10, 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
33 changes: 23 additions & 10 deletions web/client/components/manager/importer/Import.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Spinner = require('react-spinkit');
const Message = require('../../I18N/Message');
const TaskProgress = require('./TaskProgress');
const ImporterUtils = require('../../../utils/ImporterUtils');
const {Grid, Row, Panel, Label, Table, Button, Glyphicon} = require('react-bootstrap');
const {Grid, Row, Panel, Label, Table, Button, Glyphicon, OverlayTrigger, Tooltip} = require('react-bootstrap');
require("./style/importer.css");

const Task = React.createClass({
Expand All @@ -23,13 +23,20 @@ const Task = React.createClass({
runImport: React.PropTypes.func,
updateProgress: React.PropTypes.func,
deleteImport: React.PropTypes.func,
deleteTask: React.PropTypes.func
deleteTask: React.PropTypes.func,
deleteAction: React.PropTypes.node,
editAction: React.PropTypes.node,
placement: React.PropTypes.string
},
contextTypes: {
router: React.PropTypes.object
router: React.PropTypes.object,
messages: React.PropTypes.object
},
getDefaultProps() {
return {
placement: "bottom",
deleteAction: <Message msgId="importer.task.delete"/>,
editAction: <Message msgId="importer.task.edit"/>,
timeout: 10000,
"import": {},
loadTask: () => {},
Expand Down Expand Up @@ -72,18 +79,24 @@ const Task = React.createClass({
}
},
renderTask(task) {

let tooltipDelete = <Tooltip id="import-delete-action">{this.props.deleteAction}</Tooltip>;
let tooltipEdit = <Tooltip id="import-edit-action">{this.props.editAction}</Tooltip>;
return (<tr key={task && task.id}>
<td><a onClick={(e) => {e.preventDefault(); this.props.loadTask(task.id); }} >{task.id}</a></td>
<td><Label bsStyle={this.getbsStyleForState(task.state)}>{task.state}</Label>{this.renderProgressTask(task)}{this.renderLoadingTask(task)}</td>
<td key="actions">
<Button className="importer-button" bsSize="xsmall" onClick={(e) => {e.preventDefault(); this.props.deleteTask(this.props.import.id, task.id); }}>
<Glyphicon glyph="remove-circle"/>
<Message msgId="importer.import.delete" />
</Button>
<OverlayTrigger overlay={tooltipDelete} placement={this.props.placement}>
<Button className="importer-button" bsSize="xsmall" onClick={(e) => {e.preventDefault(); this.props.deleteTask(this.props.import.id, task.id); }}>
<Glyphicon glyph="remove"/>
</Button>
</OverlayTrigger>
{task.state === "COMPLETE" ?
<Button className="importer-button" bsSize="xsmall" onClick={this.editDefaultStyle.bind(null, task.id)}>
<Glyphicon glyph="pencil"/>Edit Default Style</Button>
<OverlayTrigger overlay={tooltipEdit} placement={this.props.placement}>
<Button className="importer-button" bsSize="xsmall" onClick={this.editDefaultStyle.bind(null, task.id)}>
<Glyphicon glyph="pencil"/>
<Message msgId="importer.task.edit" />
</Button>
</OverlayTrigger>
: null}
</td>
</tr>);
Expand Down
31 changes: 21 additions & 10 deletions web/client/components/manager/importer/ImportsGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ const React = require('react');
const Spinner = require('react-spinkit');
const Message = require('../../I18N/Message');
const ImporterUtils = require('../../../utils/ImporterUtils');
const {Table, Glyphicon, Button, Label} = require('react-bootstrap');
const {Table, Glyphicon, Button, Label, OverlayTrigger, Tooltip} = require('react-bootstrap');

const ImportsGrid = React.createClass({
propTypes: {
loading: React.PropTypes.bool,
loadImport: React.PropTypes.func,
deleteImport: React.PropTypes.func,
imports: React.PropTypes.array
imports: React.PropTypes.array,
deleteAction: React.PropTypes.object,
placement: React.PropTypes.string
},
contextTypes: {
messages: React.PropTypes.object
},
getDefaultProps() {
return {

placement: "bottom",
deleteAction: <Message msgId="importer.import.deleteImport" />,
loadImport: () => {},
deleteImport: () => {},
imports: []
Expand All @@ -32,7 +38,7 @@ const ImportsGrid = React.createClass({
renderLoadingMessage(importObj) {
switch (importObj.message) {
case "deleting":
return <Message msg="importer.import.deleting" />;
return <Message msgId="importer.import.deleting" />;
default:
return null;
}
Expand All @@ -44,10 +50,15 @@ const ImportsGrid = React.createClass({
return null;
},
renderImport(importObj) {
let tooltip = <Tooltip id="import-delete-action">{this.props.deleteAction}</Tooltip>;
return (<tr key={importObj && importObj.id}>
<td key="id"><a onClick={(e) => {e.preventDefault(); this.props.loadImport(importObj.id); }} >{importObj.id}</a></td>
<td key="state"><Label bsStyle={this.getbsStyleForState(importObj.state)}>{importObj.state}</Label>{this.renderLoadingImport(importObj)}</td>
<td key="actions"><Button bsSize="xsmall" onClick={(e) => {e.preventDefault(); this.props.deleteImport(importObj.id); }}><Glyphicon glyph="remove"/></Button></td>
<td key="actions">
<OverlayTrigger overlay={tooltip} placement={this.props.placement}>
<Button bsSize="xsmall" onClick={(e) => {e.preventDefault(); this.props.deleteImport(importObj.id); }}><Glyphicon glyph="remove"/></Button>
</OverlayTrigger>
</td>
</tr>);
},
render() {
Expand All @@ -57,11 +68,11 @@ const ImportsGrid = React.createClass({
return (
<Table striped bordered condensed hover>
<thead>
<tr>
<th>#</th>
<th>Status</th>
<th>Actions</th>
</tr>
<tr>
<th>#</th>
<th><Message msgId="importer.import.status" /></th>
<th><Message msgId="importer.import.actions" /></th>
</tr>
</thead>
<tbody>
{this.props.imports.map(this.renderImport)}
Expand Down
19 changes: 16 additions & 3 deletions web/client/components/manager/importer/TransformsGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
const React = require('react');
const Spinner = require('react-spinkit');
const Message = require('../../I18N/Message');
const {Panel, Table, Button, Glyphicon} = require('react-bootstrap');
const {Panel, Table, Button, Glyphicon, OverlayTrigger, Tooltip} = require('react-bootstrap');

const TransformsGrid = React.createClass({
propTypes: {
Expand All @@ -17,20 +17,33 @@ const TransformsGrid = React.createClass({
type: React.PropTypes.string,
loadTransform: React.PropTypes.func,
deleteTransform: React.PropTypes.func,
transforms: React.PropTypes.array
transforms: React.PropTypes.array,
deleteAction: React.PropTypes.object,
placement: React.PropTypes.string
},
contextTypes: {
messages: React.PropTypes.object
},
getDefaultProps() {
// TODO check translations
return {
placement: "bottom",
deleteAction: <Message msgId="importer.transform.delete" />,
transforms: [],
loadTransform: () => {},
deleteTransform: () => {}
};
},
renderTransform(transform, index) {
let tooltip = <Tooltip id="transform-delete-action">{this.props.deleteAction}</Tooltip>;
return (<tr key={index}>
<td key="id"><a onClick={(e) => {e.preventDefault(); this.props.loadTransform(index); }}>{index}</a></td>
<td key="type">{transform.type}</td>
<td key="actions"><Button bsSize="xsmall" onClick={(e) => {e.preventDefault(); this.props.deleteTransform(index); }}><Glyphicon glyph="remove"/></Button></td>
<td key="actions">
<OverlayTrigger overlay={tooltip} placement={this.props.placement}>
<Button bsSize="xsmall" onClick={(e) => {e.preventDefault(); this.props.deleteTransform(index); }}><Glyphicon glyph="remove"/></Button>
</OverlayTrigger>
</td>
</tr>);
},
render() {
Expand Down
12 changes: 9 additions & 3 deletions web/client/components/manager/importer/Workspace.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
const React = require('react');
const Select = require('react-select');
const {Input, Button, Alert} = require('react-bootstrap');
const Message = require('../../I18N/Message');
const LocaleUtils = require('../../../utils/LocaleUtils');

module.exports = React.createClass({
propTypes: {
enabled: React.PropTypes.bool,
Expand All @@ -20,6 +23,9 @@ module.exports = React.createClass({
datastoreTemplates: React.PropTypes.array,
createWorkspace: React.PropTypes.func
},
contextTypes: {
messages: React.PropTypes.object
},
getDefaultProps() {
return {
loadWorkspaces: () => {},
Expand All @@ -46,7 +52,7 @@ module.exports = React.createClass({
},
render() {
return (<div>
<strong>target workspace: </strong>
<strong><Message msgId="importer.workspace.target" /></strong>
{this.props.enabled ?
(<div>{this.props.selectedWorkSpace}</div>)
: (<Select
Expand All @@ -61,11 +67,11 @@ module.exports = React.createClass({
}))}
/>)}
<div className="form-inline" style={{marginTop: "10px", display: this.props.enabled ? "none" : "block"}}>
<strong>create a new workspace: </strong>
<strong><Message msgId="importer.workspace.create" /></strong>
<Input
onChange={this.validate}
ref="workspaceNewName"
placeholder="New workspace name..."
placeholder={LocaleUtils.getMessageById(this.context.messages, "importer.workspace.new")}
bsSize="small"
name="workspace-name"
key="workspace-name"
Expand Down
10 changes: 9 additions & 1 deletion web/client/translations/data.en-US
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,12 @@
"dropfile": "drop files here to create a new importing session",
"dropfileImport": "drop here files to add it to this session",
"process": "Session",
"number": "#",
"workspace": {
"create": "create a new workspace: ",
"target": "target workspace: ",
"new": "New workspace name..."
},
"import": {
"actions": "Actions",
"tasks": "Packages",
Expand Down Expand Up @@ -562,14 +568,16 @@
"transforms": "Trasformations Chain",
"update": "Update",
"run": "Import This Package",
"edit": "Edit Default Style",
"delete": "Delete This Package"
},
"transform": {
"panelTitle": "Transformation {id}",
"type": "Transformation Type",
"actions": "Actions",
"options": "Transformation Options",
"overviewlevels": "Overview Levels"
"overviewlevels": "Overview Levels",
"delete": "Delete this transformation"
}
},
"rasterstyler": {
Expand Down
20 changes: 14 additions & 6 deletions web/client/translations/data.fr-FR
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,19 @@
"dropfileImport": "drop here files to add it to this process"
},
"importer": {
"title": "Import Data",
"title": "Importer des données",
"imports": "Processus d'importation",
"importN": "Processus {id}",
"creatingImportProcess": "Création d'importation ...",
"dropfile": "faire glisser des fichiers ici pour créer un nouveau processus d'importation",
"dropfileImport": "faites glisser les fichiers ici pour ajouter à ce processus",
"process": "Processus",
"number": "#",
"workspace": {
"create": "créer un nouvel espace de travail: ",
"target": "cible espace de travail: ",
"new": "Nom..."
},
"import": {
"actions": "Actes",
"tasks": "paquet",
Expand All @@ -555,23 +561,25 @@
"status": "Statut",
"updateMode": "Mode refresh",
"originalData": "fichier original",
"file": "File Name",
"file": "Nom de fichier",
"format": "Format",
"targetStore": "target store",
"storeType": "Type de store",
"storeName": "Le nom du store",
"layer": "Layer",
"transforms": "Chaîne de transformations",
"update": "Update",
"run": "Import This Package",
"delete": "Delete This Package"
"update": "Mettre à jour",
"run": "Importez Ce forfait",
"edit": "Modifier le style par défaut",
"delete": "Supprimer Ce forfait"
},
"transform": {
"panelTitle": "Transformation {id}",
"type": "Type de transformation",
"actions": "Actes",
"options": "transformations des options",
"overviewlevels": "Vue d'ensemble des niveaux"
"overviewlevels": "Vue d'ensemble des niveaux",
"delete": "Supprimer cette transformation"
}
},
"rasterstyler": {
Expand Down
14 changes: 11 additions & 3 deletions web/client/translations/data.it-IT
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,12 @@
"dropfile": "trascina i file qui per creare un nuovo processo di importazione",
"dropfileImport": "trascina i file qui per aggiungerli a questo processo",
"process": "Processo",
"number": "#",
"workspace": {
"create": "Crea un nuovo workspace: ",
"target": "Workspace di destinazione: ",
"new": "Nome del workspace..."
},
"import": {
"actions": "Azioni",
"tasks": "Pacchetti",
Expand All @@ -544,7 +550,7 @@
"deleteTask": "Elimina",
"status": "Stato",
"archive": "Archivia",
"deleting": "Cancellazione in corso...",
"deleting": "Eliminazione in corso...",
"analyzing": "Analisi del package...",
"applyingPreset": "Applicazione dei preset..."
},
Expand All @@ -563,14 +569,16 @@
"transforms": "Catena di transformazioni",
"update": "Aggiorna",
"run": "Importa questo package",
"delete": "Cancella questo package"
"edit": "Modifica lo stile di default",
"delete": "Elimina questo package"
},
"transform": {
"panelTitle": "Trasformazione {id}",
"type": "Tipo di trasformazione",
"actions": "Azioni",
"options": "Opzioni trasformazioni",
"overviewlevels": "Livelli di overview"
"overviewlevels": "Livelli di overview",
"delete": "Elimina questa trasformazione"
}
},
"rasterstyler": {
Expand Down