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
e464a8e6
Commit
e464a8e6
authored
Dec 13, 2021
by
Zack Cuddy
Committed by
Andrew Fontaine
Dec 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Global Search - Dynamic Import Header Search
parent
0acbdfa9
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
173 additions
and
14 deletions
+173
-14
app/assets/javascripts/header_search/components/app.vue
app/assets/javascripts/header_search/components/app.vue
+1
-0
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+17
-13
app/assets/stylesheets/startup/startup-dark.scss
app/assets/stylesheets/startup/startup-dark.scss
+38
-0
app/assets/stylesheets/startup/startup-general.scss
app/assets/stylesheets/startup/startup-general.scss
+38
-0
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+3
-1
ee/app/assets/stylesheets/startup/startup-dark.scss
ee/app/assets/stylesheets/startup/startup-dark.scss
+38
-0
ee/app/assets/stylesheets/startup/startup-general.scss
ee/app/assets/stylesheets/startup/startup-general.scss
+38
-0
No files found.
app/assets/javascripts/header_search/components/app.vue
View file @
e464a8e6
...
...
@@ -138,6 +138,7 @@ export default {
class=
"header-search gl-relative"
>
<gl-search-box-by-type
id=
"search"
v-model=
"searchText"
role=
"searchbox"
class=
"gl-z-index-1"
...
...
app/assets/javascripts/main.js
View file @
e464a8e6
...
...
@@ -14,7 +14,6 @@ import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
import
{
initRails
}
from
'
~/lib/utils/rails_ujs
'
;
import
*
as
popovers
from
'
~/popovers
'
;
import
*
as
tooltips
from
'
~/tooltips
'
;
import
{
initHeaderSearchApp
}
from
'
~/header_search
'
;
import
initAlertHandler
from
'
./alert_handler
'
;
import
{
addDismissFlashClickListener
}
from
'
./flash
'
;
import
initTodoToggle
from
'
./header
'
;
...
...
@@ -98,25 +97,30 @@ function deferredInitialisation() {
initDefaultTrackers
();
initFeatureHighlight
();
if
(
gon
.
features
?.
newHeaderSearch
)
{
initHeaderSearchApp
();
}
else
{
const
search
=
document
.
querySelector
(
'
#search
'
);
if
(
search
)
{
search
.
addEventListener
(
'
focus
'
,
()
=>
{
if
(
gon
.
features
?.
newHeaderSearch
)
{
import
(
/* webpackChunkName: 'globalSearch' */
'
~/header_search
'
)
.
then
(
async
({
initHeaderSearchApp
})
=>
{
await
initHeaderSearchApp
();
document
.
querySelector
(
'
#search
'
).
focus
();
})
.
catch
(()
=>
{});
}
else
{
import
(
/* webpackChunkName: 'globalSearch' */
'
./search_autocomplete
'
)
.
then
(({
default
:
initSearchAutocomplete
})
=>
{
const
searchDropdown
=
initSearchAutocomplete
();
searchDropdown
.
onSearchInputFocus
();
})
.
catch
(()
=>
{});
}
},
{
once
:
true
},
);
}
}
addSelectOnFocusBehaviour
(
'
.js-select-on-focus
'
);
...
...
app/assets/stylesheets/startup/startup-dark.scss
View file @
e464a8e6
...
...
@@ -407,6 +407,21 @@ h1 {
.
gl-form-input
.
form-control
::
placeholder
{
color
:
#868686
;
}
.gl-icon
{
fill
:
currentColor
;
}
.gl-icon.s12
{
width
:
12px
;
height
:
12px
;
}
.gl-icon.s16
{
width
:
16px
;
height
:
16px
;
}
.gl-icon.s32
{
width
:
32px
;
height
:
32px
;
}
.gl-button
{
display
:
inline-flex
;
}
...
...
@@ -439,6 +454,29 @@ h1 {
outline
:
none
;
background-color
:
#404040
;
}
.gl-button.gl-button.btn-default
:active
.gl-icon
,
.gl-button.gl-button.btn-default.active
.gl-icon
{
color
:
#fafafa
;
}
.gl-button.gl-button.btn-default
.gl-icon
{
color
:
#999
;
}
.gl-search-box-by-type-search-icon
{
margin
:
0
.5rem
;
color
:
#999
;
width
:
1rem
;
position
:
absolute
;
}
.gl-search-box-by-type
{
display
:
flex
;
position
:
relative
;
}
.gl-search-box-by-type-input
,
.gl-search-box-by-type-input.gl-form-input
{
height
:
2rem
;
padding-right
:
2rem
;
padding-left
:
1
.75rem
;
}
body
,
.form-control
,
.search
form
{
...
...
app/assets/stylesheets/startup/startup-general.scss
View file @
e464a8e6
...
...
@@ -388,6 +388,21 @@ h1 {
.
gl-form-input
.
form-control
::
placeholder
{
color
:
#868686
;
}
.gl-icon
{
fill
:
currentColor
;
}
.gl-icon.s12
{
width
:
12px
;
height
:
12px
;
}
.gl-icon.s16
{
width
:
16px
;
height
:
16px
;
}
.gl-icon.s32
{
width
:
32px
;
height
:
32px
;
}
.gl-button
{
display
:
inline-flex
;
}
...
...
@@ -420,6 +435,29 @@ h1 {
outline
:
none
;
background-color
:
#dbdbdb
;
}
.gl-button.gl-button.btn-default
:active
.gl-icon
,
.gl-button.gl-button.btn-default.active
.gl-icon
{
color
:
#303030
;
}
.gl-button.gl-button.btn-default
.gl-icon
{
color
:
#666
;
}
.gl-search-box-by-type-search-icon
{
margin
:
0
.5rem
;
color
:
#666
;
width
:
1rem
;
position
:
absolute
;
}
.gl-search-box-by-type
{
display
:
flex
;
position
:
relative
;
}
.gl-search-box-by-type-input
,
.gl-search-box-by-type-input.gl-form-input
{
height
:
2rem
;
padding-right
:
2rem
;
padding-left
:
1
.75rem
;
}
body
,
.form-control
,
.search
form
{
...
...
app/views/layouts/header/_default.html.haml
View file @
e464a8e6
...
...
@@ -36,7 +36,9 @@
'issues-path'
=>
issues_dashboard_path
,
'mr-path'
=>
merge_requests_dashboard_path
,
'autocomplete-path'
=>
search_autocomplete_path
}
}
%input
{
type:
"text"
,
placeholder:
_
(
'Search or jump to...'
),
class:
'form-control gl-form-input'
}
.gl-search-box-by-type
=
sprite_icon
(
'search'
,
css_class:
'gl-search-box-by-type-search-icon gl-icon'
)
%input
{
type:
"text"
,
placeholder:
_
(
'Search or jump to...'
),
class:
'form-control gl-form-input gl-search-box-by-type-input'
,
id:
'search'
,
autocomplete:
'off'
}
-
else
=
render
'layouts/search'
%li
.nav-item
{
class:
'd-none d-sm-inline-block d-lg-none'
}
...
...
ee/app/assets/stylesheets/startup/startup-dark.scss
View file @
e464a8e6
...
...
@@ -407,6 +407,21 @@ h1 {
.
gl-form-input
.
form-control
::
placeholder
{
color
:
#868686
;
}
.gl-icon
{
fill
:
currentColor
;
}
.gl-icon.s12
{
width
:
12px
;
height
:
12px
;
}
.gl-icon.s16
{
width
:
16px
;
height
:
16px
;
}
.gl-icon.s32
{
width
:
32px
;
height
:
32px
;
}
.gl-button
{
display
:
inline-flex
;
}
...
...
@@ -439,6 +454,29 @@ h1 {
outline
:
none
;
background-color
:
#404040
;
}
.gl-button.gl-button.btn-default
:active
.gl-icon
,
.gl-button.gl-button.btn-default.active
.gl-icon
{
color
:
#fafafa
;
}
.gl-button.gl-button.btn-default
.gl-icon
{
color
:
#999
;
}
.gl-search-box-by-type-search-icon
{
margin
:
0
.5rem
;
color
:
#999
;
width
:
1rem
;
position
:
absolute
;
}
.gl-search-box-by-type
{
display
:
flex
;
position
:
relative
;
}
.gl-search-box-by-type-input
,
.gl-search-box-by-type-input.gl-form-input
{
height
:
2rem
;
padding-right
:
2rem
;
padding-left
:
1
.75rem
;
}
body
,
.form-control
,
.search
form
{
...
...
ee/app/assets/stylesheets/startup/startup-general.scss
View file @
e464a8e6
...
...
@@ -388,6 +388,21 @@ h1 {
.
gl-form-input
.
form-control
::
placeholder
{
color
:
#868686
;
}
.gl-icon
{
fill
:
currentColor
;
}
.gl-icon.s12
{
width
:
12px
;
height
:
12px
;
}
.gl-icon.s16
{
width
:
16px
;
height
:
16px
;
}
.gl-icon.s32
{
width
:
32px
;
height
:
32px
;
}
.gl-button
{
display
:
inline-flex
;
}
...
...
@@ -420,6 +435,29 @@ h1 {
outline
:
none
;
background-color
:
#dbdbdb
;
}
.gl-button.gl-button.btn-default
:active
.gl-icon
,
.gl-button.gl-button.btn-default.active
.gl-icon
{
color
:
#303030
;
}
.gl-button.gl-button.btn-default
.gl-icon
{
color
:
#666
;
}
.gl-search-box-by-type-search-icon
{
margin
:
0
.5rem
;
color
:
#666
;
width
:
1rem
;
position
:
absolute
;
}
.gl-search-box-by-type
{
display
:
flex
;
position
:
relative
;
}
.gl-search-box-by-type-input
,
.gl-search-box-by-type-input.gl-form-input
{
height
:
2rem
;
padding-right
:
2rem
;
padding-left
:
1
.75rem
;
}
body
,
.form-control
,
.search
form
{
...
...
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