Skip to content

Commit 1ef4b66

Browse files
committed
Fix PropType Errors
1 parent 01665fd commit 1ef4b66

File tree

5 files changed

+9
-27
lines changed

5 files changed

+9
-27
lines changed

client/modules/IDE/components/AssetList.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ AssetList.propTypes = {
8686
key: PropTypes.string.isRequired,
8787
name: PropTypes.string.isRequired,
8888
url: PropTypes.string.isRequired,
89-
sketchName: PropTypes.string.isRequired,
90-
sketchId: PropTypes.string.isRequired
89+
sketchName: PropTypes.string,
90+
sketchId: PropTypes.string
9191
})).isRequired,
9292
getAssets: PropTypes.func.isRequired,
9393
loading: PropTypes.bool.isRequired

client/modules/IDE/components/CollectionList/CollectionList.jsx

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class CollectionList extends React.Component {
6262
}
6363

6464
hideAddSketches = () => {
65-
console.log('hideAddSketches');
6665
this.setState({
6766
addingSketchesToCollectionId: null,
6867
});
@@ -161,28 +160,12 @@ class CollectionList extends React.Component {
161160
}
162161
}
163162

164-
const ProjectShape = PropTypes.shape({
165-
id: PropTypes.string.isRequired,
166-
name: PropTypes.string.isRequired,
167-
createdAt: PropTypes.string.isRequired,
168-
updatedAt: PropTypes.string.isRequired,
169-
user: PropTypes.shape({
170-
username: PropTypes.string.isRequired
171-
}).isRequired,
172-
});
173-
174-
const ItemsShape = PropTypes.shape({
175-
createdAt: PropTypes.string.isRequired,
176-
updatedAt: PropTypes.string.isRequired,
177-
project: ProjectShape
178-
});
179-
180163
CollectionList.propTypes = {
181164
user: PropTypes.shape({
182165
username: PropTypes.string,
183166
authenticated: PropTypes.bool.isRequired
184167
}).isRequired,
185-
projectId: PropTypes.string.isRequired,
168+
projectId: PropTypes.string,
186169
getCollections: PropTypes.func.isRequired,
187170
getProject: PropTypes.func.isRequired,
188171
collections: PropTypes.arrayOf(PropTypes.shape({
@@ -191,7 +174,6 @@ CollectionList.propTypes = {
191174
description: PropTypes.string,
192175
createdAt: PropTypes.string.isRequired,
193176
updatedAt: PropTypes.string.isRequired,
194-
items: PropTypes.arrayOf(ItemsShape),
195177
})).isRequired,
196178
username: PropTypes.string,
197179
loading: PropTypes.bool.isRequired,
@@ -210,6 +192,7 @@ CollectionList.propTypes = {
210192
};
211193

212194
CollectionList.defaultProps = {
195+
projectId: undefined,
213196
project: {
214197
id: undefined,
215198
owner: undefined
@@ -224,7 +207,7 @@ function mapStateToProps(state, ownProps) {
224207
sorting: state.sorting,
225208
loading: state.loading,
226209
project: state.project,
227-
projectId: ownProps && ownProps.params ? ownProps.prams.project_id : null,
210+
projectId: ownProps && ownProps.params ? ownProps.params.project_id : null,
228211
};
229212
}
230213

client/modules/IDE/components/CollectionList/CollectionListRow.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,6 @@ CollectionListRowBase.propTypes = {
235235
})
236236
}))
237237
}).isRequired,
238-
project: PropTypes.shape({
239-
id: PropTypes.string.isRequired,
240-
}).isRequired,
241238
username: PropTypes.string.isRequired,
242239
user: PropTypes.shape({
243240
username: PropTypes.string,

client/modules/IDE/components/QuickAddList/QuickAddList.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ const ItemType = PropTypes.shape({
2323
});
2424

2525
Item.propTypes = {
26-
...ItemType,
26+
name: PropTypes.string.isRequired,
27+
url: PropTypes.string.isRequired,
28+
isAdded: PropTypes.bool.isRequired,
2729
onSelect: PropTypes.func.isRequired,
2830
};
2931

client/modules/User/pages/DashboardView.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ DashboardView.propTypes = {
171171
previousPath: PropTypes.string.isRequired,
172172
theme: PropTypes.string.isRequired,
173173
user: PropTypes.shape({
174-
username: PropTypes.string.isRequired,
174+
username: PropTypes.string,
175175
}),
176176
};
177177

0 commit comments

Comments
 (0)