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

Up and running. #204

Open
wants to merge 82 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
324bdf8
added Trelloboard link to README.md file
paulineldb Jun 10, 2024
dfb572a
created header and footer html files + added header and footer to pos…
paulineldb Jun 10, 2024
31d5e83
added username to posts
EthanDunwiddie Jun 11, 2024
da5c50b
Merge pull request #1 from Hakim-Kay/username-to-post
emilyhardy98 Jun 11, 2024
73a71c8
removed bug from user model
EthanDunwiddie Jun 11, 2024
18d0be1
Merge pull request #2 from Hakim-Kay/username-to-post
EthanDunwiddie Jun 11, 2024
389dca1
Added imageurl field to post model and added image_url field to post …
Zach-Deladev Jun 11, 2024
c599ee1
User can add profile picture on signup
EthanDunwiddie Jun 11, 2024
8e30382
Deleted test profile picture folder
EthanDunwiddie Jun 11, 2024
d8dfe6e
CSS files modified. Header and Footer applied to posts/index.html & u…
paulineldb Jun 11, 2024
20bf01d
Created pipeline and setup docker
Hakim-Kay Jun 11, 2024
521b4e6
Merge pull request #3 from Hakim-Kay/deployment-pipeline
Hakim-Kay Jun 11, 2024
bb957b1
Fixes to deployment errors in Dockerfile & yml
Hakim-Kay Jun 11, 2024
9629a27
Fixes to deployment bugs
Hakim-Kay Jun 11, 2024
c552b91
Merge pull request #4 from Hakim-Kay/header-implementation
emilyhardy98 Jun 11, 2024
917f48f
Revert CI/CD setup to allow collaborators to push changes comfortably
Hakim-Kay Jun 11, 2024
7ef6c8f
Set up CI/CD pipeline in deployment-pipeline branch
Hakim-Kay Jun 11, 2024
cc5a583
made changes to the main body of posts to match the style of the header
emilyhardy98 Jun 11, 2024
38b011d
Added chromedriver to the CI env
Hakim-Kay Jun 11, 2024
6144678
Merge pull request #6 from Hakim-Kay/body-css-changes
paulineldb Jun 11, 2024
cd28e53
Added upload button to HTML, added Amazon S3 storage to controller fo…
Zach-Deladev Jun 11, 2024
0ca2c4b
Fixed issue with env variables.
Zach-Deladev Jun 11, 2024
29a3fac
Updated brancg with main and resolved conflicts.
Zach-Deladev Jun 11, 2024
7de494b
Deployment - Deleted old CI/CD.yml file (#8)
Hakim-Kay Jun 11, 2024
b7c3186
Merge pull request #7 from Hakim-Kay/post-with-images
Zach-Deladev Jun 12, 2024
4d35d70
User can add profile picture on signup
EthanDunwiddie Jun 11, 2024
9fc298d
Deleted V4__create_comments_table.sql migration file
emilyhardy98 Jun 12, 2024
c2a1bf0
Deleted test profile picture folder
EthanDunwiddie Jun 11, 2024
0bf6037
Fix 1: Resolve conflicts
Hakim-Kay Jun 12, 2024
cb0cc8d
Add V7__create_comments_table.sql for creating comments table
emilyhardy98 Jun 12, 2024
b9a838c
Resolved Conflicts
Hakim-Kay Jun 12, 2024
30c1508
Merge pull request #5 from Hakim-Kay/deployment-pipeline
Zach-Deladev Jun 12, 2024
c0e1de7
fixed lyway migration
EthanDunwiddie Jun 12, 2024
b264464
"resolved merge conflicts"
EthanDunwiddie Jun 12, 2024
5f2ec47
"resolved things"Merge remote-tracking branch 'origin/main' into prof…
EthanDunwiddie Jun 12, 2024
a8b7954
db updates
EthanDunwiddie Jun 12, 2024
7e506a9
Completed adding profile picture to s3
EthanDunwiddie Jun 12, 2024
63c3add
Merge pull request #10 from Hakim-Kay/profile-picture-on-signup
Zach-Deladev Jun 12, 2024
d4cff3f
added timestamp to be saved to the database when a post is created
paulineldb Jun 13, 2024
943c0a6
Comments working in most simplistic form
emilyhardy98 Jun 13, 2024
6df3acf
added 'Newest post appears first' functionality
paulineldb Jun 13, 2024
907ec8b
Likes working in most simplistic form
emilyhardy98 Jun 13, 2024
f4dded5
Merge pull request #11 from Hakim-Kay/newest-post-appears-first
Zach-Deladev Jun 13, 2024
c767725
Updated db migration
emilyhardy98 Jun 13, 2024
bd6157c
Merge branch 'main' into comments-and-likes
paulineldb Jun 13, 2024
6988bc6
Merge pull request #13 from Hakim-Kay/comments-and-likes
paulineldb Jun 13, 2024
5d4ac15
Added user posts to profile.
Zach-Deladev Jun 13, 2024
b7b1ed9
Added user posts to profile.
Zach-Deladev Jun 13, 2024
674282c
fixed issues with sign up form appearing twice
paulineldb Jun 13, 2024
68e784e
Merge pull request #14 from Hakim-Kay/comments-and-likes
emilyhardy98 Jun 13, 2024
6a289d2
Fixed migration issues.
Zach-Deladev Jun 13, 2024
cd3c7df
Resolved merge conflicts
Zach-Deladev Jun 13, 2024
40215f0
Complete merge
Zach-Deladev Jun 13, 2024
e635c6c
modified 'new post' form styling to be more user-friendly + minor cha…
paulineldb Jun 13, 2024
b90d0b7
Added styling to profile page.
Zach-Deladev Jun 14, 2024
e7ae983
Changes to like button
emilyhardy98 Jun 14, 2024
734af1a
Styled posts section on profile page.
Zach-Deladev Jun 14, 2024
7cef70e
Merge pull request #16 from Hakim-Kay/profile-page
EthanDunwiddie Jun 14, 2024
446eaf3
added login page to app
EthanDunwiddie Jun 14, 2024
c83c6d6
fixed posts
EthanDunwiddie Jun 14, 2024
177d1d5
Tests added for comments and like button
emilyhardy98 Jun 14, 2024
902dd8a
fixed profile posts
EthanDunwiddie Jun 14, 2024
957bfe1
Merge pull request #17 from Hakim-Kay/login-page
Zach-Deladev Jun 14, 2024
d4fa893
modified main.css to make 'posts' page more readable
paulineldb Jun 14, 2024
4d97749
conflicts resolved + minor changes to profile.css & main.css
paulineldb Jun 14, 2024
790f3e0
Merge pull request #20 from Hakim-Kay/body-css-changes
Zach-Deladev Jun 14, 2024
2f209df
like changes
emilyhardy98 Jun 14, 2024
dc92188
added bio logic to profile page
EthanDunwiddie Jun 14, 2024
8811f48
fixed css with comments and likes
emilyhardy98 Jun 14, 2024
52b3f2a
Merge pull request #21 from Hakim-Kay/comments-and-likes
Zach-Deladev Jun 14, 2024
fda4c6c
Changes.
Zach-Deladev Jun 14, 2024
79e5c2b
"Merge with mina."Merge remote-tracking branch 'origin/main' into pro…
Zach-Deladev Jun 14, 2024
5a4207a
message
EthanDunwiddie Jun 14, 2024
857d34e
update css
EthanDunwiddie Jun 14, 2024
9059d29
Merge pull request #22 from Hakim-Kay/add-bio
Zach-Deladev Jun 14, 2024
fe65880
"Merge to main."Merge remote-tracking branch 'origin/main' into profi…
Zach-Deladev Jun 14, 2024
e3dd0ee
Added on error messages to profile pictures.
Zach-Deladev Jun 14, 2024
ed204fb
Configured for render.
Zach-Deladev Jun 14, 2024
94a5392
Fixed variables.
Zach-Deladev Jun 14, 2024
c108857
Still tinkering.
Zach-Deladev Jun 14, 2024
fe1370d
tinkering.
Zach-Deladev Jun 14, 2024
c597fd3
Fix database connection environment variables
Zach-Deladev Jun 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added timestamp to be saved to the database when a post is created
paulineldb committed Jun 13, 2024
commit d4cff3f8f85d779c3a0e4af583ab0a510366f400
12 changes: 11 additions & 1 deletion src/main/java/com/makersacademy/acebook/model/Post.java
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

@Data
@Entity
@Table(name = "POSTS")
@@ -29,16 +31,24 @@ public class Post {
@Getter
private String imageUrl;

public Post() {}
@Setter
@Getter
private LocalDateTime createdAt;

public Post() {
this.createdAt = LocalDateTime.now();
}

public Post(String content, User user) {
this.content = content;
this.user = user;
this.createdAt = LocalDateTime.now();
}

public Post(String content, User user, String imageUrl) {
this.content = content;
this.user = user;
this.imageUrl = imageUrl;
this.createdAt = LocalDateTime.now();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE POSTS
ADD COLUMN created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
10 changes: 10 additions & 0 deletions src/test/java/com/makersacademy/acebook/model/PostTest.java
Original file line number Diff line number Diff line change
@@ -7,6 +7,9 @@
import org.junit.Before;
import org.junit.Test;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

public class PostTest {

private User user;
@@ -50,4 +53,11 @@ public void postWithImageHasImageUrl() {
public void postWithoutImageDoesNotHaveImageUrl() {
assertNull(postWithoutImage.getImageUrl());
}

@Test
public void postHasCreatedAtTimestampWhenCreated() {
Post newPost = new Post("timestamped post", user);
assertNotNull(newPost.getCreatedAt());
assertTrue(ChronoUnit.SECONDS.between(newPost.getCreatedAt(), LocalDateTime.now()) < 1);
}
}