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
a46a5aef
Commit
a46a5aef
authored
Sep 25, 2019
by
jackie / Andrea Ida Malkah Klaura
Browse files
FIX
#14
use vuejs logger instead of console.log
parent
308b4cd5
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/App.vue
View file @
a46a5aef
...
...
@@ -88,18 +88,18 @@ export default {
oidc
.
Log
.
logger
=
console
let
self
=
this
this
.
oidcmgr
.
events
.
addAccessTokenExpiring
(
function
()
{
console
.
lo
g
(
'
starting silent access_token renewal
'
)
this
.
$log
.
debu
g
(
'
starting silent access_token renewal
'
)
self
.
oidcmgr
.
signinSilent
().
then
(
function
(
user
)
{
self
.
user
.
access_token
=
user
.
access_token
console
.
lo
g
(
self
.
user
.
access_token
)
this
.
$log
.
debu
g
(
self
.
user
.
access_token
)
}).
catch
(
function
(
err
)
{
console
.
lo
g
(
err
)
this
.
$log
.
debu
g
(
err
)
alert
(
'
Your OpenID access token could not be renewed automatically.
\n
'
+
'
You will be logged out in
'
+
process
.
env
.
VUE_APP_API_STEERING_OIDC_EXPIRE_NOTIFICATION
+
'
seconds.
'
)
})
})
this
.
oidcmgr
.
events
.
addAccessTokenExpired
(
function
()
{
console
.
lo
g
(
'
expired!
'
)
this
.
$log
.
debu
g
(
'
expired!
'
)
self
.
signOut
()
})
this
.
getOIDCUser
()
...
...
@@ -107,16 +107,18 @@ export default {
methods
:
{
signIn
()
{
this
.
oidcmgr
.
signinRedirect
().
catch
(
function
(
err
)
{
console
.
log
(
err
)
alert
(
'
Error: something went wrong when signing in. See console for details.
'
)
this
.
$log
.
error
(
err
)
})
},
signOut
()
{
let
self
=
this
this
.
oidcmgr
.
signoutRedirect
().
then
(
function
(
resp
)
{
self
.
user
.
logged_in
=
false
console
.
lo
g
(
'
signed out
'
,
resp
)
this
.
$log
.
debu
g
(
'
signed out
'
,
resp
)
}).
catch
(
function
(
err
)
{
console
.
log
(
err
)
this
.
$log
.
error
(
err
)
alert
(
'
Error: something went wrong when logging out. See console for details.
'
)
})
},
getSteeringUser
()
{
...
...
@@ -139,7 +141,9 @@ export default {
}
}
}).
catch
(
error
=>
{
alert
(
'
There was an error fetching user data from the steering backend:
'
+
error
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not fetch user object from the steering backend. See console for details.
'
)
})
},
getOIDCUser
()
{
...
...
@@ -157,7 +161,8 @@ export default {
self
.
getSteeringUser
()
}
}).
catch
(
function
(
err
)
{
console
.
log
(
err
)
this
.
$log
.
error
(
err
)
alert
(
'
Error: could not fetch OIDC user object. See console for details.
'
)
})
},
setUserProperties
(
user
)
{
...
...
@@ -167,9 +172,9 @@ export default {
this
.
user
.
email
=
user
.
profile
.
email
this
.
user
.
access_token
=
user
.
access_token
// TODO: remove debug info after thorough testing
console
.
lo
g
(
new
Date
(
user
.
expires_at
*
1000
).
toString
())
console
.
lo
g
(
new
Date
(
user
.
expires_at
*
1000
).
toUTCString
())
console
.
lo
g
(
user
.
access_token
)
this
.
$log
.
debu
g
(
new
Date
(
user
.
expires_at
*
1000
).
toString
())
this
.
$log
.
debu
g
(
new
Date
(
user
.
expires_at
*
1000
).
toUTCString
())
this
.
$log
.
debu
g
(
user
.
access_token
)
}
}
}
...
...
src/components/Debug.vue
View file @
a46a5aef
...
...
@@ -29,16 +29,16 @@
import
axios
from
'
axios
'
function
debugErrorRequest
(
data
,
headers
)
{
console
.
lo
g
(
'
Request headers:
'
)
console
.
lo
g
(
headers
)
console
.
lo
g
(
'
Request data:
'
)
console
.
lo
g
(
data
)
this
.
$log
.
debu
g
(
'
Request headers:
'
)
this
.
$log
.
debu
g
(
headers
)
this
.
$log
.
debu
g
(
'
Request data:
'
)
this
.
$log
.
debu
g
(
data
)
return
data
}
function
debugErrorResponse
(
data
)
{
console
.
lo
g
(
'
Response data:
'
)
console
.
lo
g
(
data
)
this
.
$log
.
debu
g
(
'
Response data:
'
)
this
.
$log
.
debu
g
(
data
)
return
data
}
...
...
@@ -56,10 +56,10 @@ export default {
transformResponse
:
[
debugErrorResponse
]
}).
then
(
response
=>
{
this
.
response
=
response
console
.
lo
g
(
response
)
this
.
$log
.
debu
g
(
response
)
}).
catch
(
error
=>
{
console
.
log
(
error
)
alert
(
e
rror
)
this
.
$log
.
error
(
error
)
alert
(
'
E
rror
: see console for details
'
)
})
}
}
...
...
src/components/ShowManager.vue
View file @
a46a5aef
...
...
@@ -1011,8 +1011,9 @@ export default {
this
.
current
.
notes
=
[]
}
}).
catch
(
error
=>
{
console
.
log
(
error
)
alert
(
'
There was an error fetching timeslots from the server
\n
'
+
error
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not fetch timeslots. See console for details.
'
)
})
// done fetching timeslots
},
...
...
src/components/ShowManagerModalNotes.vue
View file @
a46a5aef
...
...
@@ -78,15 +78,6 @@ import prettyDate from '../mixins/prettyDate'
import
slugify
from
'
../mixins/slugify
'
import
axios
from
'
axios
'
/*
function debugErrorResponse (data) {
console.log('Response data provided to transformResponse:')
console.log(data)
// alert(data)
return data
}
*/
export
default
{
mixins
:
[
prettyDate
,
slugify
],
props
:
{
...
...
@@ -156,9 +147,9 @@ export default {
// everything was fine, we can close the modal now
this
.
$refs
.
modalNote
.
hide
()
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
There was an error while trying to update the note:
'
+
error
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not update the note. See console for details.
'
)
// as there was an error saving the show, we have to make sure
// to restore the initial values of the note object
this
.
note
.
title
=
this
.
backuptitle
...
...
@@ -221,9 +212,9 @@ export default {
// everything was fine, we can close the modal now
this
.
$refs
.
modalNote
.
hide
()
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
There was an error while trying to
post
ing
the new note
:
'
+
error
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not
post the new note
. See console for details.
'
)
// as there was an error saving the show, we have to make sure
// to restore the initial values of the note object
this
.
note
.
title
=
this
.
backuptitle
...
...
@@ -259,7 +250,6 @@ export default {
this
.
content
=
this
.
note
.
content
this
.
host_selected
=
this
.
note
.
host
}
// console.log(this.$refs.modalNote)
this
.
timeslotID
=
timeslotID
this
.
scheduleID
=
scheduleID
this
.
$refs
.
modalNote
.
show
()
...
...
src/components/ShowManagerModalShow.vue
View file @
a46a5aef
...
...
@@ -398,13 +398,6 @@
<
script
>
import
axios
from
'
axios
'
// debug function - can be thrown out as soon as this component is stable
/* function debugErrorResponse (data) {
console.log('Response data provided to transformResponse:')
console.log(data)
return data
} */
export
default
{
props
:
{
show
:
{
type
:
Object
,
required
:
true
}
...
...
@@ -531,9 +524,9 @@ export default {
this
.
$refs
.
modalShowName
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
name
=
this
.
backupstring
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new show information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the
show name. See console for details.
'
)
})
}
},
...
...
@@ -549,9 +542,9 @@ export default {
this
.
$refs
.
modalShowShortDescription
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
short_description
=
this
.
backupstring
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new show information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the
show
\'
s short description. See console for details.
'
)
})
}
},
...
...
@@ -567,9 +560,9 @@ export default {
this
.
$refs
.
modalShowDescription
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
description
=
this
.
backupstring
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new
show
information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the show
description. See console for details.
'
)
})
}
},
...
...
@@ -585,9 +578,9 @@ export default {
this
.
$refs
.
modalShowEmail
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
email
=
this
.
backupstring
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new
show
information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the show
e-mail contact. See console for details.
'
)
})
}
},
...
...
@@ -603,9 +596,9 @@ export default {
this
.
$refs
.
modalShowWebsite
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
website
=
this
.
backupstring
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new
show
information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the show
website. See console for details.
'
)
})
}
},
...
...
@@ -621,9 +614,9 @@ export default {
this
.
$refs
.
modalShowCBAid
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
cba_series_id
=
this
.
backupid
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new
show i
nformation
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the
CBA
show i
d. See console for details.
'
)
})
}
},
...
...
@@ -640,9 +633,9 @@ export default {
this
.
$refs
.
modalShowType
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
type
=
this
.
backupid
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new
show
information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the show
type. See console for details.
'
)
})
}
},
...
...
@@ -651,7 +644,6 @@ export default {
event
.
preventDefault
()
this
.
backupid
=
this
.
show
.
predecessor_id
this
.
show
.
predecessor_id
=
this
.
id
console
.
log
(
this
.
show
.
predecessor_id
)
axios
.
put
(
process
.
env
.
VUE_APP_API_STEERING_SHOWS
+
this
.
show
.
id
+
'
/
'
,
this
.
show
,
{
withCredentials
:
true
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
$parent
.
user
.
access_token
}
...
...
@@ -659,9 +651,9 @@ export default {
this
.
$refs
.
modalShowPredecessor
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
predecessor
=
this
.
backupid
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new
show
information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the show
predecessor. See console for details.
'
)
})
}
},
...
...
@@ -678,9 +670,9 @@ export default {
this
.
$refs
.
modalShowType
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
fundingcategory
=
this
.
backupid
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new show information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the
show
\'
funding category. See console for details.
'
)
})
}
},
...
...
@@ -729,9 +721,9 @@ export default {
this
.
$refs
.
modalShowTopics
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
topic
=
this
.
backuparray
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new show information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the
show
\'
s topics. See console for details.
'
)
})
}
},
...
...
@@ -748,9 +740,9 @@ export default {
this
.
$refs
.
modalShowMusicFocus
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
musicfocus
=
this
.
backuparray
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new show information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the
show
\'
s music focus. See console for details.
'
)
})
}
},
...
...
@@ -767,9 +759,9 @@ export default {
this
.
$refs
.
modalShowLanguages
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
language
=
this
.
backuparray
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new show information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the
show
\'
s languages. See console for details.
'
)
})
}
},
...
...
@@ -786,9 +778,9 @@ export default {
this
.
$refs
.
modalShowHosts
.
hide
()
}).
catch
(
error
=>
{
this
.
show
.
hosts
=
this
.
backuparray
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not save the
new show information
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not save the
show
\'
s hosts. See console for details.
'
)
})
}
},
...
...
@@ -906,9 +898,9 @@ export default {
this
.
types
=
response
.
data
this
.
loaded
=
true
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not load
available
show types
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not load show types
. See console for details.
'
)
})
this
.
$refs
.
modalShowType
.
show
()
},
...
...
@@ -922,9 +914,9 @@ export default {
this
.
fundingcategories
=
response
.
data
this
.
loaded
=
true
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not load
available
funding categories
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not load funding categories
. See console for details.
'
)
})
this
.
$refs
.
modalShowFundingCategory
.
show
()
},
...
...
@@ -938,9 +930,9 @@ export default {
this
.
categories
=
response
.
data
this
.
loaded
=
true
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not load
available
categories
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not load categories
. See console for details.
'
)
})
this
.
$refs
.
modalShowCategories
.
show
()
},
...
...
@@ -954,9 +946,9 @@ export default {
this
.
topics
=
response
.
data
this
.
loaded
=
true
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not load
available topics
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not load
topics. See console for details.
'
)
})
this
.
$refs
.
modalShowTopics
.
show
()
},
...
...
@@ -970,9 +962,9 @@ export default {
this
.
musicfocus
=
response
.
data
this
.
loaded
=
true
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not load
available
music foci
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not load music foci
. See console for details.
'
)
})
this
.
$refs
.
modalShowMusicFocus
.
show
()
},
...
...
@@ -986,9 +978,9 @@ export default {
this
.
languages
=
response
.
data
this
.
loaded
=
true
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not load
available languages
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not load
languages. See console for details.
'
)
})
this
.
$refs
.
modalShowLanguages
.
show
()
},
...
...
@@ -1002,9 +994,9 @@ export default {
this
.
hosts
=
response
.
data
this
.
loaded
=
true
}).
catch
(
error
=>
{
console
.
log
(
'
Error:
'
)
console
.
log
(
error
)
alert
(
'
Error: could not load
available hosts
'
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not load
hosts. See console for details.
'
)
})
this
.
$refs
.
modalShowHosts
.
show
()
},
...
...
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