diff --git a/deployments/staging/docker-compose.yaml b/deployments/staging/docker-compose.yaml index 6a9181e..ad7f300 100644 --- a/deployments/staging/docker-compose.yaml +++ b/deployments/staging/docker-compose.yaml @@ -1,11 +1,13 @@ +version: "3.3" services: admin: container_name: admin_front restart: unless-stopped image: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID networks: - - penahub_frontend - hostname: hub + - marketplace_penahub_frontend + hostname: admin + tty: true networks: - penahub_frontend: + marketplace_penahub_frontend: external: true diff --git a/package.json b/package.json index e6e2f40..7d9ba5a 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,8 @@ "@types/react": "^18.0.18", "@types/react-dom": "^18.0.6", "@types/react-router-dom": "^5.3.3", - "craco": "^0.0.3", "dayjs": "^1.11.5", "moment": "^2.29.4", - "nanoid": "^4.0.1", "numeral": "^2.0.6", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -61,8 +59,5 @@ "last 1 firefox version", "last 1 safari version" ] - }, - "devDependencies": { - "craco-alias": "^3.0.1" } } diff --git a/src/__tests__/menu-link.test.js b/src/__tests__/menu-link.test.js new file mode 100644 index 0000000..ce20363 --- /dev/null +++ b/src/__tests__/menu-link.test.js @@ -0,0 +1,44 @@ + const puppeteer = require('puppeteer'); + const url = "http://localhost:3000/users"; + const urlMass = ['/users','/tariffs','/discounts','/promocode','/support', '/entities']; + + jest.setTimeout(1000 * 60 * 5); + + let browser; + let page; + + describe('Тест', (() => { + beforeAll(async()=>{ + browser = puppeteer.launch({headless:true}); + page = browser.newPage(); + + page.goto(url); + // Set screen size + page.setViewport({width: 1080, height: 1024}); + + }) + afterAll(() => browser.quit()); + test('Тест меню',async () => { + +// Ждем загрузки менюшек + page.waitForSelector('.menu') + + // Берем все ссылки с кнопок, у которых есть класс menu и вставляем в массив + let menuLink = page.evaluate(()=>{ + let menuArray = document.querySelectorAll('.menu') + let Urls = Object.values(menuArray).map( + menuItem => ( + menuItem.href.slice(menuItem.href.lastIndexOf('/')) + ) + ) + return Urls + }) +// Проверяем, какие ссылки есть в нашем массиве, а каких нет + for (let i = 0; i < menuLink.length; i++) { + expect(urlMass.find((elem)=>elem===menuLink[i])).toBe(true) + } + + }) +})) + + diff --git a/src/pages/dashboard/Content/Tariffs/Contractor/index.tsx b/src/pages/dashboard/Content/Tariffs/Contractor/index.tsx new file mode 100644 index 0000000..2a0e466 --- /dev/null +++ b/src/pages/dashboard/Content/Tariffs/Contractor/index.tsx @@ -0,0 +1,81 @@ +import * as React from "react"; +import { Box, Typography, Button } from "@mui/material"; +import theme from "../../../../../theme"; + + +export interface MWProps { + openModal: (type:number, num: number) => void +} + +const Contractor: React.FC = ({ openModal }) => { + return ( + + + Сокращатель ссылок + + + + + + + + + ); +} + + +export default Contractor; \ No newline at end of file diff --git a/src/pages/dashboard/Content/Tariffs/Quiz/index.tsx b/src/pages/dashboard/Content/Tariffs/Quiz/index.tsx new file mode 100644 index 0000000..30ccc25 --- /dev/null +++ b/src/pages/dashboard/Content/Tariffs/Quiz/index.tsx @@ -0,0 +1,81 @@ +import * as React from "react"; +import { Box, Typography, Button } from "@mui/material"; +import theme from "../../../../../theme"; + + +export interface MWProps { + openModal: (type:number, num: number) => void +} + +const Quiz: React.FC = ({ openModal }) => { + return ( + + + Опросник + + + + + + + + + ); +} + + +export default Quiz; \ No newline at end of file diff --git a/src/pages/dashboard/Content/Tariffs/Templater/index.tsx b/src/pages/dashboard/Content/Tariffs/Templater/index.tsx new file mode 100644 index 0000000..4a5b9e7 --- /dev/null +++ b/src/pages/dashboard/Content/Tariffs/Templater/index.tsx @@ -0,0 +1,95 @@ +import * as React from "react"; +import { Box, Typography, Button } from "@mui/material"; +import theme from "../../../../../theme"; + + +export interface MWProps { + openModal: (type:number, num: number) => void +} + +const Templater: React.FC = ({ openModal }) => { + return ( + + + Шаблонизатор документов + + + + + + + + + + ); +} + + +export default Templater; \ No newline at end of file diff --git a/src/pages/dashboard/Menu/index.tsx b/src/pages/dashboard/Menu/index.tsx index 0a8e205..000f5e3 100644 --- a/src/pages/dashboard/Menu/index.tsx +++ b/src/pages/dashboard/Menu/index.tsx @@ -101,15 +101,15 @@ const Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== 'open' }), ); -const links: {path: string; element: JSX.Element; title: string} [] =[ - {path: '/users', element: , title: 'Информация о проекте'}, - {path: '/entities', element: , title: 'Юридические лица'}, - {path: '/tariffs', element: , title: 'Шаблонизатор документов'}, - {path: '/discounts', element: , title: 'Скидки'}, - {path: '/promocode', element: , title: 'Промокод'}, - {path: '/kkk', element: , title: 'Настройки'}, - {path: '/jjj', element: , title: 'Камера' }, - {path: '/support', element: , title: 'Служба поддержки'}, +const links: {path: string; element: JSX.Element; title: string, className: string} [] =[ + {path: '/users', element: , title: 'Информация о проекте', className:'menu'}, + {path: '/entities', element: , title: 'Юридические лица', className:'menu'}, + {path: '/tariffs', element: , title: 'Шаблонизатор документов', className:'menu'}, + {path: '/discounts', element: , title: 'Скидки', className:'menu'}, + {path: '/promocode', element: , title: 'Промокод', className:'menu'}, + {path: '/kkk', element: , title: 'Настройки', className:'menu'}, + {path: '/jjj', element: , title: 'Камера', className:'menu'}, + {path: '/support', element: , title: 'Служба поддержки', className:'menu'}, ] @@ -122,7 +122,7 @@ const Navigation = (props:any) => { > {links.map((e, i) => ( - +