-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add get by id route gf-86 * feat: add page for project gf-86 * fix: fix small errors gf-86 * feat: add styles gf-86 * fix: change project component gf-86 * fix: make description text type gf-86 * fix: fix migrations gf-86 * feat: add clickable project item gf-86 * fix: change const FieldLimit in migration gf-86 * fix: change response type to GetAllItem gf-86 * fix: get all item file name gf-86 * fix: change conditions in project component gf-86 * fix: little layout fix gf-86 * fix: use configureString gf-86 * fix: use loader correct gf-86 * fix: rename findRequest to getId gf-86 * fix: add projectStatus gf-86 * fix: change title gf-86 * fix: remove react-router-dom import gf-86 * feat: add changed package-lock.json gf-86 * fix: remove ProjectGetByIdRequestDto gf-86
- Loading branch information
1 parent
c6496a4
commit ba11d74
Showing
22 changed files
with
245 additions
and
26 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
apps/backend/src/db/migrations/20240829201429_change_description_type.ts
This file contains 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,28 @@ | ||
import { type Knex } from "knex"; | ||
|
||
const TABLE_NAME = "projects"; | ||
|
||
const ColumnName = { | ||
DESCRIPTION: "description", | ||
} as const; | ||
|
||
const FieldLimit = { | ||
DESCRIPTION: 1000, | ||
DESCRIPTION_PREVIOUS: 50, | ||
} as const; | ||
|
||
function up(knex: Knex): Promise<void> { | ||
return knex.schema.alterTable(TABLE_NAME, (table) => { | ||
table.string(ColumnName.DESCRIPTION, FieldLimit.DESCRIPTION).alter(); | ||
}); | ||
} | ||
|
||
function down(knex: Knex): Promise<void> { | ||
return knex.schema.alterTable(TABLE_NAME, (table) => { | ||
table | ||
.string(ColumnName.DESCRIPTION, FieldLimit.DESCRIPTION_PREVIOUS) | ||
.alter(); | ||
}); | ||
} | ||
|
||
export { down, up }; |
This file contains 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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export { | ||
type ProjectCreateRequestDto, | ||
type ProjectCreateResponseDto, | ||
type ProjectGetAllItemResponseDto, | ||
type ProjectGetAllResponseDto, | ||
} from "@git-fit/shared"; |
This file contains 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 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 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 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 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 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 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 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 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 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 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,53 @@ | ||
import { PageLayout } from "~/libs/components/components.js"; | ||
import { DataStatus } from "~/libs/enums/enums.js"; | ||
import { | ||
useAppDispatch, | ||
useAppSelector, | ||
useEffect, | ||
useParams, | ||
} from "~/libs/hooks/hooks.js"; | ||
import { actions as projectActions } from "~/modules/projects/projects.js"; | ||
import { NotFound } from "~/pages/not-found/not-found.jsx"; | ||
|
||
import styles from "./styles.module.css"; | ||
|
||
const Project = (): JSX.Element => { | ||
const dispatch = useAppDispatch(); | ||
const { id: projectId } = useParams<{ id: string }>(); | ||
|
||
const { project, projectStatus } = useAppSelector(({ projects }) => ({ | ||
project: projects.project, | ||
projectStatus: projects.projectStatus, | ||
})); | ||
|
||
useEffect(() => { | ||
if (projectId) { | ||
void dispatch(projectActions.getById({ id: projectId })); | ||
} | ||
}, [dispatch, projectId]); | ||
|
||
const isLoading = | ||
projectStatus === DataStatus.PENDING || projectStatus === DataStatus.IDLE; | ||
|
||
const isRejected = projectStatus === DataStatus.REJECTED; | ||
|
||
if (isRejected) { | ||
return <NotFound />; | ||
} | ||
|
||
return ( | ||
<PageLayout isLoading={isLoading}> | ||
<div className={styles["project-layout"]}> | ||
<h1 className={styles["title"]}>{project?.name}</h1> | ||
<div className={styles["project-description-layout"]}> | ||
<h3 className={styles["project-description-title"]}>Description</h3> | ||
<p className={styles["project-description"]}> | ||
{project?.description} | ||
</p> | ||
</div> | ||
</div> | ||
</PageLayout> | ||
); | ||
}; | ||
|
||
export { Project }; |
This file contains 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 @@ | ||
.project-layout { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 24px; | ||
align-items: flex-start; | ||
padding: 0; | ||
color: var(--color-text-primary); | ||
} | ||
|
||
.title { | ||
margin: 0; | ||
font-size: 30px; | ||
line-height: 120%; | ||
} | ||
|
||
.project-description-layout { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
align-items: flex-start; | ||
padding: 0; | ||
} | ||
|
||
.project-description-title { | ||
margin: 0; | ||
font-size: 20px; | ||
line-height: 130%; | ||
} | ||
|
||
.project-description { | ||
margin: 0; | ||
font-size: 16px; | ||
line-height: 150%; | ||
} |
Oops, something went wrong.