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
b685ac52
Commit
b685ac52
authored
Jun 04, 2021
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address reviewer comment
Switch to use FeatureFlag mixin
parent
6835cfd8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
app/assets/javascripts/repository/components/blob_header_edit.vue
...ts/javascripts/repository/components/blob_header_edit.vue
+3
-6
spec/frontend/repository/components/blob_header_edit_spec.js
spec/frontend/repository/components/blob_header_edit_spec.js
+7
-6
No files found.
app/assets/javascripts/repository/components/blob_header_edit.vue
View file @
b685ac52
...
...
@@ -2,6 +2,7 @@
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
WebIdeLink
from
'
~/vue_shared/components/web_ide_link.vue
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
export
default
{
i18n
:
{
...
...
@@ -12,6 +13,7 @@ export default {
GlButton
,
WebIdeLink
,
},
mixins
:
[
glFeatureFlagsMixin
()],
props
:
{
editPath
:
{
type
:
String
,
...
...
@@ -22,17 +24,12 @@ export default {
required
:
true
,
},
},
computed
:
{
isFeatureEnabled
()
{
return
Boolean
(
gon
.
features
?.
consolidatedEditButton
);
},
},
};
</
script
>
<
template
>
<web-ide-link
v-if=
"
isFeatureEnabled
"
v-if=
"
glFeatures.consolidatedEditButton
"
class=
"gl-mr-3"
:edit-url=
"editPath"
:web-ide-url=
"webIdePath"
...
...
spec/frontend/repository/components/blob_header_edit_spec.js
View file @
b685ac52
...
...
@@ -11,12 +11,17 @@ const DEFAULT_PROPS = {
describe
(
'
BlobHeaderEdit component
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
(
props
=
{})
=>
{
const
createComponent
=
(
consolidatedEditButton
=
false
,
props
=
{})
=>
{
wrapper
=
shallowMount
(
BlobHeaderEdit
,
{
propsData
:
{
...
DEFAULT_PROPS
,
...
props
,
},
provide
:
{
glFeatures
:
{
consolidatedEditButton
,
},
},
});
};
...
...
@@ -64,11 +69,7 @@ describe('BlobHeaderEdit component', () => {
});
it
(
'
renders WebIdeLink component
'
,
()
=>
{
window
.
gon
.
features
=
{
consolidatedEditButton
:
true
,
};
createComponent
();
createComponent
(
true
);
const
{
editPath
:
editUrl
,
webIdePath
:
webIdeUrl
}
=
DEFAULT_PROPS
;
...
...
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