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
3d27674c
Commit
3d27674c
authored
Sep 27, 2019
by
jackie / Andrea Ida Malkah Klaura
Browse files
FIX
#22
implement activate & deactivate shows
parent
8457bee8
Changes
2
Show whitespace changes
Inline
Side-by-side
src/components/ShowManager.vue
View file @
3d27674c
...
...
@@ -83,7 +83,7 @@
<b-button
variant=
"danger"
size=
"sm"
@
click=
"$refs.appModalSuperuser.showModalDeactivateShow(shows[currentShow]
.id, shows[currentShow].name
)"
@
click=
"$refs.appModalSuperuser.showModalDeactivateShow(shows[currentShow])"
>
Deactivate show
</b-button>
...
...
@@ -97,7 +97,7 @@
<b-button
variant=
"success"
size=
"sm"
@
click=
"
notYetImplemented(
)"
@
click=
"
$refs.appModalSuperuser.activateShow(shows[currentShow]
)"
>
Activate!
</b-button>
...
...
src/components/ShowManagerModalSuperuser.vue
View file @
3d27674c
...
...
@@ -316,21 +316,41 @@ export default {
deactivateShow
(
event
)
{
// prevent the modal from closing automatically on click
event
.
preventDefault
()
let
uri
=
process
.
env
.
VUE_APP_API_STEERING_SHOWS
+
this
.
deactivatedShow
.
id
axios
.
delete
(
uri
,
{
let
updatedShow
=
this
.
getUpdateShowObject
()
updatedShow
.
is_active
=
false
let
uri
=
process
.
env
.
VUE_APP_API_STEERING_SHOWS
+
this
.
deactivatedShow
.
id
+
'
/
'
axios
.
put
(
uri
,
updatedShow
,
{
withCredentials
:
true
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
$parent
.
user
.
access_token
}
}).
then
(()
=>
{
this
.
show
.
is_active
=
false
this
.
$refs
.
modalDeactivateShow
.
hide
()
this
.
$parent
.
loadAndSwitch
(
null
)
}).
catch
(
error
=>
{
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not de
le
te show. See console for details.
'
)
alert
(
'
Error: could not de
activa
te show. See console for details.
'
)
// and we leave the modal open, so no call to its .hide function here
})
},
activateShow
(
show
)
{
this
.
show
=
show
let
updatedShow
=
this
.
getUpdateShowObject
()
updatedShow
.
is_active
=
true
let
uri
=
process
.
env
.
VUE_APP_API_STEERING_SHOWS
+
show
.
id
+
'
/
'
axios
.
put
(
uri
,
updatedShow
,
{
withCredentials
:
true
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
$parent
.
user
.
access_token
}
}).
then
(()
=>
{
this
.
show
.
is_active
=
true
this
.
$refs
.
modalDeactivateShow
.
hide
()
}).
catch
(
error
=>
{
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not activate show. See console for details.
'
)
})
},
// remove an owner from the list of show owners
deleteOwner
(
id
)
{
// we only have to find the item in our array and splice it out
...
...
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