Commit c3ec4eba authored by Viacheslav Pavlov's avatar Viacheslav Pavlov

Added missing translations and small fixes

- fixed parameterSelector shrink
- added null handle for execution reducer
parent a8574a7c
......@@ -496,6 +496,13 @@
"type": "Type",
"values": "Values"
},
"execution": {
"type":{
"COUNT": "Count",
"AVERAGE": "Average",
"SUM": "Sum"
}
},
"executionCard": {
"dimensionField": "Field",
"dimensionLink": "Link",
......
......@@ -33,8 +33,8 @@ const INITIAL_STATE: {
},
} = {
exec: {
page: null,
details: null,
page: {},
details: new Execution(),
},
dim: {
page: null,
......@@ -56,8 +56,18 @@ export default function admin(state = INITIAL_STATE, action: IReducerAction) {
}
case ADMIN_RECEIVE_EXEC: {
const execution = action.payload;
const receivedIndex = state.exec.page ? state.exec.page.content.findIndex((item) => item.name === execution.name) : -1;
if (!state.exec.page || !state.exec.page.content) {
return update(state, {
exec: {
details: {
execution: { $set: execution },
},
},
});
}
const receivedIndex = state.exec.page.content.findIndex((item) => item.name === execution.name);
if (receivedIndex !== -1) {
return update(state, {
exec: {
......
......@@ -8,6 +8,13 @@
"type": "Type",
"values": "Values"
},
"execution": {
"type":{
"COUNT": "Count",
"AVERAGE": "Average",
"SUM": "Sum"
}
},
"executionCard": {
"dimensionField": "Field",
"dimensionLink": "Link",
......
......@@ -49,7 +49,7 @@ class Dashboard extends React.Component<IDashboardProps, any> {
public componentWillMount() {
const { execs, listExecutions, params, listParameters, dims, listDimensions } = this.props;
console.log(`cwm: `, execs, params, dims);
if (! execs) {
if (! execs || !execs.content) {
console.log(`Listing executions`);
listExecutions({});
}
......
......@@ -41,7 +41,7 @@ class ParameterSelector extends React.Component<any> {
return (
<div>
<FormControl fullWidth label={ label } meta={ meta } shrink={ selectValue !== '' }>
<FormControl fullWidth label={ label } meta={ meta } shrink>
<Select
value={ selectValue }
displayEmpty
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment