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
7311e69f
Commit
7311e69f
authored
Apr 26, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added aria-label to buttons
updated variable name removed un-used prop
parent
9f35f6d9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
26 deletions
+19
-26
app/assets/javascripts/ide/components/activity_bar.vue
app/assets/javascripts/ide/components/activity_bar.vue
+8
-6
app/assets/javascripts/ide/components/ide.vue
app/assets/javascripts/ide/components/ide.vue
+1
-6
app/assets/javascripts/ide/constants.js
app/assets/javascripts/ide/constants.js
+1
-1
app/assets/javascripts/ide/index.js
app/assets/javascripts/ide/index.js
+1
-5
app/assets/javascripts/ide/stores/state.js
app/assets/javascripts/ide/stores/state.js
+2
-2
spec/javascripts/ide/components/activity_bar_spec.js
spec/javascripts/ide/components/activity_bar_spec.js
+4
-4
spec/javascripts/ide/components/ide_side_bar_spec.js
spec/javascripts/ide/components/ide_side_bar_spec.js
+2
-2
No files found.
app/assets/javascripts/ide/components/activity_bar.vue
View file @
7311e69f
<
script
>
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
{
A
ctivityBarViews
}
from
'
../constants
'
;
import
{
a
ctivityBarViews
}
from
'
../constants
'
;
export
default
{
components
:
{
...
...
@@ -17,7 +17,7 @@ export default {
methods
:
{
...
mapActions
([
'
updateActivityBarView
'
]),
},
A
ctivityBarViews
,
a
ctivityBarViews
,
};
</
script
>
...
...
@@ -41,9 +41,10 @@ export default {
type=
"button"
class=
"ide-sidebar-link js-ide-edit-mode"
:class=
"
{
active: currentActivityView === $options.
A
ctivityBarViews.edit
active: currentActivityView === $options.
a
ctivityBarViews.edit
}"
@click.prevent="updateActivityBarView($options.ActivityBarViews.edit)"
@click.prevent="updateActivityBarView($options.activityBarViews.edit)"
:aria-label="s__('IDE|Edit mode')"
>
<icon
name=
"code"
...
...
@@ -55,9 +56,10 @@ export default {
type=
"button"
class=
"ide-sidebar-link js-ide-commit-mode"
:class=
"
{
active: currentActivityView === $options.
A
ctivityBarViews.commit
active: currentActivityView === $options.
a
ctivityBarViews.commit
}"
@click.prevent="updateActivityBarView($options.ActivityBarViews.commit)"
@click.prevent="updateActivityBarView($options.activityBarViews.commit)"
:aria-label="s__('IDE|Commit mode')"
>
<icon
name=
"commit"
...
...
app/assets/javascripts/ide/components/ide.vue
View file @
7311e69f
...
...
@@ -17,12 +17,6 @@ export default {
RepoEditor
,
FindFile
,
},
props
:
{
emptyStateSvgPath
:
{
type
:
String
,
required
:
true
,
},
},
computed
:
{
...
mapState
([
'
changedFiles
'
,
...
...
@@ -30,6 +24,7 @@ export default {
'
viewer
'
,
'
currentMergeRequestId
'
,
'
fileFindVisible
'
,
'
emptyStateSvgPath
'
,
]),
...
mapGetters
([
'
activeFile
'
,
'
hasChanges
'
]),
},
...
...
app/assets/javascripts/ide/constants.js
View file @
7311e69f
...
...
@@ -7,7 +7,7 @@ export const FILE_FINDER_EMPTY_ROW_HEIGHT = 33;
export
const
MAX_TITLE_LENGTH
=
50
;
export
const
MAX_BODY_LENGTH
=
72
;
export
const
A
ctivityBarViews
=
{
export
const
a
ctivityBarViews
=
{
edit
:
'
ide-tree
'
,
commit
:
'
commit-section
'
,
};
app/assets/javascripts/ide/index.js
View file @
7311e69f
...
...
@@ -22,11 +22,7 @@ function initIde(el) {
});
},
render
(
createElement
)
{
return
createElement
(
'
ide
'
,
{
props
:
{
emptyStateSvgPath
:
el
.
dataset
.
emptyStateSvgPath
,
},
});
return
createElement
(
'
ide
'
);
},
});
}
...
...
app/assets/javascripts/ide/stores/state.js
View file @
7311e69f
import
{
A
ctivityBarViews
}
from
'
../constants
'
;
import
{
a
ctivityBarViews
}
from
'
../constants
'
;
export
default
()
=>
({
currentProjectId
:
''
,
...
...
@@ -20,6 +20,6 @@ export default () => ({
entries
:
{},
viewer
:
'
editor
'
,
delayViewerUpdated
:
false
,
currentActivityView
:
A
ctivityBarViews
.
edit
,
currentActivityView
:
a
ctivityBarViews
.
edit
,
fileFindVisible
:
false
,
});
spec/javascripts/ide/components/activity_bar_spec.js
View file @
7311e69f
import
Vue
from
'
vue
'
;
import
store
from
'
~/ide/stores
'
;
import
{
A
ctivityBarViews
}
from
'
~/ide/constants
'
;
import
{
a
ctivityBarViews
}
from
'
~/ide/constants
'
;
import
ActivityBar
from
'
~/ide/components/activity_bar.vue
'
;
import
{
createComponentWithStore
}
from
'
../../helpers/vue_mount_component_helper
'
;
import
{
resetStore
}
from
'
../helpers
'
;
...
...
@@ -54,13 +54,13 @@ describe('IDE activity bar', () => {
it
(
'
calls updateActivityBarView with edit value on click
'
,
()
=>
{
vm
.
$el
.
querySelector
(
'
.js-ide-edit-mode
'
).
click
();
expect
(
vm
.
updateActivityBarView
).
toHaveBeenCalledWith
(
A
ctivityBarViews
.
edit
);
expect
(
vm
.
updateActivityBarView
).
toHaveBeenCalledWith
(
a
ctivityBarViews
.
edit
);
});
it
(
'
calls updateActivityBarView with commit value on click
'
,
()
=>
{
vm
.
$el
.
querySelector
(
'
.js-ide-commit-mode
'
).
click
();
expect
(
vm
.
updateActivityBarView
).
toHaveBeenCalledWith
(
A
ctivityBarViews
.
commit
);
expect
(
vm
.
updateActivityBarView
).
toHaveBeenCalledWith
(
a
ctivityBarViews
.
commit
);
});
});
...
...
@@ -74,7 +74,7 @@ describe('IDE activity bar', () => {
});
it
(
'
sets commit item active
'
,
done
=>
{
vm
.
$store
.
state
.
currentActivityView
=
A
ctivityBarViews
.
commit
;
vm
.
$store
.
state
.
currentActivityView
=
a
ctivityBarViews
.
commit
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-ide-commit-mode
'
).
classList
).
toContain
(
'
active
'
);
...
...
spec/javascripts/ide/components/ide_side_bar_spec.js
View file @
7311e69f
import
Vue
from
'
vue
'
;
import
store
from
'
~/ide/stores
'
;
import
ideSidebar
from
'
~/ide/components/ide_side_bar.vue
'
;
import
{
A
ctivityBarViews
}
from
'
~/ide/constants
'
;
import
{
a
ctivityBarViews
}
from
'
~/ide/constants
'
;
import
{
createComponentWithStore
}
from
'
spec/helpers/vue_mount_component_helper
'
;
import
{
resetStore
}
from
'
../helpers
'
;
import
{
projectData
}
from
'
../mock_data
'
;
...
...
@@ -45,7 +45,7 @@ describe('IdeSidebar', () => {
});
it
(
'
renders commit component
'
,
done
=>
{
vm
.
$store
.
state
.
currentActivityView
=
A
ctivityBarViews
.
commit
;
vm
.
$store
.
state
.
currentActivityView
=
a
ctivityBarViews
.
commit
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.multi-file-commit-panel-section
'
)).
not
.
toBeNull
();
...
...
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