Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
netvs-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scc-net
netvs
netvs-core
Commits
26d27dca
Commit
26d27dca
authored
1 year ago
by
Alexander Kaschta
Browse files
Options
Downloads
Patches
Plain Diff
FIX: Copy transaction list on error to keep the error message static
Should fix
#454
parent
ac5ba1c1
No related branches found
No related tags found
No related merge requests found
Pipeline
#274699
passed with warnings
1 year ago
Stage: build
Stage: lint
Stage: deploy
Stage: e2e
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/src/components/TransactionList.vue
+1
-1
1 addition, 1 deletion
frontend/src/components/TransactionList.vue
frontend/src/util/apiutil.js
+3
-2
3 additions, 2 deletions
frontend/src/util/apiutil.js
frontend/src/vuex.js
+19
-0
19 additions, 0 deletions
frontend/src/vuex.js
with
23 additions
and
3 deletions
frontend/src/components/TransactionList.vue
+
1
−
1
View file @
26d27dca
...
...
@@ -381,7 +381,7 @@ export default {
return
res
},
api_ta
()
{
return
APIUtils
.
buildAPITaFromTaObjectArray
(
this
.
$store
.
state
)
return
APIUtils
.
buildAPITaFromTaObjectArray
(
this
.
$store
.
state
,
true
)
},
config_snippet_text
()
{
return
`[DEFAULT]
...
...
This diff is collapsed.
Click to expand it.
frontend/src/util/apiutil.js
+
3
−
2
View file @
26d27dca
...
...
@@ -56,9 +56,10 @@ export default {
}
return
res
},
buildAPITaFromTaObjectArray
(
state
)
{
buildAPITaFromTaObjectArray
(
state
,
use_copy_with_errors
=
false
)
{
const
res
=
[]
const
obj
=
state
.
ta_list
// Use the ta_list copy with errors only when specified by the parameter
const
obj
=
(
use_copy_with_errors
)
?
state
.
ta_list_errors
:
state
.
ta_list
for
(
let
i
=
0
;
i
<
obj
.
length
;
i
++
)
{
const
ta
=
obj
[
i
].
content
if
(
obj
[
i
].
ta_type
===
'
db_editor_simple
'
)
{
...
...
This diff is collapsed.
Click to expand it.
frontend/src/vuex.js
+
19
−
0
View file @
26d27dca
...
...
@@ -23,6 +23,7 @@ const NetvsVuex = new Vuex.Store({
undone
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'
undone
'
))
||
[],
undo_redo_new_mutaion
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'
undo_redo_new_mutation
'
))
||
true
,
transaction_result
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'
transaction_result
'
))
||
null
,
ta_list_errors
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'
ta_list_errors
'
))
||
[],
executing_transaction
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'
executing_transaction
'
))
||
false
,
show_sidebar_left
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'
show_sidebar_left
'
))
||
true
,
show_sidebar_right
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'
show_sidebar_right
'
))
||
false
,
...
...
@@ -138,6 +139,7 @@ const NetvsVuex = new Vuex.Store({
state
.
undone
=
[]
state
.
done
=
[]
state
.
transaction_result
=
null
state
.
ta_list_errors
=
[]
state
.
executing_transaction
=
false
state
.
show_sidebar_right
=
false
state
.
macfinder_jobs
=
[]
...
...
@@ -146,6 +148,7 @@ const NetvsVuex = new Vuex.Store({
window
.
localStorage
.
removeItem
(
'
undone
'
)
window
.
localStorage
.
removeItem
(
'
undo_redo_new_mutation
'
)
window
.
localStorage
.
removeItem
(
'
transaction_result
'
)
window
.
localStorage
.
removeItem
(
'
ta_list_errors
'
)
window
.
localStorage
.
removeItem
(
'
executing_transaction
'
)
window
.
localStorage
.
removeItem
(
'
show_sidebar_right
'
)
window
.
localStorage
.
removeItem
(
'
db_editor_cache
'
)
...
...
@@ -189,7 +192,9 @@ const NetvsVuex = new Vuex.Store({
},
emptyTransactionList
(
state
)
{
state
.
ta_list
=
[]
state
.
ta_list_errors
=
[]
window
.
localStorage
.
setItem
(
'
ta_list
'
,
JSON
.
stringify
(
state
.
ta_list
))
window
.
localStorage
.
setItem
(
'
ta_list_errors
'
,
JSON
.
stringify
(
state
.
ta_list_errors
))
},
setNavigationRefreshHandle
(
state
,
payload
)
{
state
.
refreshHandleObjType
=
payload
.
objType
...
...
@@ -199,6 +204,13 @@ const NetvsVuex = new Vuex.Store({
state
.
transaction_result
=
result
window
.
localStorage
.
setItem
(
'
transaction_result
'
,
JSON
.
stringify
(
state
.
transaction_result
))
},
copyTransactionsWithErrors
(
state
,
payload
)
{
if
(
state
.
ta_list_errors
==
null
)
{
state
.
ta_list_errors
=
[]
}
state
.
ta_list_errors
=
payload
window
.
localStorage
.
setItem
(
'
ta_list_errors
'
,
JSON
.
stringify
(
state
.
ta_list_errors
))
},
showSidebarLeft
(
state
,
show
)
{
state
.
show_sidebar_left
=
show
window
.
localStorage
.
setItem
(
'
show_sidebar_left
'
,
show
)
...
...
@@ -214,6 +226,8 @@ const NetvsVuex = new Vuex.Store({
removeTransactionResult
(
state
)
{
state
.
transaction_result
=
null
window
.
localStorage
.
removeItem
(
'
transaction_result
'
)
state
.
ta_list_errors
=
[]
window
.
localStorage
.
removeItem
(
'
ta_list_errors
'
)
},
reloadRouterComp
(
state
)
{
state
.
reload_count
++
...
...
@@ -253,6 +267,8 @@ const NetvsVuex = new Vuex.Store({
}
catch
(
e
)
{
window
.
console
.
error
(
e
)
const
pos
=
state
.
ta_list
[
APIUtil
.
getAPIErrorIndexFromDBException
(
e
.
response
.
data
.
exception
)]
// Create a copy of the ta_list in ta_list_errors
commit
(
'
copyTransactionsWithErrors
'
,
JSON
.
parse
(
JSON
.
stringify
(
state
.
ta_list
)))
state
.
transaction_result
=
{
type
:
'
error
'
,
error
:
(
typeof
e
.
response
.
data
===
'
object
'
&&
'
exception
'
in
e
.
response
.
data
)
?
e
.
response
.
data
.
exception
:
e
.
response
.
data
,
...
...
@@ -286,6 +302,8 @@ const NetvsVuex = new Vuex.Store({
}
catch
(
e
)
{
window
.
console
.
debug
(
e
.
response
)
const
pos
=
state
.
ta_list
[
APIUtil
.
getAPIErrorIndexFromDBException
(
e
.
response
.
data
.
exception
)]
// Create a copy of the ta_list in ta_list_errors
commit
(
'
copyTransactionsWithErrors
'
,
JSON
.
parse
(
JSON
.
stringify
(
state
.
ta_list
)))
commit
(
'
setTransactionResult
'
,
{
type
:
'
error
'
,
error
:
(
typeof
e
.
response
.
data
===
'
object
'
&&
'
exception
'
in
e
.
response
.
data
)
?
e
.
response
.
data
.
exception
:
e
.
response
.
data
,
...
...
@@ -315,6 +333,7 @@ const NetvsVuex = new Vuex.Store({
'
removeTransactionElement
'
,
'
emptyTransactionList
'
,
'
removeTransactionResult
'
,
'
copyTransactionsWithErrors
'
,
'
setTransactionBusy
'
,
'
moveTaElements
'
,
'
replaceTransactionList
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment