Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
959f2ebd
Commit
959f2ebd
authored
Jan 12, 2019
by
Nicolas Giard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: graphql error notifications
parent
7e62c01e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
42 additions
and
58 deletions
+42
-58
admin-auth.vue
client/components/admin/admin-auth.vue
+27
-23
admin-general.vue
client/components/admin/admin-general.vue
+1
-5
admin-groups-edit.vue
client/components/admin/admin-groups-edit.vue
+2
-10
admin-groups.vue
client/components/admin/admin-groups.vue
+1
-5
admin-mail.vue
client/components/admin/admin-mail.vue
+1
-5
admin-navigation.vue
client/components/admin/admin-navigation.vue
+1
-5
admin-theme.vue
client/components/admin/admin-theme.vue
+1
-5
index.js
client/store/index.js
+7
-0
group.js
server/graph/resolvers/group.js
+1
-0
No files found.
client/components/admin/admin-auth.vue
View file @
959f2ebd
...
...
@@ -204,29 +204,33 @@ export default {
},
async
save
()
{
this
.
$store
.
commit
(
`loadingStart`
,
'admin-auth-savestrategies'
)
await
this
.
$apollo
.
mutate
({
mutation
:
strategiesSaveMutation
,
variables
:
{
config
:
{
audience
:
this
.
jwtAudience
,
tokenExpiration
:
this
.
jwtExpiration
,
tokenRenewal
:
this
.
jwtRenewablePeriod
},
strategies
:
this
.
strategies
.
map
(
str
=>
_
.
pick
(
str
,
[
'isEnabled'
,
'key'
,
'config'
,
'selfRegistration'
,
'domainWhitelist'
,
'autoEnrollGroups'
])).
map
(
str
=>
({...
str
,
config
:
str
.
config
.
map
(
cfg
=>
({...
cfg
,
value
:
JSON
.
stringify
({
v
:
cfg
.
value
.
value
})}))}))
}
})
this
.
$store
.
commit
(
'showNotification'
,
{
message
:
'Authentication configuration saved successfully.'
,
style
:
'success'
,
icon
:
'check'
})
try
{
await
this
.
$apollo
.
mutate
({
mutation
:
strategiesSaveMutation
,
variables
:
{
config
:
{
audience
:
this
.
jwtAudience
,
tokenExpiration
:
this
.
jwtExpiration
,
tokenRenewal
:
this
.
jwtRenewablePeriod
},
strategies
:
this
.
strategies
.
map
(
str
=>
_
.
pick
(
str
,
[
'isEnabled'
,
'key'
,
'config'
,
'selfRegistration'
,
'domainWhitelist'
,
'autoEnrollGroups'
])).
map
(
str
=>
({...
str
,
config
:
str
.
config
.
map
(
cfg
=>
({...
cfg
,
value
:
JSON
.
stringify
({
v
:
cfg
.
value
.
value
})}))}))
}
})
this
.
$store
.
commit
(
'showNotification'
,
{
message
:
'Authentication configuration saved successfully.'
,
style
:
'success'
,
icon
:
'check'
})
}
catch
(
err
)
{
this
.
$store
.
commit
(
'pushGraphError'
,
err
)
}
this
.
$store
.
commit
(
`loadingStop`
,
'admin-auth-savestrategies'
)
}
},
...
...
client/components/admin/admin-general.vue
View file @
959f2ebd
...
...
@@ -229,11 +229,7 @@ export default {
this
.
siteTitle
=
this
.
config
.
title
this
.
company
=
this
.
config
.
company
}
catch
(
err
)
{
this
.
$store
.
commit
(
'showNotification'
,
{
style
:
'red'
,
message
:
err
.
message
,
icon
:
'warning'
})
this
.
$store
.
commit
(
'pushGraphError'
,
err
)
}
}
},
...
...
client/components/admin/admin-groups-edit.vue
View file @
959f2ebd
...
...
@@ -93,11 +93,7 @@ export default {
icon
:
'check'
})
}
catch
(
err
)
{
this
.
$store
.
commit
(
'showNotification'
,
{
style
:
'red'
,
message
:
err
.
message
,
icon
:
'warning'
})
this
.
$store
.
commit
(
'pushGraphError'
,
err
)
}
},
async
deleteGroup
()
{
...
...
@@ -119,11 +115,7 @@ export default {
})
this
.
$router
.
replace
(
'/groups'
)
}
catch
(
err
)
{
this
.
$store
.
commit
(
'showNotification'
,
{
style
:
'red'
,
message
:
err
.
message
,
icon
:
'warning'
})
this
.
$store
.
commit
(
'pushGraphError'
,
err
)
}
},
async
refresh
()
{
...
...
client/components/admin/admin-groups.vue
View file @
959f2ebd
...
...
@@ -149,11 +149,7 @@ export default {
icon
:
'check'
})
}
catch
(
err
)
{
this
.
$store
.
commit
(
'showNotification'
,
{
style
:
'red'
,
message
:
err
.
message
,
icon
:
'warning'
})
this
.
$store
.
commit
(
'pushGraphError'
,
err
)
}
}
},
...
...
client/components/admin/admin-mail.vue
View file @
959f2ebd
...
...
@@ -180,11 +180,7 @@ export default {
icon
:
'check'
})
}
catch
(
err
)
{
this
.
$store
.
commit
(
'showNotification'
,
{
style
:
'red'
,
message
:
err
.
message
,
icon
:
'warning'
})
this
.
$store
.
commit
(
'pushGraphError'
,
err
)
}
}
},
...
...
client/components/admin/admin-navigation.vue
View file @
959f2ebd
...
...
@@ -214,11 +214,7 @@ export default {
throw
new
Error
(
_
.
get
(
resp
,
'data.navigation.updateTree.responseResult.message'
,
'An unexpected error occured.'
))
}
}
catch
(
err
)
{
this
.
$store
.
commit
(
'showNotification'
,
{
message
:
err
.
message
,
style
:
'red'
,
icon
:
'warning'
}
)
this
.
$store
.
commit
(
'pushGraphError'
,
err
)
}
this
.
$store
.
commit
(
`loadingStop`
,
'admin-navigation-save'
)
}
,
...
...
client/components/admin/admin-theme.vue
View file @
959f2ebd
...
...
@@ -146,11 +146,7 @@ export default {
throw
new
Error
(
resp
.
message
)
}
}
catch
(
err
)
{
this
.
$store
.
commit
(
'showNotification'
,
{
message
:
`Error:
${
err
.
message
}
`
,
style
:
'error'
,
icon
:
'warning'
})
this
.
$store
.
commit
(
'pushGraphError'
,
err
)
}
this
.
$store
.
commit
(
`loadingStop`
,
'admin-theme-save'
)
this
.
loading
=
false
...
...
client/store/index.js
View file @
959f2ebd
...
...
@@ -47,6 +47,13 @@ export default new Vuex.Store({
},
updateNotificationState
(
state
,
newState
)
{
state
.
notification
.
isActive
=
newState
},
pushGraphError
(
state
,
err
)
{
WIKI
.
$store
.
commit
(
'showNotification'
,
{
style
:
'red'
,
message
:
_
.
get
(
err
,
'graphQLErrors[0].message'
,
err
.
message
),
icon
:
'warning'
})
}
},
actions
:
{
},
...
...
server/graph/resolvers/group.js
View file @
959f2ebd
const
graphHelper
=
require
(
'../../helpers/graph'
)
const
safeRegex
=
require
(
'safe-regex'
)
const
_
=
require
(
'lodash'
)
/* global WIKI */
...
...
Write
Preview
Markdown
is supported
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