Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
eb71b5da
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
eb71b5da
编写于
4月 06, 2018
作者:
F
Filipa Lacerda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove modal store and mixins from global scope
上级
41ee09c9
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
33 addition
and
33 deletion
+33
-33
app/assets/javascripts/boards/components/modal/empty_state.js
...assets/javascripts/boards/components/modal/empty_state.js
+3
-3
app/assets/javascripts/boards/components/modal/footer.js
app/assets/javascripts/boards/components/modal/footer.js
+3
-3
app/assets/javascripts/boards/components/modal/header.js
app/assets/javascripts/boards/components/modal/header.js
+3
-3
app/assets/javascripts/boards/components/modal/index.js
app/assets/javascripts/boards/components/modal/index.js
+1
-2
app/assets/javascripts/boards/components/modal/list.js
app/assets/javascripts/boards/components/modal/list.js
+1
-2
app/assets/javascripts/boards/components/modal/lists_dropdown.js
...ets/javascripts/boards/components/modal/lists_dropdown.js
+1
-2
app/assets/javascripts/boards/components/modal/tabs.js
app/assets/javascripts/boards/components/modal/tabs.js
+3
-3
app/assets/javascripts/boards/index.js
app/assets/javascripts/boards/index.js
+3
-4
app/assets/javascripts/boards/mixins/modal_mixins.js
app/assets/javascripts/boards/mixins/modal_mixins.js
+2
-2
app/assets/javascripts/boards/stores/modal_store.js
app/assets/javascripts/boards/stores/modal_store.js
+1
-4
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+2
-1
app/assets/javascripts/milestone_select.js
app/assets/javascripts/milestone_select.js
+2
-1
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+2
-1
changelogs/unreleased/44224-remove-gl.yml
changelogs/unreleased/44224-remove-gl.yml
+5
-0
spec/javascripts/boards/modal_store_spec.js
spec/javascripts/boards/modal_store_spec.js
+1
-2
未找到文件。
app/assets/javascripts/boards/components/modal/empty_state.js
浏览文件 @
eb71b5da
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
import
modalMixin
from
'
../../mixins/modal_mixins
'
;
gl
.
issueBoards
.
ModalEmptyState
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalEmptyState
=
Vue
.
extend
({
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
mixins
:
[
modalMixin
],
data
()
{
data
()
{
return
ModalStore
.
store
;
return
ModalStore
.
store
;
},
},
...
...
app/assets/javascripts/boards/components/modal/footer.js
浏览文件 @
eb71b5da
...
@@ -3,11 +3,11 @@ import Flash from '../../../flash';
...
@@ -3,11 +3,11 @@ import Flash from '../../../flash';
import
{
__
}
from
'
../../../locale
'
;
import
{
__
}
from
'
../../../locale
'
;
import
'
./lists_dropdown
'
;
import
'
./lists_dropdown
'
;
import
{
pluralize
}
from
'
../../../lib/utils/text_utility
'
;
import
{
pluralize
}
from
'
../../../lib/utils/text_utility
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
import
modalMixin
from
'
../../mixins/modal_mixins
'
;
gl
.
issueBoards
.
ModalFooter
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalFooter
=
Vue
.
extend
({
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
mixins
:
[
modalMixin
],
data
()
{
data
()
{
return
{
return
{
modal
:
ModalStore
.
store
,
modal
:
ModalStore
.
store
,
...
...
app/assets/javascripts/boards/components/modal/header.js
浏览文件 @
eb71b5da
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
modalFilters
from
'
./filters
'
;
import
modalFilters
from
'
./filters
'
;
import
'
./tabs
'
;
import
'
./tabs
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
import
modalMixin
from
'
../../mixins/modal_mixins
'
;
gl
.
issueBoards
.
ModalHeader
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalHeader
=
Vue
.
extend
({
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
mixins
:
[
modalMixin
],
props
:
{
props
:
{
projectId
:
{
projectId
:
{
type
:
Number
,
type
:
Number
,
...
...
app/assets/javascripts/boards/components/modal/index.js
浏览文件 @
eb71b5da
...
@@ -7,8 +7,7 @@ import './header';
...
@@ -7,8 +7,7 @@ import './header';
import
'
./list
'
;
import
'
./list
'
;
import
'
./footer
'
;
import
'
./footer
'
;
import
'
./empty_state
'
;
import
'
./empty_state
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
gl
.
issueBoards
.
IssuesModal
=
Vue
.
extend
({
gl
.
issueBoards
.
IssuesModal
=
Vue
.
extend
({
props
:
{
props
:
{
...
...
app/assets/javascripts/boards/components/modal/list.js
浏览文件 @
eb71b5da
...
@@ -2,8 +2,7 @@
...
@@ -2,8 +2,7 @@
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
bp
from
'
../../../breakpoints
'
;
import
bp
from
'
../../../breakpoints
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
gl
.
issueBoards
.
ModalList
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalList
=
Vue
.
extend
({
props
:
{
props
:
{
...
...
app/assets/javascripts/boards/components/modal/lists_dropdown.js
浏览文件 @
eb71b5da
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
gl
.
issueBoards
.
ModalFooterListsDropdown
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalFooterListsDropdown
=
Vue
.
extend
({
data
()
{
data
()
{
...
...
app/assets/javascripts/boards/components/modal/tabs.js
浏览文件 @
eb71b5da
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
ModalStore
from
'
../../stores/modal_store
'
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
import
modalMixin
from
'
../../mixins/modal_mixins
'
;
gl
.
issueBoards
.
ModalTabs
=
Vue
.
extend
({
gl
.
issueBoards
.
ModalTabs
=
Vue
.
extend
({
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
mixins
:
[
modalMixin
],
data
()
{
data
()
{
return
ModalStore
.
store
;
return
ModalStore
.
store
;
},
},
...
...
app/assets/javascripts/boards/index.js
浏览文件 @
eb71b5da
...
@@ -17,9 +17,9 @@ import './models/milestone';
...
@@ -17,9 +17,9 @@ import './models/milestone';
import
'
./models/project
'
;
import
'
./models/project
'
;
import
'
./models/assignee
'
;
import
'
./models/assignee
'
;
import
'
./stores/boards_store
'
;
import
'
./stores/boards_store
'
;
import
'
./stores/modal_store
'
;
import
ModalStore
from
'
./stores/modal_store
'
;
import
BoardService
from
'
./services/board_service
'
;
import
BoardService
from
'
./services/board_service
'
;
import
'
./mixins/modal_mixins
'
;
import
modalMixin
from
'
./mixins/modal_mixins
'
;
import
'
./mixins/sortable_default_options
'
;
import
'
./mixins/sortable_default_options
'
;
import
'
./filters/due_date_filters
'
;
import
'
./filters/due_date_filters
'
;
import
'
./components/board
'
;
import
'
./components/board
'
;
...
@@ -31,7 +31,6 @@ import '~/vue_shared/vue_resource_interceptor'; // eslint-disable-line import/fi
...
@@ -31,7 +31,6 @@ import '~/vue_shared/vue_resource_interceptor'; // eslint-disable-line import/fi
export
default
()
=>
{
export
default
()
=>
{
const
$boardApp
=
document
.
getElementById
(
'
board-app
'
);
const
$boardApp
=
document
.
getElementById
(
'
board-app
'
);
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
...
@@ -176,7 +175,7 @@ export default () => {
...
@@ -176,7 +175,7 @@ export default () => {
gl
.
IssueBoardsModalAddBtn
=
new
Vue
({
gl
.
IssueBoardsModalAddBtn
=
new
Vue
({
el
:
document
.
getElementById
(
'
js-add-issues-btn
'
),
el
:
document
.
getElementById
(
'
js-add-issues-btn
'
),
mixins
:
[
gl
.
issueBoards
.
ModalMixins
],
mixins
:
[
modalMixin
],
data
()
{
data
()
{
return
{
return
{
modal
:
ModalStore
.
store
,
modal
:
ModalStore
.
store
,
...
...
app/assets/javascripts/boards/mixins/modal_mixins.js
浏览文件 @
eb71b5da
const
ModalStore
=
gl
.
issueBoards
.
ModalStore
;
import
ModalStore
from
'
../stores/modal_store
'
;
gl
.
issueBoards
.
ModalMixins
=
{
export
default
{
methods
:
{
methods
:
{
toggleModal
(
toggle
)
{
toggleModal
(
toggle
)
{
ModalStore
.
store
.
showAddIssuesModal
=
toggle
;
ModalStore
.
store
.
showAddIssuesModal
=
toggle
;
...
...
app/assets/javascripts/boards/stores/modal_store.js
浏览文件 @
eb71b5da
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
class
ModalStore
{
class
ModalStore
{
constructor
()
{
constructor
()
{
this
.
store
=
{
this
.
store
=
{
...
@@ -95,4 +92,4 @@ class ModalStore {
...
@@ -95,4 +92,4 @@ class ModalStore {
}
}
}
}
gl
.
issueBoards
.
ModalStore
=
new
ModalStore
();
export
default
new
ModalStore
();
app/assets/javascripts/labels_select.js
浏览文件 @
eb71b5da
...
@@ -10,6 +10,7 @@ import IssuableBulkUpdateActions from './issuable_bulk_update_actions';
...
@@ -10,6 +10,7 @@ import IssuableBulkUpdateActions from './issuable_bulk_update_actions';
import
DropdownUtils
from
'
./filtered_search/dropdown_utils
'
;
import
DropdownUtils
from
'
./filtered_search/dropdown_utils
'
;
import
CreateLabelDropdown
from
'
./create_label
'
;
import
CreateLabelDropdown
from
'
./create_label
'
;
import
flash
from
'
./flash
'
;
import
flash
from
'
./flash
'
;
import
ModalStore
from
'
./boards/stores/modal_store
'
;
export
default
class
LabelsSelect
{
export
default
class
LabelsSelect
{
constructor
(
els
,
options
=
{})
{
constructor
(
els
,
options
=
{})
{
...
@@ -350,7 +351,7 @@ export default class LabelsSelect {
...
@@ -350,7 +351,7 @@ export default class LabelsSelect {
}
}
if
(
$dropdown
.
closest
(
'
.add-issues-modal
'
).
length
)
{
if
(
$dropdown
.
closest
(
'
.add-issues-modal
'
).
length
)
{
boardsModel
=
gl
.
issueBoards
.
ModalStore
.
store
.
filter
;
boardsModel
=
ModalStore
.
store
.
filter
;
}
}
if
(
boardsModel
)
{
if
(
boardsModel
)
{
...
...
app/assets/javascripts/milestone_select.js
浏览文件 @
eb71b5da
...
@@ -6,6 +6,7 @@ import $ from 'jquery';
...
@@ -6,6 +6,7 @@ import $ from 'jquery';
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
{
timeFor
}
from
'
./lib/utils/datetime_utility
'
;
import
{
timeFor
}
from
'
./lib/utils/datetime_utility
'
;
import
ModalStore
from
'
./boards/stores/modal_store
'
;
export
default
class
MilestoneSelect
{
export
default
class
MilestoneSelect
{
constructor
(
currentProject
,
els
,
options
=
{})
{
constructor
(
currentProject
,
els
,
options
=
{})
{
...
@@ -164,7 +165,7 @@ export default class MilestoneSelect {
...
@@ -164,7 +165,7 @@ export default class MilestoneSelect {
}
}
if
(
$dropdown
.
closest
(
'
.add-issues-modal
'
).
length
)
{
if
(
$dropdown
.
closest
(
'
.add-issues-modal
'
).
length
)
{
boardsStore
=
gl
.
issueBoards
.
ModalStore
.
store
.
filter
;
boardsStore
=
ModalStore
.
store
.
filter
;
}
}
if
(
boardsStore
)
{
if
(
boardsStore
)
{
...
...
app/assets/javascripts/users_select.js
浏览文件 @
eb71b5da
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
ModalStore
from
'
./boards/stores/modal_store
'
;
// TODO: remove eventHub hack after code splitting refactor
// TODO: remove eventHub hack after code splitting refactor
window
.
emitSidebarEvent
=
window
.
emitSidebarEvent
||
$
.
noop
;
window
.
emitSidebarEvent
=
window
.
emitSidebarEvent
||
$
.
noop
;
...
@@ -441,7 +442,7 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -441,7 +442,7 @@ function UsersSelect(currentUser, els, options = {}) {
return
;
return
;
}
}
if
(
$el
.
closest
(
'
.add-issues-modal
'
).
length
)
{
if
(
$el
.
closest
(
'
.add-issues-modal
'
).
length
)
{
gl
.
issueBoards
.
ModalStore
.
store
.
filter
[
$dropdown
.
data
(
'
fieldName
'
)]
=
user
.
id
;
ModalStore
.
store
.
filter
[
$dropdown
.
data
(
'
fieldName
'
)]
=
user
.
id
;
}
else
if
(
handleClick
)
{
}
else
if
(
handleClick
)
{
e
.
preventDefault
();
e
.
preventDefault
();
handleClick
(
user
,
isMarking
);
handleClick
(
user
,
isMarking
);
...
...
changelogs/unreleased/44224-remove-gl.yml
0 → 100644
浏览文件 @
eb71b5da
---
title
:
Removes modal boards store and mixins from global scope
merge_request
:
author
:
type
:
other
spec/javascripts/boards/modal_store_spec.js
浏览文件 @
eb71b5da
...
@@ -4,12 +4,11 @@ import '~/vue_shared/models/label';
...
@@ -4,12 +4,11 @@ import '~/vue_shared/models/label';
import
'
~/boards/models/issue
'
;
import
'
~/boards/models/issue
'
;
import
'
~/boards/models/list
'
;
import
'
~/boards/models/list
'
;
import
'
~/boards/models/assignee
'
;
import
'
~/boards/models/assignee
'
;
import
'
~/boards/stores/modal_store
'
;
import
Store
from
'
~/boards/stores/modal_store
'
;
describe
(
'
Modal store
'
,
()
=>
{
describe
(
'
Modal store
'
,
()
=>
{
let
issue
;
let
issue
;
let
issue2
;
let
issue2
;
const
Store
=
gl
.
issueBoards
.
ModalStore
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
// Setup default state
// Setup default state
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录