Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
00df24b3
Commit
00df24b3
authored
Nov 24, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux: search progress
parent
bc81298d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
12 deletions
+22
-12
public/app/core/components/search/search.html
+3
-1
public/app/core/services/context_srv.ts
+0
-2
public/app/core/services/search_srv.ts
+6
-0
public/app/core/specs/search_srv.jest.ts
+2
-0
public/sass/components/_search.scss
+11
-9
No files found.
public/app/core/components/search/search.html
View file @
00df24b3
...
...
@@ -80,7 +80,9 @@
</span>
</span>
<span
class=
"search-item__actions"
>
<i
class=
"fa"
ng-class=
"{'fa-star': item.isStarred, 'fa-star-o': !item.isStarred}"
></i>
<span
class=
"search-item__actions__item"
ng-click=
"ctrl.toggleStar()"
>
<i
class=
"fa"
ng-class=
"{'fa-star': item.isStarred, 'fa-star-o': !item.isStarred}"
></i>
</span>
</span>
</a>
</div>
...
...
public/app/core/services/context_srv.ts
View file @
00df24b3
///<reference path="../../headers/common.d.ts" />
import
config
from
'app/core/config'
;
import
_
from
'lodash'
;
import
coreModule
from
'app/core/core_module'
;
...
...
public/app/core/services/search_srv.ts
View file @
00df24b3
...
...
@@ -2,6 +2,7 @@ import _ from 'lodash';
import
coreModule
from
'app/core/core_module'
;
import
impressionSrv
from
'app/core/services/impression_srv'
;
import
store
from
'app/core/store'
;
import
{
contextSrv
}
from
'app/core/services/context_srv'
;
export
class
SearchSrv
{
recentIsOpen
:
boolean
;
...
...
@@ -20,6 +21,7 @@ export class SearchSrv {
title
:
'Recent Boards'
,
icon
:
'fa fa-clock-o'
,
score
:
-
1
,
removable
:
true
,
expanded
:
this
.
recentIsOpen
,
toggle
:
this
.
toggleRecent
.
bind
(
this
),
items
:
result
,
...
...
@@ -60,6 +62,10 @@ export class SearchSrv {
}
private
getStarred
(
sections
)
{
if
(
!
contextSrv
.
isSignedIn
)
{
return
Promise
.
resolve
();
}
return
this
.
backendSrv
.
search
({
starred
:
true
,
limit
:
5
}).
then
(
result
=>
{
if
(
result
.
length
>
0
)
{
sections
[
'starred'
]
=
{
...
...
public/app/core/specs/search_srv.jest.ts
View file @
00df24b3
import
{
SearchSrv
}
from
'app/core/services/search_srv'
;
import
{
BackendSrvMock
}
from
'test/mocks/backend_srv'
;
import
impressionSrv
from
'app/core/services/impression_srv'
;
import
{
contextSrv
}
from
'app/core/services/context_srv'
;
jest
.
mock
(
'app/core/store'
,
()
=>
{
return
{
...
...
@@ -22,6 +23,7 @@ describe('SearchSrv', () => {
backendSrvMock
=
new
BackendSrvMock
();
searchSrv
=
new
SearchSrv
(
backendSrvMock
,
Promise
);
contextSrv
.
isSignedIn
=
true
;
impressionSrv
.
getDashboardOpened
=
jest
.
fn
().
mockReturnValue
([]);
});
...
...
public/sass/components/_search.scss
View file @
00df24b3
...
...
@@ -141,14 +141,6 @@
&
.selected
{
background
:
$list-item-hover-bg
;
}
// .fa-star, .fa-star-o {
// padding-left: 13px;
// }
//
// .fa-star {
// color: $orange;
// }
}
.search-item__body
{
...
...
@@ -182,7 +174,17 @@
}
.search-item__actions
{
visibility
:
hidden
;
flex
:
0
0
auto
;
}
.search-item__actions__item
{
display
:
none
;
}
.search-item
:hover
{
.search-item__actions__item
{
opacity
:
0
.8
;
}
}
.search-button-row
{
...
...
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