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
d959ef7e
Commit
d959ef7e
authored
Apr 05, 2020
by
NGPixel
Committed by
Nicolas Giard
Apr 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: profile - pages
parent
80ee45ae
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
115 additions
and
3 deletions
+115
-3
profile.vue
client/components/profile.vue
+1
-1
pages.vue
client/components/profile/pages.vue
+100
-2
page.js
server/graph/resolvers/page.js
+12
-0
page.graphql
server/graph/schemas/page.graphql
+2
-0
No files found.
client/components/profile.vue
View file @
d959ef7e
...
...
@@ -22,7 +22,7 @@
//- v-list-item-title
{{
$t
(
'profile:comments.title'
)
}}
//- v-list-item-subtitle.caption.grey--text.text--lighten-1 Coming soon
v-content
v-content
(:class='darkMode ? "grey darken-4" : "grey lighten-5"')
transition(name='profile-router')
router-view
...
...
client/components/profile/pages.vue
View file @
d959ef7e
<
template
lang=
'pug'
>
v-container(fluid,
fill-height,
grid-list-lg)
v-container(fluid, grid-list-lg)
v-layout(row wrap)
v-flex(xs12)
.profile-header
...
...
@@ -7,13 +7,111 @@
.profile-header-title
.headline.primary--text.animated.fadeInLeft
{{
$t
(
'profile:pages.title'
)
}}
.subheading.grey--text.animated.fadeInLeft
{{
$t
(
'profile:pages.subtitle'
)
}}
v-spacer
v-btn.animated.fadeInDown.wait-p1s(color='grey', outlined, @click='refresh', large)
v-icon.grey--text mdi-refresh
v-flex(xs12)
v-card.animated.fadeInUp
v-data-table(
:items='pages'
:headers='headers'
:page.sync='pagination'
:items-per-page='15'
:loading='loading'
must-sort,
sort-by='updatedAt',
sort-desc,
hide-default-footer
)
template(slot='item', slot-scope='props')
tr.is-clickable(:active='props.selected', @click='goToPage(props.item.id)')
td
.body-2: strong
{{
props
.
item
.
title
}}
.caption
{{
props
.
item
.
description
}}
td.admin-pages-path
v-chip(label, small, :color='$vuetify.theme.dark ? `grey darken-4` : `grey lighten-4`')
{{
props
.
item
.
locale
}}
span.ml-2.grey--text(:class='$vuetify.theme.dark ? `text--lighten-1` : `text--darken-2`') /
{{
props
.
item
.
path
}}
td
{{
props
.
item
.
createdAt
|
moment
(
'calendar'
)
}}
td
{{
props
.
item
.
updatedAt
|
moment
(
'calendar'
)
}}
template(slot='no-data')
v-alert.ma-3(icon='mdi-alert', :value='true', outlined, color='grey')
em.caption
{{
$t
(
'profile:pages.emptyList'
)
}}
.text-center.py-2.animated.fadeInDown(v-if='this.pageTotal > 1')
v-pagination(v-model='pagination', :length='pageTotal')
</
template
>
<
script
>
import
gql
from
'graphql-tag'
export
default
{
data
()
{
return
{
}
return
{
selectedPage
:
{},
pagination
:
1
,
pages
:
[],
loading
:
false
}
},
computed
:
{
headers
()
{
return
[
{
text
:
this
.
$t
(
'profile:pages.headerTitle'
),
value
:
'title'
},
{
text
:
this
.
$t
(
'profile:pages.headerPath'
),
value
:
'path'
},
{
text
:
this
.
$t
(
'profile:pages.headerCreatedAt'
),
value
:
'createdAt'
,
width
:
250
},
{
text
:
this
.
$t
(
'profile:pages.headerUpdatedAt'
),
value
:
'updatedAt'
,
width
:
250
}
]
},
pageTotal
()
{
return
Math
.
ceil
(
this
.
pages
.
length
/
15
)
}
},
methods
:
{
async
refresh
()
{
await
this
.
$apollo
.
queries
.
pages
.
refetch
()
this
.
$store
.
commit
(
'showNotification'
,
{
message
:
this
.
$t
(
'profile:pages.refreshSuccess'
),
style
:
'success'
,
icon
:
'cached'
})
},
goToPage
(
id
)
{
window
.
location
.
assign
(
`/i/`
+
id
)
}
},
apollo
:
{
pages
:
{
query
:
gql
`
query($creatorId: Int, $authorId: Int) {
pages {
list(creatorId: $creatorId, authorId: $authorId) {
id
locale
path
title
description
contentType
isPublished
isPrivate
privateNS
createdAt
updatedAt
}
}
}
`
,
variables
()
{
return
{
creatorId
:
this
.
$store
.
get
(
'user/id'
),
authorId
:
this
.
$store
.
get
(
'user/id'
)
}
},
fetchPolicy
:
'network-only'
,
update
:
(
data
)
=>
data
.
pages
.
list
,
watchLoading
(
isLoading
)
{
this
.
loading
=
isLoading
this
.
$store
.
commit
(
`loading
${
isLoading
?
'Start'
:
'Stop'
}
`
,
'profile-pages-refresh'
)
}
}
}
}
</
script
>
...
...
server/graph/resolvers/page.js
View file @
d959ef7e
...
...
@@ -97,6 +97,18 @@ module.exports = {
if
(
args
.
locale
)
{
queryBuilder
.
where
(
'localeCode'
,
args
.
locale
)
}
if
(
args
.
creatorId
&&
args
.
authorId
&&
args
.
creatorId
>
0
&&
args
.
authorId
>
0
)
{
queryBuilder
.
where
(
function
()
{
this
.
where
(
'creatorId'
,
args
.
creatorId
).
orWhere
(
'authorId'
,
args
.
authorId
)
})
}
else
{
if
(
args
.
creatorId
&&
args
.
creatorId
>
0
)
{
queryBuilder
.
where
(
'creatorId'
,
args
.
creatorId
)
}
if
(
args
.
authorId
&&
args
.
authorId
>
0
)
{
queryBuilder
.
where
(
'authorId'
,
args
.
authorId
)
}
}
if
(
args
.
tags
&&
args
.
tags
.
length
>
0
)
{
queryBuilder
.
whereIn
(
'tags.tag'
,
args
.
tags
)
}
...
...
server/graph/schemas/page.graphql
View file @
d959ef7e
...
...
@@ -38,6 +38,8 @@ type PageQuery {
orderByDirection
:
PageOrderByDirection
tags
:
[
String
!]
locale
:
String
creatorId
:
Int
authorId
:
Int
):
[
PageListItem
!]!
@
auth
(
requires
:
[
"
manage
:
system
"
,
"
read
:
pages
"
])
single
(
...
...
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