From 33742e7907c2977614f12c1865bb7d610b953dc3 Mon Sep 17 00:00:00 2001 From: "Papu Kumar(ReX)" Date: Mon, 11 Oct 2021 19:18:24 +0530 Subject: [PATCH] Fix PropTypes Error Create New Post Page (#14969) --- app/javascript/article-form/articleForm.jsx | 2 +- .../components/ArticleCoverImage.jsx | 2 +- .../article-form/components/EditorActions.jsx | 2 +- .../article-form/components/ErrorList.jsx | 4 ++-- .../article-form/components/Form.jsx | 4 ++-- .../article-form/components/Header.jsx | 6 ++--- .../components/Help/EditorFormattingHelp.jsx | 2 +- .../article-form/components/Help/index.jsx | 20 +++++++++-------- .../article-form/components/Meta.jsx | 2 +- .../article-form/components/PageTitle.jsx | 6 ++--- .../article-form/components/Preview.jsx | 2 +- .../article-form/components/TagsField.jsx | 2 +- app/javascript/crayons/Button/Button.jsx | 3 ++- app/javascript/leftSidebar/TagsFollowed.jsx | 22 ++++++++++--------- app/javascript/packs/articleForm.jsx | 2 +- app/javascript/shared/components/tags.jsx | 4 ++-- 16 files changed, 45 insertions(+), 40 deletions(-) diff --git a/app/javascript/article-form/articleForm.jsx b/app/javascript/article-form/articleForm.jsx index f4e8a0ef9..ad17139ba 100644 --- a/app/javascript/article-form/articleForm.jsx +++ b/app/javascript/article-form/articleForm.jsx @@ -65,7 +65,7 @@ export class ArticleForm extends Component { }; static defaultProps = { - organizations: '', + organizations: '[]', }; constructor(props) { diff --git a/app/javascript/article-form/components/ArticleCoverImage.jsx b/app/javascript/article-form/components/ArticleCoverImage.jsx index be716e9fa..2e0ceb404 100644 --- a/app/javascript/article-form/components/ArticleCoverImage.jsx +++ b/app/javascript/article-form/components/ArticleCoverImage.jsx @@ -228,7 +228,7 @@ export class ArticleCoverImage extends Component { } ArticleCoverImage.propTypes = { - mainImage: PropTypes.string.isRequired, + mainImage: PropTypes.string, onMainImageUrlChange: PropTypes.func.isRequired, }; diff --git a/app/javascript/article-form/components/EditorActions.jsx b/app/javascript/article-form/components/EditorActions.jsx index bc4dfd2c2..21be7fb09 100644 --- a/app/javascript/article-form/components/EditorActions.jsx +++ b/app/javascript/article-form/components/EditorActions.jsx @@ -74,7 +74,7 @@ EditorActions.propTypes = { edited: PropTypes.bool.isRequired, version: PropTypes.string.isRequired, onClearChanges: PropTypes.func.isRequired, - passedData: PropTypes.string.isRequired, + passedData: PropTypes.object.isRequired, onConfigChange: PropTypes.func.isRequired, submitting: PropTypes.bool.isRequired, }; diff --git a/app/javascript/article-form/components/ErrorList.jsx b/app/javascript/article-form/components/ErrorList.jsx index 79b4d6e85..39c0da955 100644 --- a/app/javascript/article-form/components/ErrorList.jsx +++ b/app/javascript/article-form/components/ErrorList.jsx @@ -11,7 +11,7 @@ export const ErrorList = ({ errors }) => {