Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wotwizard-ui
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
clients
wotwizard-ui
Commits
23ee6d75
Commit
23ee6d75
authored
3 years ago
by
Pierre-Jean CHANCELLIER
Browse files
Options
Downloads
Patches
Plain Diff
optimize computed variables
parent
408fe606
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
graphql/queries.js
+2
-2
2 additions, 2 deletions
graphql/queries.js
pages/membre.vue
+30
-28
30 additions, 28 deletions
pages/membre.vue
with
32 additions
and
30 deletions
graphql/queries.js
+
2
−
2
View file @
23ee6d75
...
...
@@ -79,7 +79,7 @@ export const NEWCOMERS = gql`
}
`
// Pour la page membre
s/index
// Pour la page membre
export
const
SEARCH_MEMBERS
=
gql
`
query SearchMember($hint: String) {
idSearch(with: { hint: $hint }) {
...
...
@@ -102,7 +102,7 @@ export const SEARCH_MEMBERS = gql`
}
`
// Pour la page membre
s/_hash
// Pour la page membre
export
const
SEARCH_MEMBER
=
gql
`
query SearchMemberWithHash($hash: Hash!) {
idFromHash(hash: $hash) {
...
...
This diff is collapsed.
Click to expand it.
pages/membre.vue
+
30
−
28
View file @
23ee6d75
...
...
@@ -27,9 +27,9 @@
['NEWCOMER', 'MISSING'].includes(idFromHash.status)
&&
idFromHash.received_certifications.certifications.length
<
5
}"
>
{{
$t
(
"
certification.recues
"
)
}}
(
{{
nbCertifs
(
"
r
eceived
"
)
}}
<span
v-if=
"nbCertifsPending
('r
eceived
')
!= 0"
>
{{
"
+
"
+
nbCertifsPending
(
"
r
eceived
"
)
{{
$t
(
"
certification.recues
"
)
}}
(
{{
nbCertifs
R
eceived
}}
<span
v-if=
"nbCertifsPending
R
eceived != 0"
>
{{
"
+
"
+
nbCertifsPending
R
eceived
}}
</span
>
)
<BadgeDanger
...
...
@@ -44,9 +44,9 @@
class=
"col-sm-10 col-md-7 col-lg-5 mx-auto"
v-if=
"['MISSING', 'MEMBER'].includes(idFromHash.status)"
>
<h3
class=
"h4 text-center"
>
{{
$t
(
"
certification.envoyees
"
)
}}
(
{{
nbCertifs
(
"
s
ent
"
)
}}
<span
v-if=
"nbCertifsPending
('s
ent
')
!= 0"
>
{{
"
+
"
+
nbCertifsPending
(
"
s
ent
"
)
{{
$t
(
"
certification.envoyees
"
)
}}
(
{{
nbCertifs
S
ent
}}
<span
v-if=
"nbCertifsPending
S
ent != 0"
>
{{
"
+
"
+
nbCertifsPending
S
ent
}}
</span
>
)
</h3>
...
...
@@ -65,7 +65,7 @@
import
{
SEARCH_MEMBER
}
from
"
@/graphql/queries
"
export
default
{
name
:
'
membre
'
,
name
:
"
membre
"
,
data
()
{
return
{
breadcrumb
:
[
...
...
@@ -85,28 +85,30 @@ export default {
error
:
null
}
},
methods
:
{
nbCertifs
(
sens
)
{
return
sens
==
"
received
"
?
this
.
idFromHash
.
received_certifications
.
certifications
.
filter
(
(
el
)
=>
{
return
el
.
pending
==
false
}
).
length
:
this
.
idFromHash
.
sent_certifications
.
filter
((
el
)
=>
{
return
el
.
pending
==
false
}).
length
computed
:
{
nbCertifsSent
()
{
return
this
.
idFromHash
.
sent_certifications
.
filter
((
el
)
=>
{
return
el
.
pending
==
false
}).
length
},
nbCertifsReceived
()
{
return
this
.
idFromHash
.
received_certifications
.
certifications
.
filter
(
(
el
)
=>
{
return
el
.
pending
==
false
}
).
length
},
nbCertifsPending
(
sens
)
{
return
sens
==
"
received
"
?
this
.
idFromHash
.
received_certifications
.
certifications
.
filter
(
(
el
)
=>
{
return
el
.
pending
==
true
}
).
length
:
this
.
idFromHash
.
sent_certifications
.
filter
((
el
)
=>
{
return
el
.
pending
==
true
}).
length
nbCertifsPendingSent
()
{
return
this
.
idFromHash
.
sent_certifications
.
filter
((
el
)
=>
{
return
el
.
pending
==
true
}).
length
},
nbCertifsPendingReceived
()
{
return
this
.
idFromHash
.
received_certifications
.
certifications
.
filter
(
(
el
)
=>
{
return
el
.
pending
==
true
}
).
length
}
},
apollo
:
{
...
...
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