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
18489000
Unverified
Commit
18489000
authored
May 13, 2020
by
Peter Holmberg
Committed by
GitHub
May 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chore: Fix strict null errors on getting started (#24605)
* fix strict nulls * fix typings
parent
5f45a039
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
public/app/plugins/panel/gettingstarted/components/Step.tsx
+3
-3
public/app/plugins/panel/gettingstarted/components/TutorialCard.tsx
+3
-3
public/app/plugins/panel/gettingstarted/types.ts
+6
-3
No files found.
public/app/plugins/panel/gettingstarted/components/Step.tsx
View file @
18489000
...
...
@@ -3,7 +3,7 @@ import { css } from 'emotion';
import
{
GrafanaTheme
}
from
'@grafana/data'
;
import
{
stylesFactory
,
useTheme
}
from
'@grafana/ui'
;
import
{
TutorialCard
}
from
'./TutorialCard'
;
import
{
Card
,
SetupStep
}
from
'../types'
;
import
{
Card
,
SetupStep
,
TutorialCardType
}
from
'../types'
;
import
{
DocsCard
}
from
'./DocsCard'
;
interface
Props
{
...
...
@@ -21,10 +21,10 @@ export const Step: FC<Props> = ({ step }) => {
<
p
>
{
step
.
info
}
</
p
>
</
div
>
<
div
className=
{
styles
.
cards
}
>
{
step
.
cards
.
map
((
card
:
Card
,
index
:
number
)
=>
{
{
step
.
cards
.
map
((
card
:
Card
|
TutorialCardType
,
index
:
number
)
=>
{
const
key
=
`${card.title}-${index}`
;
if
(
card
.
type
===
'tutorial'
)
{
return
<
TutorialCard
key=
{
key
}
card=
{
card
}
/>;
return
<
TutorialCard
key=
{
key
}
card=
{
card
as
TutorialCardType
}
/>;
}
return
<
DocsCard
key=
{
key
}
card=
{
card
}
/>;
})
}
...
...
public/app/plugins/panel/gettingstarted/components/TutorialCard.tsx
View file @
18489000
...
...
@@ -4,10 +4,10 @@ import { Icon, stylesFactory, useTheme } from '@grafana/ui';
import
{
css
}
from
'emotion'
;
import
store
from
'app/core/store'
;
import
{
cardContent
,
cardStyle
,
iconStyle
}
from
'./sharedStyles'
;
import
{
Card
}
from
'../types'
;
import
{
TutorialCardType
}
from
'../types'
;
interface
Props
{
card
:
Card
;
card
:
TutorialCardType
;
}
export
const
TutorialCard
:
FC
<
Props
>
=
({
card
})
=>
{
...
...
@@ -27,7 +27,7 @@ export const TutorialCard: FC<Props> = ({ card }) => {
);
};
const
handleTutorialClick
=
(
event
:
MouseEvent
<
HTMLAnchorElement
>
,
card
:
Card
)
=>
{
const
handleTutorialClick
=
(
event
:
MouseEvent
<
HTMLAnchorElement
>
,
card
:
TutorialCardType
)
=>
{
event
.
preventDefault
();
const
isSet
=
store
.
get
(
card
.
key
);
if
(
!
isSet
)
{
...
...
public/app/plugins/panel/gettingstarted/types.ts
View file @
18489000
...
...
@@ -10,10 +10,13 @@ export interface Card {
check
:
()
=>
Promise
<
boolean
>
;
done
:
boolean
;
heading
:
string
;
learnHref
?:
string
;
}
export
interface
TutorialCardType
extends
Card
{
info
?:
string
;
// For local storage
key
?:
string
;
learnHref
?:
string
;
key
:
string
;
}
export
interface
SetupStep
{
...
...
@@ -21,6 +24,6 @@ export interface SetupStep {
subheading
:
string
;
title
:
string
;
info
:
string
;
cards
:
Card
[];
cards
:
(
Card
|
TutorialCardType
)
[];
done
:
boolean
;
}
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