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
4c94d06f
Commit
4c94d06f
authored
Mar 06, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use LabelsSelect component, add block class for date pickers
parent
f70ffde0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
6 deletions
+71
-6
ee/app/assets/javascripts/epics/sidebar/components/sidebar_app.vue
...sets/javascripts/epics/sidebar/components/sidebar_app.vue
+71
-6
No files found.
ee/app/assets/javascripts/epics/sidebar/components/sidebar_app.vue
View file @
4c94d06f
<
script
>
<
script
>
/* global ListLabel */
/* eslint-disable vue/require-default-prop */
/* eslint-disable vue/require-default-prop */
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
Flash
from
'
~/flash
'
;
import
Flash
from
'
~/flash
'
;
import
{
capitalizeFirstCharacter
}
from
'
~/lib/utils/text_utility
'
;
import
{
capitalizeFirstCharacter
}
from
'
~/lib/utils/text_utility
'
;
import
sidebarDatePicker
from
'
~/vue_shared/components/sidebar/date_picker.vue
'
;
import
SidebarDatePicker
from
'
~/vue_shared/components/sidebar/date_picker.vue
'
;
import
sidebarCollapsedGroupedDatePicker
from
'
~/vue_shared/components/sidebar/collapsed_grouped_date_picker.vue
'
;
import
SidebarCollapsedGroupedDatePicker
from
'
~/vue_shared/components/sidebar/collapsed_grouped_date_picker.vue
'
;
import
SidebarLabelsSelect
from
'
~/vue_shared/components/sidebar/labels_select/base.vue
'
;
import
SidebarService
from
'
../services/sidebar_service
'
;
import
SidebarService
from
'
../services/sidebar_service
'
;
import
Store
from
'
../stores/sidebar_store
'
;
import
Store
from
'
../stores/sidebar_store
'
;
export
default
{
export
default
{
name
:
'
EpicSidebar
'
,
name
:
'
EpicSidebar
'
,
components
:
{
components
:
{
sidebarDatePicker
,
SidebarDatePicker
,
sidebarCollapsedGroupedDatePicker
,
SidebarCollapsedGroupedDatePicker
,
SidebarLabelsSelect
,
},
},
props
:
{
props
:
{
endpoint
:
{
endpoint
:
{
...
@@ -32,6 +35,31 @@
...
@@ -32,6 +35,31 @@
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
},
},
initialLabels
:
{
type
:
Array
,
required
:
true
,
},
namespace
:
{
type
:
String
,
required
:
false
,
default
:
'
#
'
,
},
updatePath
:
{
type
:
String
,
required
:
true
,
},
labelsPath
:
{
type
:
String
,
required
:
true
,
},
labelsWebUrl
:
{
type
:
String
,
required
:
true
,
},
epicsWebUrl
:
{
type
:
String
,
required
:
true
,
},
},
},
data
()
{
data
()
{
const
store
=
new
Store
({
const
store
=
new
Store
({
...
@@ -46,13 +74,16 @@
...
@@ -46,13 +74,16 @@
savingStartDate
:
false
,
savingStartDate
:
false
,
savingEndDate
:
false
,
savingEndDate
:
false
,
service
:
new
SidebarService
(
this
.
endpoint
),
service
:
new
SidebarService
(
this
.
endpoint
),
epicContext
:
{
labels
:
this
.
initialLabels
,
},
};
};
},
},
methods
:
{
methods
:
{
toggleSidebar
()
{
toggleSidebar
()
{
this
.
collapsed
=
!
this
.
collapsed
;
this
.
collapsed
=
!
this
.
collapsed
;
const
contentContainer
=
this
.
$el
.
closest
(
'
.page-with-sidebar
'
);
const
contentContainer
=
this
.
$el
.
closest
(
'
.page-with-
contextual-
sidebar
'
);
contentContainer
.
classList
.
toggle
(
'
right-sidebar-expanded
'
);
contentContainer
.
classList
.
toggle
(
'
right-sidebar-expanded
'
);
contentContainer
.
classList
.
toggle
(
'
right-sidebar-collapsed
'
);
contentContainer
.
classList
.
toggle
(
'
right-sidebar-collapsed
'
);
...
@@ -82,6 +113,24 @@
...
@@ -82,6 +113,24 @@
saveEndDate
(
date
)
{
saveEndDate
(
date
)
{
return
this
.
saveDate
(
'
end
'
,
date
);
return
this
.
saveDate
(
'
end
'
,
date
);
},
},
handleLabelClick
(
label
)
{
if
(
label
.
isAny
)
{
this
.
epicContext
.
labels
=
[];
}
else
{
const
labelIndex
=
this
.
epicContext
.
labels
.
findIndex
(
l
=>
l
.
id
===
label
.
id
);
if
(
labelIndex
===
-
1
)
{
this
.
epicContext
.
labels
.
push
(
new
ListLabel
({
id
:
label
.
id
,
title
:
label
.
title
,
color
:
label
.
color
[
0
],
textColor
:
label
.
text_color
,
}));
}
else
{
this
.
epicContext
.
labels
.
splice
(
labelIndex
,
1
);
}
}
},
},
},
};
};
</
script
>
</
script
>
...
@@ -91,9 +140,10 @@
...
@@ -91,9 +140,10 @@
class=
"right-sidebar"
class=
"right-sidebar"
:class=
"
{ 'right-sidebar-expanded' : !collapsed, 'right-sidebar-collapsed': collapsed }"
:class=
"
{ 'right-sidebar-expanded' : !collapsed, 'right-sidebar-collapsed': collapsed }"
>
>
<div
class=
"issuable-sidebar"
>
<div
class=
"issuable-sidebar
js-issuable-update
"
>
<sidebar-date-picker
<sidebar-date-picker
v-if=
"!collapsed"
v-if=
"!collapsed"
block-class=
"start-date"
:collapsed=
"collapsed"
:collapsed=
"collapsed"
:is-loading=
"savingStartDate"
:is-loading=
"savingStartDate"
:editable=
"editable"
:editable=
"editable"
...
@@ -106,6 +156,7 @@
...
@@ -106,6 +156,7 @@
/>
/>
<sidebar-date-picker
<sidebar-date-picker
v-if=
"!collapsed"
v-if=
"!collapsed"
block-class=
"end-date"
:collapsed=
"collapsed"
:collapsed=
"collapsed"
:is-loading=
"savingEndDate"
:is-loading=
"savingEndDate"
:editable=
"editable"
:editable=
"editable"
...
@@ -123,6 +174,20 @@
...
@@ -123,6 +174,20 @@
:show-toggle-sidebar=
"true"
:show-toggle-sidebar=
"true"
@
toggleCollapse=
"toggleSidebar"
@
toggleCollapse=
"toggleSidebar"
/>
/>
<sidebar-labels-select
ability-name=
"epic"
:context=
"epicContext"
:namespace=
"namespace"
:update-path=
"updatePath"
:labels-path=
"labelsPath"
:labels-web-url=
"labelsWebUrl"
:label-filter-base-path=
"epicsWebUrl"
:can-edit=
"editable"
:show-create=
"true"
@
onLabelClick=
"handleLabelClick"
>
{{
__
(
'
None
'
)
}}
</sidebar-labels-select>
</div>
</div>
</aside>
</aside>
</
template
>
</
template
>
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