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
Soluris
Madis Cyber
Commits
40d6e4bd
Commit
40d6e4bd
authored
Sep 12, 2022
by
Jonathan Foucher
Browse files
update graph automatically when changing action data.
parent
51cf81e9
Pipeline
#31867
failed with stages
in 10 minutes and 49 seconds
Changes
4
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Kernel.php
View file @
40d6e4bd
...
...
@@ -40,7 +40,8 @@ class Kernel extends HttpKernel
'api'
=>
[
\
Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful
::
class
,
'throttle:api'
,
// 'throttle:api',
'throttle:6000,1'
,
\
Illuminate\Routing\Middleware\SubstituteBindings
::
class
,
],
];
...
...
resources/js/components/Evaluations/Single/Components/Step4/MeasureActionForm.vue
View file @
40d6e4bd
...
...
@@ -83,7 +83,7 @@ export default {
evaluation
.
measure_levels
=
this
.
evaluation
.
measure_levels
.
map
(
m
=>
m
.
measure_id
===
this
.
measure
.
id
?
({...
m
,
expected_level
:
parseInt
(
newValue
,
10
)
})
:
m
)
console
.
log
(
'
evaluation.measure_levels
'
,
evaluation
.
measure_levels
)
this
.
$store
.
dispatch
(
'
saveDraftEvaluation
'
,
evaluation
).
then
(()
=>
{
this
.
$store
.
dispatch
(
'
saveDraftEvaluation
'
,
{...
evaluation
,
toast
:
false
}
).
then
(()
=>
{
this
.
$store
.
dispatch
(
'
getGraphForEvaluation
'
,
{
name
:
'
risks
'
,
id
:
evaluation
.
id
})
this
.
$store
.
dispatch
(
'
getGraphForEvaluation
'
,
{
name
:
'
futurerisks
'
,
id
:
evaluation
.
id
})
this
.
$store
.
commit
(
'
updateEvaluation
'
,
evaluation
)
...
...
@@ -104,6 +104,11 @@ export default {
}
evaluation
.
measure_levels
=
this
.
evaluation
.
measure_levels
.
map
(
m
=>
m
.
measure_id
===
this
.
measure
.
id
?
({...
m
,
end_date
:
moment
(
newValue
.
startDate
).
format
(
'
YYYY-MM-DD
'
),
expected_level
:
parseInt
(
this
.
expected_level
,
10
)
})
:
m
)
this
.
$store
.
commit
(
'
updateEvaluation
'
,
evaluation
)
this
.
$store
.
dispatch
(
'
saveDraftEvaluation
'
,
{...
evaluation
,
toast
:
false
}).
then
(()
=>
{
this
.
$store
.
dispatch
(
'
getGraphForEvaluation
'
,
{
name
:
'
risks
'
,
id
:
evaluation
.
id
})
this
.
$store
.
dispatch
(
'
getGraphForEvaluation
'
,
{
name
:
'
futurerisks
'
,
id
:
evaluation
.
id
})
this
.
$store
.
commit
(
'
updateEvaluation
'
,
evaluation
)
})
}
},
manager
:
{
...
...
@@ -117,6 +122,11 @@ export default {
}
evaluation
.
measure_levels
=
this
.
evaluation
.
measure_levels
.
map
(
m
=>
m
.
measure_id
===
this
.
measure
.
id
?
({...
m
,
manager
:
newValue
,
expected_level
:
parseInt
(
this
.
expected_level
,
10
)
})
:
m
)
this
.
$store
.
commit
(
'
updateEvaluation
'
,
evaluation
)
this
.
$store
.
dispatch
(
'
saveDraftEvaluation
'
,
{...
evaluation
,
toast
:
false
}).
then
(()
=>
{
this
.
$store
.
dispatch
(
'
getGraphForEvaluation
'
,
{
name
:
'
risks
'
,
id
:
evaluation
.
id
})
this
.
$store
.
dispatch
(
'
getGraphForEvaluation
'
,
{
name
:
'
futurerisks
'
,
id
:
evaluation
.
id
})
this
.
$store
.
commit
(
'
updateEvaluation
'
,
evaluation
)
})
}
},
},
...
...
resources/js/components/Evaluations/Single/Components/Step4/PlanAction.vue
View file @
40d6e4bd
...
...
@@ -63,6 +63,7 @@ export default {
computed
:
{
measures
()
{
if
(
!
this
.
bestMeasures
||
!
this
.
$store
.
state
.
measures
.
all
)
{
this
.
$store
.
dispatch
(
'
getBestMeasures
'
,
{
id
:
this
.
evaluation
.
id
})
return
[]
}
return
this
.
$store
.
state
.
measures
.
all
...
...
@@ -107,6 +108,7 @@ export default {
},
},
mounted
()
{
console
.
log
(
'
plan action mounted
'
)
this
.
$store
.
dispatch
(
'
getBestMeasures
'
,
{
id
:
this
.
evaluation
.
id
})
}
}
...
...
resources/js/stores/evaluations.js
View file @
40d6e4bd
...
...
@@ -45,10 +45,12 @@ export default {
return
req
},
updateEvaluation
({
commit
},
item
)
{
const
toast
=
item
.
toast
delete
item
.
toast
const
req
=
item
.
id
?
axios
.
put
(
`/api/evaluations/
${
item
.
id
}
`
,
item
)
:
axios
.
post
(
'
/api/evaluations
'
,
item
)
req
.
then
(
res
=>
{
commit
(
'
updateEvaluation
'
,
res
.
data
)
item
.
id
&&
toaster
(
this
.
_vm
,
'
Mise à jour effectuée
'
,
'
bg-success
'
,
'
check
'
)
item
.
id
&&
toast
&&
toaster
(
this
.
_vm
,
'
Mise à jour effectuée
'
,
'
bg-success
'
,
'
check
'
)
}).
catch
(
err
=>
{
console
.
log
(
'
could not update evaluation
'
,
err
)
commit
(
'
setErrors
'
,
{
errors
:
err
.
response
.
data
,
status
:
err
.
response
.
status
})
...
...
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