Просмотр исходного кода

represent numbers as structured and names of categories in routing

FE_dev
Dzenis Hadzifejzovic 2 лет назад
Родитель
Сommit
7da589b032
6 измененных файлов: 14291 добавлений и 12691 удалений
  1. 1272
    89
      package-lock.json
  2. 1
    0
      package.json
  3. 2
    2
      src/assets/styles/components/_files.scss
  4. 9
    6
      src/pages/FilesPage/FileTable.js
  5. 9
    4
      src/pages/FilesPage/FilesPage.js
  6. 12998
    12590
      yarn.lock

+ 1272
- 89
package-lock.json
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 1
- 0
package.json Просмотреть файл

"react-helmet-async": "^1.0.9", "react-helmet-async": "^1.0.9",
"react-i18next": "^11.10.0", "react-i18next": "^11.10.0",
"react-mentions": "^4.4.7", "react-mentions": "^4.4.7",
"react-pretty-numbers": "^3.0.0",
"react-redux": "^7.2.4", "react-redux": "^7.2.4",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
"react-scripts": "4.0.3", "react-scripts": "4.0.3",

+ 2
- 2
src/assets/styles/components/_files.scss Просмотреть файл



.files-page-categories-category { .files-page-categories-category {
width: calc(100% / 6) !important; width: calc(100% / 6) !important;
margin: 0 !important;
padding: 16px; padding: 16px;
padding-left: 0px;
} }


.files-page-categories-category-responsive { .files-page-categories-category-responsive {
width: calc(100% / 3) !important; width: calc(100% / 3) !important;
margin: 0 !important;
padding: 0px; padding: 0px;
margin-top: 10px;
} }


.files-page-category-button { .files-page-category-button {

+ 9
- 6
src/pages/FilesPage/FileTable.js Просмотреть файл

import { PAGE_SIZE_FILES } from "../../constants/keyCodeConstants"; import { PAGE_SIZE_FILES } from "../../constants/keyCodeConstants";
import { useTheme } from "@mui/system"; import { useTheme } from "@mui/system";
import { useMediaQuery } from "@mui/material"; import { useMediaQuery } from "@mui/material";
import NumericLabel from "react-pretty-numbers";


const FileTable = ({ trigger }) => { const FileTable = ({ trigger }) => {
const [file, setFile] = useState(null); const [file, setFile] = useState(null);
{file === null ? <th>{t("files.doucmentPath")}</th> : ""} {file === null ? <th>{t("files.doucmentPath")}</th> : ""}
<th>{t("files.doucmentName")}</th> <th>{t("files.doucmentName")}</th>
{file === null ? <th>{t("files.doucmentType")}</th> : ""} {file === null ? <th>{t("files.doucmentType")}</th> : ""}
{file === null ? <th>{t("files.doucmentSize")}</th> : ""}
{file === null ? <th>{t("files.doucmentSize")} (kB)</th> : ""}
{file === null ? <th>{t("files.deleteDocument")}</th> : ""} {file === null ? <th>{t("files.deleteDocument")}</th> : ""}
{file === null ? <th>{t("files.note")}</th> : ""} {file === null ? <th>{t("files.note")}</th> : ""}
<th>{t("files.downloadDocument")}</th> <th>{t("files.downloadDocument")}</th>
{file === null ? <td>{n.file_type && n.file_type}</td> : ""} {file === null ? <td>{n.file_type && n.file_type}</td> : ""}


{file === null ? ( {file === null ? (
<td className="profession">{n.cached_file_size}kB</td>
<td className="profession">
{<NumericLabel>{n.cached_file_size}</NumericLabel>}
</td>
) : ( ) : (
"" ""
)} )}
{file === null ? ( {file === null ? (
<td className="profession"> <td className="profession">
<IconButton <IconButton
className="c-btn c-btn--primary-outlined files-view-page-delete-btn"
className="c-btn c-btn--primary-outlined"
onClick={() => onClick={() =>
setFileForDelete({ setFileForDelete({
open: true, open: true,
{file === null ? ( {file === null ? (
<td className="profession"> <td className="profession">
<IconButton <IconButton
className="c-btn c-btn--primary-outlined files-view-page-delete-btn"
className="c-btn c-btn--primary-outlined"
onClick={() => { onClick={() => {
setOpenNoteModal({ setOpenNoteModal({
open: true, open: true,
<a <a
className="applicant-cv-button" className="applicant-cv-button"
style={{ style={{
width: "100px",
width: "90px",
height: "40px", height: "40px",
padding: 8,
padding: 10,
}} }}
download={n.title} download={n.title}
href={getPathForFile(n.file_type, n.file_stream)} href={getPathForFile(n.file_type, n.file_stream)}

+ 9
- 4
src/pages/FilesPage/FilesPage.js Просмотреть файл

}; };


const getNameHandler = (name) => { const getNameHandler = (name) => {
if (name.length > 15) return name.substr(0, 15) + "...";
return name;
if (matches) {
if (name.length > 7) return name.substr(0, 7) + "...";
return name;
} else {
if (name.length > 14) return name.substr(0, 14) + "...";
return name;
}
}; };


const onSuccessCreatingCategoryHandler = () => { const onSuccessCreatingCategoryHandler = () => {
marginTop: matches && "20px", marginTop: matches && "20px",
}} }}
> >
<div style={{ marginBottom: "20px" }}>
<div>
<div <div
style={{ style={{
display: "flex", display: "flex",
className="files-file-routing" className="files-file-routing"
onClick={() => history.push({ pathname: relation.id })} onClick={() => history.push({ pathname: relation.id })}
> >
{relation.name}
{getNameHandler(relation.name)}
</div> </div>
</div> </div>
))} ))}

+ 12998
- 12590
yarn.lock
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


Загрузка…
Отмена
Сохранить