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

FRONTEND: refactoring #20

Merged
merged 42 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d5825c2
fix: fix icons style in the header
Melichka Aug 21, 2024
7526776
fix: use another component from the MUI library
Melichka Aug 21, 2024
175e193
fix: fix backgraund color
Melichka Aug 21, 2024
c47d8e4
fix: use a different icon and font
Melichka Aug 21, 2024
97db4db
feat: move the display change as a new component
Melichka Aug 21, 2024
0c77b49
fix: remove display from component
Melichka Aug 21, 2024
c5e404e
fix: use new components
Melichka Aug 21, 2024
1338c35
fix: add outlined search bar
Melichka Aug 21, 2024
cb48ae7
fix: Improve NavButton
Melichka Aug 21, 2024
bf1650e
fix: change icon
Melichka Aug 21, 2024
4e2f730
fix: change style for card
Melichka Aug 21, 2024
861f45b
feat: update indents
Melichka Aug 21, 2024
2226d3c
fix: add stack icon and fix title style
Melichka Aug 21, 2024
5e87f64
fix: center elements
Melichka Aug 21, 2024
86d9647
fix: change status chip color
Melichka Aug 25, 2024
4d4d7de
fix: change borders in table
Melichka Aug 25, 2024
3a9aff9
fix: fix style for goals table
Melichka Aug 26, 2024
e14cae4
fix: change status selector
Melichka Aug 26, 2024
0f6ae57
fix: delete backgraund
Melichka Aug 26, 2024
65619f5
fix: change timeline`s style
Melichka Aug 26, 2024
2cdaa2e
fix: change margin
Melichka Aug 26, 2024
9119153
feat: add translstion
Melichka Aug 28, 2024
6a56424
fix: delete unnecessary route
Melichka Aug 28, 2024
58b353c
feat: add translate
Melichka Aug 28, 2024
14fc399
fix: fix navigation
Melichka Aug 28, 2024
ae7ca74
feat: add login page
Melichka Aug 29, 2024
9f77ba3
feat: add image
Melichka Aug 29, 2024
9a775a5
fix: change routes
Melichka Aug 29, 2024
a502a82
feat: add translate
Melichka Aug 29, 2024
8d4a725
feat: add profile card
Melichka Aug 30, 2024
d0aee2a
feat: add profile card component
Melichka Aug 30, 2024
0d491b2
fix: fix header display
Melichka Aug 30, 2024
c39761b
fix: change margin
Melichka Aug 30, 2024
af05e8d
fix: add filter
Melichka Aug 30, 2024
2030f6a
fix: add random backgraund color
Melichka Aug 30, 2024
c7ee957
fix: fix project route
Melichka Aug 30, 2024
1a417eb
feat: add navigate
Melichka Aug 30, 2024
1cb5fa2
feat: add gantt lib
Melichka Aug 30, 2024
df3a3b9
feat: init gantt lib
Melichka Aug 30, 2024
4f0f62e
fix: change gantt`s header
Melichka Aug 30, 2024
8d4fe22
feat(frontend): add login page
Melichka Sep 2, 2024
ee14040
refactor(frontend): remove gant, fix env vars, change aliases
Melichka Sep 2, 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
859 changes: 506 additions & 353 deletions application/frontend/package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions application/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@
"globals": "^15.9.0",
"husky": "^9.1.4",
"prettier": "^3.3.3",
"typescript": "^5.5.3",
"typescript": "^5.1.6",
"typescript-eslint": "^8.0.0",
"vite": "^5.4.0"
"vite": "^4.2.0",
"vite-plugin-svgr": "^4.2.0"
},
"plugins": [
"@semantic-release/commit-analyzer",
Expand Down
56 changes: 55 additions & 1 deletion application/frontend/public/locales/translation/en.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
{
"header": "Header"
"header": "Header",
"projectList": "Project List",
"settings": "Settings",
"search": "Search",
"projects": "Projects",
"quiz": "Quiz",
"rating": "Rating",
"notifications": "Notifications",
"profile": "Profile",
"more": "More",
"toggleTheme": "Toggle Theme",
"changeLanguage": "Change Language",
"projectName": "Project \"{{name}}\"",
"reportList": "Report List",
"searchPlaceholder": "Search",
"createReport": "Create Report",
"status": {
"Error": "Error",
"Success": "Success",
"Warning": "Warning"
},
"goalsTable": {
"title": "Title",
"status": "Status",
"description": "Description"
},
"reportsTable": {
"name": "Name",
"status": "Status",
"author": "Author",
"startDate": "Start Date",
"endDate": "End Date"
},
"reportOverlay": {
"createReport": "Create Report",
"reportName": "Report Name",
"trafficLightColor": "Traffic Light Color",
"success": "Success",
"error": "Error",
"warning": "Warning",
"startDate": "Start Date",
"endDate": "End Date",
"colors": "Traffic Light Colors",
"onVacation": "Is anyone on vacation?",
"reporterOnVacation": "Is the reporter on vacation?",
"addGoal": "+ Add Goal",
"cancel": "Cancel",
"submit": "Submit",
"main": "Main",
"goals": "Goals",
"colorValue": "Value",
"yes":"Yes",
"no":"No"
},
"selectUser": "Select your user"
}
56 changes: 55 additions & 1 deletion application/frontend/public/locales/translation/ru.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
{
"header": "Шапка"
"header": "Шапка",
"projectList": "Список проектов",
"settings": "Настройки",
"search": "Поиск",
"projects": "Проекты",
"quiz": "Опрос",
"rating": "Рейтинг",
"notifications": "Уведомления",
"profile": "Профиль",
"more": "Ещё",
"toggleTheme": "Переключить тему",
"changeLanguage": "Сменить язык",
"projectName": "Проект \"{{name}}\"",
"reportList": "Список отчетов",
"searchPlaceholder": "Поиск",
"createReport": "Создать отчет",
"status": {
"Error": "Ошибка",
"Success": "Успех",
"Warning": "Предупреждение"
},
"goalsTable": {
"title": "Название",
"status": "Статус",
"description": "Описание"
},
"reportsTable": {
"name": "Название",
"status": "Статус",
"author": "Автор",
"startDate": "Дата начала",
"endDate": "Дата окончания"
},
"reportOverlay": {
"createReport": "Создать отчет",
"reportName": "Название отчета",
"trafficLightColor": "Итоговый цвет светофора",
"success": "Успех",
"error": "Ошибка",
"warning": "Предупреждение",
"startDate": "Дата начала",
"endDate": "Дата окончания",
"colors": "Цвета светофора",
"onVacation": "Идет ли кто-то в отпуск?",
"reporterOnVacation": "Идет ли в отпуск тот, кто пишет отчет?",
"addGoal": "+ Добавить цель",
"cancel": "Отмена",
"submit": "Создать",
"main": "Основное",
"goals": "Цели",
"colorValue": "Текст",
"yes":"Да",
"no":"Нет"
},
"selectUser": "Выберите своего пользователя"
}
1 change: 1 addition & 0 deletions application/frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react"
import { BrowserRouter } from "react-router-dom"

import "@fontsource/roboto/300.css"
Expand Down
9 changes: 9 additions & 0 deletions application/frontend/src/assets/loginpage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions application/frontend/src/assets/settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions application/frontend/src/assets/stack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react"
import { useTranslation } from "react-i18next"

import { Button } from "@mui/material"

Expand All @@ -7,9 +8,11 @@ interface CreateReportButtonProps {
}

export const CreateReportButton: React.FC<CreateReportButtonProps> = ({ onClick }) => {
const { t } = useTranslation()

return (
<Button variant="contained" color="primary" onClick={onClick}>
Create Report
{t("createReport")}
</Button>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import styled from "styled-components"

import { Table, TableCell, TableRow, TextField } from "@mui/material"

export const TableContainer = styled.div`
border-radius: 8px;
overflow: hidden;
border: 1px solid rgba(217, 217, 217, 1);
`

export const StyledTable = styled(Table)`
border-collapse: separate;
border-spacing: 0;
`

export const StyledTableCell = styled(TableCell)`
padding: 8px;
border: none;
`

export const StyledTableRow = styled(TableRow)`
&:not(:last-child) ${StyledTableCell} {
border-bottom: 1px solid rgba(217, 217, 217, 1);
}
`

export const CustomTextField = styled(TextField)`
.MuiInputBase-root {
border: none;
}

.MuiInputLabel-root {
border: none;
}

.MuiOutlinedInput-root {
border: none;
fieldset {
border: none;
}
}
`
88 changes: 51 additions & 37 deletions application/frontend/src/components/GoalsTable/GoalsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import React from "react"
import { useTranslation } from "react-i18next"

import { Table, TableBody, TableCell, TableHead, TableRow, TextField } from "@mui/material"
import { TableBody, TableHead, TableRow } from "@mui/material"

import { StatusSelector } from "../StatusSelector"
import {
CustomTextField,
StyledTable,
StyledTableCell,
StyledTableRow,
TableContainer,
} from "./GoalsTable.styled"

interface Goal {
title: string
Expand All @@ -16,44 +24,50 @@ interface GoalsTableProps {
}

export const GoalsTable: React.FC<GoalsTableProps> = ({ goals, onGoalChange }) => {
const { t } = useTranslation()

return (
<Table>
<TableHead>
<TableRow>
<TableCell>Название</TableCell>
<TableCell>Статус</TableCell>
<TableCell>Описание</TableCell>
</TableRow>
</TableHead>
<TableBody>
{goals.map((goal, index) => (
<TableRow key={index}>
<TableCell>
<TextField
fullWidth
value={goal.title}
onChange={(e) => onGoalChange(index, "title", e.target.value)}
/>
</TableCell>
<TableCell>
<StatusSelector
value={goal.status}
onChange={(value) => onGoalChange(index, "status", value)}
/>
</TableCell>
<TableCell>
<TextField
fullWidth
multiline
rows={2}
value={goal.description}
onChange={(e) => onGoalChange(index, "description", e.target.value)}
/>
</TableCell>
<TableContainer>
<StyledTable>
<TableHead>
<TableRow>
<StyledTableCell>{t("goalsTable.title")}</StyledTableCell>
<StyledTableCell>{t("goalsTable.status")}</StyledTableCell>
<StyledTableCell>{t("goalsTable.description")}</StyledTableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableHead>
<TableBody>
{goals.map((goal, index) => (
<StyledTableRow key={index}>
<StyledTableCell>
<CustomTextField
fullWidth
value={goal.title}
onChange={(e) => onGoalChange(index, "title", e.target.value)}
variant="outlined"
/>
</StyledTableCell>
<StyledTableCell>
<StatusSelector
value={goal.status}
onChange={(value) => onGoalChange(index, "status", value)}
/>
</StyledTableCell>
<StyledTableCell>
<CustomTextField
fullWidth
multiline
rows={2}
value={goal.description}
onChange={(e) => onGoalChange(index, "description", e.target.value)}
variant="outlined"
/>
</StyledTableCell>
</StyledTableRow>
))}
</TableBody>
</StyledTable>
</TableContainer>
)
}

Expand Down
Loading
Loading