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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2365337c
Commit
2365337c
authored
Jan 28, 2021
by
Kushal Pandya
Committed by
Phil Hughes
Jan 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add options support for groupLabels
Add support for additional options param in `groupLabels` method.
parent
981ad651
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
5 deletions
+62
-5
app/assets/javascripts/api.js
app/assets/javascripts/api.js
+2
-2
app/assets/javascripts/issuable_list/components/issuable_item.vue
...ts/javascripts/issuable_list/components/issuable_item.vue
+6
-0
app/assets/javascripts/issuable_list/components/issuable_list_root.vue
...vascripts/issuable_list/components/issuable_list_root.vue
+1
-1
app/assets/javascripts/issuable_list/components/issuable_tabs.vue
...ts/javascripts/issuable_list/components/issuable_tabs.vue
+5
-2
app/assets/stylesheets/framework/filters.scss
app/assets/stylesheets/framework/filters.scss
+9
-0
spec/frontend/api_spec.js
spec/frontend/api_spec.js
+22
-0
spec/frontend/issuable_list/components/issuable_item_spec.js
spec/frontend/issuable_list/components/issuable_item_spec.js
+17
-0
No files found.
app/assets/javascripts/api.js
View file @
2365337c
...
@@ -179,9 +179,9 @@ const Api = {
...
@@ -179,9 +179,9 @@ const Api = {
});
});
},
},
groupLabels
(
namespace
)
{
groupLabels
(
namespace
,
options
=
{}
)
{
const
url
=
Api
.
buildUrl
(
Api
.
groupLabelsPath
).
replace
(
'
:namespace_path
'
,
namespace
);
const
url
=
Api
.
buildUrl
(
Api
.
groupLabelsPath
).
replace
(
'
:namespace_path
'
,
namespace
);
return
axios
.
get
(
url
).
then
(({
data
})
=>
data
);
return
axios
.
get
(
url
,
options
).
then
(({
data
})
=>
data
);
},
},
// Return namespaces list. Filtered by query
// Return namespaces list. Filtered by query
...
...
app/assets/javascripts/issuable_list/components/issuable_item.vue
View file @
2365337c
...
@@ -139,6 +139,12 @@ export default {
...
@@ -139,6 +139,12 @@ export default {
<div
class=
"issuable-main-info"
>
<div
class=
"issuable-main-info"
>
<div
data-testid=
"issuable-title"
class=
"issue-title title"
>
<div
data-testid=
"issuable-title"
class=
"issue-title title"
>
<span
class=
"issue-title-text"
dir=
"auto"
>
<span
class=
"issue-title-text"
dir=
"auto"
>
<gl-icon
v-if=
"issuable.confidential"
v-gl-tooltip
name=
"eye-slash"
:title=
"__('Confidential')"
/>
<gl-link
:href=
"issuable.webUrl"
v-bind=
"issuableTitleProps"
<gl-link
:href=
"issuable.webUrl"
v-bind=
"issuableTitleProps"
>
{{
issuable
.
title
>
{{
issuable
.
title
}}
<gl-icon
v-if=
"isIssuableUrlExternal"
name=
"external-link"
class=
"gl-ml-2"
}}
<gl-icon
v-if=
"isIssuableUrlExternal"
name=
"external-link"
class=
"gl-ml-2"
...
...
app/assets/javascripts/issuable_list/components/issuable_list_root.vue
View file @
2365337c
...
@@ -230,7 +230,7 @@ export default {
...
@@ -230,7 +230,7 @@ export default {
:initial-sort-by=
"initialSortBy"
:initial-sort-by=
"initialSortBy"
:show-checkbox=
"showBulkEditSidebar"
:show-checkbox=
"showBulkEditSidebar"
:checkbox-checked=
"allIssuablesChecked"
:checkbox-checked=
"allIssuablesChecked"
class=
"gl-flex-grow-1 row-content-block"
class=
"gl-flex-grow-1
gl-border-t-none
row-content-block"
@
checked-input=
"handleAllIssuablesCheckedInput"
@
checked-input=
"handleAllIssuablesCheckedInput"
@
onFilter=
"$emit('filter', $event)"
@
onFilter=
"$emit('filter', $event)"
@
onSort=
"$emit('sort', $event)"
@
onSort=
"$emit('sort', $event)"
...
...
app/assets/javascripts/issuable_list/components/issuable_tabs.vue
View file @
2365337c
...
@@ -32,7 +32,10 @@ export default {
...
@@ -32,7 +32,10 @@ export default {
<
template
>
<
template
>
<div
class=
"top-area"
>
<div
class=
"top-area"
>
<gl-tabs
class=
"nav-links mobile-separator issuable-state-filters"
>
<gl-tabs
class=
"gl-display-flex gl-flex-fill-1 gl-p-0 gl-m-0 mobile-separator issuable-state-filters"
nav-class=
"gl-border-b-0"
>
<gl-tab
<gl-tab
v-for=
"tab in tabs"
v-for=
"tab in tabs"
:key=
"tab.id"
:key=
"tab.id"
...
@@ -41,7 +44,7 @@ export default {
...
@@ -41,7 +44,7 @@ export default {
>
>
<template
#title
>
<template
#title
>
<span
:title=
"tab.titleTooltip"
>
{{
tab
.
title
}}
</span>
<span
:title=
"tab.titleTooltip"
>
{{
tab
.
title
}}
</span>
<gl-badge
v-if=
"tabCounts"
variant=
"neutral"
size=
"sm"
class=
"gl-
px-2 gl-py-1!
"
>
{{
<gl-badge
v-if=
"tabCounts"
variant=
"neutral"
size=
"sm"
class=
"gl-
tab-counter-badge
"
>
{{
tabCounts
[
tab
.
name
]
tabCounts
[
tab
.
name
]
}}
</gl-badge>
}}
</gl-badge>
</
template
>
</
template
>
...
...
app/assets/stylesheets/framework/filters.scss
View file @
2365337c
...
@@ -475,6 +475,15 @@
...
@@ -475,6 +475,15 @@
}
}
}
}
.sort-dropdown-container
{
// This property is set to have borders
// around sort dropdown match with filter
// input field.
.gl-button
{
box-shadow
:
inset
0
0
0
1px
$gray-400
;
}
}
@include
media-breakpoint-up
(
md
)
{
@include
media-breakpoint-up
(
md
)
{
.sort-dropdown-container
{
.sort-dropdown-container
{
margin-left
:
10px
;
margin-left
:
10px
;
...
...
spec/frontend/api_spec.js
View file @
2365337c
...
@@ -260,6 +260,28 @@ describe('Api', () => {
...
@@ -260,6 +260,28 @@ describe('Api', () => {
});
});
});
});
describe
(
'
groupLabels
'
,
()
=>
{
it
(
'
fetches group labels
'
,
(
done
)
=>
{
const
options
=
{
params
:
{
search
:
'
foo
'
}
};
const
expectedGroup
=
'
gitlab-org
'
;
const
expectedUrl
=
`
${
dummyUrlRoot
}
/groups/
${
expectedGroup
}
/-/labels`
;
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
[
{
id
:
1
,
title
:
'
Foo Label
'
,
},
]);
Api
.
groupLabels
(
expectedGroup
,
options
)
.
then
((
res
)
=>
{
expect
(
res
.
length
).
toBe
(
1
);
expect
(
res
[
0
].
title
).
toBe
(
'
Foo Label
'
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
describe
(
'
namespaces
'
,
()
=>
{
describe
(
'
namespaces
'
,
()
=>
{
it
(
'
fetches namespaces
'
,
(
done
)
=>
{
it
(
'
fetches namespaces
'
,
(
done
)
=>
{
const
query
=
'
dummy query
'
;
const
query
=
'
dummy query
'
;
...
...
spec/frontend/issuable_list/components/issuable_item_spec.js
View file @
2365337c
...
@@ -257,6 +257,23 @@ describe('IssuableItem', () => {
...
@@ -257,6 +257,23 @@ describe('IssuableItem', () => {
);
);
});
});
it
(
'
renders issuable confidential icon when issuable is confidential
'
,
async
()
=>
{
wrapper
.
setProps
({
issuable
:
{
...
mockIssuable
,
confidential
:
true
,
},
});
await
wrapper
.
vm
.
$nextTick
();
const
confidentialEl
=
wrapper
.
find
(
'
[data-testid="issuable-title"]
'
).
find
(
GlIcon
);
expect
(
confidentialEl
.
exists
()).
toBe
(
true
);
expect
(
confidentialEl
.
props
(
'
name
'
)).
toBe
(
'
eye-slash
'
);
expect
(
confidentialEl
.
attributes
(
'
title
'
)).
toBe
(
'
Confidential
'
);
});
it
(
'
renders issuable reference
'
,
()
=>
{
it
(
'
renders issuable reference
'
,
()
=>
{
const
referenceEl
=
wrapper
.
find
(
'
[data-testid="issuable-reference"]
'
);
const
referenceEl
=
wrapper
.
find
(
'
[data-testid="issuable-reference"]
'
);
...
...
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