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
bf90c008
Commit
bf90c008
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
validate new member
parent
fae8f056
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/project/Project_members.vue
+27
-19
27 additions, 19 deletions
src/views/project/Project_members.vue
with
27 additions
and
19 deletions
src/views/project/Project_members.vue
+
27
−
19
View file @
bf90c008
...
@@ -16,11 +16,11 @@
...
@@ -16,11 +16,11 @@
:search=
"true"
:search=
"true"
:clearable=
"true"
:clearable=
"true"
/>
/>
<!--
<ul
id=
"errorlist
-title
"
class=
"errorlist"
>
<ul
id=
"errorlist"
class=
"errorlist"
>
<li
v-for=
"error in
form.title
.errors"
:key=
"error"
>
<li
v-for=
"error in
newMember
.errors"
:key=
"error"
>
{{
error
}}
{{
error
}}
</li>
</li>
</ul>
-->
</ul>
</div>
</div>
<div
class=
"field"
>
<div
class=
"field"
>
<!--
<label
for=
"add-member"
></label>
-->
<!--
<label
for=
"add-member"
></label>
-->
...
@@ -97,11 +97,7 @@
...
@@ -97,11 +97,7 @@
<div
class=
"ui divider"
></div>
<div
class=
"ui divider"
></div>
<button
<button
@
click=
"saveMembers"
type=
"button"
class=
"ui teal icon button"
>
@
click=
"validateMembers"
type=
"button"
class=
"ui teal icon button"
>
<i
class=
"white save icon"
></i>
Enregistrer les changements
<i
class=
"white save icon"
></i>
Enregistrer les changements
</button>
</button>
</form>
</form>
...
@@ -134,6 +130,7 @@ export default {
...
@@ -134,6 +130,7 @@ export default {
{
name
:
"
Administrateur projet
"
,
value
:
"
admin
"
},
{
name
:
"
Administrateur projet
"
,
value
:
"
admin
"
},
],
],
newMember
:
{
newMember
:
{
errors
:
[],
user
:
{
user
:
{
name
:
""
,
name
:
""
,
value
:
""
,
value
:
""
,
...
@@ -200,15 +197,26 @@ export default {
...
@@ -200,15 +197,26 @@ export default {
},
},
methods
:
{
methods
:
{
validateNewMember
()
{
this
.
newMember
.
errors
=
[];
if
(
!
this
.
newMember
.
user
.
value
)
{
this
.
newMember
.
errors
.
push
(
"
Veuillez compléter ce champ.
"
);
return
false
;
}
return
true
;
},
addMember
()
{
addMember
()
{
//* find user
if
(
this
.
validateNewMember
())
{
const
indexOfUser
=
this
.
projectUsers
.
findIndex
(
//* find user
(
el
)
=>
el
.
user
.
id
===
this
.
newMember
.
user
.
value
const
indexOfUser
=
this
.
projectUsers
.
findIndex
(
);
(
el
)
=>
el
.
user
.
id
===
this
.
newMember
.
user
.
value
//* modify its userLever
);
this
.
projectUsers
[
indexOfUser
].
userLevel
=
this
.
newMember
.
role
;
//* modify its userLever
//* empty add form
this
.
projectUsers
[
indexOfUser
].
userLevel
=
this
.
newMember
.
role
;
this
.
newMember
.
user
=
{
value
:
""
,
name
:
""
};
//* empty add form
this
.
newMember
.
user
=
{
value
:
""
,
name
:
""
};
}
},
},
isSortedAsc
(
column
)
{
isSortedAsc
(
column
)
{
...
@@ -228,7 +236,7 @@ export default {
...
@@ -228,7 +236,7 @@ export default {
}
}
},
},
validat
eMembers
()
{
sav
eMembers
()
{
const
data
=
this
.
projectUsers
.
map
((
member
)
=>
{
const
data
=
this
.
projectUsers
.
map
((
member
)
=>
{
return
{
return
{
user
:
member
.
user
,
user
:
member
.
user
,
...
...
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