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
1b525713
Commit
1b525713
authored
Jan 10, 2022
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
0b923a09
c3eeefff
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
272 additions
and
225 deletions
+272
-225
.rubocop_todo/gitlab/delegate_predicate_methods.yml
.rubocop_todo/gitlab/delegate_predicate_methods.yml
+0
-1
app/assets/javascripts/repository/components/blob_button_group.vue
...s/javascripts/repository/components/blob_button_group.vue
+19
-6
app/assets/javascripts/repository/components/blob_content_viewer.vue
...javascripts/repository/components/blob_content_viewer.vue
+2
-0
app/assets/javascripts/repository/components/delete_blob_modal.vue
...s/javascripts/repository/components/delete_blob_modal.vue
+4
-0
app/assets/javascripts/repository/components/fork_suggestion.vue
...ets/javascripts/repository/components/fork_suggestion.vue
+1
-0
app/assets/javascripts/repository/components/upload_blob_modal.vue
...s/javascripts/repository/components/upload_blob_modal.vue
+4
-0
ee/app/models/license.rb
ee/app/models/license.rb
+7
-1
ee/spec/frontend/repository/components/blob_button_group_spec.js
.../frontend/repository/components/blob_button_group_spec.js
+1
-0
qa/knapsack/master_report.json
qa/knapsack/master_report.json
+197
-207
spec/frontend/repository/components/blob_button_group_spec.js
.../frontend/repository/components/blob_button_group_spec.js
+37
-10
No files found.
.rubocop_todo/gitlab/delegate_predicate_methods.yml
View file @
1b525713
...
@@ -5,5 +5,4 @@ Gitlab/DelegatePredicateMethods:
...
@@ -5,5 +5,4 @@ Gitlab/DelegatePredicateMethods:
-
app/models/concerns/integrations/base_data_fields.rb
-
app/models/concerns/integrations/base_data_fields.rb
-
app/models/project.rb
-
app/models/project.rb
-
ee/app/models/concerns/ee/ci/metadatable.rb
-
ee/app/models/concerns/ee/ci/metadatable.rb
-
ee/app/models/license.rb
-
lib/gitlab/ci/trace/stream.rb
-
lib/gitlab/ci/trace/stream.rb
app/assets/javascripts/repository/components/blob_button_group.vue
View file @
1b525713
<
script
>
<
script
>
import
{
GlButtonGroup
,
GlButton
,
GlModalDirective
}
from
'
@gitlab/ui
'
;
import
{
GlButtonGroup
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
uniqueId
}
from
'
lodash
'
;
import
{
uniqueId
}
from
'
lodash
'
;
import
{
sprintf
,
__
}
from
'
~/locale
'
;
import
{
sprintf
,
__
}
from
'
~/locale
'
;
import
glFeatureFlagMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
glFeatureFlagMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
...
@@ -20,9 +20,6 @@ export default {
...
@@ -20,9 +20,6 @@ export default {
DeleteBlobModal
,
DeleteBlobModal
,
LockButton
:
()
=>
import
(
'
ee_component/repository/components/lock_button.vue
'
),
LockButton
:
()
=>
import
(
'
ee_component/repository/components/lock_button.vue
'
),
},
},
directives
:
{
GlModal
:
GlModalDirective
,
},
mixins
:
[
getRefMixin
,
glFeatureFlagMixin
()],
mixins
:
[
getRefMixin
,
glFeatureFlagMixin
()],
inject
:
{
inject
:
{
targetBranch
:
{
targetBranch
:
{
...
@@ -73,6 +70,10 @@ export default {
...
@@ -73,6 +70,10 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
required
:
true
,
required
:
true
,
},
},
showForkSuggestion
:
{
type
:
Boolean
,
required
:
true
,
},
},
},
computed
:
{
computed
:
{
replaceModalId
()
{
replaceModalId
()
{
...
@@ -91,6 +92,16 @@ export default {
...
@@ -91,6 +92,16 @@ export default {
return
this
.
canLock
?
'
lock_button
'
:
'
disabled_lock_button
'
;
return
this
.
canLock
?
'
lock_button
'
:
'
disabled_lock_button
'
;
},
},
},
},
methods
:
{
showModal
(
modalId
)
{
if
(
this
.
showForkSuggestion
)
{
this
.
$emit
(
'
fork
'
);
return
;
}
this
.
$refs
[
modalId
].
show
();
},
},
};
};
</
script
>
</
script
>
...
@@ -107,14 +118,15 @@ export default {
...
@@ -107,14 +118,15 @@ export default {
data-testid=
"lock"
data-testid=
"lock"
:data-qa-selector=
"lockBtnQASelector"
:data-qa-selector=
"lockBtnQASelector"
/>
/>
<gl-button
v-gl-modal=
"replaceModalId"
data-testid=
"replace
"
>
<gl-button
data-testid=
"replace"
@
click=
"showModal(replaceModalId)
"
>
{{
$options
.
i18n
.
replace
}}
{{
$options
.
i18n
.
replace
}}
</gl-button>
</gl-button>
<gl-button
v-gl-modal=
"deleteModalId"
data-testid=
"delete
"
>
<gl-button
data-testid=
"delete"
@
click=
"showModal(deleteModalId)
"
>
{{
$options
.
i18n
.
delete
}}
{{
$options
.
i18n
.
delete
}}
</gl-button>
</gl-button>
</gl-button-group>
</gl-button-group>
<upload-blob-modal
<upload-blob-modal
:ref=
"replaceModalId"
:modal-id=
"replaceModalId"
:modal-id=
"replaceModalId"
:modal-title=
"replaceModalTitle"
:modal-title=
"replaceModalTitle"
:commit-message=
"replaceModalTitle"
:commit-message=
"replaceModalTitle"
...
@@ -126,6 +138,7 @@ export default {
...
@@ -126,6 +138,7 @@ export default {
:primary-btn-text=
"$options.i18n.replacePrimaryBtnText"
:primary-btn-text=
"$options.i18n.replacePrimaryBtnText"
/>
/>
<delete-blob-modal
<delete-blob-modal
:ref=
"deleteModalId"
:modal-id=
"deleteModalId"
:modal-id=
"deleteModalId"
:modal-title=
"deleteModalTitle"
:modal-title=
"deleteModalTitle"
:delete-path=
"deletePath"
:delete-path=
"deletePath"
...
...
app/assets/javascripts/repository/components/blob_content_viewer.vue
View file @
1b525713
...
@@ -280,6 +280,8 @@ export default {
...
@@ -280,6 +280,8 @@ export default {
:project-path=
"projectPath"
:project-path=
"projectPath"
:is-locked=
"Boolean(pathLockedByUser)"
:is-locked=
"Boolean(pathLockedByUser)"
:can-lock=
"canLock"
:can-lock=
"canLock"
:show-fork-suggestion=
"showForkSuggestion"
@
fork=
"setForkTarget('ide')"
/>
/>
</
template
>
</
template
>
</blob-header>
</blob-header>
...
...
app/assets/javascripts/repository/components/delete_blob_modal.vue
View file @
1b525713
...
@@ -146,6 +146,9 @@ export default {
...
@@ -146,6 +146,9 @@ export default {
/* eslint-enable dot-notation */
/* eslint-enable dot-notation */
},
},
methods
:
{
methods
:
{
show
()
{
this
.
$refs
[
this
.
modalId
].
show
();
},
submitForm
(
e
)
{
submitForm
(
e
)
{
e
.
preventDefault
();
// Prevent modal from closing
e
.
preventDefault
();
// Prevent modal from closing
this
.
form
.
showValidation
=
true
;
this
.
form
.
showValidation
=
true
;
...
@@ -164,6 +167,7 @@ export default {
...
@@ -164,6 +167,7 @@ export default {
<
template
>
<
template
>
<gl-modal
<gl-modal
:ref=
"modalId"
v-bind=
"$attrs"
v-bind=
"$attrs"
data-testid=
"modal-delete"
data-testid=
"modal-delete"
:modal-id=
"modalId"
:modal-id=
"modalId"
...
...
app/assets/javascripts/repository/components/fork_suggestion.vue
View file @
1b525713
...
@@ -32,6 +32,7 @@ export default {
...
@@ -32,6 +32,7 @@ export default {
class=
"gl-mr-3"
class=
"gl-mr-3"
category=
"secondary"
category=
"secondary"
variant=
"confirm"
variant=
"confirm"
data-method=
"post"
:href=
"forkPath"
:href=
"forkPath"
data-testid=
"fork"
data-testid=
"fork"
>
>
...
...
app/assets/javascripts/repository/components/upload_blob_modal.vue
View file @
1b525713
...
@@ -136,6 +136,9 @@ export default {
...
@@ -136,6 +136,9 @@ export default {
},
},
},
},
methods
:
{
methods
:
{
show
()
{
this
.
$refs
[
this
.
modalId
].
show
();
},
setFile
(
file
)
{
setFile
(
file
)
{
this
.
file
=
file
;
this
.
file
=
file
;
...
@@ -206,6 +209,7 @@ export default {
...
@@ -206,6 +209,7 @@ export default {
<
template
>
<
template
>
<gl-form>
<gl-form>
<gl-modal
<gl-modal
:ref=
"modalId"
:modal-id=
"modalId"
:modal-id=
"modalId"
:title=
"modalTitle"
:title=
"modalTitle"
:action-primary=
"primaryOptions"
:action-primary=
"primaryOptions"
...
...
ee/app/models/license.rb
View file @
1b525713
...
@@ -315,7 +315,13 @@ class License < ApplicationRecord
...
@@ -315,7 +315,13 @@ class License < ApplicationRecord
EE_ALL_PLANS
EE_ALL_PLANS
end
end
delegate
:block_changes?
,
:feature_available?
,
to: :current
,
allow_nil:
true
def
block_changes?
!!
current
&
.
block_changes?
end
def
feature_available?
(
feature
)
!!
current
&
.
feature_available?
(
feature
)
end
def
reset_current
def
reset_current
cache
.
expire
(
CACHE_KEY
)
cache
.
expire
(
CACHE_KEY
)
...
...
ee/spec/frontend/repository/components/blob_button_group_spec.js
View file @
1b525713
...
@@ -13,6 +13,7 @@ const DEFAULT_PROPS = {
...
@@ -13,6 +13,7 @@ const DEFAULT_PROPS = {
projectPath
:
'
some/project/path
'
,
projectPath
:
'
some/project/path
'
,
isLocked
:
false
,
isLocked
:
false
,
canLock
:
true
,
canLock
:
true
,
showForkSuggestion
:
false
,
};
};
const
DEFAULT_INJECT
=
{
const
DEFAULT_INJECT
=
{
...
...
qa/knapsack/master_report.json
View file @
1b525713
This diff is collapsed.
Click to expand it.
spec/frontend/repository/components/blob_button_group_spec.js
View file @
1b525713
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
mountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
import
BlobButtonGroup
from
'
~/repository/components/blob_button_group.vue
'
;
import
BlobButtonGroup
from
'
~/repository/components/blob_button_group.vue
'
;
import
DeleteBlobModal
from
'
~/repository/components/delete_blob_modal.vue
'
;
import
DeleteBlobModal
from
'
~/repository/components/delete_blob_modal.vue
'
;
import
UploadBlobModal
from
'
~/repository/components/upload_blob_modal.vue
'
;
import
UploadBlobModal
from
'
~/repository/components/upload_blob_modal.vue
'
;
...
@@ -16,6 +15,7 @@ const DEFAULT_PROPS = {
...
@@ -16,6 +15,7 @@ const DEFAULT_PROPS = {
projectPath
:
'
some/project/path
'
,
projectPath
:
'
some/project/path
'
,
isLocked
:
false
,
isLocked
:
false
,
canLock
:
true
,
canLock
:
true
,
showForkSuggestion
:
false
,
};
};
const
DEFAULT_INJECT
=
{
const
DEFAULT_INJECT
=
{
...
@@ -27,7 +27,7 @@ describe('BlobButtonGroup component', () => {
...
@@ -27,7 +27,7 @@ describe('BlobButtonGroup component', () => {
let
wrapper
;
let
wrapper
;
const
createComponent
=
(
props
=
{})
=>
{
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
shallowMount
(
BlobButtonGroup
,
{
wrapper
=
mountExtended
(
BlobButtonGroup
,
{
propsData
:
{
propsData
:
{
...
DEFAULT_PROPS
,
...
DEFAULT_PROPS
,
...
props
,
...
props
,
...
@@ -35,9 +35,6 @@ describe('BlobButtonGroup component', () => {
...
@@ -35,9 +35,6 @@ describe('BlobButtonGroup component', () => {
provide
:
{
provide
:
{
...
DEFAULT_INJECT
,
...
DEFAULT_INJECT
,
},
},
directives
:
{
GlModal
:
createMockDirective
(),
},
});
});
};
};
...
@@ -47,7 +44,8 @@ describe('BlobButtonGroup component', () => {
...
@@ -47,7 +44,8 @@ describe('BlobButtonGroup component', () => {
const
findDeleteBlobModal
=
()
=>
wrapper
.
findComponent
(
DeleteBlobModal
);
const
findDeleteBlobModal
=
()
=>
wrapper
.
findComponent
(
DeleteBlobModal
);
const
findUploadBlobModal
=
()
=>
wrapper
.
findComponent
(
UploadBlobModal
);
const
findUploadBlobModal
=
()
=>
wrapper
.
findComponent
(
UploadBlobModal
);
const
findReplaceButton
=
()
=>
wrapper
.
find
(
'
[data-testid="replace"]
'
);
const
findDeleteButton
=
()
=>
wrapper
.
findByTestId
(
'
delete
'
);
const
findReplaceButton
=
()
=>
wrapper
.
findByTestId
(
'
replace
'
);
it
(
'
renders component
'
,
()
=>
{
it
(
'
renders component
'
,
()
=>
{
createComponent
();
createComponent
();
...
@@ -63,6 +61,8 @@ describe('BlobButtonGroup component', () => {
...
@@ -63,6 +61,8 @@ describe('BlobButtonGroup component', () => {
describe
(
'
buttons
'
,
()
=>
{
describe
(
'
buttons
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponent
();
createComponent
();
jest
.
spyOn
(
findUploadBlobModal
().
vm
,
'
show
'
);
jest
.
spyOn
(
findDeleteBlobModal
().
vm
,
'
show
'
);
});
});
it
(
'
renders both the replace and delete button
'
,
()
=>
{
it
(
'
renders both the replace and delete button
'
,
()
=>
{
...
@@ -75,10 +75,37 @@ describe('BlobButtonGroup component', () => {
...
@@ -75,10 +75,37 @@ describe('BlobButtonGroup component', () => {
});
});
it
(
'
triggers the UploadBlobModal from the replace button
'
,
()
=>
{
it
(
'
triggers the UploadBlobModal from the replace button
'
,
()
=>
{
const
{
value
}
=
getBinding
(
findReplaceButton
().
element
,
'
gl-modal
'
);
findReplaceButton
().
trigger
(
'
click
'
);
const
modalId
=
findUploadBlobModal
().
props
(
'
modalId
'
);
expect
(
findUploadBlobModal
().
vm
.
show
).
toHaveBeenCalled
();
});
it
(
'
triggers the DeleteBlobModal from the delete button
'
,
()
=>
{
findDeleteButton
().
trigger
(
'
click
'
);
expect
(
findDeleteBlobModal
().
vm
.
show
).
toHaveBeenCalled
();
});
describe
(
'
showForkSuggestion set to true
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
showForkSuggestion
:
true
});
jest
.
spyOn
(
findUploadBlobModal
().
vm
,
'
show
'
);
jest
.
spyOn
(
findDeleteBlobModal
().
vm
,
'
show
'
);
});
it
(
'
does not trigger the UploadBlobModal from the replace button
'
,
()
=>
{
findReplaceButton
().
trigger
(
'
click
'
);
expect
(
findUploadBlobModal
().
vm
.
show
).
not
.
toHaveBeenCalled
();
expect
(
wrapper
.
emitted
().
fork
).
toBeTruthy
();
});
it
(
'
does not trigger the DeleteBlobModal from the delete button
'
,
()
=>
{
findDeleteButton
().
trigger
(
'
click
'
);
expect
(
modalId
).
toEqual
(
value
);
expect
(
findDeleteBlobModal
().
vm
.
show
).
not
.
toHaveBeenCalled
();
expect
(
wrapper
.
emitted
().
fork
).
toBeTruthy
();
});
});
});
});
});
...
...
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