Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

161348758 User should be able to create an article #19

Merged
merged 1 commit into from
Dec 20, 2018

Conversation

judeinno
Copy link

@judeinno judeinno commented Dec 12, 2018

What does this PR do?

Add feature cor create an article.

Description of Task to be completed?

  • Add user create article form.
  • Add drop down for articles to create articles and get all articles
  • Add container for create article form.
  • Add component for create article form.
  • Add actions and reducers for create article.
  • Add tests

How should this be manually tested?

  • Go to create article URL: /createArticle
  • Input the article data:
- Title
- Description
- Tags
- Image
- Body

What are the relevant pivotal tracker stories?

#161348758

Screenshots

Input UI

image

image

When Get all articles is active (Dropdown changes fields)

image

When create article is active(Dropdown changes fields)

image

</div>
);

CreateArticle.propTypes = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

@judeinno judeinno force-pushed the ft-create-article-161348758 branch 3 times, most recently from b11bdf9 to e621818 Compare December 12, 2018 11:03
@judeinno judeinno added the still in progress Still being worked on label Dec 13, 2018
@judeinno judeinno added ready ready for merging and removed still in progress Still being worked on labels Dec 14, 2018
@dnuwa
Copy link
Contributor

dnuwa commented Dec 17, 2018

kindly fix the merge conflicts

@judeinno judeinno force-pushed the ft-create-article-161348758 branch 2 times, most recently from 2afda60 to a9c2929 Compare December 17, 2018 10:34
.env Outdated
@@ -0,0 +1 @@
APP_URL=https://ah-backend-thanos-staging.herokuapp.com/api
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new line at the end of file

payload: imageUrl,
});

const tok = localStorage.getItem('token');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does tok mean??

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am going to update it

handleSubmit = (event) => {
event.preventDefault();
const { postArticle, createArticleReducer } = this.props;
postArticle({ ...createArticleReducer.articlePostData, tag_list: createArticleReducer.articlePostData.tag_list.split(', ') });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is too long

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed It

@tibetegya
Copy link
Contributor

Resolve merge conflicts

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 14672 lines exceeds the maximum allowed for the inline comments feature.


const mapStateToProps = ({ createArticleReducer }) => ({ createArticleReducer });

export const mapDispatchToProps = dispatch => ({
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

const headers = {
headers: { Authorization: token },
};
return axios.post(url, userdata, headers)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

expect(CreateArticlePageComponent).toMatchSnapshot();
});

it('should dispatch a method to get user input', () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

@judeinno judeinno force-pushed the ft-create-article-161348758 branch 6 times, most recently from 932066e to b053275 Compare December 20, 2018 10:00
dnuwa
dnuwa previously approved these changes Dec 20, 2018
@judeinno judeinno force-pushed the ft-create-article-161348758 branch 2 times, most recently from a02e624 to cd38ab7 Compare December 20, 2018 10:16
@brucemakallan brucemakallan temporarily deployed to ah-frontend-thanos-devel-pr-19 December 20, 2018 11:20 Inactive
brucemakallan
brucemakallan previously approved these changes Dec 20, 2018
Copy link
Collaborator

@brucemakallan brucemakallan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried this out on Heroku. All good.

dnuwa
dnuwa previously approved these changes Dec 20, 2018
Sulaiman-Mozes
Sulaiman-Mozes previously approved these changes Dec 20, 2018
- Add user create article form.
- Add container for create article form.
- Add component for create article form.
- Add actions and reducers for create article.

[#161348758]
@codeclimate
Copy link

codeclimate bot commented Dec 20, 2018

Code Climate has analyzed commit dea500e and detected 0 issues on this pull request.

View more on Code Climate.

@tibetegya tibetegya merged commit 588d4d5 into develop Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ready for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants