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
99c4e46d
Commit
99c4e46d
authored
May 28, 2018
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix `no-unused-vars`
parent
ef849c6c
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
109 additions
and
159 deletions
+109
-159
app/assets/javascripts/boards/components/modal/list.js
app/assets/javascripts/boards/components/modal/list.js
+5
-4
app/assets/javascripts/boards/components/project_select.vue
app/assets/javascripts/boards/components/project_select.vue
+55
-57
app/assets/javascripts/ide/lib/common/model.js
app/assets/javascripts/ide/lib/common/model.js
+0
-1
app/assets/javascripts/ide/stores/actions/file.js
app/assets/javascripts/ide/stores/actions/file.js
+3
-3
app/assets/javascripts/ide/stores/actions/merge_request.js
app/assets/javascripts/ide/stores/actions/merge_request.js
+3
-3
app/assets/javascripts/ide/stores/actions/project.js
app/assets/javascripts/ide/stores/actions/project.js
+4
-10
app/assets/javascripts/ide/stores/actions/tree.js
app/assets/javascripts/ide/stores/actions/tree.js
+3
-3
app/assets/javascripts/ide/stores/modules/commit/actions.js
app/assets/javascripts/ide/stores/modules/commit/actions.js
+4
-7
app/assets/javascripts/jobs/job_details_mediator.js
app/assets/javascripts/jobs/job_details_mediator.js
+2
-3
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+19
-50
app/assets/javascripts/registry/stores/actions.js
app/assets/javascripts/registry/stores/actions.js
+11
-11
spec/javascripts/boards/board_blank_state_spec.js
spec/javascripts/boards/board_blank_state_spec.js
+0
-1
spec/javascripts/boards/board_card_spec.js
spec/javascripts/boards/board_card_spec.js
+0
-1
spec/javascripts/boards/board_list_spec.js
spec/javascripts/boards/board_list_spec.js
+0
-1
spec/javascripts/boards/board_new_issue_spec.js
spec/javascripts/boards/board_new_issue_spec.js
+0
-1
spec/javascripts/boards/boards_store_spec.js
spec/javascripts/boards/boards_store_spec.js
+0
-1
spec/javascripts/boards/issue_spec.js
spec/javascripts/boards/issue_spec.js
+0
-1
spec/javascripts/boards/list_spec.js
spec/javascripts/boards/list_spec.js
+0
-1
No files found.
app/assets/javascripts/boards/components/modal/list.js
View file @
99c4e46d
/* global ListIssue */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
bp
from
'
../../../breakpoints
'
;
import
bp
from
'
../../../breakpoints
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
...
@@ -56,8 +54,11 @@ gl.issueBoards.ModalList = Vue.extend({
...
@@ -56,8 +54,11 @@ gl.issueBoards.ModalList = Vue.extend({
scrollHandler
()
{
scrollHandler
()
{
const
currentPage
=
Math
.
floor
(
this
.
issues
.
length
/
this
.
perPage
);
const
currentPage
=
Math
.
floor
(
this
.
issues
.
length
/
this
.
perPage
);
if
((
this
.
scrollTop
()
>
this
.
scrollHeight
()
-
100
)
&&
!
this
.
loadingNewPage
if
(
&&
currentPage
===
this
.
page
)
{
this
.
scrollTop
()
>
this
.
scrollHeight
()
-
100
&&
!
this
.
loadingNewPage
&&
currentPage
===
this
.
page
)
{
this
.
loadingNewPage
=
true
;
this
.
loadingNewPage
=
true
;
this
.
page
+=
1
;
this
.
page
+=
1
;
}
}
...
...
app/assets/javascripts/boards/components/project_select.vue
View file @
99c4e46d
<
script
>
<
script
>
/* global ListIssue */
import
$
from
'
jquery
'
;
import
_
from
'
underscore
'
;
import
eventHub
from
'
../eventhub
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
import
Api
from
'
../../api
'
;
import
$
from
'
jquery
'
;
export
default
{
import
_
from
'
underscore
'
;
import
eventHub
from
'
../eventhub
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
import
Api
from
'
../../api
'
;
export
default
{
name
:
'
BoardProjectSelect
'
,
name
:
'
BoardProjectSelect
'
,
components
:
{
components
:
{
loadingIcon
,
loadingIcon
,
...
@@ -48,7 +46,7 @@
...
@@ -48,7 +46,7 @@
selectable
:
true
,
selectable
:
true
,
data
:
(
term
,
callback
)
=>
{
data
:
(
term
,
callback
)
=>
{
this
.
loading
=
true
;
this
.
loading
=
true
;
return
Api
.
groupProjects
(
this
.
groupId
,
term
,
(
projects
)
=>
{
return
Api
.
groupProjects
(
this
.
groupId
,
term
,
projects
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
callback
(
projects
);
callback
(
projects
);
});
});
...
@@ -65,7 +63,7 @@
...
@@ -65,7 +63,7 @@
text
:
project
=>
project
.
name
,
text
:
project
=>
project
.
name
,
});
});
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
...
...
app/assets/javascripts/ide/lib/common/model.js
View file @
99c4e46d
/* global monaco */
import
Disposable
from
'
./disposable
'
;
import
Disposable
from
'
./disposable
'
;
import
eventHub
from
'
../../eventhub
'
;
import
eventHub
from
'
../../eventhub
'
;
...
...
app/assets/javascripts/ide/stores/actions/file.js
View file @
99c4e46d
...
@@ -84,11 +84,11 @@ export const getFileData = ({ state, commit, dispatch }, { path, makeFileActive
...
@@ -84,11 +84,11 @@ export const getFileData = ({ state, commit, dispatch }, { path, makeFileActive
});
});
};
};
export
const
setFileMrChange
=
({
state
,
commit
},
{
file
,
mrChange
})
=>
{
export
const
setFileMrChange
=
({
commit
},
{
file
,
mrChange
})
=>
{
commit
(
types
.
SET_FILE_MERGE_REQUEST_CHANGE
,
{
file
,
mrChange
});
commit
(
types
.
SET_FILE_MERGE_REQUEST_CHANGE
,
{
file
,
mrChange
});
};
};
export
const
getRawFileData
=
({
state
,
commit
,
dispatch
},
{
path
,
baseSha
})
=>
{
export
const
getRawFileData
=
({
state
,
commit
},
{
path
,
baseSha
})
=>
{
const
file
=
state
.
entries
[
path
];
const
file
=
state
.
entries
[
path
];
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
service
service
...
@@ -156,7 +156,7 @@ export const setEditorPosition = ({ getters, commit }, { editorRow, editorColumn
...
@@ -156,7 +156,7 @@ export const setEditorPosition = ({ getters, commit }, { editorRow, editorColumn
}
}
};
};
export
const
setFileViewMode
=
({
state
,
commit
},
{
file
,
viewMode
})
=>
{
export
const
setFileViewMode
=
({
commit
},
{
file
,
viewMode
})
=>
{
commit
(
types
.
SET_FILE_VIEWMODE
,
{
file
,
viewMode
});
commit
(
types
.
SET_FILE_VIEWMODE
,
{
file
,
viewMode
});
};
};
...
...
app/assets/javascripts/ide/stores/actions/merge_request.js
View file @
99c4e46d
...
@@ -3,7 +3,7 @@ import service from '../../services';
...
@@ -3,7 +3,7 @@ import service from '../../services';
import
*
as
types
from
'
../mutation_types
'
;
import
*
as
types
from
'
../mutation_types
'
;
export
const
getMergeRequestData
=
(
export
const
getMergeRequestData
=
(
{
commit
,
state
,
dispatch
},
{
commit
,
state
},
{
projectId
,
mergeRequestId
,
force
=
false
}
=
{},
{
projectId
,
mergeRequestId
,
force
=
false
}
=
{},
)
=>
)
=>
new
Promise
((
resolve
,
reject
)
=>
{
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -32,7 +32,7 @@ export const getMergeRequestData = (
...
@@ -32,7 +32,7 @@ export const getMergeRequestData = (
});
});
export
const
getMergeRequestChanges
=
(
export
const
getMergeRequestChanges
=
(
{
commit
,
state
,
dispatch
},
{
commit
,
state
},
{
projectId
,
mergeRequestId
,
force
=
false
}
=
{},
{
projectId
,
mergeRequestId
,
force
=
false
}
=
{},
)
=>
)
=>
new
Promise
((
resolve
,
reject
)
=>
{
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -58,7 +58,7 @@ export const getMergeRequestChanges = (
...
@@ -58,7 +58,7 @@ export const getMergeRequestChanges = (
});
});
export
const
getMergeRequestVersions
=
(
export
const
getMergeRequestVersions
=
(
{
commit
,
state
,
dispatch
},
{
commit
,
state
},
{
projectId
,
mergeRequestId
,
force
=
false
}
=
{},
{
projectId
,
mergeRequestId
,
force
=
false
}
=
{},
)
=>
)
=>
new
Promise
((
resolve
,
reject
)
=>
{
new
Promise
((
resolve
,
reject
)
=>
{
...
...
app/assets/javascripts/ide/stores/actions/project.js
View file @
99c4e46d
...
@@ -7,10 +7,7 @@ import Poll from '../../../lib/utils/poll';
...
@@ -7,10 +7,7 @@ import Poll from '../../../lib/utils/poll';
let
eTagPoll
;
let
eTagPoll
;
export
const
getProjectData
=
(
export
const
getProjectData
=
({
commit
,
state
},
{
namespace
,
projectId
,
force
=
false
}
=
{})
=>
{
commit
,
state
,
dispatch
},
{
namespace
,
projectId
,
force
=
false
}
=
{},
)
=>
new
Promise
((
resolve
,
reject
)
=>
{
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
state
.
projects
[
`
${
namespace
}
/
${
projectId
}
`
]
||
force
)
{
if
(
!
state
.
projects
[
`
${
namespace
}
/
${
projectId
}
`
]
||
force
)
{
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
state
});
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
state
});
...
@@ -40,10 +37,7 @@ export const getProjectData = (
...
@@ -40,10 +37,7 @@ export const getProjectData = (
}
}
});
});
export
const
getBranchData
=
(
export
const
getBranchData
=
({
commit
,
state
},
{
projectId
,
branchId
,
force
=
false
}
=
{})
=>
{
commit
,
state
,
dispatch
},
{
projectId
,
branchId
,
force
=
false
}
=
{},
)
=>
new
Promise
((
resolve
,
reject
)
=>
{
new
Promise
((
resolve
,
reject
)
=>
{
if
(
if
(
typeof
state
.
projects
[
`
${
projectId
}
`
]
===
'
undefined
'
||
typeof
state
.
projects
[
`
${
projectId
}
`
]
===
'
undefined
'
||
...
@@ -78,7 +72,7 @@ export const getBranchData = (
...
@@ -78,7 +72,7 @@ export const getBranchData = (
}
}
});
});
export
const
refreshLastCommitData
=
({
commit
,
state
,
dispatch
},
{
projectId
,
branchId
}
=
{})
=>
export
const
refreshLastCommitData
=
({
commit
},
{
projectId
,
branchId
}
=
{})
=>
service
service
.
getBranchData
(
projectId
,
branchId
)
.
getBranchData
(
projectId
,
branchId
)
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
...
@@ -92,7 +86,7 @@ export const refreshLastCommitData = ({ commit, state, dispatch }, { projectId,
...
@@ -92,7 +86,7 @@ export const refreshLastCommitData = ({ commit, state, dispatch }, { projectId,
flash
(
__
(
'
Error loading last commit.
'
),
'
alert
'
,
document
,
null
,
false
,
true
);
flash
(
__
(
'
Error loading last commit.
'
),
'
alert
'
,
document
,
null
,
false
,
true
);
});
});
export
const
pollSuccessCallBack
=
({
commit
,
state
,
dispatch
},
{
data
})
=>
{
export
const
pollSuccessCallBack
=
({
commit
,
state
},
{
data
})
=>
{
if
(
data
.
pipelines
&&
data
.
pipelines
.
length
)
{
if
(
data
.
pipelines
&&
data
.
pipelines
.
length
)
{
const
lastCommitHash
=
const
lastCommitHash
=
state
.
projects
[
state
.
currentProjectId
].
branches
[
state
.
currentBranchId
].
commit
.
id
;
state
.
projects
[
state
.
currentProjectId
].
branches
[
state
.
currentBranchId
].
commit
.
id
;
...
...
app/assets/javascripts/ide/stores/actions/tree.js
View file @
99c4e46d
...
@@ -5,7 +5,7 @@ import * as types from '../mutation_types';
...
@@ -5,7 +5,7 @@ import * as types from '../mutation_types';
import
{
findEntry
}
from
'
../utils
'
;
import
{
findEntry
}
from
'
../utils
'
;
import
FilesDecoratorWorker
from
'
../workers/files_decorator_worker
'
;
import
FilesDecoratorWorker
from
'
../workers/files_decorator_worker
'
;
export
const
toggleTreeOpen
=
({
commit
,
dispatch
},
path
)
=>
{
export
const
toggleTreeOpen
=
({
commit
},
path
)
=>
{
commit
(
types
.
TOGGLE_TREE_OPEN
,
path
);
commit
(
types
.
TOGGLE_TREE_OPEN
,
path
);
};
};
...
@@ -23,7 +23,7 @@ export const handleTreeEntryAction = ({ commit, dispatch }, row) => {
...
@@ -23,7 +23,7 @@ export const handleTreeEntryAction = ({ commit, dispatch }, row) => {
}
}
};
};
export
const
getLastCommitData
=
({
state
,
commit
,
dispatch
,
getters
},
tree
=
state
)
=>
{
export
const
getLastCommitData
=
({
state
,
commit
,
dispatch
},
tree
=
state
)
=>
{
if
(
!
tree
||
tree
.
lastCommitPath
===
null
||
!
tree
.
lastCommitPath
)
return
;
if
(
!
tree
||
tree
.
lastCommitPath
===
null
||
!
tree
.
lastCommitPath
)
return
;
service
service
...
@@ -49,7 +49,7 @@ export const getLastCommitData = ({ state, commit, dispatch, getters }, tree = s
...
@@ -49,7 +49,7 @@ export const getLastCommitData = ({ state, commit, dispatch, getters }, tree = s
.
catch
(()
=>
flash
(
'
Error fetching log data.
'
,
'
alert
'
,
document
,
null
,
false
,
true
));
.
catch
(()
=>
flash
(
'
Error fetching log data.
'
,
'
alert
'
,
document
,
null
,
false
,
true
));
};
};
export
const
getFiles
=
({
state
,
commit
,
dispatch
},
{
projectId
,
branchId
}
=
{})
=>
export
const
getFiles
=
({
state
,
commit
},
{
projectId
,
branchId
}
=
{})
=>
new
Promise
((
resolve
,
reject
)
=>
{
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
state
.
trees
[
`
${
projectId
}
/
${
branchId
}
`
])
{
if
(
!
state
.
trees
[
`
${
projectId
}
/
${
branchId
}
`
])
{
const
selectedProject
=
state
.
projects
[
projectId
];
const
selectedProject
=
state
.
projects
[
projectId
];
...
...
app/assets/javascripts/ide/stores/modules/commit/actions.js
View file @
99c4e46d
...
@@ -31,9 +31,9 @@ export const setLastCommitMessage = ({ rootState, commit }, data) => {
...
@@ -31,9 +31,9 @@ export const setLastCommitMessage = ({ rootState, commit }, data) => {
const
currentProject
=
rootState
.
projects
[
rootState
.
currentProjectId
];
const
currentProject
=
rootState
.
projects
[
rootState
.
currentProjectId
];
const
commitStats
=
data
.
stats
const
commitStats
=
data
.
stats
?
sprintf
(
__
(
'
with %{additions} additions, %{deletions} deletions.
'
),
{
?
sprintf
(
__
(
'
with %{additions} additions, %{deletions} deletions.
'
),
{
additions
:
data
.
stats
.
additions
,
// eslint-disable-line indent
additions
:
data
.
stats
.
additions
,
// eslint-disable-line indent
-legacy
deletions
:
data
.
stats
.
deletions
,
// eslint-disable-line indent
deletions
:
data
.
stats
.
deletions
,
// eslint-disable-line indent
-legacy
})
// eslint-disable-line indent
})
// eslint-disable-line indent
-legacy
:
''
;
:
''
;
const
commitMsg
=
sprintf
(
const
commitMsg
=
sprintf
(
__
(
'
Your changes have been committed. Commit %{commitId} %{commitStats}
'
),
__
(
'
Your changes have been committed. Commit %{commitId} %{commitStats}
'
),
...
@@ -74,10 +74,7 @@ export const checkCommitStatus = ({ rootState }) =>
...
@@ -74,10 +74,7 @@ export const checkCommitStatus = ({ rootState }) =>
),
),
);
);
export
const
updateFilesAfterCommit
=
(
export
const
updateFilesAfterCommit
=
({
commit
,
dispatch
,
rootState
},
{
data
})
=>
{
{
commit
,
dispatch
,
state
,
rootState
,
rootGetters
},
{
data
},
)
=>
{
const
selectedProject
=
rootState
.
projects
[
rootState
.
currentProjectId
];
const
selectedProject
=
rootState
.
projects
[
rootState
.
currentProjectId
];
const
lastCommit
=
{
const
lastCommit
=
{
commit_path
:
`
${
selectedProject
.
web_url
}
/commit/
${
data
.
id
}
`
,
commit_path
:
`
${
selectedProject
.
web_url
}
/commit/
${
data
.
id
}
`
,
...
...
app/assets/javascripts/jobs/job_details_mediator.js
View file @
99c4e46d
/* global Build */
import
Visibility
from
'
visibilityjs
'
;
import
Visibility
from
'
visibilityjs
'
;
import
Flash
from
'
../flash
'
;
import
Flash
from
'
../flash
'
;
import
Poll
from
'
../lib/utils/poll
'
;
import
Poll
from
'
../lib/utils/poll
'
;
...
@@ -50,7 +48,8 @@ export default class JobMediator {
...
@@ -50,7 +48,8 @@ export default class JobMediator {
}
}
getJob
()
{
getJob
()
{
return
this
.
service
.
getJob
()
return
this
.
service
.
getJob
()
.
then
(
response
=>
this
.
successCallback
(
response
))
.
then
(
response
=>
this
.
successCallback
(
response
))
.
catch
(()
=>
this
.
errorCallback
());
.
catch
(()
=>
this
.
errorCallback
());
}
}
...
...
app/assets/javascripts/notes/stores/actions.js
View file @
99c4e46d
...
@@ -12,20 +12,13 @@ import { isInViewport, scrollToElement } from '../../lib/utils/common_utils';
...
@@ -12,20 +12,13 @@ import { isInViewport, scrollToElement } from '../../lib/utils/common_utils';
let
eTagPoll
;
let
eTagPoll
;
export
const
setNotesData
=
({
commit
},
data
)
=>
export
const
setNotesData
=
({
commit
},
data
)
=>
commit
(
types
.
SET_NOTES_DATA
,
data
);
commit
(
types
.
SET_NOTES_DATA
,
data
);
export
const
setNoteableData
=
({
commit
},
data
)
=>
commit
(
types
.
SET_NOTEABLE_DATA
,
data
);
export
const
setNoteableData
=
({
commit
},
data
)
=>
export
const
setUserData
=
({
commit
},
data
)
=>
commit
(
types
.
SET_USER_DATA
,
data
);
commit
(
types
.
SET_NOTEABLE_DATA
,
data
);
export
const
setLastFetchedAt
=
({
commit
},
data
)
=>
commit
(
types
.
SET_LAST_FETCHED_AT
,
data
);
export
const
setUserData
=
({
commit
},
data
)
=>
export
const
setInitialNotes
=
({
commit
},
data
)
=>
commit
(
types
.
SET_INITIAL_NOTES
,
data
);
commit
(
types
.
SET_USER_DATA
,
data
);
export
const
setTargetNoteHash
=
({
commit
},
data
)
=>
commit
(
types
.
SET_TARGET_NOTE_HASH
,
data
);
export
const
setLastFetchedAt
=
({
commit
},
data
)
=>
export
const
toggleDiscussion
=
({
commit
},
data
)
=>
commit
(
types
.
TOGGLE_DISCUSSION
,
data
);
commit
(
types
.
SET_LAST_FETCHED_AT
,
data
);
export
const
setInitialNotes
=
({
commit
},
data
)
=>
commit
(
types
.
SET_INITIAL_NOTES
,
data
);
export
const
setTargetNoteHash
=
({
commit
},
data
)
=>
commit
(
types
.
SET_TARGET_NOTE_HASH
,
data
);
export
const
toggleDiscussion
=
({
commit
},
data
)
=>
commit
(
types
.
TOGGLE_DISCUSSION
,
data
);
export
const
fetchNotes
=
({
commit
},
path
)
=>
export
const
fetchNotes
=
({
commit
},
path
)
=>
service
service
...
@@ -69,20 +62,14 @@ export const createNewNote = ({ commit }, { endpoint, data }) =>
...
@@ -69,20 +62,14 @@ export const createNewNote = ({ commit }, { endpoint, data }) =>
return
res
;
return
res
;
});
});
export
const
removePlaceholderNotes
=
({
commit
})
=>
export
const
removePlaceholderNotes
=
({
commit
})
=>
commit
(
types
.
REMOVE_PLACEHOLDER_NOTES
);
commit
(
types
.
REMOVE_PLACEHOLDER_NOTES
);
export
const
toggleResolveNote
=
(
export
const
toggleResolveNote
=
({
commit
},
{
endpoint
,
isResolved
,
discussion
})
=>
{
commit
},
{
endpoint
,
isResolved
,
discussion
},
)
=>
service
service
.
toggleResolveNote
(
endpoint
,
isResolved
)
.
toggleResolveNote
(
endpoint
,
isResolved
)
.
then
(
res
=>
res
.
json
())
.
then
(
res
=>
res
.
json
())
.
then
(
res
=>
{
.
then
(
res
=>
{
const
mutationType
=
discussion
const
mutationType
=
discussion
?
types
.
UPDATE_DISCUSSION
:
types
.
UPDATE_NOTE
;
?
types
.
UPDATE_DISCUSSION
:
types
.
UPDATE_NOTE
;
commit
(
mutationType
,
res
);
commit
(
mutationType
,
res
);
});
});
...
@@ -114,7 +101,7 @@ export const reopenIssue = ({ commit, dispatch, state }) => {
...
@@ -114,7 +101,7 @@ export const reopenIssue = ({ commit, dispatch, state }) => {
export
const
toggleStateButtonLoading
=
({
commit
},
value
)
=>
export
const
toggleStateButtonLoading
=
({
commit
},
value
)
=>
commit
(
types
.
TOGGLE_STATE_BUTTON_LOADING
,
value
);
commit
(
types
.
TOGGLE_STATE_BUTTON_LOADING
,
value
);
export
const
emitStateChangedEvent
=
({
commit
,
getters
},
data
)
=>
{
export
const
emitStateChangedEvent
=
({
getters
},
data
)
=>
{
const
event
=
new
CustomEvent
(
'
issuable_vue_app:change
'
,
{
const
event
=
new
CustomEvent
(
'
issuable_vue_app:change
'
,
{
detail
:
{
detail
:
{
data
,
data
,
...
@@ -179,10 +166,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
...
@@ -179,10 +166,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
loadAwardsHandler
()
loadAwardsHandler
()
.
then
(
awardsHandler
=>
{
.
then
(
awardsHandler
=>
{
awardsHandler
.
addAwardToEmojiBar
(
awardsHandler
.
addAwardToEmojiBar
(
votesBlock
,
commandsChanges
.
emoji_award
);
votesBlock
,
commandsChanges
.
emoji_award
,
);
awardsHandler
.
scrollToAwards
();
awardsHandler
.
scrollToAwards
();
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
...
@@ -194,10 +178,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
...
@@ -194,10 +178,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
});
});
}
}
if
(
if
(
commandsChanges
.
spend_time
!=
null
||
commandsChanges
.
time_estimate
!=
null
)
{
commandsChanges
.
spend_time
!=
null
||
commandsChanges
.
time_estimate
!=
null
)
{
sidebarTimeTrackingEventHub
.
$emit
(
'
timeTrackingUpdated
'
,
res
);
sidebarTimeTrackingEventHub
.
$emit
(
'
timeTrackingUpdated
'
,
res
);
}
}
}
}
...
@@ -218,14 +199,8 @@ const pollSuccessCallBack = (resp, commit, state, getters) => {
...
@@ -218,14 +199,8 @@ const pollSuccessCallBack = (resp, commit, state, getters) => {
resp
.
notes
.
forEach
(
note
=>
{
resp
.
notes
.
forEach
(
note
=>
{
if
(
notesById
[
note
.
id
])
{
if
(
notesById
[
note
.
id
])
{
commit
(
types
.
UPDATE_NOTE
,
note
);
commit
(
types
.
UPDATE_NOTE
,
note
);
}
else
if
(
}
else
if
(
note
.
type
===
constants
.
DISCUSSION_NOTE
||
note
.
type
===
constants
.
DIFF_NOTE
)
{
note
.
type
===
constants
.
DISCUSSION_NOTE
||
const
discussion
=
utils
.
findNoteObjectById
(
state
.
notes
,
note
.
discussion_id
);
note
.
type
===
constants
.
DIFF_NOTE
)
{
const
discussion
=
utils
.
findNoteObjectById
(
state
.
notes
,
note
.
discussion_id
,
);
if
(
discussion
)
{
if
(
discussion
)
{
commit
(
types
.
ADD_NEW_REPLY_TO_DISCUSSION
,
note
);
commit
(
types
.
ADD_NEW_REPLY_TO_DISCUSSION
,
note
);
...
@@ -249,11 +224,8 @@ export const poll = ({ commit, state, getters }) => {
...
@@ -249,11 +224,8 @@ export const poll = ({ commit, state, getters }) => {
method
:
'
poll
'
,
method
:
'
poll
'
,
data
:
state
,
data
:
state
,
successCallback
:
resp
=>
successCallback
:
resp
=>
resp
resp
.
json
().
then
(
data
=>
pollSuccessCallBack
(
data
,
commit
,
state
,
getters
)),
.
json
()
errorCallback
:
()
=>
Flash
(
'
Something went wrong while fetching latest comments.
'
),
.
then
(
data
=>
pollSuccessCallBack
(
data
,
commit
,
state
,
getters
)),
errorCallback
:
()
=>
Flash
(
'
Something went wrong while fetching latest comments.
'
),
});
});
if
(
!
Visibility
.
hidden
())
{
if
(
!
Visibility
.
hidden
())
{
...
@@ -292,14 +264,11 @@ export const fetchData = ({ commit, state, getters }) => {
...
@@ -292,14 +264,11 @@ export const fetchData = ({ commit, state, getters }) => {
.
catch
(()
=>
Flash
(
'
Something went wrong while fetching latest comments.
'
));
.
catch
(()
=>
Flash
(
'
Something went wrong while fetching latest comments.
'
));
};
};
export
const
toggleAward
=
(
export
const
toggleAward
=
({
commit
,
getters
},
{
awardName
,
noteId
})
=>
{
{
commit
,
state
,
getters
,
dispatch
},
{
awardName
,
noteId
},
)
=>
{
commit
(
types
.
TOGGLE_AWARD
,
{
awardName
,
note
:
getters
.
notesById
[
noteId
]
});
commit
(
types
.
TOGGLE_AWARD
,
{
awardName
,
note
:
getters
.
notesById
[
noteId
]
});
};
};
export
const
toggleAwardRequest
=
({
commit
,
getters
,
dispatch
},
data
)
=>
{
export
const
toggleAwardRequest
=
({
dispatch
},
data
)
=>
{
const
{
endpoint
,
awardName
}
=
data
;
const
{
endpoint
,
awardName
}
=
data
;
return
service
return
service
...
...
app/assets/javascripts/registry/stores/actions.js
View file @
99c4e46d
...
@@ -7,9 +7,10 @@ Vue.use(VueResource);
...
@@ -7,9 +7,10 @@ Vue.use(VueResource);
export
const
fetchRepos
=
({
commit
,
state
})
=>
{
export
const
fetchRepos
=
({
commit
,
state
})
=>
{
commit
(
types
.
TOGGLE_MAIN_LOADING
);
commit
(
types
.
TOGGLE_MAIN_LOADING
);
return
Vue
.
http
.
get
(
state
.
endpoint
)
return
Vue
.
http
.
get
(
state
.
endpoint
)
.
then
(
res
=>
res
.
json
())
.
then
(
res
=>
res
.
json
())
.
then
(
(
response
)
=>
{
.
then
(
response
=>
{
commit
(
types
.
TOGGLE_MAIN_LOADING
);
commit
(
types
.
TOGGLE_MAIN_LOADING
);
commit
(
types
.
SET_REPOS_LIST
,
response
);
commit
(
types
.
SET_REPOS_LIST
,
response
);
});
});
...
@@ -18,20 +19,19 @@ export const fetchRepos = ({ commit, state }) => {
...
@@ -18,20 +19,19 @@ export const fetchRepos = ({ commit, state }) => {
export
const
fetchList
=
({
commit
},
{
repo
,
page
})
=>
{
export
const
fetchList
=
({
commit
},
{
repo
,
page
})
=>
{
commit
(
types
.
TOGGLE_REGISTRY_LIST_LOADING
,
repo
);
commit
(
types
.
TOGGLE_REGISTRY_LIST_LOADING
,
repo
);
return
Vue
.
http
.
get
(
repo
.
tagsPath
,
{
params
:
{
page
}
})
return
Vue
.
http
.
get
(
repo
.
tagsPath
,
{
params
:
{
page
}
}).
then
(
response
=>
{
.
then
((
response
)
=>
{
const
headers
=
response
.
headers
;
const
headers
=
response
.
headers
;
return
response
.
json
().
then
((
resp
)
=>
{
return
response
.
json
().
then
(
resp
=>
{
commit
(
types
.
TOGGLE_REGISTRY_LIST_LOADING
,
repo
);
commit
(
types
.
TOGGLE_REGISTRY_LIST_LOADING
,
repo
);
commit
(
types
.
SET_REGISTRY_LIST
,
{
repo
,
resp
,
headers
});
commit
(
types
.
SET_REGISTRY_LIST
,
{
repo
,
resp
,
headers
});
});
});
});
});
};
};
export
const
deleteRepo
=
({
commit
},
repo
)
=>
Vue
.
http
.
delete
(
repo
.
destroyPath
);
export
const
deleteRepo
=
({
commit
},
repo
)
=>
Vue
.
http
.
delete
(
repo
.
destroyPath
);
// eslint-disable-line no-unused-vars
export
const
deleteRegistry
=
({
commit
},
image
)
=>
Vue
.
http
.
delete
(
image
.
destroyPath
);
export
const
deleteRegistry
=
({
commit
},
image
)
=>
Vue
.
http
.
delete
(
image
.
destroyPath
);
// eslint-disable-line no-unused-vars
export
const
setMainEndpoint
=
({
commit
},
data
)
=>
commit
(
types
.
SET_MAIN_ENDPOINT
,
data
);
export
const
setMainEndpoint
=
({
commit
},
data
)
=>
commit
(
types
.
SET_MAIN_ENDPOINT
,
data
);
export
const
toggleLoading
=
({
commit
})
=>
commit
(
types
.
TOGGLE_MAIN_LOADING
);
export
const
toggleLoading
=
({
commit
})
=>
commit
(
types
.
TOGGLE_MAIN_LOADING
);
...
...
spec/javascripts/boards/board_blank_state_spec.js
View file @
99c4e46d
/* global BoardService */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
'
~/boards/stores/boards_store
'
;
import
'
~/boards/stores/boards_store
'
;
import
BoardBlankState
from
'
~/boards/components/board_blank_state.vue
'
;
import
BoardBlankState
from
'
~/boards/components/board_blank_state.vue
'
;
...
...
spec/javascripts/boards/board_card_spec.js
View file @
99c4e46d
/* global List */
/* global List */
/* global ListAssignee */
/* global ListAssignee */
/* global ListLabel */
/* global ListLabel */
/* global BoardService */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
...
...
spec/javascripts/boards/board_list_spec.js
View file @
99c4e46d
/* global BoardService */
/* global List */
/* global List */
/* global ListIssue */
/* global ListIssue */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
...
...
spec/javascripts/boards/board_new_issue_spec.js
View file @
99c4e46d
/* global BoardService */
/* global List */
/* global List */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
...
...
spec/javascripts/boards/boards_store_spec.js
View file @
99c4e46d
/* eslint-disable comma-dangle, one-var, no-unused-vars */
/* eslint-disable comma-dangle, one-var, no-unused-vars */
/* global BoardService */
/* global ListIssue */
/* global ListIssue */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
...
...
spec/javascripts/boards/issue_spec.js
View file @
99c4e46d
/* eslint-disable comma-dangle */
/* eslint-disable comma-dangle */
/* global BoardService */
/* global ListIssue */
/* global ListIssue */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
...
...
spec/javascripts/boards/list_spec.js
View file @
99c4e46d
/* eslint-disable comma-dangle */
/* eslint-disable comma-dangle */
/* global BoardService */
/* global List */
/* global List */
/* global ListIssue */
/* global ListIssue */
...
...
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