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
efed5aed
Commit
efed5aed
authored
May 03, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unused computed prop
remove object.assign instead directly assign to state created new constants
parent
58c27033
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
26 deletions
+26
-26
app/assets/javascripts/ide/components/commit_sidebar/actions.vue
...ets/javascripts/ide/components/commit_sidebar/actions.vue
+4
-2
app/assets/javascripts/ide/components/commit_sidebar/form.vue
...assets/javascripts/ide/components/commit_sidebar/form.vue
+5
-4
app/assets/javascripts/ide/constants.js
app/assets/javascripts/ide/constants.js
+4
-0
app/assets/javascripts/ide/stores/mutations/file.js
app/assets/javascripts/ide/stores/mutations/file.js
+13
-20
No files found.
app/assets/javascripts/ide/components/commit_sidebar/actions.vue
View file @
efed5aed
...
...
@@ -10,7 +10,6 @@ export default {
},
computed
:
{
...
mapState
([
'
currentBranchId
'
,
'
changedFiles
'
,
'
stagedFiles
'
]),
...
mapGetters
([
'
hasChanges
'
]),
commitToCurrentBranchText
()
{
return
sprintf
(
__
(
'
Commit to %{branchName} branch
'
),
...
...
@@ -18,6 +17,9 @@ export default {
false
,
);
},
disableMergeRequestRadio
()
{
return
this
.
changedFiles
.
length
>
0
&&
this
.
stagedFiles
.
length
>
0
;
},
},
commitToCurrentBranch
:
consts
.
COMMIT_TO_CURRENT_BRANCH
,
commitToNewBranch
:
consts
.
COMMIT_TO_NEW_BRANCH
,
...
...
@@ -45,7 +47,7 @@ export default {
:value=
"$options.commitToNewBranchMR"
:label=
"__('Create a new branch and merge request')"
:show-input=
"true"
:disabled=
"
!!changedFiles.length && !!stagedFiles.length
"
:disabled=
"
disableMergeRequestRadio
"
/>
</div>
</
template
>
app/assets/javascripts/ide/components/commit_sidebar/form.vue
View file @
efed5aed
...
...
@@ -4,7 +4,7 @@ import { sprintf, __ } from '~/locale';
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
CommitMessageField
from
'
./message_field.vue
'
;
import
Actions
from
'
./actions.vue
'
;
import
{
activityBarViews
}
from
'
../../constants
'
;
import
{
activityBarViews
,
MAX_WINDOW_HEIGHT_COMPACT
,
COMMIT_ITEM_PADDING
}
from
'
../../constants
'
;
export
default
{
components
:
{
...
...
@@ -38,7 +38,8 @@ export default {
watch
:
{
currentActivityView
()
{
this
.
isCompact
=
!
(
this
.
currentActivityView
===
activityBarViews
.
commit
&&
window
.
innerHeight
>=
750
this
.
currentActivityView
===
activityBarViews
.
commit
&&
window
.
innerHeight
>=
MAX_WINDOW_HEIGHT_COMPACT
);
},
},
...
...
@@ -59,7 +60,7 @@ export default {
?
this
.
$refs
.
formEl
&&
this
.
$refs
.
formEl
.
offsetHeight
:
this
.
$refs
.
compactEl
&&
this
.
$refs
.
compactEl
.
offsetHeight
;
this
.
componentHeight
=
elHeight
+
32
;
this
.
componentHeight
=
elHeight
+
COMMIT_ITEM_PADDING
;
},
enterTransition
()
{
this
.
$nextTick
(()
=>
{
...
...
@@ -67,7 +68,7 @@ export default {
?
this
.
$refs
.
compactEl
&&
this
.
$refs
.
compactEl
.
offsetHeight
:
this
.
$refs
.
formEl
&&
this
.
$refs
.
formEl
.
offsetHeight
;
this
.
componentHeight
=
elHeight
+
32
;
this
.
componentHeight
=
elHeight
+
COMMIT_ITEM_PADDING
;
});
},
afterEndTransition
()
{
...
...
app/assets/javascripts/ide/constants.js
View file @
efed5aed
...
...
@@ -3,6 +3,10 @@ export const MAX_FILE_FINDER_RESULTS = 40;
export
const
FILE_FINDER_ROW_HEIGHT
=
55
;
export
const
FILE_FINDER_EMPTY_ROW_HEIGHT
=
33
;
export
const
MAX_WINDOW_HEIGHT_COMPACT
=
750
;
export
const
COMMIT_ITEM_PADDING
=
32
;
// Commit message textarea
export
const
MAX_TITLE_LENGTH
=
50
;
export
const
MAX_BODY_LENGTH
=
72
;
...
...
app/assets/javascripts/ide/stores/mutations/file.js
View file @
efed5aed
/* eslint-disable no-param-reassign */
import
*
as
types
from
'
../mutation_types
'
;
export
default
{
...
...
@@ -169,26 +170,18 @@ export default {
});
},
[
types
.
ADD_PENDING_TAB
](
state
,
{
file
,
keyPrefix
=
'
pending
'
})
{
const
key
=
`
${
keyPrefix
}
-
${
file
.
key
}
`
;
Object
.
assign
(
state
,
{
entries
:
Object
.
assign
(
state
.
entries
,
{
[
file
.
path
]:
Object
.
assign
(
state
.
entries
[
file
.
path
],
{
opened
:
false
,
active
:
false
,
lastOpenedAt
:
new
Date
().
getTime
(),
}),
}),
openFiles
:
[
state
.
entries
[
file
.
path
].
opened
=
false
;
state
.
entries
[
file
.
path
].
active
=
false
;
state
.
entries
[
file
.
path
].
lastOpenedAt
=
new
Date
().
getTime
();
state
.
openFiles
=
[
{
...
file
,
key
,
key
:
`
${
keyPrefix
}
-
${
file
.
key
}
`
,
pending
:
true
,
opened
:
true
,
active
:
true
,
},
],
});
];
},
[
types
.
REMOVE_PENDING_TAB
](
state
,
file
)
{
Object
.
assign
(
state
,
{
...
...
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