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
44d332e0
Commit
44d332e0
authored
Oct 07, 2019
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Vue Issuable Sidebar app
Adds Vue Issuablr Sidebar app containing wrapper component for Right Sidebar.
parent
86d28c47
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
90 additions
and
5 deletions
+90
-5
app/assets/javascripts/issuable_sidebar/components/sidebar_app.vue
...s/javascripts/issuable_sidebar/components/sidebar_app.vue
+23
-0
app/assets/javascripts/issuable_sidebar/sidebar_bundle.js
app/assets/javascripts/issuable_sidebar/sidebar_bundle.js
+27
-0
app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js
.../pages/projects/merge_requests/init_merge_request_show.js
+6
-1
app/assets/javascripts/pages/projects/merge_requests/show/index.js
...s/javascripts/pages/projects/merge_requests/show/index.js
+3
-1
ee/app/assets/javascripts/epic/components/epic_body.vue
ee/app/assets/javascripts/epic/components/epic_body.vue
+17
-2
ee/app/assets/javascripts/pages/projects/merge_requests/show/index.js
...s/javascripts/pages/projects/merge_requests/show/index.js
+3
-1
spec/spec_helper.rb
spec/spec_helper.rb
+11
-0
No files found.
app/assets/javascripts/issuable_sidebar/components/sidebar_app.vue
0 → 100644
View file @
44d332e0
<
script
>
export
default
{
props
:
{
signedIn
:
{
type
:
Boolean
,
required
:
true
,
},
sidebarStatusClass
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
};
</
script
>
<
template
>
<aside
:class=
"sidebarStatusClass"
class=
"right-sidebar js-right-sidebar js-issuable-sidebar"
aria-live=
"polite"
></aside>
</
template
>
app/assets/javascripts/issuable_sidebar/sidebar_bundle.js
0 → 100644
View file @
44d332e0
import
Vue
from
'
vue
'
;
import
SidebarApp
from
'
./components/sidebar_app.vue
'
;
export
default
()
=>
{
const
el
=
document
.
getElementById
(
'
js-vue-issuable-sidebar
'
);
if
(
!
el
)
{
return
false
;
}
const
{
sidebarStatusClass
}
=
el
.
dataset
;
// An empty string is present when user is signed in.
const
signedIn
=
el
.
dataset
.
signedIn
===
''
;
return
new
Vue
({
el
,
components
:
{
SidebarApp
},
render
:
createElement
=>
createElement
(
'
sidebar-app
'
,
{
props
:
{
signedIn
,
sidebarStatusClass
,
},
}),
});
};
app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js
View file @
44d332e0
...
...
@@ -4,11 +4,16 @@ import ShortcutsIssuable from '~/behaviors/shortcuts/shortcuts_issuable';
import
{
handleLocationHash
}
from
'
~/lib/utils/common_utils
'
;
import
howToMerge
from
'
~/how_to_merge
'
;
import
initPipelines
from
'
~/commit/pipelines/pipelines_bundle
'
;
import
initVueIssuableSidebarApp
from
'
~/issuable_sidebar/sidebar_bundle
'
;
import
initWidget
from
'
../../../vue_merge_request_widget
'
;
export
default
function
()
{
new
ZenMode
();
// eslint-disable-line no-new
initIssuableSidebar
();
if
(
gon
.
features
&&
gon
.
features
.
vueIssuableSidebar
)
{
initVueIssuableSidebarApp
();
}
else
{
initIssuableSidebar
();
}
initPipelines
();
new
ShortcutsIssuable
(
true
);
// eslint-disable-line no-new
handleLocationHash
();
...
...
app/assets/javascripts/pages/projects/merge_requests/show/index.js
View file @
44d332e0
...
...
@@ -4,6 +4,8 @@ import initShow from '../init_merge_request_show';
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
initShow
();
initSidebarBundle
();
if
(
gon
.
features
&&
!
gon
.
features
.
vueIssuableSidebar
)
{
initSidebarBundle
();
}
initMrNotes
();
});
ee/app/assets/javascripts/epic/components/epic_body.vue
View file @
44d332e0
<
script
>
import
{
mapState
}
from
'
vuex
'
;
import
{
mapState
,
mapGetters
}
from
'
vuex
'
;
import
IssuableBody
from
'
~/issue_show/components/app.vue
'
;
import
IssuableSidebar
from
'
~/issuable_sidebar/components/sidebar_app.vue
'
;
import
RelatedItems
from
'
ee/related_issues/components/related_issues_root.vue
'
;
import
EpicSidebar
from
'
./epic_sidebar.vue
'
;
...
...
@@ -10,6 +11,7 @@ export default {
epicsPathIdSeparator
:
'
&
'
,
components
:
{
IssuableBody
,
IssuableSidebar
,
RelatedItems
,
EpicSidebar
,
},
...
...
@@ -30,10 +32,18 @@ export default {
'
initialDescriptionHtml
'
,
'
initialDescriptionText
'
,
'
lockVersion
'
,
'
sidebarCollapsed
'
,
]),
...
mapGetters
([
'
isUserSignedIn
'
]),
isEpicTreeEnabled
()
{
return
gon
.
features
&&
gon
.
features
.
epicTrees
;
},
isVueIssuableEpicSidebarEnabled
()
{
return
gon
.
features
&&
gon
.
features
.
vueIssuableEpicSidebar
;
},
sidebarStatusClass
()
{
return
this
.
sidebarCollapsed
?
'
right-sidebar-collapsed
'
:
'
right-sidebar-expanded
'
;
},
},
};
</
script
>
...
...
@@ -84,6 +94,11 @@ export default {
css-class=
"js-related-issues-block"
path-id-separator=
"#"
/>
<epic-sidebar
/>
<issuable-sidebar
v-if=
"isVueIssuableEpicSidebarEnabled"
:signed-in=
"isUserSignedIn"
:sidebar-status-class=
"sidebarStatusClass"
/>
<epic-sidebar
v-else
/>
</div>
</
template
>
ee/app/assets/javascripts/pages/projects/merge_requests/show/index.js
View file @
44d332e0
...
...
@@ -5,7 +5,9 @@ import { initReviewBar } from 'ee/batch_comments';
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
initShow
();
initSidebarBundle
();
if
(
gon
.
features
&&
!
gon
.
features
.
vueIssuableSidebar
)
{
initSidebarBundle
();
}
initMrNotes
();
initReviewBar
();
});
spec/spec_helper.rb
View file @
44d332e0
...
...
@@ -154,6 +154,17 @@ RSpec.configure do |config|
.
with
(
:force_autodevops_on_by_default
,
anything
)
.
and_return
(
false
)
# The following can be removed once Vue Issuable Sidebar
# is feature-complete and can be made default in place
# of older sidebar.
# See https://gitlab.com/groups/gitlab-org/-/epics/1863
allow
(
Feature
).
to
receive
(
:enabled?
)
.
with
(
:vue_issuable_sidebar
,
anything
)
.
and_return
(
false
)
allow
(
Feature
).
to
receive
(
:enabled?
)
.
with
(
:vue_issuable_epic_sidebar
,
anything
)
.
and_return
(
false
)
# Stub these calls due to being expensive operations
# It can be reenabled for specific tests via:
#
...
...
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