Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
AURA
dashboard
Commits
b5a64b84
Commit
b5a64b84
authored
7 years ago
by
jackie / Andrea Ida Malkah Klaura
Browse files
Options
Downloads
Patches
Plain Diff
added save function to show modals - still debugging
parent
a2983a53
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/ShowManager.vue
+8
-6
8 additions, 6 deletions
src/components/ShowManager.vue
src/components/ShowManagerModalShow.vue
+61
-8
61 additions, 8 deletions
src/components/ShowManagerModalShow.vue
with
69 additions
and
14 deletions
src/components/ShowManager.vue
+
8
−
6
View file @
b5a64b84
...
...
@@ -13,20 +13,22 @@
<template
slot=
"header"
>
<span
v-if=
"loaded.shows"
>
{{
shows
[
currentShow
].
name
}}
<img
src=
"../assets/16x16/emblem-system.png"
alt=
"edit name of show"
v-on:click=
"$refs.appModalShow.
$refs.modalS
howName
.show
()"
/>
<img
src=
"../assets/16x16/emblem-system.png"
alt=
"edit name of show"
v-on:click=
"$refs.appModalShow.
s
howName()"
/>
</span>
<span
v-else
>
Shows are being loaded
</span>
</
template
>
<
template
slot=
"lead"
>
<span
v-if=
"loaded.shows"
>
{{
shows
[
currentShow
].
short_description
}}
</span>
<img
src=
"../assets/16x16/emblem-system.png"
alt=
"edit short description"
v-on:click=
"$refs.appModalShow.
$refs.modalS
howShortDescription
.show
()"
/>
<img
src=
"../assets/16x16/emblem-system.png"
alt=
"edit short description"
v-on:click=
"$refs.appModalShow.
s
howShortDescription()"
/>
</
template
>
<p
v-if=
"loaded.shows"
>
<b>
Description:
</b>
<img
src=
"../assets/16x16/emblem-system.png"
alt=
"edit description"
v-on:click=
"$refs.appModalShow.
$refs.modalS
howDescription
.show
()"
/>
<b>
Description:
</b>
<img
src=
"../assets/16x16/emblem-system.png"
alt=
"edit description"
v-on:click=
"$refs.appModalShow.
s
howDescription()"
/>
<div
v-if=
"loaded.shows"
>
<!-- TODO: see if we can make a nice but secure html rendering of the description -->
<!--{{ shows[currentShow].description.replace(/<[^>]*>/g, '') }}-->
{{ shows[currentShow].description }}
<!-- TODO: see if we can make a nice but secure html rendering of the description
This should be already secure, as long as you do not write directly to the DOM.
Only if you do this and render HTML, take care to have it save (no script tags etc.).
This current regex replace is only to have it looking nicely, in case there are html tags. -->
{{ shows[currentShow].description.replace(/
<
[^
>
]*>/g, '') }}
<!-- TODO: add image and logo here? -->
</div>
</p>
...
...
This diff is collapsed.
Click to expand it.
src/components/ShowManagerModalShow.vue
+
61
−
8
View file @
b5a64b84
<
template
>
<div>
<b-modal
ref=
"modalShowName"
title=
"Name of the show"
size=
"lg"
>
<b-form-input
v-model=
"s
how.name
"
type=
"text"
placeholder=
"Enter name of the show"
></b-form-input>
<b-modal
ref=
"modalShowName"
title=
"Name of the show"
size=
"lg"
@
ok=
"saveName"
>
<b-form-input
v-model=
"s
tring
"
type=
"text"
placeholder=
"Enter name of the show"
></b-form-input>
</b-modal>
<b-modal
ref=
"modalShowShortDescription"
title=
"Short description"
size=
"lg"
>
<b-form-textarea
v-model=
"s
how.short_description
"
:rows=
"2"
placeholder=
"Enter a short description"
></b-form-textarea>
<b-form-textarea
v-model=
"s
tring
"
:rows=
"2"
placeholder=
"Enter a short description"
></b-form-textarea>
</b-modal>
<b-modal
ref=
"modalShowDescription"
title=
"Full description"
size=
"lg"
>
<b-form-textarea
v-model=
"s
how.description
"
:rows=
"2"
placeholder=
"Enter the full description of this show"
></b-form-textarea>
<b-form-textarea
v-model=
"s
tring
"
:rows=
"2"
placeholder=
"Enter the full description of this show"
></b-form-textarea>
</b-modal>
</div>
</
template
>
<
script
>
// import axios from 'axios'
import
axios
from
'
axios
'
function
debugErrorResponse
(
data
)
{
console
.
log
(
'
Response date provided to transformResponse:
'
)
console
.
log
(
data
)
return
data
}
export
default
{
props
:
{
...
...
@@ -24,11 +30,58 @@ export default {
},
data
()
{
return
{
string
:
''
,
backupstring
:
''
,
id
:
0
,
backupid
:
0
,
array
:
[],
backuparray
:
[]
}
},
methods
:
{
save
:
function
()
{
save
()
{
var
retval
=
false
console
.
log
(
'
trying to save show
'
)
console
.
log
(
process
.
env
.
API_STEERING_SHOWS
+
this
.
show
.
id
+
'
/
'
)
console
.
log
(
this
.
show
)
axios
.
put
(
process
.
env
.
API_STEERING_SHOWS
+
this
.
show
.
id
+
'
/
'
,
this
.
show
,
{
withCredentials
:
true
,
transformResponse
:
[
debugErrorResponse
]
}).
then
(
response
=>
{
console
.
log
(
'
Response:
'
)
console
.
log
(
response
)
retval
=
true
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
// alert('There was an error fetching shows from the server: ' + error)
retval
=
false
})
return
retval
},
saveName
(
event
)
{
event
.
preventDefault
()
this
.
backupstring
=
this
.
show
.
name
this
.
show
.
name
=
this
.
string
var
retval
=
this
.
save
()
if
(
retval
===
false
)
{
this
.
show
.
name
=
this
.
backupstring
alert
(
'
Error: could not save the new show information
'
)
}
else
{
this
.
$refs
.
modalShowName
.
hide
()
}
},
showName
()
{
this
.
string
=
this
.
show
.
name
this
.
$refs
.
modalShowName
.
show
()
},
showShortDescription
()
{
this
.
string
=
this
.
show
.
short_description
this
.
$refs
.
modalShowShortDescription
.
show
()
},
showDescription
()
{
this
.
string
=
this
.
show
.
description
this
.
$refs
.
modalShowDescription
.
show
()
}
}
}
...
...
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