-
Notifications
You must be signed in to change notification settings - Fork 0
[feat] create post and interface adjustments #35
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
Open
vitorcbs
wants to merge
2
commits into
main
Choose a base branch
from
feat/postCreate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { Post } from "./post.interface"; | ||
| import { User } from "./user.interface"; | ||
|
|
||
| export interface Like { | ||
| id: string; | ||
| user: User; | ||
| post: Post; | ||
| createdAt?: Date; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { User } from "./user.interface"; | ||
|
|
||
| export interface LoginResponse { | ||
| accessToken: string; | ||
| refreshToken: string; | ||
| user: User; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { Like } from "./like.interface"; | ||
| import { Topic } from "./topic.interface"; | ||
| import { User } from "./user.interface"; | ||
|
|
||
| export interface Post { | ||
| id: string; | ||
| title: string; | ||
| content: string; | ||
| published: boolean; | ||
| author?: User; | ||
| topics?: Topic[]; | ||
| like?: Like; | ||
| likes?: Like[]; | ||
| createdAt?: Date; | ||
| updatedAt?: Date; | ||
| } |
vitorcbs marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| export interface RefreshTokenResponse { | ||
| accessToken: string; | ||
| refreshToken: string; | ||
| } |
7 changes: 7 additions & 0 deletions
7
apps/web/src/app/core/interfaces/registerResponse.interface.ts
vitorcbs marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export interface RegisterResponse { | ||
| id: string; | ||
| email: string; | ||
| name: string; | ||
| createdAt: Date; | ||
| updatedAt: Date; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { Post } from "./post.interface"; | ||
|
|
||
| export interface Topic { | ||
| id: string; | ||
| label: string; | ||
| posts?: Post[]; | ||
| selected?: boolean; | ||
| createdAt: Date; | ||
| updatedAt: Date; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export interface User { | ||
| id: string; | ||
| email: string; | ||
| name: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
apps/web/src/app/modules/home/components/post/post.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/web/src/app/modules/home/components/topic/topic.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...eb/src/app/modules/post/components/create-post-toolbar/create-post-toolbar.component.html
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Abaixo eu falo um pouco sobre a metodologia BEM de CSS para você entender melhor como algumas coisas devem ser reorganizadas aqui |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <div class="nexus-toolbar"> | ||
| <header class="nexus-toolbar_header"> | ||
| <h1 class="nexus-toolbar_title">Enter you knowledge</h1> | ||
| <p class="nexus-toolbar_description">Share with the community your ideas, and let us know everything that you want!</p> | ||
| <h2 class="nexus-toolbar_subtitle tracking-in-expand">Be creative!</h2> | ||
| </header> | ||
| </div> |
34 changes: 34 additions & 0 deletions
34
...eb/src/app/modules/post/components/create-post-toolbar/create-post-toolbar.component.scss
vitorcbs marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| .nexus-toolbar{ | ||
| @apply w-full | ||
| mx-auto | ||
| text-lg | ||
| min-h-[1vh]; | ||
|
|
||
|
|
||
| &_header{ | ||
vitorcbs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @apply mb-5 | ||
| p-1; | ||
| } | ||
|
|
||
| &_title{ | ||
| @apply text-primary | ||
| flex | ||
| font-bold | ||
| text-center; | ||
| } | ||
|
|
||
| &_description { | ||
| @apply text-lg | ||
| text-justify; | ||
| } | ||
|
|
||
| &_subtitle{ | ||
| @apply text-primary | ||
| text-center | ||
| font-bold | ||
| pt-5; | ||
| } | ||
| } | ||
|
|
||
| @keyframes tracking-in-expand{0%{letter-spacing:-.5em;opacity:0}40%{opacity:.6}100%{opacity:1}} | ||
| .tracking-in-expand{animation:tracking-in-expand .7s cubic-bezier(.215,.61,.355,1.000) both} | ||
21 changes: 21 additions & 0 deletions
21
...src/app/modules/post/components/create-post-toolbar/create-post-toolbar.component.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
| import { CreatePostToolbarComponent } from './create-post-toolbar.component'; | ||
|
|
||
| describe('CreatePostToolbarComponent', () => { | ||
| let component: CreatePostToolbarComponent; | ||
| let fixture: ComponentFixture<CreatePostToolbarComponent>; | ||
|
|
||
| beforeEach(async () => { | ||
| await TestBed.configureTestingModule({ | ||
| declarations: [CreatePostToolbarComponent], | ||
| }).compileComponents(); | ||
|
|
||
| fixture = TestBed.createComponent(CreatePostToolbarComponent); | ||
| component = fixture.componentInstance; | ||
| fixture.detectChanges(); | ||
| }); | ||
|
|
||
| it('should create', () => { | ||
| expect(component).toBeTruthy(); | ||
| }); | ||
| }); |
8 changes: 8 additions & 0 deletions
8
.../web/src/app/modules/post/components/create-post-toolbar/create-post-toolbar.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { Component } from '@angular/core'; | ||
|
|
||
| @Component({ | ||
| selector: 'nexus-create-post-toolbar', | ||
| templateUrl: './create-post-toolbar.component.html', | ||
| styleUrls: ['./create-post-toolbar.component.scss'], | ||
| }) | ||
| export class CreatePostToolbarComponent {} |
24 changes: 24 additions & 0 deletions
24
apps/web/src/app/modules/post/components/create-post/create-post.component.html
vitorcbs marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <div [ngClass]="{'scale-out-center': addScaleOutClass}"> | ||
| <form [formGroup]="post" class="nexus-create_form"> | ||
| <input type="text" placeholder="Insert title" formControlName="title" class="nexus-create_title"/> | ||
| <ul class="nexus-create_topics"> | ||
| <li *ngFor="let topic of topics"> | ||
| <nexus-topic | ||
| [data]="topic" | ||
| [disabled]="false" | ||
| (toggle)="topic.selected = !topic.selected" | ||
| ></nexus-topic> | ||
| </li> | ||
| </ul> | ||
| <div class="nexus-create_content"> | ||
| <ckeditor | ||
| [editor]="editor" | ||
| [config]="config" | ||
| formControlName="content" | ||
| ></ckeditor> | ||
| </div> | ||
| <div class="nexus-create_footer"> | ||
| <button type="submit" class="nexus-create_submit" (click)="submit()">Submit</button> | ||
| </div> | ||
| </form> | ||
| </div> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.