Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IA2
GMS
Commits
3400d77f
Commit
3400d77f
authored
Jun 04, 2020
by
Sonia Zorba
Browse files
Renamed rename group functionality to edit group
parent
9e0d84c6
Changes
4
Hide whitespace changes
Inline
Side-by-side
gms-ui/src/api/mock/index.js
View file @
3400d77f
...
...
@@ -35,7 +35,7 @@ export default {
addGroup
()
{
return
fetch
(
groupsPanel
);
},
renam
eGroup
()
{
updat
eGroup
()
{
return
fetch
(
groupsPanel
);
},
removeGroup
()
{
...
...
gms-ui/src/api/server/index.js
View file @
3400d77f
...
...
@@ -145,7 +145,7 @@ export default {
})
});
},
renam
eGroup
(
groupId
,
newGroupName
,
leaf
,
input
)
{
updat
eGroup
(
groupId
,
newGroupName
,
leaf
,
input
)
{
let
url
=
BASE_API_URL
+
'
group/
'
+
groupId
;
return
apiRequest
(
url
,
{
method
:
'
PUT
'
,
...
...
gms-ui/src/components/GroupsPanel.vue
View file @
3400d77f
...
...
@@ -10,7 +10,7 @@
<b-list-group-item
href=
"#"
v-on:click=
"openGroup(group)"
>
<span
class=
"float-left"
>
{{
group
.
groupName
}}
</span>
<span
v-if=
"group.permission === 'ADMIN'"
class=
"float-right"
>
<a
href=
"#"
v-on:click.stop=
"open
Rename
GroupModal(group)"
title=
"
Rename
"
>
<a
href=
"#"
v-on:click.stop=
"open
Edit
GroupModal(group)"
title=
"
Edit
"
>
<font-awesome-icon
icon=
"edit"
></font-awesome-icon>
</a>
...
...
@@ -23,13 +23,13 @@
<p
v-if=
"model.groupsPanel.items.length === 0"
>
No groups
</p>
</div>
<Paginator
:paginatedPanel=
"model.groupsPanel"
:onUpdate=
"updatePagination"
:paginatorInput=
"input"
/>
<
Rename
GroupModal
ref=
"
rename
GroupModal"
/>
<
Edit
GroupModal
ref=
"
edit
GroupModal"
/>
<ConfirmRemoveGroupModal
ref=
"confirmRemoveGroupModal"
/>
</b-tab>
</
template
>
<
script
>
import
Rename
GroupModal
from
'
./modals/
Rename
GroupModal.vue
'
;
import
Edit
GroupModal
from
'
./modals/
Edit
GroupModal.vue
'
;
import
ConfirmRemoveGroupModal
from
'
./modals/ConfirmRemoveGroupModal.vue
'
;
import
Paginator
from
'
./Paginator.vue
'
;
import
{
...
...
@@ -42,7 +42,7 @@ import debounce from 'debounce'; // for delaying the input event (search filter)
export
default
{
name
:
'
GroupsPanel
'
,
components
:
{
Rename
GroupModal
,
Edit
GroupModal
,
ConfirmRemoveGroupModal
,
Paginator
},
...
...
@@ -54,8 +54,8 @@ export default {
openGroup
:
function
(
group
)
{
this
.
$store
.
commit
(
'
openGroup
'
,
group
.
groupId
);
},
open
Rename
GroupModal
:
function
(
group
)
{
this
.
$refs
.
rename
GroupModal
.
open
Rename
GroupModal
(
group
);
open
Edit
GroupModal
:
function
(
group
)
{
this
.
$refs
.
edit
GroupModal
.
open
Edit
GroupModal
(
group
);
},
openRemoveGroupModal
:
function
(
group
)
{
this
.
$refs
.
confirmRemoveGroupModal
.
openRemoveGroupModal
(
group
);
...
...
gms-ui/src/components/modals/
Rename
GroupModal.vue
→
gms-ui/src/components/modals/
Edit
GroupModal.vue
View file @
3400d77f
<
template
>
<b-modal
id=
"
rename
-group-modal"
title=
"
Rename
group"
ok-title=
"
Renam
e"
@
ok=
"
renam
eGroup"
>
<b-modal
id=
"
edit
-group-modal"
title=
"
Edit
group"
ok-title=
"
Updat
e"
@
ok=
"
updat
eGroup"
>
<b-form
inline
>
<label
class=
"w-25"
for=
"new-group-name-input"
>
Group name:
</label>
<b-form-input
v-model=
"newGroupName"
id=
"new-group-name-input"
class=
"w-75"
aria-describedby=
"new-group-name-input-feedback"
:state=
"newGroupNameState"
v-on:input=
"resetError"
>
...
...
@@ -14,7 +14,7 @@
import
client
from
'
api-client
'
;
export
default
{
name
:
'
Rename
GroupModal
'
,
name
:
'
Edit
GroupModal
'
,
computed
:
{
newGroupNameState
()
{
if
(
this
.
newGroupNameError
)
{
...
...
@@ -36,13 +36,13 @@ export default {
resetError
:
function
()
{
this
.
newGroupNameError
=
null
;
},
open
Rename
GroupModal
:
function
(
group
)
{
open
Edit
GroupModal
:
function
(
group
)
{
this
.
newGroupName
=
group
.
groupName
;
this
.
groupId
=
group
.
groupId
;
this
.
leaf
=
group
.
leaf
;
this
.
$bvModal
.
show
(
'
rename
-group-modal
'
);
this
.
$bvModal
.
show
(
'
edit
-group-modal
'
);
},
renam
eGroup
:
function
(
event
)
{
updat
eGroup
:
function
(
event
)
{
// Prevent modal from closing
event
.
preventDefault
();
...
...
@@ -52,17 +52,17 @@ export default {
}
if
(
this
.
oldGroupName
===
this
.
newGroupName
)
{
this
.
$bvModal
.
hide
(
'
rename
-group-modal
'
);
this
.
$bvModal
.
hide
(
'
edit
-group-modal
'
);
return
;
}
client
.
renam
eGroup
(
this
.
groupId
,
this
.
newGroupName
,
this
.
leaf
,
this
.
$store
.
state
.
input
)
client
.
updat
eGroup
(
this
.
groupId
,
this
.
newGroupName
,
this
.
leaf
,
this
.
$store
.
state
.
input
)
.
then
(
res
=>
{
if
(
res
.
status
===
400
)
{
this
.
newGroupNameError
=
res
.
message
;
}
else
{
this
.
$store
.
commit
(
'
updateGroupsPanel
'
,
res
);
this
.
$bvModal
.
hide
(
'
rename
-group-modal
'
);
this
.
$bvModal
.
hide
(
'
edit
-group-modal
'
);
}
});
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment