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
616cec34
Commit
616cec34
authored
Jun 22, 2020
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'fe-fix-incorrect-mitt-usage' into 'master'"
This reverts merge request !34242
parent
c9d043c6
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
36 additions
and
48 deletions
+36
-48
app/assets/javascripts/boards/components/board_card.vue
app/assets/javascripts/boards/components/board_card.vue
+2
-2
app/assets/javascripts/boards/index.js
app/assets/javascripts/boards/index.js
+1
-1
app/assets/javascripts/deploy_keys/components/action_btn.vue
app/assets/javascripts/deploy_keys/components/action_btn.vue
+3
-6
app/assets/javascripts/deploy_keys/components/app.vue
app/assets/javascripts/deploy_keys/components/app.vue
+2
-2
app/assets/javascripts/groups/components/app.vue
app/assets/javascripts/groups/components/app.vue
+2
-2
app/assets/javascripts/groups/components/groups.vue
app/assets/javascripts/groups/components/groups.vue
+1
-6
app/assets/javascripts/groups/components/item_actions.vue
app/assets/javascripts/groups/components/item_actions.vue
+1
-1
app/assets/javascripts/helpers/event_hub_factory.js
app/assets/javascripts/helpers/event_hub_factory.js
+0
-6
app/assets/javascripts/sidebar/event_hub.js
app/assets/javascripts/sidebar/event_hub.js
+2
-2
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
+2
-2
ee/app/assets/javascripts/sidebar/components/weight/sidebar_weight.vue
.../javascripts/sidebar/components/weight/sidebar_weight.vue
+1
-1
ee/app/assets/javascripts/sidebar/components/weight/weight.vue
...p/assets/javascripts/sidebar/components/weight/weight.vue
+2
-2
ee/spec/frontend/sidebar/weight_spec.js
ee/spec/frontend/sidebar/weight_spec.js
+2
-2
spec/frontend/boards/board_card_spec.js
spec/frontend/boards/board_card_spec.js
+1
-1
spec/frontend/deploy_keys/components/action_btn_spec.js
spec/frontend/deploy_keys/components/action_btn_spec.js
+1
-1
spec/frontend/deploy_keys/components/app_spec.js
spec/frontend/deploy_keys/components/app_spec.js
+3
-3
spec/frontend/groups/components/app_spec.js
spec/frontend/groups/components/app_spec.js
+4
-4
spec/frontend/groups/components/groups_spec.js
spec/frontend/groups/components/groups_spec.js
+3
-2
spec/frontend/groups/components/item_actions_spec.js
spec/frontend/groups/components/item_actions_spec.js
+3
-2
No files found.
app/assets/javascripts/boards/components/board_card.vue
View file @
616cec34
...
...
@@ -89,10 +89,10 @@ export default {
eventHub
.
$emit
(
'
clearDetailIssue
'
,
isMultiSelect
);
if
(
isMultiSelect
)
{
eventHub
.
$emit
(
'
newDetailIssue
'
,
[
this
.
issue
,
isMultiSelect
]
);
eventHub
.
$emit
(
'
newDetailIssue
'
,
this
.
issue
,
isMultiSelect
);
}
}
else
{
eventHub
.
$emit
(
'
newDetailIssue
'
,
[
this
.
issue
,
isMultiSelect
]
);
eventHub
.
$emit
(
'
newDetailIssue
'
,
this
.
issue
,
isMultiSelect
);
boardsStore
.
setListDetail
(
this
.
list
);
}
}
...
...
app/assets/javascripts/boards/index.js
View file @
616cec34
...
...
@@ -202,7 +202,7 @@ export default () => {
updateTokens
()
{
this
.
filterManager
.
updateTokens
();
},
updateDetailIssue
(
[
newIssue
,
multiSelect
=
false
]
)
{
updateDetailIssue
(
newIssue
,
multiSelect
=
false
)
{
const
{
sidebarInfoEndpoint
}
=
newIssue
;
if
(
sidebarInfoEndpoint
&&
newIssue
.
subscribed
===
undefined
)
{
newIssue
.
setFetchingState
(
'
subscriptions
'
,
true
);
...
...
app/assets/javascripts/deploy_keys/components/action_btn.vue
View file @
616cec34
...
...
@@ -30,12 +30,9 @@ export default {
doAction
()
{
this
.
isLoading
=
true
;
eventHub
.
$emit
(
`
${
this
.
type
}
.key`
,
[
this
.
deployKey
,
()
=>
{
this
.
isLoading
=
false
;
},
]);
eventHub
.
$emit
(
`
${
this
.
type
}
.key`
,
this
.
deployKey
,
()
=>
{
this
.
isLoading
=
false
;
});
},
},
};
...
...
app/assets/javascripts/deploy_keys/components/app.vue
View file @
616cec34
...
...
@@ -90,13 +90,13 @@ export default {
return
new
Flash
(
s__
(
'
DeployKeys|Error getting deploy keys
'
));
});
},
enableKey
(
[
deployKey
]
)
{
enableKey
(
deployKey
)
{
this
.
service
.
enableKey
(
deployKey
.
id
)
.
then
(
this
.
fetchKeys
)
.
catch
(()
=>
new
Flash
(
s__
(
'
DeployKeys|Error enabling deploy key
'
)));
},
disableKey
(
[
deployKey
,
callback
]
)
{
disableKey
(
deployKey
,
callback
)
{
if
(
// eslint-disable-next-line no-alert
window
.
confirm
(
s__
(
'
DeployKeys|You are going to remove this deploy key. Are you sure?
'
))
...
...
app/assets/javascripts/groups/components/app.vue
View file @
616cec34
...
...
@@ -123,7 +123,7 @@ export default {
this
.
updateGroups
(
res
,
Boolean
(
filterGroupsBy
));
});
},
fetchPage
(
[
page
,
filterGroupsBy
,
sortBy
,
archived
]
)
{
fetchPage
(
page
,
filterGroupsBy
,
sortBy
,
archived
)
{
this
.
isLoading
=
true
;
return
this
.
fetchGroups
({
...
...
@@ -169,7 +169,7 @@ export default {
parentGroup
.
isOpen
=
false
;
}
},
showLeaveGroupModal
(
[
group
,
parentGroup
]
)
{
showLeaveGroupModal
(
group
,
parentGroup
)
{
const
{
fullName
}
=
group
;
this
.
targetGroup
=
group
;
this
.
targetParentGroup
=
parentGroup
;
...
...
app/assets/javascripts/groups/components/groups.vue
View file @
616cec34
...
...
@@ -35,12 +35,7 @@ export default {
const
filterGroupsParam
=
getParameterByName
(
'
filter
'
);
const
sortParam
=
getParameterByName
(
'
sort
'
);
const
archivedParam
=
getParameterByName
(
'
archived
'
);
eventHub
.
$emit
(
`
${
this
.
action
}
fetchPage`
,
[
page
,
filterGroupsParam
,
sortParam
,
archivedParam
,
]);
eventHub
.
$emit
(
`
${
this
.
action
}
fetchPage`
,
page
,
filterGroupsParam
,
sortParam
,
archivedParam
);
},
},
};
...
...
app/assets/javascripts/groups/components/item_actions.vue
View file @
616cec34
...
...
@@ -37,7 +37,7 @@ export default {
},
methods
:
{
onLeaveGroup
()
{
eventHub
.
$emit
(
`
${
this
.
action
}
showLeaveGroupModal`
,
[
this
.
group
,
this
.
parentGroup
]
);
eventHub
.
$emit
(
`
${
this
.
action
}
showLeaveGroupModal`
,
this
.
group
,
this
.
parentGroup
);
},
},
};
...
...
app/assets/javascripts/helpers/event_hub_factory.js
View file @
616cec34
...
...
@@ -3,8 +3,6 @@ import mitt from 'mitt';
export
default
()
=>
{
const
emitter
=
mitt
();
const
originalEmit
=
emitter
.
emit
;
emitter
.
once
=
(
event
,
handler
)
=>
{
const
wrappedHandler
=
evt
=>
{
handler
(
evt
);
...
...
@@ -13,10 +11,6 @@ export default () => {
emitter
.
on
(
event
,
wrappedHandler
);
};
emitter
.
emit
=
(
event
,
args
=
[])
=>
{
originalEmit
(
event
,
args
);
};
emitter
.
$on
=
emitter
.
on
;
emitter
.
$once
=
emitter
.
once
;
emitter
.
$off
=
emitter
.
off
;
...
...
app/assets/javascripts/sidebar/event_hub.js
View file @
616cec34
import
createEventHub
from
'
~/helpers/event_hub_factory
'
;
import
Vue
from
'
vue
'
;
const
eventHub
=
createEventHub
();
const
eventHub
=
new
Vue
();
// TODO: remove eventHub hack after code splitting refactor
window
.
emitSidebarEvent
=
(...
args
)
=>
eventHub
.
$emit
(...
args
);
...
...
ee/app/assets/javascripts/boards/stores/boards_store_ee.js
View file @
616cec34
/* eslint-disable class-methods-use-this, no-param-reassign */
/*
no-param-reassign is disabled because one method of BoardsStoreEE
no-param-reassign is disabled because one method of BoardsStoreEE
modify the passed parameter in conformity with non-ee BoardsStore.
*/
...
...
@@ -190,7 +190,7 @@ class BoardsStoreEE {
issue
.
epic
=
newEpic
;
}
updateWeight
(
[
newWeight
,
id
]
)
{
updateWeight
(
newWeight
,
id
)
{
const
{
issue
}
=
this
.
store
.
detail
;
if
(
issue
.
id
===
id
&&
issue
.
sidebarInfoEndpoint
)
{
issue
.
setLoadingState
(
'
weight
'
,
true
);
...
...
ee/app/assets/javascripts/sidebar/components/weight/sidebar_weight.vue
View file @
616cec34
...
...
@@ -27,7 +27,7 @@ export default {
},
methods
:
{
onUpdateWeight
(
[
newWeight
]
)
{
onUpdateWeight
(
newWeight
)
{
this
.
mediator
.
updateWeight
(
newWeight
).
catch
(()
=>
{
Flash
(
__
(
'
Error occurred while updating the issue weight
'
));
});
...
...
ee/app/assets/javascripts/sidebar/components/weight/weight.vue
View file @
616cec34
...
...
@@ -140,14 +140,14 @@ export default {
$
(
this
.
$el
).
trigger
(
'
hidden.gl.dropdown
'
);
if
(
isNewValue
)
{
eventHub
.
$emit
(
'
updateWeight
'
,
[
value
,
this
.
id
]
);
eventHub
.
$emit
(
'
updateWeight
'
,
value
,
this
.
id
);
}
this
.
showEditField
(
false
);
}
},
removeWeight
()
{
eventHub
.
$emit
(
'
updateWeight
'
,
[
''
,
this
.
id
]
);
eventHub
.
$emit
(
'
updateWeight
'
,
''
,
this
.
id
);
},
},
};
...
...
ee/spec/frontend/sidebar/weight_spec.js
View file @
616cec34
...
...
@@ -125,7 +125,7 @@ describe('Weight', () => {
vm
.
$refs
.
editableField
.
dispatchEvent
(
event
);
expect
(
vm
.
hasValidInput
).
toBe
(
true
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
updateWeight
'
,
[
expectedWeightValue
,
ID
]
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
updateWeight
'
,
expectedWeightValue
,
ID
);
});
});
...
...
@@ -143,7 +143,7 @@ describe('Weight', () => {
return
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
hasValidInput
).
toBe
(
true
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
updateWeight
'
,
[
''
,
ID
]
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
updateWeight
'
,
''
,
ID
);
});
});
...
...
spec/frontend/boards/board_card_spec.js
View file @
616cec34
...
...
@@ -196,7 +196,7 @@ describe('Board card', () => {
wrapper
.
trigger
(
'
mousedown
'
);
wrapper
.
trigger
(
'
mouseup
'
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
newDetailIssue
'
,
[
wrapper
.
vm
.
issue
,
undefined
]
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
newDetailIssue
'
,
wrapper
.
vm
.
issue
,
undefined
);
expect
(
boardsStore
.
detail
.
list
).
toEqual
(
wrapper
.
vm
.
list
);
});
...
...
spec/frontend/deploy_keys/components/action_btn_spec.js
View file @
616cec34
...
...
@@ -32,7 +32,7 @@ describe('Deploy keys action btn', () => {
wrapper
.
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
enable.key
'
,
[
deployKey
,
expect
.
any
(
Function
)]
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
enable.key
'
,
deployKey
,
expect
.
anything
()
);
});
});
...
...
spec/frontend/deploy_keys/components/app_spec.js
View file @
616cec34
...
...
@@ -88,7 +88,7 @@ describe('Deploy keys app component', () => {
jest
.
spyOn
(
wrapper
.
vm
.
service
,
'
getKeys
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
wrapper
.
vm
.
service
,
'
enableKey
'
).
mockImplementation
(()
=>
Promise
.
resolve
());
eventHub
.
$emit
(
'
enable.key
'
,
[
key
]
);
eventHub
.
$emit
(
'
enable.key
'
,
key
);
return
wrapper
.
vm
.
$nextTick
();
})
...
...
@@ -106,7 +106,7 @@ describe('Deploy keys app component', () => {
jest
.
spyOn
(
wrapper
.
vm
.
service
,
'
getKeys
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
wrapper
.
vm
.
service
,
'
disableKey
'
).
mockImplementation
(()
=>
Promise
.
resolve
());
eventHub
.
$emit
(
'
disable.key
'
,
[
key
]
);
eventHub
.
$emit
(
'
disable.key
'
,
key
);
return
wrapper
.
vm
.
$nextTick
();
})
...
...
@@ -124,7 +124,7 @@ describe('Deploy keys app component', () => {
jest
.
spyOn
(
wrapper
.
vm
.
service
,
'
getKeys
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
wrapper
.
vm
.
service
,
'
disableKey
'
).
mockImplementation
(()
=>
Promise
.
resolve
());
eventHub
.
$emit
(
'
remove.key
'
,
[
key
]
);
eventHub
.
$emit
(
'
remove.key
'
,
key
);
return
wrapper
.
vm
.
$nextTick
();
})
...
...
spec/frontend/groups/components/app_spec.js
View file @
616cec34
...
...
@@ -184,7 +184,7 @@ describe('AppComponent', () => {
jest
.
spyOn
(
window
.
history
,
'
replaceState
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
$
,
'
scrollTo
'
).
mockImplementation
(()
=>
{});
const
fetchPagePromise
=
vm
.
fetchPage
(
[
2
,
null
,
null
,
true
]
);
const
fetchPagePromise
=
vm
.
fetchPage
(
2
,
null
,
null
,
true
);
expect
(
vm
.
isLoading
).
toBe
(
true
);
expect
(
vm
.
fetchGroups
).
toHaveBeenCalledWith
({
...
...
@@ -275,7 +275,7 @@ describe('AppComponent', () => {
expect
(
vm
.
targetGroup
).
toBe
(
null
);
expect
(
vm
.
targetParentGroup
).
toBe
(
null
);
vm
.
showLeaveGroupModal
(
[
group
,
mockParentGroupItem
]
);
vm
.
showLeaveGroupModal
(
group
,
mockParentGroupItem
);
expect
(
vm
.
targetGroup
).
not
.
toBe
(
null
);
expect
(
vm
.
targetParentGroup
).
not
.
toBe
(
null
);
...
...
@@ -286,7 +286,7 @@ describe('AppComponent', () => {
expect
(
vm
.
showModal
).
toBe
(
false
);
expect
(
vm
.
groupLeaveConfirmationMessage
).
toBe
(
''
);
vm
.
showLeaveGroupModal
(
[
group
,
mockParentGroupItem
]
);
vm
.
showLeaveGroupModal
(
group
,
mockParentGroupItem
);
expect
(
vm
.
showModal
).
toBe
(
true
);
expect
(
vm
.
groupLeaveConfirmationMessage
).
toBe
(
...
...
@@ -298,7 +298,7 @@ describe('AppComponent', () => {
describe
(
'
hideLeaveGroupModal
'
,
()
=>
{
it
(
'
hides modal confirmation which is shown before leaving the group
'
,
()
=>
{
const
group
=
{
...
mockParentGroupItem
};
vm
.
showLeaveGroupModal
(
[
group
,
mockParentGroupItem
]
);
vm
.
showLeaveGroupModal
(
group
,
mockParentGroupItem
);
expect
(
vm
.
showModal
).
toBe
(
true
);
vm
.
hideLeaveGroupModal
();
...
...
spec/frontend/groups/components/groups_spec.js
View file @
616cec34
...
...
@@ -41,12 +41,13 @@ describe('GroupsComponent', () => {
vm
.
change
(
2
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
fetchPage
'
,
[
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
fetchPage
'
,
2
,
expect
.
any
(
Object
),
expect
.
any
(
Object
),
expect
.
any
(
Object
),
]
);
);
});
});
});
...
...
spec/frontend/groups/components/item_actions_spec.js
View file @
616cec34
...
...
@@ -31,10 +31,11 @@ describe('ItemActionsComponent', () => {
jest
.
spyOn
(
eventHub
,
'
$emit
'
).
mockImplementation
(()
=>
{});
vm
.
onLeaveGroup
();
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
showLeaveGroupModal
'
,
[
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
showLeaveGroupModal
'
,
vm
.
group
,
vm
.
parentGroup
,
]
);
);
});
});
});
...
...
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