Skip to content

Commit 3935302

Browse files
authored
(chore) Use standalone proptypes (#5988)
* upgrade deps * run codemod * update storybook
1 parent f41ecd3 commit 3935302

File tree

250 files changed

+1553
-1087
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+1553
-1087
lines changed

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"node-libs-browser": "0.5.3",
4545
"platformicons": "0.1.1",
4646
"po-catalog-loader": "^1.2.0",
47+
"prop-types": "^15.5.10",
4748
"query-string": "2.4.2",
4849
"raven-js": "3.16.1",
4950
"react": "15.3.2",
@@ -84,7 +85,9 @@
8485
"snapshot": "build-storybook && PERCY_TOKEN=$STORYBOOK_PERCY_TOKEN PERCY_PROJECT=$STORYBOOK_PERCY_PROJECT percy-storybook --widths=375,1280"
8586
},
8687
"jest": {
87-
"snapshotSerializers": ["enzyme-to-json/serializer"],
88+
"snapshotSerializers": [
89+
"enzyme-to-json/serializer"
90+
],
8891
"moduleNameMapper": {
8992
"\\.(css|less)$": "<rootDir>/tests/js/helpers/importStyleMock.js",
9093
"integration-docs-platforms": "<rootDir>/tests/fixtures/_platforms.json"
@@ -102,9 +105,9 @@
102105
},
103106
"devDependencies": {
104107
"@percy-io/react-percy-storybook": "^1.0.2",
105-
"@storybook/addon-actions": "3.2.0",
106-
"@storybook/addon-info": "3.2.0",
107-
"@storybook/react": "3.2.0",
108+
"@storybook/addon-actions": "^3.2.0",
109+
"@storybook/addon-info": "^3.2.0",
110+
"@storybook/react": "^3.2.0",
108111
"babel-eslint": "7.1.1",
109112
"babel-jest": "^19.0.0",
110113
"chai": "3.4.1",

src/sentry/static/sentry/app/components/actionOverlay.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23
import OrganizationState from '../mixins/organizationState';
34
import {t} from '../locale';
@@ -6,12 +7,12 @@ import LoadingIndicator from '../components/loadingIndicator';
67

78
const ActionOverlay = React.createClass({
89
propTypes: {
9-
actionId: React.PropTypes.string.isRequired,
10-
isLoading: React.PropTypes.bool
10+
actionId: PropTypes.string.isRequired,
11+
isLoading: PropTypes.bool
1112
},
1213

1314
contextTypes: {
14-
router: React.PropTypes.object.isRequired
15+
router: PropTypes.object.isRequired
1516
},
1617

1718
mixins: [OrganizationState],

src/sentry/static/sentry/app/components/activity/feed.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23

34
import ApiMixin from '../../mixins/apiMixin';
@@ -10,10 +11,10 @@ import {logException} from '../../utils/logging';
1011

1112
const ActivityFeed = React.createClass({
1213
propTypes: {
13-
endpoint: React.PropTypes.string,
14-
query: React.PropTypes.object,
15-
renderEmpty: React.PropTypes.func,
16-
pagination: React.PropTypes.bool
14+
endpoint: PropTypes.string,
15+
query: PropTypes.object,
16+
renderEmpty: PropTypes.func,
17+
pagination: PropTypes.bool
1718
},
1819

1920
mixins: [ApiMixin],

src/sentry/static/sentry/app/components/activity/item.jsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import marked from 'marked';
2+
import PropTypes from 'prop-types';
23
import React from 'react';
34

45
import {CommitLink} from '../../views/releases/releaseCommits';
@@ -14,10 +15,10 @@ import {t, tn, tct} from '../../locale';
1415

1516
const ActivityItem = React.createClass({
1617
propTypes: {
17-
clipHeight: React.PropTypes.number,
18-
defaultClipped: React.PropTypes.bool,
19-
item: React.PropTypes.object.isRequired,
20-
orgId: React.PropTypes.string.isRequired
18+
clipHeight: PropTypes.number,
19+
defaultClipped: PropTypes.bool,
20+
item: PropTypes.object.isRequired,
21+
orgId: PropTypes.string.isRequired
2122
},
2223

2324
getDefaultProps() {
@@ -55,9 +56,9 @@ const ActivityItem = React.createClass({
5556
let issue = item.issue;
5657

5758
let issueLink = issue
58-
? (<IssueLink orgId={orgId} projectId={project.slug} issue={issue}>
59+
? <IssueLink orgId={orgId} projectId={project.slug} issue={issue}>
5960
{issue.shortId}
60-
</IssueLink>)
61+
</IssueLink>
6162
: null;
6263

6364
switch (item.type) {

src/sentry/static/sentry/app/components/activity/note.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23

34
import TimeSince from '../../components/timeSince';
@@ -8,10 +9,10 @@ import marked from '../../utils/marked';
89

910
const Note = React.createClass({
1011
propTypes: {
11-
author: React.PropTypes.object.isRequired,
12-
item: React.PropTypes.object.isRequired,
13-
onEdit: React.PropTypes.func.isRequired,
14-
onDelete: React.PropTypes.func.isRequired
12+
author: PropTypes.object.isRequired,
13+
item: PropTypes.object.isRequired,
14+
onEdit: PropTypes.func.isRequired,
15+
onDelete: PropTypes.func.isRequired
1516
},
1617

1718
canEdit() {

src/sentry/static/sentry/app/components/activity/noteContainer.jsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23

34
import Note from './note';
45
import NoteInput from './noteInput';
56

67
const NoteContainer = React.createClass({
78
propTypes: {
8-
group: React.PropTypes.object.isRequired,
9-
item: React.PropTypes.object.isRequired,
10-
author: React.PropTypes.object.isRequired,
11-
onDelete: React.PropTypes.func.isRequired,
12-
sessionUser: React.PropTypes.object.isRequired,
13-
memberList: React.PropTypes.array.isRequired
9+
group: PropTypes.object.isRequired,
10+
item: PropTypes.object.isRequired,
11+
author: PropTypes.object.isRequired,
12+
onDelete: PropTypes.func.isRequired,
13+
sessionUser: PropTypes.object.isRequired,
14+
memberList: PropTypes.array.isRequired
1415
},
1516

1617
getInitialState() {

src/sentry/static/sentry/app/components/activity/noteInput.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23
import marked from 'marked';
34

@@ -20,11 +21,11 @@ function makeDefaultErrorJson() {
2021

2122
const NoteInput = React.createClass({
2223
propTypes: {
23-
item: React.PropTypes.object,
24-
group: React.PropTypes.object.isRequired,
25-
onFinish: React.PropTypes.func,
26-
memberList: React.PropTypes.array.isRequired,
27-
sessionUser: React.PropTypes.object.isRequired
24+
item: PropTypes.object,
25+
group: PropTypes.object.isRequired,
26+
onFinish: PropTypes.func,
27+
memberList: PropTypes.array.isRequired,
28+
sessionUser: PropTypes.object.isRequired
2829
},
2930

3031
mixins: [PureRenderMixin, ApiMixin],

src/sentry/static/sentry/app/components/alertMessage.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23
import AlertActions from '../actions/alertActions';
34
import PureRenderMixin from 'react-addons-pure-render-mixin';
45
import {t} from '../locale';
56

67
const AlertMessage = React.createClass({
78
propTypes: {
8-
alert: React.PropTypes.shape({
9-
id: React.PropTypes.string,
10-
message: React.PropTypes.string.isRequired,
11-
type: React.PropTypes.oneOf(['success', 'error', 'warning']),
12-
url: React.PropTypes.string
9+
alert: PropTypes.shape({
10+
id: PropTypes.string,
11+
message: PropTypes.string.isRequired,
12+
type: PropTypes.oneOf(['success', 'error', 'warning']),
13+
url: PropTypes.string
1314
})
1415
},
1516

src/sentry/static/sentry/app/components/alerts/toastIndicator.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import classNames from 'classnames';
2+
import PropTypes from 'prop-types';
23
import React from 'react';
34

45
function ToastIndicator({type, children}) {
@@ -11,7 +12,7 @@ function ToastIndicator({type, children}) {
1112
}
1213

1314
ToastIndicator.propTypes = {
14-
type: React.PropTypes.string.isRequired
15+
type: PropTypes.string.isRequired
1516
};
1617

1718
export default ToastIndicator;

src/sentry/static/sentry/app/components/assigneeSelector.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23
import ReactDOM from 'react-dom';
34
import Reflux from 'reflux';
@@ -17,7 +18,7 @@ import {t} from '../locale';
1718

1819
const AssigneeSelector = React.createClass({
1920
propTypes: {
20-
id: React.PropTypes.string.isRequired
21+
id: PropTypes.string.isRequired
2122
},
2223

2324
mixins: [

src/sentry/static/sentry/app/components/avatar.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23
import $ from 'jquery';
34
import MD5 from 'crypto-js/md5';
@@ -6,11 +7,11 @@ import UserLetterAvatar from '../components/userLetterAvatar';
67

78
const Avatar = React.createClass({
89
propTypes: {
9-
user: React.PropTypes.object,
10-
size: React.PropTypes.number,
11-
default: React.PropTypes.string,
12-
title: React.PropTypes.string,
13-
gravatar: React.PropTypes.bool
10+
user: PropTypes.object,
11+
size: PropTypes.number,
12+
default: PropTypes.string,
13+
title: PropTypes.string,
14+
gravatar: PropTypes.bool
1415
},
1516

1617
getDefaultProps() {

src/sentry/static/sentry/app/components/avatarCropper.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23

34
import AlertActions from '../actions/alertActions';
45
import {t} from '../locale';
56

67
const AvatarCropper = React.createClass({
78
propTypes: {
8-
user: React.PropTypes.object.isRequired,
9-
updateDataUrlState: React.PropTypes.func.isRequired,
10-
savedDataUrl: React.PropTypes.string
9+
user: PropTypes.object.isRequired,
10+
updateDataUrlState: PropTypes.func.isRequired,
11+
savedDataUrl: PropTypes.string
1112
},
1213

1314
getInitialState() {

src/sentry/static/sentry/app/components/avatarRadio.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23

34
import {t} from '../locale';
45

56
const AvatarRadio = React.createClass({
67
propTypes: {
7-
user: React.PropTypes.object.isRequired,
8-
updateUser: React.PropTypes.func.isRequired
8+
user: PropTypes.object.isRequired,
9+
updateUser: PropTypes.func.isRequired
910
},
1011

1112
OPTIONS: {

src/sentry/static/sentry/app/components/avatarSettings.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23

34
import AlertActions from '../actions/alertActions';
@@ -10,7 +11,7 @@ import {t} from '../locale';
1011

1112
const AvatarSettings = React.createClass({
1213
propTypes: {
13-
userId: React.PropTypes.number
14+
userId: PropTypes.number
1415
},
1516

1617
mixins: [ApiMixin],

src/sentry/static/sentry/app/components/badge.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23

34
const Badge = React.createClass({
45
propTypes: {
5-
text: React.PropTypes.string,
6-
isNew: React.PropTypes.bool
6+
text: PropTypes.string,
7+
isNew: PropTypes.bool
78
},
89

910
render() {

src/sentry/static/sentry/app/components/barChart.jsx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23
import StackedBarChart from '../components/stackedBarChart';
34

45
const BarChart = React.createClass({
56
propTypes: {
6-
points: React.PropTypes.arrayOf(
7-
React.PropTypes.shape({
8-
x: React.PropTypes.number.isRequired,
9-
y: React.PropTypes.number.isRequired,
10-
label: React.PropTypes.string
7+
points: PropTypes.arrayOf(
8+
PropTypes.shape({
9+
x: PropTypes.number.isRequired,
10+
y: PropTypes.number.isRequired,
11+
label: PropTypes.string
1112
})
1213
),
13-
interval: React.PropTypes.string,
14-
height: React.PropTypes.number,
15-
width: React.PropTypes.number,
16-
placement: React.PropTypes.string,
17-
label: React.PropTypes.string,
18-
markers: React.PropTypes.arrayOf(
19-
React.PropTypes.shape({
20-
x: React.PropTypes.number.isRequired,
21-
label: React.PropTypes.string
14+
interval: PropTypes.string,
15+
height: PropTypes.number,
16+
width: PropTypes.number,
17+
placement: PropTypes.string,
18+
label: PropTypes.string,
19+
markers: PropTypes.arrayOf(
20+
PropTypes.shape({
21+
x: PropTypes.number.isRequired,
22+
label: PropTypes.string
2223
})
2324
)
2425
},

src/sentry/static/sentry/app/components/broadcastModal.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23
import IconCloseLg from '../icons/icon-close-lg';
34
import ConfigStore from '../stores/configStore';
@@ -49,12 +50,12 @@ const ReleaseAnnouncement = ({close}) => {
4950
};
5051

5152
ReleaseAnnouncement.propTypes = {
52-
close: React.PropTypes.func.isRequired
53+
close: PropTypes.func.isRequired
5354
};
5455

5556
const BroadcastModal = React.createClass({
5657
propTypes: {
57-
closeBroadcast: React.PropTypes.func.isRequired
58+
closeBroadcast: PropTypes.func.isRequired
5859
},
5960
mixins: [ApiMixin],
6061

src/sentry/static/sentry/app/components/buttons/button.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, {PropTypes} from 'react';
1+
import PropTypes from 'prop-types';
2+
import React from 'react';
23
import {Link} from 'react-router';
34
import classNames from 'classnames';
45

src/sentry/static/sentry/app/components/clippedBox.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
import PropTypes from 'prop-types';
12
import React from 'react';
23
import ReactDOM from 'react-dom';
34
import {t} from '../locale';
45

56
const ClippedBox = React.createClass({
67
propTypes: {
7-
title: React.PropTypes.string,
8-
defaultClipped: React.PropTypes.bool,
9-
clipHeight: React.PropTypes.number,
10-
btnClassName: React.PropTypes.string,
11-
btnText: React.PropTypes.string
8+
title: PropTypes.string,
9+
defaultClipped: PropTypes.bool,
10+
clipHeight: PropTypes.number,
11+
btnClassName: PropTypes.string,
12+
btnText: PropTypes.string
1213
},
1314

1415
getDefaultProps() {

0 commit comments

Comments
 (0)