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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
f7a565b9
Commit
f7a565b9
authored
Feb 13, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moves mr widget components into vue files
Adds i18n Improves test cases
parent
dd8f56e8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
86 additions
and
60 deletions
+86
-60
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_not_allowed.js
...request_widget/components/states/mr_widget_not_allowed.js
+0
-19
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_not_allowed.vue
...equest_widget/components/states/mr_widget_not_allowed.vue
+25
-0
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.js
...st_widget/components/states/mr_widget_pipeline_blocked.js
+0
-18
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.vue
...t_widget/components/states/mr_widget_pipeline_blocked.vue
+24
-0
app/assets/javascripts/vue_merge_request_widget/dependencies.js
...sets/javascripts/vue_merge_request_widget/dependencies.js
+2
-2
spec/javascripts/vue_mr_widget/components/states/mr_widget_not_allowed_spec.js
...mr_widget/components/states/mr_widget_not_allowed_spec.js
+18
-11
spec/javascripts/vue_mr_widget/components/states/mr_widget_pipeline_blocked_spec.js
...dget/components/states/mr_widget_pipeline_blocked_spec.js
+17
-10
No files found.
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_not_allowed.js
deleted
100644 → 0
View file @
dd8f56e8
import
statusIcon
from
'
../mr_widget_status_icon.vue
'
;
export
default
{
name
:
'
MRWidgetNotAllowed
'
,
components
:
{
statusIcon
,
},
template
:
`
<div class="mr-widget-body media">
<status-icon status="success" :show-disabled-button="true" />
<div class="media-body space-children">
<span class="bold">
Ready to be merged automatically.
Ask someone with write access to this repository to merge this request
</span>
</div>
</div>
`
,
};
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_not_allowed.vue
0 → 100644
View file @
f7a565b9
<
script
>
import
StatusIcon
from
'
../mr_widget_status_icon.vue
'
;
export
default
{
name
:
'
MRWidgetNotAllowed
'
,
components
:
{
StatusIcon
,
},
};
</
script
>
<
template
>
<div
class=
"mr-widget-body media"
>
<status-icon
status=
"success"
:show-disabled-button=
"true"
/>
<div
class=
"media-body space-children"
>
<span
class=
"bold"
>
{{
s__
(
`mrWidget|Ready to be merged automatically.
Ask someone with write access to this repository to merge this request`
)
}}
</span>
</div>
</div>
</
template
>
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.js
deleted
100644 → 0
View file @
dd8f56e8
import
statusIcon
from
'
../mr_widget_status_icon.vue
'
;
export
default
{
name
:
'
MRWidgetPipelineBlocked
'
,
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">
Pipeline blocked. The pipeline for this merge request requires a manual action to proceed
</span>
</div>
</div>
`
,
};
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.vue
0 → 100644
View file @
f7a565b9
<
script
>
import
StatusIcon
from
'
../mr_widget_status_icon.vue
'
;
export
default
{
name
:
'
MRWidgetPipelineBlocked
'
,
components
:
{
StatusIcon
,
},
};
</
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"
>
{{
s__
(
`mrWidget|Pipeline blocked.
The pipeline for this merge request requires a manual action to proceed`
)
}}
</span>
</div>
</div>
</
template
>
app/assets/javascripts/vue_merge_request_widget/dependencies.js
View file @
f7a565b9
...
...
@@ -25,11 +25,11 @@ export { default as ArchivedState } from './components/states/mr_widget_archived
export
{
default
as
ConflictsState
}
from
'
./components/states/mr_widget_conflicts.vue
'
;
export
{
default
as
NothingToMergeState
}
from
'
./components/states/mr_widget_nothing_to_merge
'
;
export
{
default
as
MissingBranchState
}
from
'
./components/states/mr_widget_missing_branch.vue
'
;
export
{
default
as
NotAllowedState
}
from
'
./components/states/mr_widget_not_allowed
'
;
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
SHAMismatchState
}
from
'
./components/states/mr_widget_sha_mismatch
'
;
export
{
default
as
UnresolvedDiscussionsState
}
from
'
./components/states/mr_widget_unresolved_discussions
'
;
export
{
default
as
PipelineBlockedState
}
from
'
./components/states/mr_widget_pipeline_blocked
'
;
export
{
default
as
PipelineBlockedState
}
from
'
./components/states/mr_widget_pipeline_blocked
.vue
'
;
export
{
default
as
PipelineFailedState
}
from
'
./components/states/mr_widget_pipeline_failed
'
;
export
{
default
as
MergeWhenPipelineSucceedsState
}
from
'
./components/states/mr_widget_merge_when_pipeline_succeeds.vue
'
;
export
{
default
as
RebaseState
}
from
'
./components/states/mr_widget_rebase.vue
'
;
...
...
spec/javascripts/vue_mr_widget/components/states/mr_widget_not_allowed_spec.js
View file @
f7a565b9
import
Vue
from
'
vue
'
;
import
notAllowedComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_not_allowed
'
;
import
notAllowedComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_not_allowed.vue
'
;
import
mountComponent
from
'
../../../helpers/vue_mount_component_helper
'
;
describe
(
'
MRWidgetNotAllowed
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
notAllowedComponent
);
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
(
'
Ready to be merged automatically.
'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
Ask someone with write access to this repository to merge this request
'
);
});
vm
=
mountComponent
(
Component
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
renders success icon
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.ci-status-icon-success
'
)).
not
.
toBe
(
null
);
});
it
(
'
renders informative text
'
,
()
=>
{
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
Ready to be merged automatically.
'
);
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
Ask someone with write access to this repository to merge this request
'
);
});
});
spec/javascripts/vue_mr_widget/components/states/mr_widget_pipeline_blocked_spec.js
View file @
f7a565b9
import
Vue
from
'
vue
'
;
import
pipelineBlockedComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked
'
;
import
pipelineBlockedComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.vue
'
;
import
mountComponent
from
'
../../../helpers/vue_mount_component_helper
'
;
describe
(
'
MRWidgetPipelineBlocked
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
pipelineBlockedComponent
);
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
(
'
Pipeline blocked. The pipeline for this merge request requires a manual action to proceed
'
);
});
vm
=
mountComponent
(
Component
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
renders warning icon
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.ci-status-icon-warning
'
)).
not
.
toBe
(
null
);
});
it
(
'
renders information text
'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
.
trim
().
replace
(
/
[\r\n]
+/g
,
'
'
)).
toContain
(
'
Pipeline blocked. The pipeline for this merge request requires a manual action to proceed
'
);
});
});
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