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
f7f124c5
Commit
f7f124c5
authored
Mar 10, 2019
by
ryan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reuse deprecationWarning
parent
d13eebfe
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
9 deletions
+11
-9
packages/grafana-ui/src/components/ColorPicker/warnAboutColorPickerPropsDeprecation.ts
+2
-2
packages/grafana-ui/src/utils/deprecationWarning.ts
+6
-0
packages/grafana-ui/src/utils/index.ts
+1
-0
packages/grafana-ui/src/utils/propDeprecationWarning.ts
+0
-6
public/app/core/utils/kbn.ts
+2
-1
No files found.
packages/grafana-ui/src/components/ColorPicker/warnAboutColorPickerPropsDeprecation.ts
View file @
f7f124c5
import
propDeprecationWarning
from
'../../utils/propD
eprecationWarning'
;
import
deprecationWarning
from
'../../utils/d
eprecationWarning'
;
import
{
ColorPickerProps
}
from
'./ColorPickerPopover'
;
export
const
warnAboutColorPickerPropsDeprecation
=
(
componentName
:
string
,
props
:
ColorPickerProps
)
=>
{
const
{
onColorChange
}
=
props
;
if
(
onColorChange
)
{
propD
eprecationWarning
(
componentName
,
'onColorChange'
,
'onChange'
);
d
eprecationWarning
(
componentName
,
'onColorChange'
,
'onChange'
);
}
};
packages/grafana-ui/src/utils/deprecationWarning.ts
0 → 100644
View file @
f7f124c5
const
deprecationWarning
=
(
file
:
string
,
oldName
:
string
,
newName
:
string
)
=>
{
const
message
=
`[Deprecation warning]
${
file
}
:
${
oldName
}
is deprecated. Use
${
newName
}
instead`
;
console
.
warn
(
message
);
};
export
default
deprecationWarning
;
packages/grafana-ui/src/utils/index.ts
View file @
f7f124c5
...
...
@@ -3,4 +3,5 @@ export * from './valueFormats/valueFormats';
export
*
from
'./colors'
;
export
*
from
'./namedColorsPalette'
;
export
*
from
'./string'
;
export
*
from
'./deprecationWarning'
;
export
{
getMappedValue
}
from
'./valueMappings'
;
packages/grafana-ui/src/utils/propDeprecationWarning.ts
deleted
100644 → 0
View file @
d13eebfe
const
propDeprecationWarning
=
(
componentName
:
string
,
propName
:
string
,
newPropName
:
string
)
=>
{
const
message
=
`[Deprecation warning]
${
componentName
}
:
${
propName
}
is deprecated. Use
${
newPropName
}
instead`
;
console
.
warn
(
message
);
};
export
default
propDeprecationWarning
;
public/app/core/utils/kbn.ts
View file @
f7f124c5
import
_
from
'lodash'
;
import
{
getValueFormat
,
getValueFormatterIndex
,
getValueFormats
,
stringToJsRegex
}
from
'@grafana/ui'
;
import
deprecationWarning
from
'@grafana/ui/src/utils/deprecationWarning'
;
const
kbn
:
any
=
{};
...
...
@@ -230,7 +231,7 @@ kbn.slugifyForUrl = str => {
/** deprecated since 6.1, use grafana/ui */
kbn.stringToJsRegex = str => {
console.warn('Migrate stringToJsRegex to grafana/ui,
');
deprecationWarning('kbn.ts', 'kbn.stringToJsRegex()', '@grafana/ui
');
return stringToJsRegex(str);
};
...
...
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