Skip to content
Open
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
53 changes: 27 additions & 26 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,31 +388,31 @@
"error": "Error"
},
"tooltip": {
"times": "Times",
"started": "Started on",
"finished": "Finished on",
"notStarted": "Not started yet",
"notFinished": "Not finished yet",
"lines": {
"singular": "line",
"plural": "lines"
},
"added": {
"singular": "line added",
"plural": "lines added"
},
"modified": {
"singular": "line modified",
"plural": "lines modified"
},
"deleted": {
"singular": "line deleted",
"plural": "lines deleted"
},
"errors": {
"singular": "error",
"plural": "errors"
}
"times": "Times",
"started": "Started on",
"finished": "Finished on",
"notStarted": "Not started yet",
"notFinished": "Not finished yet",
"lines": {
"singular": "line",
"plural": "lines"
},
"added": {
"singular": "line added",
"plural": "lines added"
},
"modified": {
"singular": "line modified",
"plural": "lines modified"
},
"deleted": {
"singular": "line deleted",
"plural": "lines deleted"
},
"errors": {
"singular": "error",
"plural": "errors"
}
}
},
"datalayer": {
Expand All @@ -425,7 +425,7 @@
"data-source": "Data source",
"definition": "Definition",
"source-filter": {
"label":"Source filter",
"label": "Source filter",
"helper": "You can use an expression to filter the source data. ex: « name == \"john\" and age > 18 »",
"error": "Your input can't be parsed, please fix it.",
"error-invalid": "Your input is invalid, see error below.",
Expand Down Expand Up @@ -1020,6 +1020,7 @@
"json-editor": "JSON editor",
"label": "Label",
"type": "Type",
"graph-type": "Graph type",
"field": "Field",
"template": "Template",
"name": "Name",
Expand Down
47 changes: 24 additions & 23 deletions public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,31 +440,31 @@
"error": "Erreur"
},
"tooltip": {
"times": "Temps",
"started": "Commencé le",
"finished": "Finit le",
"times": "Temps",
"started": "Commencé le",
"finished": "Finit le",
"notStarted": "Pas encore commencé",
"notFinished": "Pas encore fini",
"lines": {
"singular": "ligne",
"plural": "lignes"
},
"added": {
"singular": "ligne ajoutée",
"plural": "lignes ajoutées"
},
"modified": {
"singular": "ligne modifiée",
"plural": "lignes modifiées"
},
"deleted": {
"singular": "ligne supprimée",
"plural": "lignes supprimées"
},
"errors": {
"singular": "erreur",
"plural": "erreurs"
}
"lines": {
"singular": "ligne",
"plural": "lignes"
},
"added": {
"singular": "ligne ajoutée",
"plural": "lignes ajoutées"
},
"modified": {
"singular": "ligne modifiée",
"plural": "lignes modifiées"
},
"deleted": {
"singular": "ligne supprimée",
"plural": "lignes supprimées"
},
"errors": {
"singular": "erreur",
"plural": "erreurs"
}
}
},
"datalayer": {
Expand Down Expand Up @@ -1074,6 +1074,7 @@
"json-editor": "Éditeur JSON",
"label": "Label",
"type": "Type",
"graph-type": "Type de graphique",
"field": "Champ",
"template": "Modèle",
"name": "Nom",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ const WidgetItemInput = ({ source }) => {
const {
input: { onChange: onChangeName },
} = useInput({ source: `${source}.name` });

const {
input: { value: typeValue },
} = useInput({ source: `${source}.type` });

return (
<div
style={{
Expand All @@ -32,6 +37,7 @@ const WidgetItemInput = ({ source }) => {
{ id: 'sum', name: 'Sum' },
{ id: 'avg', name: 'Average' },
{ id: 'value_count', name: 'Count' },
{ id: 'terms', name: 'Distribution' },
]}
translateChoice={false}
helperText={false}
Expand All @@ -41,12 +47,27 @@ const WidgetItemInput = ({ source }) => {
required
source={`${source}.field`}
/>
<TextInput
label="resources.datalayer.widgets-editor.template"
required
defaultValue="{{value}}"
source={`${source}.template`}
/>
{typeValue !== 'terms' ? (
<TextInput
label="resources.datalayer.widgets-editor.template"
required
defaultValue="{{value}}"
source={`${source}.template`}
/>
) : (
<SelectInput
required
source={`${source}.graph.type`}
label="resources.datalayer.widgets-editor.graph-type"
choices={[
{ id: 'bar', name: 'Bar' },
{ id: 'pie', name: 'Pie' },
]}
defaultValue="bar"
translateChoice={false}
helperText={false}
/>
)}
</div>
);
};
Expand Down