Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
externe Matthieu
Géocontrib Frontend
Commits
01079d85
Commit
01079d85
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
restrict projects in my account only to shared project
parent
eaf03e56
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/App.vue
+3
-3
3 additions, 3 deletions
src/App.vue
src/router/index.js
+1
-1
1 addition, 1 deletion
src/router/index.js
src/views/My_account.vue
+36
-13
36 additions, 13 deletions
src/views/My_account.vue
with
40 additions
and
17 deletions
src/App.vue
+
3
−
3
View file @
01079d85
...
...
@@ -92,7 +92,7 @@
<div
class=
"mobile"
>
<router-link
v-if=
"user"
to=
"
/
my_account
/
"
:
to=
"
{name: '
my_account
', params: { slug: $route.params.slug ? $route.params.slug : '-' }}
"
class="item"
>
{{
userFullname
||
user
.
username
||
"
Utilisateur inconnu
"
}}
...
...
@@ -145,8 +145,8 @@
<div
class=
"desktop flex push-right-desktop"
>
<router-link
v-if=
"user"
:to=
"
{name:
isSharedProject ? '' : 'my_account'
}"
:
class="
['
item
', {disable: isSharedProject}]
"
:to=
"
{name:
'my_account', params: { slug: $route.params.slug ? $route.params.slug : '-' }
}"
class="item"
>
{{
userFullname
||
user
.
username
||
"
Utilisateur inconnu
"
}}
</router-link>
...
...
This diff is collapsed.
Click to expand it.
src/router/index.js
+
1
−
1
View file @
01079d85
...
...
@@ -24,7 +24,7 @@ const routes = [
component
:
()
=>
import
(
/* webpackChunkName: "login" */
'
../views/registration/Login.vue
'
)
},
{
path
:
`
${
projectBase
===
'
projet
'
?
''
:
'
/
'
+
projectBase
}
/my_account/`
,
path
:
`
${
projectBase
===
'
projet
'
?
''
:
'
/
'
+
projectBase
+
'
/:slug
'
}
/my_account/`
,
name
:
'
my_account
'
,
component
:
()
=>
import
(
'
../views/My_account.vue
'
)
},
...
...
This diff is collapsed.
Click to expand it.
src/views/My_account.vue
+
36
−
13
View file @
01079d85
...
...
@@ -60,7 +60,7 @@
<div
class=
"ui divided items"
>
<div
v-for=
"project in
p
rojects"
v-for=
"project in
availableP
rojects"
:key=
"project.slug"
class=
"item"
>
...
...
@@ -156,25 +156,27 @@
<div
v-if=
"item.event_type === 'create'"
>
<a
v-if=
"item.object_type === 'feature'"
:href=
"item.related_feature.feature_url"
:href=
"
modifyUrl(
item.related_feature.feature_url
)
"
>
Signalement créé
<span>
Signalement créé
</span>
</a>
<a
v-else-if=
"item.object_type === 'comment'"
:href=
"item.related_feature.feature_url"
:href=
"
modifyUrl(
item.related_feature.feature_url
)
"
>
Commentaire créé
</a>
<a
v-else-if=
"item.object_type === 'attachment'"
:href=
"item.related_feature.feature_url"
:href=
"
modifyUrl(
item.related_feature.feature_url
)
"
>
Pièce jointe ajoutée
</a>
<a
v-else-if=
"item.object_type === 'project'"
:href=
"item.project_url"
:href=
"
modifyUrl(
item.project_url
)
"
>
Projet créé
</a>
...
...
@@ -183,13 +185,13 @@
<div
v-else-if=
"item.event_type === 'update'"
>
<a
v-if=
"item.object_type === 'feature'"
:href=
"item.related_feature.project_url"
:href=
"
modifyUrl(
item.related_feature.project_url
)
"
>
Signalement mis à jour
</a>
<a
v-else-if=
"item.object_type === 'project'"
:href=
"item.project_url"
:href=
"
modifyUrl(
item.project_url
)
"
>
à Projet mis à jour
</a>
</div>
...
...
@@ -232,7 +234,7 @@
<div>
<a
v-if=
"item.related_feature"
:href=
"item.related_feature.feature_url"
:href=
"
modifyUrl(
item.related_feature.feature_url
)
"
>
{{
item
.
related_feature
.
title
}}
</a>
<span
v-else
>
{{
item
.
data
.
feature_title
}}
(supprimé)
...
...
@@ -269,7 +271,7 @@
<div
class=
"content"
>
<div>
<a
:href=
"item.related_feature.feature_url"
:href=
"
modifyUrl(
item.related_feature.feature_url
)
"
>
"
{{
item
.
related_comment
.
comment
}}
"
</a>
</div>
<div
class=
"description"
>
...
...
@@ -314,24 +316,36 @@ export default {
},
computed
:
{
// todo : filter projects to user
...
mapState
([
'
user
'
,
'
USER_LEVEL_PROJECTS
'
,
'
user_permissions
'
,
]),
// todo : filter projects to user
...
mapState
(
'
projects
'
,
[
'
projects
'
]),
DJANGO_BASE_URL
:
function
()
{
DJANGO_BASE_URL
()
{
return
this
.
$store
.
state
.
configuration
.
VUE_APP_DJANGO_BASE
;
},
userFullname
:
function
()
{
userFullname
()
{
if
(
this
.
user
.
first_name
||
this
.
user
.
last_name
)
return
this
.
user
.
first_name
+
'
'
+
this
.
user
.
last_name
;
return
null
;
},
availableProjects
()
{
console
.
log
(
this
.
$route
.
path
);
if
(
this
.
$route
.
path
.
includes
(
'
projet-partage
'
))
{
return
this
.
projects
.
filter
((
el
)
=>
el
.
slug
===
this
.
$route
.
params
.
slug
);
}
return
this
.
projects
;
}
},
created
(){
this
.
getEvents
();
},
...
...
@@ -340,17 +354,26 @@ export default {
refreshId
()
{
return
'
?ver=
'
+
Math
.
random
();
},
setEvents
(
data
){
this
.
events
=
data
.
events
;
this
.
features
=
data
.
features
;
this
.
comments
=
data
.
comments
;
},
getEvents
(){
this
.
$store
.
dispatch
(
'
USER_EVENTS
'
)
.
then
((
data
)
=>
{
this
.
setEvents
(
data
);
});
},
modifyUrl
(
url
)
{
if
(
this
.
$route
.
path
.
includes
(
'
projet-partage
'
))
{
return
url
.
replace
(
'
projet
'
,
'
projet-partage
'
);
}
return
url
;
}
}
};
...
...
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