Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Website
Commits
507fb86f
Commit
507fb86f
authored
Nov 01, 2018
by
Viacheslav Pavlov
Committed by
Pavlov Viacheslav
Nov 01, 2018
Browse files
fixed SSR
removed unnecessary api call from needs
parent
260ebb08
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/kpi/reducers/admin.ts
View file @
507fb86f
...
...
@@ -66,7 +66,9 @@ export default function admin(state = INITIAL_STATE, action: IReducerAction) {
[
receivedIndex
]:
{
$set
:
execution
},
},
},
details
:
{
$set
:
execution
},
details
:
{
execution
:
{
$set
:
execution
},
},
},
});
}
else
{
...
...
@@ -75,7 +77,9 @@ export default function admin(state = INITIAL_STATE, action: IReducerAction) {
page
:
{
content
:
{
$push
:
[
execution
]},
},
details
:
{
$set
:
execution
},
details
:
{
execution
:
{
$set
:
execution
},
},
},
});
}
...
...
src/kpi/ui/admin/Dashboard.tsx
View file @
507fb86f
...
...
@@ -41,6 +41,9 @@ interface IDashboardProps extends React.ClassAttributes<any> {
class
Dashboard
extends
React
.
Component
<
IDashboardProps
,
any
>
{
protected
static
needs
=
[
({})
=>
listExecutions
({}),
({})
=>
listParameters
({}),
({})
=>
listDimensions
({}),
];
public
componentWillMount
()
{
...
...
@@ -76,15 +79,15 @@ class Dashboard extends React.Component<IDashboardProps, any> {
{
stillLoading
&&
<
Loading
/>
}
<
h5
>
{
t
(
`kpi.admin.p.dashboard.KPIExecutions`
)
}
</
h5
>
{
execs
&&
execs
.
content
.
map
((
exec
,
i
)
=>
(
{
execs
&&
execs
.
content
&&
execs
.
content
.
map
((
exec
,
i
)
=>
(
<
ExecutionCard
key
=
{
exec
.
id
}
index
=
{
i
}
execution
=
{
exec
}
compact
style
=
{
{
marginBottom
:
'
8px
'
}
}
/>
))
}
<
h5
>
{
t
(
`kpi.admin.p.dashboard.KPIParameters`
)
}
</
h5
>
{
params
&&
params
.
content
.
map
((
param
,
i
)
=>
(
{
params
&&
params
.
content
&&
params
.
content
.
map
((
param
,
i
)
=>
(
<
ParameterCard
key
=
{
param
.
id
}
parameter
=
{
param
}
index
=
{
i
}
style
=
{
{
marginBottom
:
'
8px
'
}
}
/>
))
}
<
h5
>
{
t
(
`kpi.admin.p.dashboard.KPIDimensions`
)
}
</
h5
>
{
dims
&&
dims
.
content
.
map
((
dim
,
i
)
=>
(
{
dims
&&
dims
.
content
&&
dims
.
content
.
map
((
dim
,
i
)
=>
(
<
DimensionCard
key
=
{
dim
.
id
}
dimension
=
{
dim
}
index
=
{
i
}
style
=
{
{
marginBottom
:
'
8px
'
}
}
/>
))
}
</
Grid
>
...
...
src/kpi/ui/admin/ExecutionDialog.tsx
View file @
507fb86f
...
...
@@ -54,6 +54,7 @@ class ExecutionDialog extends React.Component<IExecutionDialogProps, any> {
private
handleSubmit
=
(
execution
:
any
)
=>
{
const
{
saveExecution
}
=
this
.
props
;
execution
.
parameter
=
typeof
execution
.
parameter
===
'
string
'
?
JSON
.
parse
(
execution
.
parameter
)
:
execution
.
parameter
;
saveExecution
(
execution
);
this
.
setState
({
open
:
false
});
}
...
...
@@ -64,10 +65,10 @@ class ExecutionDialog extends React.Component<IExecutionDialogProps, any> {
<
span
>
<
Button
className
=
{
classes
.
createButton
}
onClick
=
{
this
.
show
}
variant
=
{
variant
}
>
{
buttonLabel
||
t
(
`kpi.admin.p.executionDialog.button`
)
}
</
Button
>
{
this
.
state
.
open
&&
<
Dialog
open
=
{
this
.
state
.
open
}
onClose
=
{
this
.
hide
}
maxWidth
=
"md"
fullWidth
disableEnforceFocus
>
<
Dialog
open
=
{
this
.
state
.
open
}
onClose
=
{
this
.
hide
}
maxWidth
=
"md"
fullWidth
>
<
DialogTitle
>
{
t
(
`kpi.admin.p.executionDialog.title`
)
}
</
DialogTitle
>
<
DialogContent
>
<
ExecutionForm
nameDisabled
=
{
execution
&&
execution
.
name
}
onCancel
=
{
this
.
hide
}
onSubmit
=
{
this
.
handleSubmit
}
initialValues
=
{
execution
}
/>
<
ExecutionForm
t
=
{
t
}
nameDisabled
=
{
execution
&&
execution
.
name
}
onCancel
=
{
this
.
hide
}
onSubmit
=
{
this
.
handleSubmit
}
initialValues
=
{
execution
}
/>
</
DialogContent
>
</
Dialog
>
}
...
...
@@ -84,4 +85,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
saveExecution
,
},
dispatch
);
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
withStyles
(
styles
)
<
any
>
(
translate
()
(
ExecutionDialog
)));
export
default
translate
()(
connect
(
mapStateToProps
,
mapDispatchToProps
)(
withStyles
(
styles
)(
ExecutionDialog
)));
src/kpi/ui/admin/ExecutionDisplay.tsx
View file @
507fb86f
...
...
@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import
{
bindActionCreators
}
from
'
redux
'
;
import
{
translate
}
from
'
react-i18next
'
;
// Actions
import
{
deleteExecution
,
executeExecution
,
getExecution
}
from
'
kpi/actions/admin
'
;
import
{
deleteExecution
,
executeExecution
,
getExecution
,
listDimensions
,
listParameters
}
from
'
kpi/actions/admin
'
;
// Models
import
ExecutionDetails
from
'
model/kpi/ExecutionDetails
'
;
import
ExecutionRun
from
'
model/kpi/ExecutionRun
'
;
...
...
@@ -37,6 +37,8 @@ class ExecutionDisplay extends React.Component<IExecutionProps, any> {
protected
static
needs
=
[
({
params
:
{
shortName
}
})
=>
getExecution
(
shortName
),
({})
=>
listParameters
({}),
({})
=>
listDimensions
({}),
];
public
state
=
{
...
...
src/kpi/ui/admin/c/dimensionForm/DimensionTypeSelector.tsx
View file @
507fb86f
...
...
@@ -5,7 +5,7 @@ import BooleanDimension from 'model/kpi/BooleanDimension';
import
JpaDimension
from
'
model/kpi/JpaDimension
'
;
import
NumericListDimension
from
'
model/kpi/NumericListDimension
'
;
import
StringListDimension
from
'
model/kpi/StringListDimension
'
;
import
Select
from
'
@material-ui/core/
es/
Select
'
;
import
Select
from
'
@material-ui/core/Select
'
;
import
MenuItem
from
'
@material-ui/core/MenuItem
'
;
import
FormControl
from
'
ui/common/forms/FormControl
'
;
import
{
NumericListDimensionFormExtra
}
from
'
./NumericListDimensionFormExtra
'
;
...
...
src/kpi/ui/admin/c/executionForm/DimensionListField.tsx
View file @
507fb86f
...
...
@@ -6,7 +6,7 @@ import {Field} from 'redux-form';
import
{
listDimensions
}
from
'
kpi/actions/admin
'
;
import
Dimension
from
'
model/kpi/Dimension
'
;
import
Select
from
'
@material-ui/core/
es/
Select
'
;
import
Select
from
'
@material-ui/core/Select
'
;
import
MenuItem
from
'
@material-ui/core/MenuItem
'
;
import
FormControl
from
'
ui/common/forms/FormControl
'
;
import
Grid
from
'
@material-ui/core/Grid
'
;
...
...
src/kpi/ui/admin/c/executionForm/ParameterSelector.tsx
View file @
507fb86f
...
...
@@ -4,7 +4,7 @@ import { connect } from 'react-redux';
import
{
bindActionCreators
}
from
'
redux
'
;
import
{
withStyles
}
from
'
@material-ui/core/styles
'
;
import
Select
from
'
@material-ui/core/
es/
Select
'
;
import
Select
from
'
@material-ui/core/Select
'
;
import
MenuItem
from
'
@material-ui/core/MenuItem
'
;
import
FormControl
from
'
ui/common/forms/FormControl
'
;
import
{
listParameters
}
from
'
kpi/actions/admin
'
;
...
...
@@ -73,4 +73,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
},
dispatch
);
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
translate
()
(
withStyles
(
styles
)(
ParameterSelector
)));
export
default
translate
()(
connect
(
mapStateToProps
,
mapDispatchToProps
)((
withStyles
(
styles
)(
ParameterSelector
)))
)
;
src/kpi/ui/admin/c/executionForm/index.tsx
View file @
507fb86f
import
*
as
React
from
'
react
'
;
import
{
translate
}
from
'
react-i18next
'
;
import
{
Field
,
reduxForm
}
from
'
redux-form
'
;
import
{
TextField
}
from
'
ui/common/text-field
'
;
// constants
...
...
@@ -60,7 +59,7 @@ class ExecutionForm extends React.Component<any, void> {
}
}
export
default
translate
()(
reduxForm
({
export
default
reduxForm
({
form
:
EXEC_FORM
,
enableReinitialize
:
true
,
})(
ExecutionForm
)
)
;
})(
ExecutionForm
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment