From 0105127b81f16467af00c417d9d4fb16ccd30e84 Mon Sep 17 00:00:00 2001 From: AlexKVal Date: Mon, 27 Apr 2015 22:20:10 +0300 Subject: [PATCH] [changed] Renamed Collapsable* => Collapsible* CollapsableMixin => CollaplibleMixin CollapsableNav => CollaplibleNav More here #425 Exactly this commit: Add CollapsibleMixin to src/index.js Refactor deprecationWarning() for general use. --- src/CollapsableMixin.js | 13 +++++++++---- src/CollapsableNav.js | 6 +++++- src/CollapsibleMixin.js | 3 ++- src/index.js | 2 ++ src/utils/deprecationWarning.js | 8 +++++--- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/CollapsableMixin.js b/src/CollapsableMixin.js index 3edd4c5503..1aae543000 100644 --- a/src/CollapsableMixin.js +++ b/src/CollapsableMixin.js @@ -2,11 +2,14 @@ import assign from './utils/Object.assign'; import deprecationWarning from './utils/deprecationWarning'; import CollapsibleMixin from './CollapsibleMixin'; +let link = 'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963'; + const CollapsableMixin = assign({}, CollapsibleMixin, { getCollapsableClassSet(className) { deprecationWarning( 'CollapsableMixin.getCollapsableClassSet()', - 'CollapsibleMixin.getCollapsibleClassSet()' + 'CollapsibleMixin.getCollapsibleClassSet()', + link ); return CollapsibleMixin.getCollapsibleClassSet.call(this, className); }, @@ -14,7 +17,8 @@ const CollapsableMixin = assign({}, CollapsibleMixin, { getCollapsibleDOMNode() { deprecationWarning( 'CollapsableMixin.getCollapsableDOMNode()', - 'CollapsibleMixin.getCollapsibleDOMNode()' + 'CollapsibleMixin.getCollapsibleDOMNode()', + link ); return this.getCollapsableDOMNode(); }, @@ -22,12 +26,13 @@ const CollapsableMixin = assign({}, CollapsibleMixin, { getCollapsibleDimensionValue() { deprecationWarning( 'CollapsableMixin.getCollapsableDimensionValue()', - 'CollapsibleMixin.getCollapsibleDimensionValue()' + 'CollapsibleMixin.getCollapsibleDimensionValue()', + link ); return this.getCollapsableDimensionValue(); } }); -deprecationWarning('CollapsableMixin', 'CollapsibleMixin'); +deprecationWarning('CollapsableMixin', 'CollapsibleMixin', link); export default CollapsableMixin; diff --git a/src/CollapsableNav.js b/src/CollapsableNav.js index 0e9b14f529..cc211684f3 100644 --- a/src/CollapsableNav.js +++ b/src/CollapsableNav.js @@ -3,6 +3,10 @@ import CollapsibleNav from './CollapsibleNav'; let CollapsableNav = CollapsibleNav; -deprecationWarning('CollapsableNav', 'CollapsibleNav'); +deprecationWarning( + 'CollapsableNav', + 'CollapsibleNav', + 'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963' +); export default CollapsableNav; diff --git a/src/CollapsibleMixin.js b/src/CollapsibleMixin.js index 3b6e738022..505b62909d 100644 --- a/src/CollapsibleMixin.js +++ b/src/CollapsibleMixin.js @@ -141,7 +141,8 @@ const CollapsibleMixin = { if (typeof this.getCollapsableDimension === 'function') { deprecationWarning( 'CollapsableMixin.getCollapsableDimension()', - 'CollapsibleMixin.getCollapsibleDimension()' + 'CollapsibleMixin.getCollapsibleDimension()', + 'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963' ); return this.getCollapsableDimension(); } diff --git a/src/index.js b/src/index.js index 047638f72c..f4b296d878 100644 --- a/src/index.js +++ b/src/index.js @@ -13,6 +13,7 @@ import Carousel from './Carousel'; import CarouselItem from './CarouselItem'; import Col from './Col'; import CollapsableMixin from './CollapsableMixin'; +import CollapsibleMixin from './CollapsibleMixin'; import DropdownButton from './DropdownButton'; import DropdownMenu from './DropdownMenu'; import DropdownStateMixin from './DropdownStateMixin'; @@ -66,6 +67,7 @@ export default { CarouselItem, Col, CollapsableMixin, + CollapsibleMixin, DropdownButton, DropdownMenu, DropdownStateMixin, diff --git a/src/utils/deprecationWarning.js b/src/utils/deprecationWarning.js index 44ed6435eb..2395cb4729 100644 --- a/src/utils/deprecationWarning.js +++ b/src/utils/deprecationWarning.js @@ -1,8 +1,10 @@ -export default function deprecationWarning(oldname, newname) { +export default function deprecationWarning(oldname, newname, link) { if (process.env.NODE_ENV !== 'production') { let message = `${oldname} is deprecated. Use ${newname} instead.`; console.warn(message); - let link = 'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963'; - console.warn(`You can read more about it here ${link}`); + + if (link) { + console.warn(`You can read more about it here ${link}`); + } } }