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
373b8c26
Commit
373b8c26
authored
Feb 19, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added help block
fixed commit section spec
parent
c3bee6f4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
11 deletions
+43
-11
app/assets/javascripts/ide/components/commit_sidebar/actions.vue
...ets/javascripts/ide/components/commit_sidebar/actions.vue
+2
-0
app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue
...javascripts/ide/components/commit_sidebar/radio_group.vue
+18
-1
app/assets/javascripts/ide/components/repo_commit_section.vue
...assets/javascripts/ide/components/repo_commit_section.vue
+1
-1
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+9
-0
spec/javascripts/repo/components/repo_commit_section_spec.js
spec/javascripts/repo/components/repo_commit_section_spec.js
+9
-6
spec/javascripts/repo/helpers.js
spec/javascripts/repo/helpers.js
+4
-3
No files found.
app/assets/javascripts/ide/components/commit_sidebar/actions.vue
View file @
373b8c26
...
...
@@ -37,11 +37,13 @@
:value=
"COMMIT_TO_NEW_BRANCH"
label=
"Create a new branch"
:show-input=
"true"
:help-text=
"`Creates a new branch from $
{currentBranchId}`"
/>
<radio-group
:value=
"COMMIT_TO_NEW_BRANCH_MR"
label=
"Create a new branch and merge request"
:show-input=
"true"
:help-text=
"`Creates a new branch from $
{currentBranchId} and re-directs to create a new merge request`"
/>
</div>
</
template
>
app/assets/javascripts/ide/components/commit_sidebar/radio_group.vue
View file @
373b8c26
<
script
>
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
tooltip
from
'
../../../vue_shared/directives/tooltip
'
;
export
default
{
directives
:
{
tooltip
,
},
props
:
{
value
:
{
type
:
String
,
...
...
@@ -22,6 +26,11 @@
required
:
false
,
default
:
false
,
},
helpText
:
{
type
:
String
,
required
:
false
,
default
:
null
,
}
},
computed
:
{
...
mapState
(
'
commit
'
,
[
...
...
@@ -55,11 +64,19 @@
{{
label
}}
</
template
>
<slot
v-else
></slot>
<span
v-if=
"helpText"
v-tooltip
class=
"help-block inline"
:title=
"helpText"
>
<i
class=
"fa fa-question-circle"
></i>
</span>
</span>
</label>
<div
v-if=
"commitAction === value && showInput"
class=
"
prepend-left-20
"
class=
"
ide-commit-new-branch
"
>
<input
type=
"text"
...
...
app/assets/javascripts/ide/components/repo_commit_section.vue
View file @
373b8c26
...
...
@@ -110,7 +110,7 @@ export default {
>
<div
class=
"multi-file-commit-fieldset"
>
<textarea
class=
"form-control multi-file-commit-message"
class=
"form-control
input-sm
multi-file-commit-message"
name=
"commit-message"
:value=
"commitMessage"
placeholder=
"Write a commit message..."
...
...
app/assets/stylesheets/pages/repo.scss
View file @
373b8c26
...
...
@@ -635,4 +635,13 @@ table.table tr td.multi-file-table-name {
label
{
font-weight
:
normal
;
}
.help-block
{
margin-top
:
0
;
line-height
:
0
;
}
}
.ide-commit-new-branch
{
margin-left
:
25px
;
}
spec/javascripts/repo/components/repo_commit_section_spec.js
View file @
373b8c26
...
...
@@ -116,7 +116,7 @@ describe('RepoCommitSection', () => {
});
it
(
'
resets commitMessage when clicking discard button
'
,
(
done
)
=>
{
vm
.
$store
.
state
.
commit
Message
=
'
testini
g commit message
'
;
vm
.
$store
.
state
.
commit
.
commitMessage
=
'
testin
g commit message
'
;
getSetTimeoutPromise
()
.
then
(()
=>
{
...
...
@@ -133,14 +133,17 @@ describe('RepoCommitSection', () => {
describe
(
'
when submitting
'
,
()
=>
{
beforeEach
(()
=>
{
vm
.
$store
.
state
.
commitMessage
=
'
testing
'
;
spyOn
(
vm
,
'
commitChanges
'
)
;
});
it
(
'
calls store
'
,
(
done
)
=>
{
spyOn
(
vm
,
'
commitChanges
'
);
vm
.
$el
.
querySelector
(
'
.multi-file-commit-form .btn-success
'
).
click
();
it
(
'
calls commitChanges
'
,
(
done
)
=>
{
vm
.
$store
.
state
.
commit
.
commitMessage
=
'
testing commit message
'
;
Vue
.
nextTick
()
getSetTimeoutPromise
()
.
then
(()
=>
{
vm
.
$el
.
querySelector
(
'
.multi-file-commit-form .btn-success
'
).
click
();
})
.
then
(
Vue
.
nextTick
)
.
then
(()
=>
{
expect
(
vm
.
commitChanges
).
toHaveBeenCalled
();
})
...
...
spec/javascripts/repo/helpers.js
View file @
373b8c26
...
...
@@ -3,10 +3,11 @@ import state from '~/ide/stores/state';
import
commitState
from
'
~/ide/stores/modules/commit/state
'
;
export
const
resetStore
=
(
store
)
=>
{
store
.
replaceState
(
state
());
Object
.
assign
(
store
.
state
,
{
const
newState
=
{
...
state
(),
commit
:
commitState
(),
});
};
store
.
replaceState
(
newState
);
};
export
const
file
=
(
name
=
'
name
'
,
id
=
name
,
type
=
''
)
=>
decorateData
({
...
...
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