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
095f7276
Commit
095f7276
authored
Nov 11, 2020
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load popovers after edit blob
parent
60c8aca8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
27 deletions
+72
-27
app/assets/javascripts/blob_edit/blob_bundle.js
app/assets/javascripts/blob_edit/blob_bundle.js
+31
-27
changelogs/unreleased/233965-suggest-pipeline-flow-second-step-should-open-on-page-load.yml
...st-pipeline-flow-second-step-should-open-on-page-load.yml
+5
-0
spec/features/merge_request/user_sees_suggest_pipeline_spec.rb
...features/merge_request/user_sees_suggest_pipeline_spec.rb
+36
-0
No files found.
app/assets/javascripts/blob_edit/blob_bundle.js
View file @
095f7276
...
...
@@ -8,11 +8,40 @@ import initPopover from '~/blob/suggest_gitlab_ci_yml';
import
{
disableButtonIfEmptyField
,
setCookie
}
from
'
~/lib/utils/common_utils
'
;
import
Tracking
from
'
~/tracking
'
;
const
initPopovers
=
()
=>
{
const
suggestEl
=
document
.
querySelector
(
'
.js-suggest-gitlab-ci-yml
'
);
if
(
suggestEl
)
{
const
commitButton
=
document
.
querySelector
(
'
#commit-changes
'
);
initPopover
(
suggestEl
);
if
(
commitButton
)
{
const
{
dismissKey
,
humanAccess
}
=
suggestEl
.
dataset
;
const
urlParams
=
new
URLSearchParams
(
window
.
location
.
search
);
const
mergeRequestPath
=
urlParams
.
get
(
'
mr_path
'
)
||
true
;
const
commitCookieName
=
`suggest_gitlab_ci_yml_commit_
${
dismissKey
}
`
;
const
commitTrackLabel
=
'
suggest_gitlab_ci_yml_commit_changes
'
;
const
commitTrackValue
=
'
20
'
;
commitButton
.
addEventListener
(
'
click
'
,
()
=>
{
setCookie
(
commitCookieName
,
mergeRequestPath
);
Tracking
.
event
(
undefined
,
'
click_button
'
,
{
label
:
commitTrackLabel
,
property
:
humanAccess
,
value
:
commitTrackValue
,
});
});
}
}
};
export
default
()
=>
{
const
editBlobForm
=
$
(
'
.js-edit-blob-form
'
);
const
uploadBlobForm
=
$
(
'
.js-upload-blob-form
'
);
const
deleteBlobForm
=
$
(
'
.js-delete-blob-form
'
);
const
suggestEl
=
document
.
querySelector
(
'
.js-suggest-gitlab-ci-yml
'
);
if
(
editBlobForm
.
length
)
{
const
urlRoot
=
editBlobForm
.
data
(
'
relativeUrlRoot
'
);
...
...
@@ -33,6 +62,7 @@ export default () => {
projectId
,
isMarkdown
,
});
initPopovers
();
})
.
catch
(
e
=>
createFlash
(
e
));
...
...
@@ -62,30 +92,4 @@ export default () => {
if
(
deleteBlobForm
.
length
)
{
new
NewCommitForm
(
deleteBlobForm
);
}
if
(
suggestEl
)
{
const
commitButton
=
document
.
querySelector
(
'
#commit-changes
'
);
initPopover
(
suggestEl
);
if
(
commitButton
)
{
const
{
dismissKey
,
humanAccess
}
=
suggestEl
.
dataset
;
const
urlParams
=
new
URLSearchParams
(
window
.
location
.
search
);
const
mergeRequestPath
=
urlParams
.
get
(
'
mr_path
'
)
||
true
;
const
commitCookieName
=
`suggest_gitlab_ci_yml_commit_
${
dismissKey
}
`
;
const
commitTrackLabel
=
'
suggest_gitlab_ci_yml_commit_changes
'
;
const
commitTrackValue
=
'
20
'
;
commitButton
.
addEventListener
(
'
click
'
,
()
=>
{
setCookie
(
commitCookieName
,
mergeRequestPath
);
Tracking
.
event
(
undefined
,
'
click_button
'
,
{
label
:
commitTrackLabel
,
property
:
humanAccess
,
value
:
commitTrackValue
,
});
});
}
}
};
changelogs/unreleased/233965-suggest-pipeline-flow-second-step-should-open-on-page-load.yml
0 → 100644
View file @
095f7276
---
title
:
Resolve Suggest Pipeline flow second step not loading
merge_request
:
47419
author
:
type
:
fixed
spec/features/merge_request/user_sees_suggest_pipeline_spec.rb
View file @
095f7276
...
...
@@ -30,4 +30,40 @@ RSpec.describe 'Merge request > User sees suggest pipeline', :js do
expect
(
page
).
not_to
have_content
(
'Are you adding technical debt or code vulnerabilities?'
)
end
it
'runs tour from start to finish ensuring all nudges are executed'
do
# nudge 1
expect
(
page
).
to
have_content
(
'Are you adding technical debt or code vulnerabilities?'
)
page
.
within
'.mr-pipeline-suggest'
do
find
(
'[data-testid="ok"]'
).
click
end
wait_for_requests
# nudge 2
expect
(
page
).
to
have_content
(
'Choose Code Quality to add a pipeline that tests the quality of your code.'
)
find
(
'.js-gitlab-ci-yml-selector'
).
click
wait_for_requests
within
'.gitlab-ci-yml-selector'
do
find
(
'.dropdown-input-field'
).
set
(
'Jekyll'
)
find
(
'.dropdown-content li'
,
text:
'Jekyll'
).
click
end
wait_for_requests
expect
(
page
).
not_to
have_content
(
'Choose Code Quality to add a pipeline that tests the quality of your code.'
)
# nudge 3
expect
(
page
).
to
have_content
(
'The template is ready!'
)
find
(
'#commit-changes'
).
click
wait_for_requests
# nudge 4
expect
(
page
).
to
have_content
(
"That's it, well done!"
)
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