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
56cc90e0
Commit
56cc90e0
authored
Mar 18, 2021
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change sidebar assignee to use modal
- use new modal.
parent
1cf5e3de
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
85 additions
and
16 deletions
+85
-16
app/assets/javascripts/invite_members/components/invite_members_trigger.vue
...ipts/invite_members/components/invite_members_trigger.vue
+44
-5
app/assets/javascripts/pages/projects/issues/show.js
app/assets/javascripts/pages/projects/issues/show.js
+2
-0
app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js
.../pages/projects/merge_requests/init_merge_request_show.js
+2
-0
app/views/shared/issuable/_sidebar_assignees.html.haml
app/views/shared/issuable/_sidebar_assignees.html.haml
+4
-4
changelogs/unreleased/322879-change-assignee-dropdown-invite-to-utilize-invite-modal.yml
...ange-assignee-dropdown-invite-to-utilize-invite-modal.yml
+5
-0
spec/frontend/invite_members/components/invite_members_trigger_spec.js
.../invite_members/components/invite_members_trigger_spec.js
+25
-4
spec/support/shared_examples/features/issuable_invite_members_shared_examples.rb
...mples/features/issuable_invite_members_shared_examples.rb
+3
-3
No files found.
app/assets/javascripts/invite_members/components/invite_members_trigger.vue
View file @
56cc90e0
<
script
>
<
script
>
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlLink
}
from
'
@gitlab/ui
'
;
import
ExperimentTracking
from
'
~/experimentation/experiment_tracking
'
;
import
ExperimentTracking
from
'
~/experimentation/experiment_tracking
'
;
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
export
default
{
components
:
{
GlButton
},
components
:
{
GlButton
,
GlLink
},
props
:
{
props
:
{
displayText
:
{
displayText
:
{
type
:
String
,
type
:
String
,
...
@@ -37,6 +37,42 @@ export default {
...
@@ -37,6 +37,42 @@ export default {
required
:
false
,
required
:
false
,
default
:
undefined
,
default
:
undefined
,
},
},
triggerElement
:
{
type
:
String
,
required
:
false
,
default
:
'
button
'
,
},
event
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
label
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
computed
:
{
isButton
()
{
return
this
.
triggerElement
===
'
button
'
;
},
componentAttributes
()
{
const
baseAttributes
=
{
class
:
this
.
classes
,
'
data-qa-selector
'
:
'
invite_members_button
'
,
};
if
(
this
.
event
&&
this
.
label
)
{
return
{
...
baseAttributes
,
'
data-track-event
'
:
this
.
event
,
'
data-track-label
'
:
this
.
label
,
};
}
return
baseAttributes
;
},
},
},
mounted
()
{
mounted
()
{
this
.
trackExperimentOnShow
();
this
.
trackExperimentOnShow
();
...
@@ -57,12 +93,15 @@ export default {
...
@@ -57,12 +93,15 @@ export default {
<
template
>
<
template
>
<gl-button
<gl-button
:class=
"classes
"
v-if=
"isButton
"
:icon=
"icon
"
v-bind=
"componentAttributes
"
:variant=
"variant"
:variant=
"variant"
data-qa-selector=
"invite_members_butt
on"
:icon=
"ic
on"
@
click=
"openModal"
@
click=
"openModal"
>
>
{{
displayText
}}
{{
displayText
}}
</gl-button>
</gl-button>
<gl-link
v-else
v-bind=
"componentAttributes"
data-is-link=
"true"
@
click=
"openModal"
>
{{
displayText
}}
</gl-link>
</
template
>
</
template
>
app/assets/javascripts/pages/projects/issues/show.js
View file @
56cc90e0
...
@@ -4,6 +4,7 @@ import initIssuableSidebar from '~/init_issuable_sidebar';
...
@@ -4,6 +4,7 @@ import initIssuableSidebar from '~/init_issuable_sidebar';
import
initInviteMemberModal
from
'
~/invite_member/init_invite_member_modal
'
;
import
initInviteMemberModal
from
'
~/invite_member/init_invite_member_modal
'
;
import
initInviteMemberTrigger
from
'
~/invite_member/init_invite_member_trigger
'
;
import
initInviteMemberTrigger
from
'
~/invite_member/init_invite_member_trigger
'
;
import
initInviteMembersModal
from
'
~/invite_members/init_invite_members_modal
'
;
import
initInviteMembersModal
from
'
~/invite_members/init_invite_members_modal
'
;
import
initInviteMembersTrigger
from
'
~/invite_members/init_invite_members_trigger
'
;
import
{
IssuableType
}
from
'
~/issuable_show/constants
'
;
import
{
IssuableType
}
from
'
~/issuable_show/constants
'
;
import
Issue
from
'
~/issue
'
;
import
Issue
from
'
~/issue
'
;
import
'
~/notes/index
'
;
import
'
~/notes/index
'
;
...
@@ -36,6 +37,7 @@ export default function initShowIssue() {
...
@@ -36,6 +37,7 @@ export default function initShowIssue() {
initSentryErrorStackTraceApp
();
initSentryErrorStackTraceApp
();
initRelatedMergeRequestsApp
();
initRelatedMergeRequestsApp
();
initInviteMembersModal
();
initInviteMembersModal
();
initInviteMembersTrigger
();
import
(
/* webpackChunkName: 'design_management' */
'
~/design_management
'
)
import
(
/* webpackChunkName: 'design_management' */
'
~/design_management
'
)
.
then
((
module
)
=>
module
.
default
())
.
then
((
module
)
=>
module
.
default
())
...
...
app/assets/javascripts/pages/projects/merge_requests/init_merge_request_show.js
View file @
56cc90e0
...
@@ -6,6 +6,7 @@ import initIssuableSidebar from '~/init_issuable_sidebar';
...
@@ -6,6 +6,7 @@ import initIssuableSidebar from '~/init_issuable_sidebar';
import
initInviteMemberModal
from
'
~/invite_member/init_invite_member_modal
'
;
import
initInviteMemberModal
from
'
~/invite_member/init_invite_member_modal
'
;
import
initInviteMemberTrigger
from
'
~/invite_member/init_invite_member_trigger
'
;
import
initInviteMemberTrigger
from
'
~/invite_member/init_invite_member_trigger
'
;
import
initInviteMembersModal
from
'
~/invite_members/init_invite_members_modal
'
;
import
initInviteMembersModal
from
'
~/invite_members/init_invite_members_modal
'
;
import
initInviteMembersTrigger
from
'
~/invite_members/init_invite_members_trigger
'
;
import
{
handleLocationHash
}
from
'
~/lib/utils/common_utils
'
;
import
{
handleLocationHash
}
from
'
~/lib/utils/common_utils
'
;
import
StatusBox
from
'
~/merge_request/components/status_box.vue
'
;
import
StatusBox
from
'
~/merge_request/components/status_box.vue
'
;
import
initSourcegraph
from
'
~/sourcegraph
'
;
import
initSourcegraph
from
'
~/sourcegraph
'
;
...
@@ -22,6 +23,7 @@ export default function initMergeRequestShow() {
...
@@ -22,6 +23,7 @@ export default function initMergeRequestShow() {
initInviteMemberModal
();
initInviteMemberModal
();
initInviteMemberTrigger
();
initInviteMemberTrigger
();
initInviteMembersModal
();
initInviteMembersModal
();
initInviteMembersTrigger
();
const
el
=
document
.
querySelector
(
'
.js-mr-status-box
'
);
const
el
=
document
.
querySelector
(
'
.js-mr-status-box
'
);
// eslint-disable-next-line no-new
// eslint-disable-next-line no-new
...
...
app/views/shared/issuable/_sidebar_assignees.html.haml
View file @
56cc90e0
...
@@ -53,10 +53,10 @@
...
@@ -53,10 +53,10 @@
%ul
.dropdown-footer-list
%ul
.dropdown-footer-list
%li
%li
-
if
directly_invite_members?
-
if
directly_invite_members?
=
link_to
invite_text
,
.js-invite-members-trigger
{
data:
{
trigger_element:
'anchor'
,
project_project_members_path
(
@project
)
,
display_text:
invite_text
,
title:
invite_text
,
event:
'click_invite_members'
,
data:
{
'is-link'
:
true
,
'track-event'
:
'click_invite_members'
,
'track-label'
:
track_label
}
label:
track_label
}
}
-
else
-
else
.js-invite-member-trigger
{
data:
{
display_text:
invite_text
,
event:
'click_invite_members_version_b'
,
label:
track_label
}
}
.js-invite-member-trigger
{
data:
{
display_text:
invite_text
,
event:
'click_invite_members_version_b'
,
label:
track_label
}
}
-
else
-
else
...
...
changelogs/unreleased/322879-change-assignee-dropdown-invite-to-utilize-invite-modal.yml
0 → 100644
View file @
56cc90e0
---
title
:
Change assignee dropdown invite to utilize invite modal
merge_request
:
57002
author
:
type
:
changed
spec/frontend/invite_members/components/invite_members_trigger_spec.js
View file @
56cc90e0
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
ExperimentTracking
from
'
~/experimentation/experiment_tracking
'
;
import
ExperimentTracking
from
'
~/experimentation/experiment_tracking
'
;
import
InviteMembersTrigger
from
'
~/invite_members/components/invite_members_trigger.vue
'
;
import
InviteMembersTrigger
from
'
~/invite_members/components/invite_members_trigger.vue
'
;
...
@@ -8,22 +8,29 @@ jest.mock('~/experimentation/experiment_tracking');
...
@@ -8,22 +8,29 @@ jest.mock('~/experimentation/experiment_tracking');
const
displayText
=
'
Invite team members
'
;
const
displayText
=
'
Invite team members
'
;
let
wrapper
;
let
wrapper
;
let
triggerProps
;
let
findButton
;
const
triggerComponent
=
{
button
:
GlButton
,
anchor
:
GlLink
,
};
const
createComponent
=
(
props
=
{})
=>
{
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
shallowMount
(
InviteMembersTrigger
,
{
wrapper
=
shallowMount
(
InviteMembersTrigger
,
{
propsData
:
{
propsData
:
{
displayText
,
displayText
,
...
triggerProps
,
...
props
,
...
props
,
},
},
});
});
};
};
describe
(
'
InviteMembersTrigger
'
,
()
=>
{
describe
.
each
([
'
button
'
,
'
anchor
'
])(
'
with triggerElement as %s
'
,
(
triggerElement
)
=>
{
const
findButton
=
()
=>
wrapper
.
findComponent
(
GlButton
);
triggerProps
=
{
triggerElement
};
findButton
=
()
=>
wrapper
.
findComponent
(
triggerComponent
[
triggerElement
]);
afterEach
(()
=>
{
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
.
destroy
();
wrapper
=
null
;
});
});
describe
(
'
displayText
'
,
()
=>
{
describe
(
'
displayText
'
,
()
=>
{
...
@@ -74,5 +81,19 @@ describe('InviteMembersTrigger', () => {
...
@@ -74,5 +81,19 @@ describe('InviteMembersTrigger', () => {
expect
(
ExperimentTracking
).
not
.
toHaveBeenCalledWith
(
'
_track_experiment_
'
);
expect
(
ExperimentTracking
).
not
.
toHaveBeenCalledWith
(
'
_track_experiment_
'
);
});
});
it
(
'
does not add tracking attributes
'
,
()
=>
{
createComponent
();
expect
(
findButton
().
attributes
(
'
data-track-event
'
)).
toBeUndefined
();
expect
(
findButton
().
attributes
(
'
data-track-label
'
)).
toBeUndefined
();
});
it
(
'
adds tracking attributes
'
,
()
=>
{
createComponent
({
label
:
'
_label_
'
,
event
:
'
_event_
'
});
expect
(
findButton
().
attributes
(
'
data-track-event
'
)).
toBe
(
'
_event_
'
);
expect
(
findButton
().
attributes
(
'
data-track-label
'
)).
toBe
(
'
_label_
'
);
});
});
});
});
});
spec/support/shared_examples/features/issuable_invite_members_shared_examples.rb
View file @
56cc90e0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
RSpec
.
shared_examples
'issuable invite members experiments'
do
RSpec
.
shared_examples
'issuable invite members experiments'
do
context
'when a privileged user can invite'
do
context
'when a privileged user can invite'
do
it
'shows a link for inviting members and
follows through to the members page
'
do
it
'shows a link for inviting members and
launches invite modal
'
do
project
.
add_maintainer
(
user
)
project
.
add_maintainer
(
user
)
visit
issuable_path
visit
issuable_path
...
@@ -11,14 +11,14 @@ RSpec.shared_examples 'issuable invite members experiments' do
...
@@ -11,14 +11,14 @@ RSpec.shared_examples 'issuable invite members experiments' do
wait_for_requests
wait_for_requests
page
.
within
'.dropdown-menu-user'
do
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
to
have_link
(
'Invite Members'
,
href:
project_project_members_path
(
project
)
)
expect
(
page
).
to
have_link
(
'Invite Members'
)
expect
(
page
).
to
have_selector
(
'[data-track-event="click_invite_members"]'
)
expect
(
page
).
to
have_selector
(
'[data-track-event="click_invite_members"]'
)
expect
(
page
).
to
have_selector
(
'[data-track-label="edit_assignee"]'
)
expect
(
page
).
to
have_selector
(
'[data-track-label="edit_assignee"]'
)
end
end
click_link
'Invite Members'
click_link
'Invite Members'
expect
(
current_path
).
to
eq
project_project_members_path
(
project
)
expect
(
page
).
to
have_content
(
"You're inviting members to the"
)
end
end
end
end
...
...
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