Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
dashboard
Commits
cff9ef36
Commit
cff9ef36
authored
May 01, 2020
by
jackie / Andrea Ida Malkah Klaura
Browse files
make ShowJumbotron.vue use updateProperty store action
parent
fcb0f2cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/components/ShowJumbotron.vue
View file @
cff9ef36
...
...
@@ -180,56 +180,44 @@ export default {
this
.
$refs
.
modalDeactivate
.
show
()
},
saveName
(
event
)
{
let
modal
=
this
.
$refs
.
modalName
if
(
this
.
string
!==
this
.
selectedShow
.
name
)
{
saveProperty
(
property
,
value
,
modal
,
event
)
{
if
(
this
.
string
!==
this
.
selectedShow
.
email
)
{
event
.
preventDefault
()
this
.
$store
.
dispatch
(
'
shows/update
Name
'
,
{
this
.
$store
.
dispatch
(
'
shows/update
Property
'
,
{
id
:
this
.
selectedShow
.
id
,
text
:
this
.
string
,
callback
:
()
=>
{
modal
.
hide
()
}
property
:
property
,
value
:
value
,
callback
:
()
=>
{
if
(
modal
)
{
modal
.
hide
()
}
}
})
}
},
saveName
(
event
)
{
if
(
this
.
string
!==
this
.
selectedShow
.
name
)
{
this
.
saveProperty
(
'
name
'
,
this
.
string
,
this
.
$refs
.
modalName
,
event
)
}
},
saveShortDescription
(
event
)
{
let
modal
=
this
.
$refs
.
modalShortDescription
if
(
this
.
string
!==
this
.
selectedShow
.
short_description
)
{
event
.
preventDefault
()
this
.
$store
.
dispatch
(
'
shows/updateShortDescription
'
,
{
id
:
this
.
selectedShow
.
id
,
text
:
this
.
string
,
callback
:
()
=>
{
modal
.
hide
()
}
})
this
.
saveProperty
(
'
short_description
'
,
this
.
string
,
this
.
$refs
.
modalShortDescription
,
event
)
}
},
saveDescription
(
event
)
{
let
modal
=
this
.
$refs
.
modalDescription
if
(
this
.
string
!==
this
.
selectedShow
.
description
)
{
event
.
preventDefault
()
this
.
$store
.
dispatch
(
'
shows/updateDescription
'
,
{
id
:
this
.
selectedShow
.
id
,
text
:
this
.
string
,
callback
:
()
=>
{
modal
.
hide
()
}
})
this
.
saveProperty
(
'
description
'
,
this
.
string
,
this
.
$refs
.
modalDescription
,
event
)
}
},
deactivateShow
(
event
)
{
let
modal
=
this
.
$refs
.
modalDeactivate
event
.
preventDefault
()
this
.
$store
.
dispatch
(
'
shows/deactivateShow
'
,
{
id
:
this
.
selectedShow
.
id
,
callback
:
()
=>
{
modal
.
hide
()
}
})
this
.
saveProperty
(
'
is_active
'
,
false
,
this
.
$refs
.
modalDeactivate
,
event
)
},
activateShow
(
show
)
{
this
.
$log
.
debug
(
show
)
this
.
$store
.
dispatch
(
'
shows/activateShow
'
,
{
id
:
this
.
selectedShow
.
id
,
})
activateShow
()
{
this
.
saveProperty
(
'
is_active
'
,
true
,
null
,
event
)
},
}
...
...
src/store/modules/shows.js
View file @
cff9ef36
...
...
@@ -204,82 +204,6 @@ const actions = {
})
},
updateName
(
ctx
,
data
)
{
let
show
=
cloneMinimalShowObject
(
ctx
.
getters
.
getShowByDataParam
(
data
))
show
.
name
=
data
.
text
ctx
.
dispatch
(
'
updateShow
'
,
{
id
:
data
.
id
,
show
:
show
,
callback
:
()
=>
{
ctx
.
commit
(
'
setName
'
,
{
id
:
data
.
id
,
text
:
data
.
text
})
if
(
typeof
(
data
.
callback
)
===
'
function
'
)
{
data
.
callback
()
}
}
})
},
updateShortDescription
(
ctx
,
data
)
{
let
show
=
cloneMinimalShowObject
(
ctx
.
getters
.
getShowByDataParam
(
data
))
show
.
short_description
=
data
.
text
ctx
.
dispatch
(
'
updateShow
'
,
{
id
:
data
.
id
,
show
:
show
,
callback
:
()
=>
{
ctx
.
commit
(
'
setShortDescription
'
,
{
id
:
data
.
id
,
text
:
data
.
text
})
}
})
},
updateDescription
(
ctx
,
data
)
{
let
show
=
cloneMinimalShowObject
(
ctx
.
getters
.
getShowByDataParam
(
data
))
show
.
description
=
data
.
text
ctx
.
dispatch
(
'
updateShow
'
,
{
id
:
data
.
id
,
show
:
show
,
callback
:
()
=>
{
ctx
.
commit
(
'
setDescription
'
,
{
id
:
data
.
id
,
text
:
data
.
text
})
}
})
},
activateShow
(
ctx
,
data
)
{
let
show
=
cloneMinimalShowObject
(
ctx
.
getters
.
getShowByDataParam
(
data
))
show
.
is_active
=
true
ctx
.
dispatch
(
'
updateShow
'
,
{
id
:
data
.
id
,
show
:
show
,
callback
:
()
=>
{
ctx
.
commit
(
'
setActive
'
,
{
id
:
data
.
id
,
active
:
true
})
}
})
},
deactivateShow
(
ctx
,
data
)
{
let
show
=
cloneMinimalShowObject
(
ctx
.
getters
.
getShowByDataParam
(
data
))
show
.
is_active
=
false
ctx
.
dispatch
(
'
updateShow
'
,
{
id
:
data
.
id
,
show
:
show
,
callback
:
()
=>
{
ctx
.
commit
(
'
setActive
'
,
{
id
:
data
.
id
,
active
:
false
})
}
})
},
updateProperty
(
ctx
,
data
)
{
let
show
=
cloneMinimalShowObject
(
ctx
.
getters
.
getShowByDataParam
(
data
))
show
[
data
.
property
]
=
data
.
value
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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