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
e2677750
Commit
e2677750
authored
Aug 20, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
ed6b295a
51c19691
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
124 additions
and
7 deletions
+124
-7
app/assets/javascripts/lib/utils/url_utility.js
app/assets/javascripts/lib/utils/url_utility.js
+7
-1
app/assets/javascripts/vue_shared/directives/autofocusonshow.js
...sets/javascripts/vue_shared/directives/autofocusonshow.js
+39
-0
changelogs/unreleased/fe-fix-merge-url-params-with-plus.yml
changelogs/unreleased/fe-fix-merge-url-params-with-plus.yml
+5
-0
doc/development/automatic_ce_ee_merge.md
doc/development/automatic_ce_ee_merge.md
+1
-1
lib/gitlab/ci/templates/Security/SAST.gitlab-ci.yml
lib/gitlab/ci/templates/Security/SAST.gitlab-ci.yml
+3
-0
spec/features/search/user_searches_for_code_spec.rb
spec/features/search/user_searches_for_code_spec.rb
+25
-5
spec/frontend/lib/utils/url_utility_spec.js
spec/frontend/lib/utils/url_utility_spec.js
+6
-0
spec/javascripts/vue_shared/directives/autofocusonshow_spec.js
...javascripts/vue_shared/directives/autofocusonshow_spec.js
+38
-0
No files found.
app/assets/javascripts/lib/utils/url_utility.js
View file @
e2677750
import
{
join
as
joinPaths
}
from
'
path
'
;
// Returns a decoded url parameter value
// - Treats '+' as '%20'
function
decodeUrlParameter
(
val
)
{
return
decodeURIComponent
(
val
.
replace
(
/
\+
/g
,
'
%20
'
));
}
// Returns an array containing the value(s) of the
// of the key passed as an argument
export
function
getParameterValues
(
sParam
,
url
=
window
.
location
)
{
...
...
@@ -30,7 +36,7 @@ export function mergeUrlParams(params, url) {
.
forEach
(
part
=>
{
if
(
part
.
length
)
{
const
kv
=
part
.
split
(
'
=
'
);
merged
[
decodeU
RIComponent
(
kv
[
0
])]
=
decodeURIComponent
(
kv
.
slice
(
1
).
join
(
'
=
'
));
merged
[
decodeU
rlParameter
(
kv
[
0
])]
=
decodeUrlParameter
(
kv
.
slice
(
1
).
join
(
'
=
'
));
}
});
}
...
...
app/assets/javascripts/vue_shared/directives/autofocusonshow.js
0 → 100644
View file @
e2677750
/**
* Input/Textarea Autofocus Directive for Vue
*/
export
default
{
/**
* Set focus when element is rendered, but
* is not visible, using IntersectionObserver
*
* @param {Element} el Target element
*/
inserted
(
el
)
{
if
(
'
IntersectionObserver
'
in
window
)
{
// Element visibility is dynamic, so we attach observer
el
.
visibilityObserver
=
new
IntersectionObserver
(
entries
=>
{
entries
.
forEach
(
entry
=>
{
// Combining `intersectionRatio > 0` and
// element's `offsetParent` presence will
// deteremine if element is truely visible
if
(
entry
.
intersectionRatio
>
0
&&
entry
.
target
.
offsetParent
)
{
entry
.
target
.
focus
();
}
});
});
// Bind the observer.
el
.
visibilityObserver
.
observe
(
el
,
{
root
:
document
.
documentElement
});
}
},
/**
* Detach observer on unbind hook.
*
* @param {Element} el Target element
*/
unbind
(
el
)
{
if
(
el
.
visibilityObserver
)
{
el
.
visibilityObserver
.
disconnect
();
}
},
};
changelogs/unreleased/fe-fix-merge-url-params-with-plus.yml
0 → 100644
View file @
e2677750
---
title
:
Fix search preserving space when change branch
merge_request
:
31973
author
:
minghuan lei
type
:
fixed
doc/development/automatic_ce_ee_merge.md
View file @
e2677750
...
...
@@ -200,7 +200,7 @@ code.
### Why merge automatically?
As we work towards continuous deployments and a single repository for both CE
and EE, we need to first make sure that all CE changes make their way into
C
E as
and EE, we need to first make sure that all CE changes make their way into
E
E as
fast as possible. Past experiences and data have shown that periodic CE to EE
merge requests do not scale, and often take a very long time to complete. For
example,
[
in this
...
...
lib/gitlab/ci/templates/Security/SAST.gitlab-ci.yml
View file @
e2677750
...
...
@@ -46,11 +46,14 @@ sast:
SAST_DOCKER_CLIENT_NEGOTIATION_TIMEOUT \
SAST_PULL_ANALYZER_IMAGE_TIMEOUT \
SAST_RUN_ANALYZER_TIMEOUT \
SAST_JAVA_VERSION \
ANT_HOME \
ANT_PATH \
GRADLE_PATH \
JAVA_OPTS \
JAVA_PATH \
JAVA_8_VERSION \
JAVA_11_VERSION \
MAVEN_CLI_OPTS \
MAVEN_PATH \
MAVEN_REPO_PATH \
...
...
spec/features/search/user_searches_for_code_spec.rb
View file @
e2677750
...
...
@@ -39,17 +39,16 @@ describe 'User searches for code' do
context
'when on a project page'
,
:js
do
before
do
visit
(
search_path
)
end
include_examples
'top right search form'
it
'finds code'
do
find
(
'.js-search-project-dropdown'
).
click
page
.
within
(
'.project-filter'
)
do
click_link
(
project
.
full_name
)
end
end
include_examples
'top right search form'
it
'finds code'
do
fill_in
(
'dashboard_search'
,
with:
'rspec'
)
find
(
'.btn-search'
).
click
...
...
@@ -57,6 +56,27 @@ describe 'User searches for code' do
expect
(
find
(
:css
,
'.search-results'
)).
to
have_content
(
'Update capybara, rspec-rails, poltergeist to recent versions'
)
end
end
it
'search mutiple words with refs switching'
do
expected_result
=
'Use `snake_case` for naming files'
search
=
'for naming files'
fill_in
(
'dashboard_search'
,
with:
search
)
find
(
'.btn-search'
).
click
page
.
within
(
'.results'
)
do
expect
(
find
(
'.search-results'
)).
to
have_content
(
expected_result
)
end
find
(
'.js-project-refs-dropdown'
).
click
find
(
'.dropdown-page-one .dropdown-content'
).
click_link
(
'v1.0.0'
)
page
.
within
(
'.results'
)
do
expect
(
find
(
:css
,
'.search-results'
)).
to
have_content
(
expected_result
)
end
expect
(
find_field
(
'dashboard_search'
).
value
).
to
eq
(
search
)
end
end
context
'search code within refs'
,
:js
do
...
...
spec/frontend/lib/utils/url_utility_spec.js
View file @
e2677750
...
...
@@ -94,6 +94,12 @@ describe('URL utility', () => {
it
(
'
adds and updates encoded params
'
,
()
=>
{
expect
(
urlUtils
.
mergeUrlParams
({
a
:
'
&
'
,
q
:
'
?
'
},
'
?a=%23#frag
'
)).
toBe
(
'
?a=%26&q=%3F#frag
'
);
});
it
(
'
treats "+" as "%20"
'
,
()
=>
{
expect
(
urlUtils
.
mergeUrlParams
({
ref
:
'
bogus
'
},
'
?a=lorem+ipsum&ref=charlie
'
)).
toBe
(
'
?a=lorem%20ipsum&ref=bogus
'
,
);
});
});
describe
(
'
removeParams
'
,
()
=>
{
...
...
spec/javascripts/vue_shared/directives/autofocusonshow_spec.js
0 → 100644
View file @
e2677750
import
autofocusonshow
from
'
~/vue_shared/directives/autofocusonshow
'
;
/**
* We're testing this directive's hooks as pure functions
* since behaviour of this directive is highly-dependent
* on underlying DOM methods.
*/
describe
(
'
AutofocusOnShow directive
'
,
()
=>
{
describe
(
'
with input invisible on component render
'
,
()
=>
{
let
el
;
beforeAll
(()
=>
{
setFixtures
(
'
<div id="container" style="display: none;"><input id="inputel"/></div>
'
);
el
=
document
.
querySelector
(
'
#inputel
'
);
});
it
(
'
should bind IntersectionObserver on input element
'
,
()
=>
{
spyOn
(
el
,
'
focus
'
);
autofocusonshow
.
inserted
(
el
);
expect
(
el
.
visibilityObserver
).
toBeDefined
();
expect
(
el
.
focus
).
not
.
toHaveBeenCalled
();
});
it
(
'
should stop IntersectionObserver on input element on unbind hook
'
,
()
=>
{
el
.
visibilityObserver
=
{
disconnect
:
()
=>
{},
};
spyOn
(
el
.
visibilityObserver
,
'
disconnect
'
);
autofocusonshow
.
unbind
(
el
);
expect
(
el
.
visibilityObserver
).
toBeDefined
();
expect
(
el
.
visibilityObserver
.
disconnect
).
toHaveBeenCalled
();
});
});
});
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