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
2d5fd7fd
Unverified
Commit
2d5fd7fd
authored
Feb 16, 2019
by
Torkel Ödegaard
Committed by
GitHub
Feb 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed prettier issue (#15471)
Fixed prettier CI issue that caused build failures
parent
1adc1a60
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
16 deletions
+33
-16
package.json
+1
-1
public/app/features/explore/LogMessageAnsi.test.tsx
+16
-4
public/app/features/explore/LogMessageAnsi.tsx
+16
-11
No files found.
package.json
View file @
2d5fd7fd
...
...
@@ -121,7 +121,7 @@
"jest"
:
"jest --notify --watch"
,
"api-tests"
:
"jest --notify --watch --config=tests/api/jest.js"
,
"storybook"
:
"cd packages/grafana-ui && yarn storybook"
,
"prettier:check"
:
"prettier --
--
list-different
\"
**/*.{ts,tsx,scss}
\"
"
"prettier:check"
:
"prettier --list-different
\"
**/*.{ts,tsx,scss}
\"
"
},
"husky"
:
{
"hooks"
:
{
...
...
public/app/features/explore/LogMessageAnsi.test.tsx
View file @
2d5fd7fd
...
...
@@ -16,9 +16,21 @@ describe('<LogMessageAnsi />', () => {
const
wrapper
=
shallow
(<
LogMessageAnsi
value=
{
value
}
/>);
expect
(
wrapper
.
find
(
'span'
)).
toHaveLength
(
1
);
expect
(
wrapper
.
find
(
'span'
).
first
().
prop
(
'style'
)).
toMatchObject
(
expect
.
objectContaining
({
color
:
expect
.
any
(
String
)
}));
expect
(
wrapper
.
find
(
'span'
).
first
().
text
()).
toBe
(
'ipsum'
);
expect
(
wrapper
.
find
(
'span'
)
.
first
()
.
prop
(
'style'
)
).
toMatchObject
(
expect
.
objectContaining
({
color
:
expect
.
any
(
String
),
})
);
expect
(
wrapper
.
find
(
'span'
)
.
first
()
.
text
()
).
toBe
(
'ipsum'
);
});
});
public/app/features/explore/LogMessageAnsi.tsx
View file @
2d5fd7fd
...
...
@@ -46,15 +46,15 @@ export class LogMessageAnsi extends PureComponent<Props, State> {
const
parsed
=
ansicolor
.
parse
(
props
.
value
);
return
{
chunks
:
parsed
.
spans
.
map
(
(
span
)
=>
{
return
span
.
css
?
{
style
:
convertCSSToStyle
(
span
.
css
),
text
:
span
.
text
}
:
{
text
:
span
.
text
};
chunks
:
parsed
.
spans
.
map
(
span
=>
{
return
span
.
css
?
{
style
:
convertCSSToStyle
(
span
.
css
),
text
:
span
.
text
,
}
:
{
text
:
span
.
text
};
}),
prevValue
:
props
.
value
prevValue
:
props
.
value
,
};
}
...
...
@@ -62,9 +62,14 @@ export class LogMessageAnsi extends PureComponent<Props, State> {
const
{
chunks
}
=
this
.
state
;
return
chunks
.
map
(
(
chunk
,
index
)
=>
chunk
.
style
?
<
span
key=
{
index
}
style=
{
chunk
.
style
}
>
{
chunk
.
text
}
</
span
>
:
chunk
.
text
(
chunk
,
index
)
=>
chunk
.
style
?
(
<
span
key=
{
index
}
style=
{
chunk
.
style
}
>
{
chunk
.
text
}
</
span
>
)
:
(
chunk
.
text
)
);
}
}
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