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

#164798256 Enable users manipulate articles #15

Merged
merged 1 commit into from
May 21, 2019

Conversation

patrickf949
Copy link
Contributor

@patrickf949 patrickf949 commented May 14, 2019

What does this PR do?

Enables users to create and read articles

Description of Task to be completed?

  • Add routes for article creation and viewing
  • Create pages that users will interact with to create or read stories

How should this be manually tested?

Setup the application as stated here

Create and verify a user - here

Create articles with the following routes

  • localhost:8000/create-article --Simulated here

View articles on the landing page and click on them to get the full article --Simulated here

What are the relevant pivotal tracker stories?

164798256

Screenshots

Create an article
Screenshot 2019-05-20 at 09 42 56

View all articles
Screenshot 2019-05-20 at 03 19 46

src/reducers/createArticleReducer.js Outdated Show resolved Hide resolved
src/styles/singleArticle.scss Outdated Show resolved Hide resolved
src/styles/singleArticle.scss Show resolved Hide resolved
src/styles/singleArticle.scss Show resolved Hide resolved
src/styles/singleArticle.scss Show resolved Hide resolved
src/styles/singleArticle.scss Outdated Show resolved Hide resolved
@@ -0,0 +1,25 @@
.article-title {
font-size: 40px;

Choose a reason for hiding this comment

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

Properties should be ordered color, font-size, text-align

src/styles/createArticles.scss Show resolved Hide resolved
.btn-primary {
color: #fff;
background-color: #003153;
border-color: #003153;

Choose a reason for hiding this comment

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

Color literals like #003153 should only be used in variable declarations; they should be referred to via variable everywhere else.

}
.btn-primary {
color: #fff;
background-color: #003153;

Choose a reason for hiding this comment

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

Color literals like #003153 should only be used in variable declarations; they should be referred to via variable everywhere else.

@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 14, 2019 11:20 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 4a35042 to 11f7e97 Compare May 14, 2019 11:52
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 14, 2019 11:52 Inactive
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 11f7e97 to 5d2603e Compare May 14, 2019 11:59
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/navbar.scss Outdated Show resolved Hide resolved
src/styles/createArticles.scss Show resolved Hide resolved
src/styles/createArticles.scss Show resolved Hide resolved
src/styles/createArticles.scss Show resolved Hide resolved
src/styles/createArticles.scss Show resolved Hide resolved
src/styles/createArticles.scss Show resolved Hide resolved
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 14, 2019 12:00 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 5d2603e to c891391 Compare May 14, 2019 12:30
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 14, 2019 12:30 Inactive
src/styles/createArticles.scss Show resolved Hide resolved
src/styles/createArticles.scss Show resolved Hide resolved
src/styles/createArticles.scss Show resolved Hide resolved
src/styles/createArticles.scss Show resolved Hide resolved
src/styles/createArticles.scss Show resolved Hide resolved
src/styles/createArticles.scss Show resolved Hide resolved
src/styles/createArticles.scss Show resolved Hide resolved
src/components/navbar.js Outdated Show resolved Hide resolved
src/components/articles/singleArticle.js Outdated Show resolved Hide resolved
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from c891391 to 7e88fcb Compare May 14, 2019 16:04
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 14, 2019 16:04 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 7e88fcb to 8bd7cfb Compare May 15, 2019 23:19
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 15, 2019 23:20 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 8bd7cfb to 0b4bf56 Compare May 16, 2019 07:47
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 16, 2019 07:47 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 0b4bf56 to 569f4a7 Compare May 16, 2019 13:41
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 16, 2019 13:41 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 569f4a7 to 9f31611 Compare May 17, 2019 05:02
@patrickf949 patrickf949 had a problem deploying to ah-frontend-prime-pr-15 May 17, 2019 05:02 Failure
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch 2 times, most recently from f8bd879 to 77dc529 Compare May 17, 2019 09:03
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 17, 2019 09:03 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 77dc529 to d55b4fc Compare May 17, 2019 09:22
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 17, 2019 09:22 Inactive
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 20, 2019 16:58 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 23c726f to 50ac036 Compare May 20, 2019 17:22
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 20, 2019 17:22 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 50ac036 to 5b5e43f Compare May 20, 2019 17:42
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 20, 2019 17:42 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 5b5e43f to dee5d73 Compare May 20, 2019 18:16
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 20, 2019 18:16 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from dee5d73 to a4edaae Compare May 21, 2019 10:26
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 21, 2019 10:27 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from a4edaae to 17726c8 Compare May 21, 2019 12:40
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 21, 2019 12:40 Inactive
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 17726c8 to eb00933 Compare May 21, 2019 12:40
}
onSubmit(e) {
e.preventDefault();
const messageObject = {
Copy link
Contributor

Choose a reason for hiding this comment

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

@patrickf949 you could do well with destructuring this.

Copy link
Contributor

Choose a reason for hiding this comment

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

good work with destructuring

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @e-ian

@@ -23,7 +23,10 @@ export const userLoginRequest = userData => async dispatch => {

sessionStorage.setItem("token", response.data.user.token);
sessionStorage.setItem("username", response.data.user.username);
sessionStorage.setItem("email", response.data.user.email);
Copy link
Contributor

Choose a reason for hiding this comment

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

@patrickf949 why are we storing the email in session here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@e-ian, the email is the most unique way of identifying a user, and that's what we are basing on in the backend to filter user articles

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay but the username is equally unique in our backend.

@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from eb00933 to 213ee2d Compare May 21, 2019 13:41
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 21, 2019 13:41 Inactive
Copy link
Contributor

@anyatibrian anyatibrian left a comment

Choose a reason for hiding this comment

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

GREAT WORK @patrickf949

@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from 213ee2d to c04ee4c Compare May 21, 2019 14:25
@patrickf949 patrickf949 temporarily deployed to ah-frontend-prime-pr-15 May 21, 2019 14:25 Inactive
Copy link
Contributor

@e-ian e-ian left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Genza999 Genza999 left a comment

Choose a reason for hiding this comment

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

Great work @patrickf949 .

Copy link
Contributor

@MuhanguziDavid MuhanguziDavid left a comment

Choose a reason for hiding this comment

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

Great implementation of the articles creation and retrieval. However, the retrieval of articles for a specific user is not working if one is logged in using social auth. This could be because the email is not saved in session storage on social login success. You may need to add it in the social auth action.

- add routes for article creation and viewing
- add necessary pages for article creation and viewing
- write tests for all functionality

[Finishes #164798256]
@patrickf949 patrickf949 force-pushed the ft-users-able-create-articles-164798256 branch from e8b8274 to f0dd23d Compare May 21, 2019 15:47
@patrickf949
Copy link
Contributor Author

Great implementation of the articles creation and retrieval. However, the retrieval of articles for a specific user is not working if one is logged in using social auth. This could be because the email is not saved in session storage on social login success. You may need to add it in the social auth action.

Thanks @MuhanguziDavid all done

Copy link
Contributor

@MuhanguziDavid MuhanguziDavid left a comment

Choose a reason for hiding this comment

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

LGTM

@MuhanguziDavid MuhanguziDavid merged commit 96812aa into develop May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants