BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
736541f5
Commit
736541f5
authored
Mar 19, 2018
by
Clement Ho
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refactor/move-mr-widget-sha-mismatch-vue-component' into 'master'
Move ShaMismatch vue component See merge request gitlab-org/gitlab-ce!17546
parents
27e9b8bf
07e7b15f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
19 deletions
+32
-19
sha_mismatch.vue
...e_merge_request_widget/components/states/sha_mismatch.vue
+18
-11
dependencies.js
...sets/javascripts/vue_merge_request_widget/dependencies.js
+1
-1
mr_widget_options.js
...javascripts/vue_merge_request_widget/mr_widget_options.js
+2
-2
state_maps.js
...javascripts/vue_merge_request_widget/stores/state_maps.js
+1
-1
refactor-move-mr-widget-sha-mismatch-vue-component.yml
...ed/refactor-move-mr-widget-sha-mismatch-vue-component.yml
+5
-0
mr_widget_sha_mismatch_spec.js
...r_widget/components/states/mr_widget_sha_mismatch_spec.js
+5
-4
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/
mr_widget_sha_mismatch.js
→
app/assets/javascripts/vue_merge_request_widget/components/states/
sha_mismatch.vue
View file @
736541f5
<
script
>
import
statusIcon
from
'../mr_widget_status_icon.vue'
;
export
default
{
name
:
'
MRWidgetSHA
Mismatch'
,
name
:
'
Sha
Mismatch'
,
components
:
{
statusIcon
,
},
template
:
`
<div class="mr-widget-body media">
<status-icon status="warning" :show-disabled-button="true" />
<div class="media-body space-children">
<span class="bold">
The source branch HEAD has recently changed. Please reload the page and review the changes before merging
</span>
</div>
</div>
`
,
};
</
script
>
<
template
>
<div
class=
"mr-widget-body media"
>
<status-icon
status=
"warning"
:show-disabled-button=
"true"
/>
<div
class=
"media-body space-children"
>
<span
class=
"bold"
>
The source branch HEAD has recently changed.
Please reload the page and review the changes before merging.
</span>
</div>
</div>
</
template
>
app/assets/javascripts/vue_merge_request_widget/dependencies.js
View file @
736541f5
...
...
@@ -28,7 +28,7 @@ export { default as NothingToMergeState } from './components/states/nothing_to_m
export
{
default
as
MissingBranchState
}
from
'./components/states/mr_widget_missing_branch.vue'
;
export
{
default
as
NotAllowedState
}
from
'./components/states/mr_widget_not_allowed.vue'
;
export
{
default
as
ReadyToMergeState
}
from
'./components/states/mr_widget_ready_to_merge'
;
export
{
default
as
S
HAMismatchState
}
from
'./components/states/mr_widget_sha_mismatch
'
;
export
{
default
as
S
haMismatchState
}
from
'./components/states/sha_mismatch.vue
'
;
export
{
default
as
UnresolvedDiscussionsState
}
from
'./components/states/unresolved_discussions.vue'
;
export
{
default
as
PipelineBlockedState
}
from
'./components/states/mr_widget_pipeline_blocked.vue'
;
export
{
default
as
PipelineFailedState
}
from
'./components/states/mr_widget_pipeline_failed'
;
...
...
app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js
View file @
736541f5
...
...
@@ -19,7 +19,7 @@ import {
MissingBranchState
,
NotAllowedState
,
ReadyToMergeState
,
S
HA
MismatchState
,
S
ha
MismatchState
,
UnresolvedDiscussionsState
,
PipelineBlockedState
,
PipelineFailedState
,
...
...
@@ -227,7 +227,7 @@ export default {
'mr-widget-not-allowed'
:
NotAllowedState
,
'mr-widget-missing-branch'
:
MissingBranchState
,
'mr-widget-ready-to-merge'
:
ReadyToMergeState
,
'mr-widget-sha-mismatch'
:
S
HA
MismatchState
,
'mr-widget-sha-mismatch'
:
S
ha
MismatchState
,
'mr-widget-squash-before-merge'
:
SquashBeforeMerge
,
'mr-widget-checking'
:
CheckingState
,
'mr-widget-unresolved-discussions'
:
UnresolvedDiscussionsState
,
...
...
app/assets/javascripts/vue_merge_request_widget/stores/state_maps.js
View file @
736541f5
...
...
@@ -16,7 +16,7 @@ const stateToComponentMap = {
mergeWhenPipelineSucceeds
:
'mr-widget-merge-when-pipeline-succeeds'
,
failedToMerge
:
'mr-widget-failed-to-merge'
,
autoMergeFailed
:
'mr-widget-auto-merge-failed'
,
shaMismatch
:
'
mr-widget-
sha-mismatch'
,
shaMismatch
:
'sha-mismatch'
,
rebase
:
'mr-widget-rebase'
,
};
...
...
changelogs/unreleased/refactor-move-mr-widget-sha-mismatch-vue-component.yml
0 → 100644
View file @
736541f5
---
title
:
Move ShaMismatch vue component
merge_request
:
17546
author
:
George Tsiolis
type
:
performance
spec/javascripts/vue_mr_widget/components/states/mr_widget_sha_mismatch_spec.js
View file @
736541f5
import
Vue
from
'vue'
;
import
shaMismatchComponent
from
'~/vue_merge_request_widget/components/states/mr_widget_sha_mismatch
'
;
import
ShaMismatch
from
'~/vue_merge_request_widget/components/states/sha_mismatch.vue
'
;
describe
(
'
MRWidgetSHA
Mismatch'
,
()
=>
{
describe
(
'
Sha
Mismatch'
,
()
=>
{
describe
(
'template'
,
()
=>
{
const
Component
=
Vue
.
extend
(
shaMismatchComponent
);
const
Component
=
Vue
.
extend
(
ShaMismatch
);
const
vm
=
new
Component
({
el
:
document
.
createElement
(
'div'
),
});
it
(
'should have correct elements'
,
()
=>
{
expect
(
vm
.
$el
.
classList
.
contains
(
'mr-widget-body'
)).
toBeTruthy
();
expect
(
vm
.
$el
.
querySelector
(
'button'
).
getAttribute
(
'disabled'
)).
toBeTruthy
();
expect
(
vm
.
$el
.
innerText
).
toContain
(
'The source branch HEAD has recently changed. Please reload the page and review the changes before merging'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'The source branch HEAD has recently changed.'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'Please reload the page and review the changes before merging.'
);
});
});
});
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