Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3b6ff7fc
Commit
3b6ff7fc
authored
May 10, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support to filter by name to Group list
parent
4c375338
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
56 deletions
+52
-56
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+0
-6
app/assets/javascripts/filterable_list.js
app/assets/javascripts/filterable_list.js
+3
-2
app/assets/javascripts/groups/components/group_folder.vue
app/assets/javascripts/groups/components/group_folder.vue
+0
-2
app/assets/javascripts/groups/components/groups.vue
app/assets/javascripts/groups/components/groups.vue
+5
-37
app/assets/javascripts/groups/index.js
app/assets/javascripts/groups/index.js
+38
-1
app/assets/javascripts/groups_list.js
app/assets/javascripts/groups_list.js
+3
-7
app/views/dashboard/groups/_groups.html.haml
app/views/dashboard/groups/_groups.html.haml
+3
-1
No files found.
app/assets/javascripts/dispatcher.js
View file @
3b6ff7fc
...
@@ -40,7 +40,6 @@ import Issue from './issue';
...
@@ -40,7 +40,6 @@ import Issue from './issue';
import
BindInOut
from
'
./behaviors/bind_in_out
'
;
import
BindInOut
from
'
./behaviors/bind_in_out
'
;
import
Group
from
'
./group
'
;
import
Group
from
'
./group
'
;
import
GroupName
from
'
./group_name
'
;
import
GroupName
from
'
./group_name
'
;
import
GroupsList
from
'
./groups_list
'
;
import
ProjectsList
from
'
./projects_list
'
;
import
ProjectsList
from
'
./projects_list
'
;
import
MiniPipelineGraph
from
'
./mini_pipeline_graph_dropdown
'
;
import
MiniPipelineGraph
from
'
./mini_pipeline_graph_dropdown
'
;
import
BlobLinePermalinkUpdater
from
'
./blob/blob_line_permalink_updater
'
;
import
BlobLinePermalinkUpdater
from
'
./blob/blob_line_permalink_updater
'
;
...
@@ -148,12 +147,7 @@ const ShortcutsBlob = require('./shortcuts_blob');
...
@@ -148,12 +147,7 @@ const ShortcutsBlob = require('./shortcuts_blob');
case
'
admin:projects:index
'
:
case
'
admin:projects:index
'
:
new
ProjectsList
();
new
ProjectsList
();
break
;
break
;
case
'
dashboard:groups:index
'
:
new
GroupsList
();
break
;
case
'
explore:groups:index
'
:
case
'
explore:groups:index
'
:
new
GroupsList
();
const
landingElement
=
document
.
querySelector
(
'
.js-explore-groups-landing
'
);
const
landingElement
=
document
.
querySelector
(
'
.js-explore-groups-landing
'
);
if
(
!
landingElement
)
break
;
if
(
!
landingElement
)
break
;
const
exploreGroupsLanding
=
new
Landing
(
const
exploreGroupsLanding
=
new
Landing
(
...
...
app/assets/javascripts/filterable_list.js
View file @
3b6ff7fc
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
*/
*/
export
default
class
FilterableList
{
export
default
class
FilterableList
{
constructor
(
form
,
filter
,
holder
)
{
constructor
(
form
,
filter
,
holder
,
store
)
{
this
.
store
=
store
;
this
.
filterForm
=
form
;
this
.
filterForm
=
form
;
this
.
listFilterElement
=
filter
;
this
.
listFilterElement
=
filter
;
this
.
listHolderElement
=
holder
;
this
.
listHolderElement
=
holder
;
...
@@ -33,7 +34,7 @@ export default class FilterableList {
...
@@ -33,7 +34,7 @@ export default class FilterableList {
$
(
this
.
listHolderElement
).
fadeTo
(
250
,
1
);
$
(
this
.
listHolderElement
).
fadeTo
(
250
,
1
);
},
},
success
(
data
)
{
success
(
data
)
{
this
.
listHolderElement
.
innerHTML
=
data
.
html
;
this
.
store
.
setGroups
(
data
)
;
// Change url so if user reload a page - search results are saved
// Change url so if user reload a page - search results are saved
return
window
.
history
.
replaceState
({
return
window
.
history
.
replaceState
({
...
...
app/assets/javascripts/groups/components/group_folder.vue
View file @
3b6ff7fc
<
script
>
<
script
>
import
eventHub
from
'
../event_hub
'
;
export
default
{
export
default
{
props
:
{
props
:
{
groups
:
{
groups
:
{
...
...
app/assets/javascripts/groups/components/groups.vue
View file @
3b6ff7fc
<
script
>
<
script
>
import
GroupsStore
from
'
../stores/groups_store
'
;
import
GroupsService
from
'
../services/groups_service
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
export
default
{
data
()
{
props
:
{
const
store
=
new
GroupsStore
();
groups
:
{
type
:
Array
,
return
{
required
:
true
,
store
,
state
:
store
.
state
,
};
},
created
()
{
const
appEl
=
document
.
querySelector
(
'
#dashboard-group-app
'
);
this
.
service
=
new
GroupsService
(
appEl
.
dataset
.
endpoint
);
this
.
fetchGroups
();
eventHub
.
$on
(
'
toggleSubGroups
'
,
this
.
toggleSubGroups
);
},
methods
:
{
fetchGroups
()
{
this
.
service
.
getGroups
()
.
then
((
response
)
=>
{
this
.
store
.
setGroups
(
response
.
json
());
})
.
catch
(()
=>
{
// TODO: Handler error
});
},
toggleSubGroups
(
group
)
{
GroupsStore
.
toggleSubGroups
(
group
);
this
.
fetchGroups
();
},
},
},
},
};
};
...
@@ -43,6 +11,6 @@ export default {
...
@@ -43,6 +11,6 @@ export default {
<
template
>
<
template
>
<div>
<div>
<group-folder
:groups=
"
state.
groups"
/>
<group-folder
:groups=
"groups"
/>
</div>
</div>
</
template
>
</
template
>
app/assets/javascripts/groups/index.js
View file @
3b6ff7fc
/* eslint-disable no-unused-vars */
/* eslint-disable no-unused-vars */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
GroupsList
from
'
~/groups_list
'
;
import
GroupsComponent
from
'
./components/groups.vue
'
;
import
GroupsComponent
from
'
./components/groups.vue
'
;
import
GroupFolder
from
'
./components/group_folder.vue
'
;
import
GroupFolder
from
'
./components/group_folder.vue
'
;
import
GroupItem
from
'
./components/group_item.vue
'
;
import
GroupItem
from
'
./components/group_item.vue
'
;
import
GroupsStore
from
'
./stores/groups_store
'
;
import
GroupsService
from
'
./services/groups_service
'
;
import
eventHub
from
'
./event_hub
'
;
$
(()
=>
{
$
(()
=>
{
const
appEl
=
document
.
querySelector
(
'
#dashboard-group-app
'
);
const
appEl
=
document
.
querySelector
(
'
#dashboard-group-app
'
);
const
form
=
document
.
querySelector
(
'
form#group-filter-form
'
);
const
filter
=
document
.
querySelector
(
'
.js-groups-list-filter
'
);
const
holder
=
document
.
querySelector
(
'
.js-groups-list-holder
'
);
const
store
=
new
GroupsStore
();
const
service
=
new
GroupsService
(
appEl
.
dataset
.
endpoint
);
Vue
.
component
(
'
groups-component
'
,
GroupsComponent
);
Vue
.
component
(
'
groups-component
'
,
GroupsComponent
);
Vue
.
component
(
'
group-folder
'
,
GroupFolder
);
Vue
.
component
(
'
group-folder
'
,
GroupFolder
);
...
@@ -14,6 +24,33 @@ $(() => {
...
@@ -14,6 +24,33 @@ $(() => {
const
GroupsApp
=
new
Vue
({
const
GroupsApp
=
new
Vue
({
el
:
appEl
,
el
:
appEl
,
render
:
createElement
=>
createElement
(
'
groups-component
'
),
data
()
{
return
{
store
,
state
:
store
.
state
,
};
},
methods
:
{
fetchGroups
()
{
service
.
getGroups
()
.
then
((
response
)
=>
{
store
.
setGroups
(
response
.
json
());
})
.
catch
(()
=>
{
// TODO: Handler error
});
},
toggleSubGroups
(
group
)
{
GroupsStore
.
toggleSubGroups
(
group
);
this
.
fetchGroups
();
},
},
created
()
{
const
groupFilterList
=
new
GroupsList
(
form
,
filter
,
holder
,
store
);
this
.
fetchGroups
();
eventHub
.
$on
(
'
toggleSubGroups
'
,
this
.
toggleSubGroups
);
},
});
});
});
});
app/assets/javascripts/groups_list.js
View file @
3b6ff7fc
...
@@ -5,13 +5,9 @@ import FilterableList from './filterable_list';
...
@@ -5,13 +5,9 @@ import FilterableList from './filterable_list';
* Updates the html content of the page with the received one.
* Updates the html content of the page with the received one.
*/
*/
export
default
class
GroupsList
{
export
default
class
GroupsList
{
constructor
()
{
constructor
(
form
,
filter
,
holder
,
store
)
{
const
form
=
document
.
querySelector
(
'
form#group-filter-form
'
);
if
(
form
&&
filter
&&
holder
&&
store
)
{
const
filter
=
document
.
querySelector
(
'
.js-groups-list-filter
'
);
const
list
=
new
FilterableList
(
form
,
filter
,
holder
,
store
);
const
holder
=
document
.
querySelector
(
'
.js-groups-list-holder
'
);
if
(
form
&&
filter
&&
holder
)
{
const
list
=
new
FilterableList
(
form
,
filter
,
holder
);
list
.
initSearch
();
list
.
initSearch
();
}
}
}
}
...
...
app/views/dashboard/groups/_groups.html.haml
View file @
3b6ff7fc
.js-groups-list-holder
#dashboard-group-app
{
data:
{
endpoint:
dashboard_groups_path
(
format: :json
)
}
}
.js-groups-list-holder
#dashboard-group-app
{
data:
{
endpoint:
dashboard_groups_path
(
format: :json
)
}
}
%groups-component
{
':groups'
=>
'state.groups'
}
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