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
3752cf74
Commit
3752cf74
authored
Apr 23, 2018
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: user-search component UI
parent
87264943
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
2 deletions
+101
-2
admin-groups-edit.vue
client/components/admin/admin-groups-edit.vue
+10
-2
user-search.vue
client/components/common/user-search.vue
+82
-0
common-users-query-search.gql
client/graph/common-users-query-search.gql
+9
-0
No files found.
client/components/admin/admin-groups-edit.vue
View file @
3752cf74
...
...
@@ -78,7 +78,7 @@
v-tab-item(key='users', :transition='false', :reverse-transition='false')
v-card
v-card-title.pb-0
v-btn(color='primary')
v-btn(color='primary'
, @click='assignUser'
)
v-icon(left) assignment_ind
| Assign User
v-data-table(
...
...
@@ -106,17 +106,21 @@
v-alert.ma-3(icon='warning', :value='true', outline) No users to display.
.text-xs-center.py-2(v-if='users.length > 15')
v-pagination(v-model='pagination.page', :length='pages')
user-search(v-model='searchUserDialog')
</
template
>
<
script
>
import
Criterias
from
'../common/criterias.vue'
import
UserSearch
from
'../common/user-search.vue'
import
groupQuery
from
'gql/admin-groups-query-single.gql'
import
deleteGroupMutation
from
'gql/admin-groups-mutation-delete.gql'
export
default
{
components
:
{
Criterias
Criterias
,
UserSearch
},
data
()
{
return
{
...
...
@@ -126,6 +130,7 @@ export default {
users
:
[]
},
deleteGroupDialog
:
false
,
searchUserDialog
:
false
,
pagination
:
{},
users
:
[],
headers
:
[
...
...
@@ -177,6 +182,9 @@ export default {
icon
:
'warning'
})
}
},
assignUser
()
{
this
.
searchUserDialog
=
true
}
},
apollo
:
{
...
...
client/components/common/user-search.vue
0 → 100644
View file @
3752cf74
<
template
lang=
"pug"
>
v-dialog(v-model='dialogOpen', max-width='650')
v-card
.dialog-header Search User
v-card-text
v-select(
:items='items'
:loading='searchLoading'
:search-input.sync='search'
autocomplete
autofocus
cache-items
chips
clearable
hide-details
item-text='name',
item-value='id',
label='Search users...'
light
multiple
v-model='selectedItems'
)
v-card-actions
v-spacer
v-btn(flat, @click='close', :disabled='loading') Cancel
v-btn(color='primary', dark, @click='setUser', :loading='loading', :disabled='loading')
v-icon(left) assignment_ind
span Select User
</
template
>
<
script
>
import
searchUsersQuery
from
'gql/common-users-query-search.gql'
export
default
{
props
:
{
value
:
{
type
:
Boolean
,
default
:
false
}
},
data
()
{
return
{
loading
:
false
,
searchLoading
:
false
,
search
:
''
,
items
:
[],
selectedItems
:
[]
}
},
computed
:
{
dialogOpen
:
{
get
()
{
return
this
.
value
},
set
(
value
)
{
this
.
$emit
(
'input'
,
value
)
}
}
},
methods
:
{
close
()
{
this
.
$emit
(
'input'
,
false
)
},
setUser
()
{
}
},
apollo
:
{
items
:
{
query
:
searchUsersQuery
,
variables
()
{
return
{
search
:
this
.
search
}
},
skip
()
{
return
!
this
.
search
||
this
.
search
.
length
<
2
},
update
:
(
data
)
=>
data
.
upsells
.
segments
,
watchLoading
(
isLoading
)
{
this
.
searchLoading
=
isLoading
}
}
}
}
</
script
>
client/graph/common-users-query-search.gql
0 → 100644
View file @
3752cf74
query
(
$query
:
String
!)
{
users
{
search
(
query
:
$query
)
{
id
name
email
}
}
}
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