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
Léo-Paul Géneau
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 {
...
@@ -10,7 +10,6 @@ export default {
},
},
computed
:
{
computed
:
{
...
mapState
([
'
currentBranchId
'
,
'
changedFiles
'
,
'
stagedFiles
'
]),
...
mapState
([
'
currentBranchId
'
,
'
changedFiles
'
,
'
stagedFiles
'
]),
...
mapGetters
([
'
hasChanges
'
]),
commitToCurrentBranchText
()
{
commitToCurrentBranchText
()
{
return
sprintf
(
return
sprintf
(
__
(
'
Commit to %{branchName} branch
'
),
__
(
'
Commit to %{branchName} branch
'
),
...
@@ -18,6 +17,9 @@ export default {
...
@@ -18,6 +17,9 @@ export default {
false
,
false
,
);
);
},
},
disableMergeRequestRadio
()
{
return
this
.
changedFiles
.
length
>
0
&&
this
.
stagedFiles
.
length
>
0
;
},
},
},
commitToCurrentBranch
:
consts
.
COMMIT_TO_CURRENT_BRANCH
,
commitToCurrentBranch
:
consts
.
COMMIT_TO_CURRENT_BRANCH
,
commitToNewBranch
:
consts
.
COMMIT_TO_NEW_BRANCH
,
commitToNewBranch
:
consts
.
COMMIT_TO_NEW_BRANCH
,
...
@@ -45,7 +47,7 @@ export default {
...
@@ -45,7 +47,7 @@ export default {
:value=
"$options.commitToNewBranchMR"
:value=
"$options.commitToNewBranchMR"
:label=
"__('Create a new branch and merge request')"
:label=
"__('Create a new branch and merge request')"
:show-input=
"true"
:show-input=
"true"
:disabled=
"
!!changedFiles.length && !!stagedFiles.length
"
:disabled=
"
disableMergeRequestRadio
"
/>
/>
</div>
</div>
</
template
>
</
template
>
app/assets/javascripts/ide/components/commit_sidebar/form.vue
View file @
efed5aed
...
@@ -4,7 +4,7 @@ import { sprintf, __ } from '~/locale';
...
@@ -4,7 +4,7 @@ import { sprintf, __ } from '~/locale';
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
CommitMessageField
from
'
./message_field.vue
'
;
import
CommitMessageField
from
'
./message_field.vue
'
;
import
Actions
from
'
./actions.vue
'
;
import
Actions
from
'
./actions.vue
'
;
import
{
activityBarViews
}
from
'
../../constants
'
;
import
{
activityBarViews
,
MAX_WINDOW_HEIGHT_COMPACT
,
COMMIT_ITEM_PADDING
}
from
'
../../constants
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -38,7 +38,8 @@ export default {
...
@@ -38,7 +38,8 @@ export default {
watch
:
{
watch
:
{
currentActivityView
()
{
currentActivityView
()
{
this
.
isCompact
=
!
(
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 {
...
@@ -59,7 +60,7 @@ export default {
?
this
.
$refs
.
formEl
&&
this
.
$refs
.
formEl
.
offsetHeight
?
this
.
$refs
.
formEl
&&
this
.
$refs
.
formEl
.
offsetHeight
:
this
.
$refs
.
compactEl
&&
this
.
$refs
.
compactEl
.
offsetHeight
;
:
this
.
$refs
.
compactEl
&&
this
.
$refs
.
compactEl
.
offsetHeight
;
this
.
componentHeight
=
elHeight
+
32
;
this
.
componentHeight
=
elHeight
+
COMMIT_ITEM_PADDING
;
},
},
enterTransition
()
{
enterTransition
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
...
@@ -67,7 +68,7 @@ export default {
...
@@ -67,7 +68,7 @@ export default {
?
this
.
$refs
.
compactEl
&&
this
.
$refs
.
compactEl
.
offsetHeight
?
this
.
$refs
.
compactEl
&&
this
.
$refs
.
compactEl
.
offsetHeight
:
this
.
$refs
.
formEl
&&
this
.
$refs
.
formEl
.
offsetHeight
;
:
this
.
$refs
.
formEl
&&
this
.
$refs
.
formEl
.
offsetHeight
;
this
.
componentHeight
=
elHeight
+
32
;
this
.
componentHeight
=
elHeight
+
COMMIT_ITEM_PADDING
;
});
});
},
},
afterEndTransition
()
{
afterEndTransition
()
{
...
...
app/assets/javascripts/ide/constants.js
View file @
efed5aed
...
@@ -3,6 +3,10 @@ export const MAX_FILE_FINDER_RESULTS = 40;
...
@@ -3,6 +3,10 @@ export const MAX_FILE_FINDER_RESULTS = 40;
export
const
FILE_FINDER_ROW_HEIGHT
=
55
;
export
const
FILE_FINDER_ROW_HEIGHT
=
55
;
export
const
FILE_FINDER_EMPTY_ROW_HEIGHT
=
33
;
export
const
FILE_FINDER_EMPTY_ROW_HEIGHT
=
33
;
export
const
MAX_WINDOW_HEIGHT_COMPACT
=
750
;
export
const
COMMIT_ITEM_PADDING
=
32
;
// Commit message textarea
// Commit message textarea
export
const
MAX_TITLE_LENGTH
=
50
;
export
const
MAX_TITLE_LENGTH
=
50
;
export
const
MAX_BODY_LENGTH
=
72
;
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
'
;
import
*
as
types
from
'
../mutation_types
'
;
export
default
{
export
default
{
...
@@ -169,26 +170,18 @@ export default {
...
@@ -169,26 +170,18 @@ export default {
});
});
},
},
[
types
.
ADD_PENDING_TAB
](
state
,
{
file
,
keyPrefix
=
'
pending
'
})
{
[
types
.
ADD_PENDING_TAB
](
state
,
{
file
,
keyPrefix
=
'
pending
'
})
{
const
key
=
`
${
keyPrefix
}
-
${
file
.
key
}
`
;
state
.
entries
[
file
.
path
].
opened
=
false
;
state
.
entries
[
file
.
path
].
active
=
false
;
Object
.
assign
(
state
,
{
state
.
entries
[
file
.
path
].
lastOpenedAt
=
new
Date
().
getTime
();
entries
:
Object
.
assign
(
state
.
entries
,
{
state
.
openFiles
=
[
[
file
.
path
]:
Object
.
assign
(
state
.
entries
[
file
.
path
],
{
opened
:
false
,
active
:
false
,
lastOpenedAt
:
new
Date
().
getTime
(),
}),
}),
openFiles
:
[
{
{
...
file
,
...
file
,
key
,
key
:
`
${
keyPrefix
}
-
${
file
.
key
}
`
,
pending
:
true
,
pending
:
true
,
opened
:
true
,
opened
:
true
,
active
:
true
,
active
:
true
,
},
},
],
];
});
},
},
[
types
.
REMOVE_PENDING_TAB
](
state
,
file
)
{
[
types
.
REMOVE_PENDING_TAB
](
state
,
file
)
{
Object
.
assign
(
state
,
{
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