Compare commits
	
		
			6 Commits
		
	
	
		
			developer_
			...
			fixes_task
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 7b4b4f37fc | |||
| 33af4ebbd6 | |||
| 5608e4e4f2 | |||
| 1254557a08 | |||
| c22f26f6fe | |||
| 9cb59b61d6 | 
| @@ -39,13 +39,13 @@ export const AuthHeader = () => { | ||||
|         <div className="auth-nav"> | ||||
|           <ul> | ||||
|             <li> | ||||
|               <NavLink to={"/stack"}>аутстафинг</NavLink> | ||||
|               <NavLink to={"/stack"}>Аутстафинг</NavLink> | ||||
|             </li> | ||||
|             <li> | ||||
|               <NavLink to={"/tracker-intro"}>трекер</NavLink> | ||||
|               <NavLink to={"/tracker-intro"}>Трекер</NavLink> | ||||
|             </li> | ||||
|             <li> | ||||
|               <NavLink to={"/auth-candidate"}>работа в IT</NavLink> | ||||
|               <NavLink to={"/auth-candidate"}>Работа в IT</NavLink> | ||||
|             </li> | ||||
|           </ul> | ||||
|         </div> | ||||
|   | ||||
| @@ -490,18 +490,27 @@ export const ModalTiсket = ({ | ||||
|   }, [taskTags]); | ||||
|  | ||||
|   async function handleUpload(event) { | ||||
|     const formData = new FormData(); | ||||
|     formData.append("uploadFile", event.target.files[0]); | ||||
|     const res = await fetch("https://itguild.info/api/file/upload", { | ||||
|       method: "POST", | ||||
|       body: formData, | ||||
|       headers: { ...getToken() } | ||||
|     }); | ||||
|     try { | ||||
|       const formData = new FormData(); | ||||
|       formData.append("uploadFile", event.target.files[0]); | ||||
|  | ||||
|     const data = await res.json(); | ||||
|       const res = await fetch("https://itguild.info/api/file/upload", { | ||||
|         method: "POST", | ||||
|         body: formData, | ||||
|         headers: { ...getToken() } | ||||
|       }); | ||||
|  | ||||
|     // setUploadedFile(data); | ||||
|     attachFile(data[0].id); | ||||
|       const data = await res.json(); | ||||
|  | ||||
|       // setUploadedFile(data); | ||||
|       attachFile(data[0].id); | ||||
|     } catch { | ||||
|       showNotification({ | ||||
|         show: true, | ||||
|         text: "Неверный формат файла", | ||||
|         type: "error" | ||||
|       }); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   // function deleteLoadedFile() { | ||||
| @@ -543,7 +552,7 @@ export const ModalTiсket = ({ | ||||
|  | ||||
|   function run() { | ||||
|     updateTimerSec++; | ||||
|     if (updateTimerSec > 60) { | ||||
|     if (updateTimerSec > 59) { | ||||
|       updateTimerMinute++; | ||||
|       updateTimerSec = 0; | ||||
|     } | ||||
| @@ -561,7 +570,7 @@ export const ModalTiсket = ({ | ||||
|  | ||||
|   function correctTimerTime(time) { | ||||
|     if (time < 10) return `0${time}`; | ||||
|     if (time > 10) return time; | ||||
|     if (time >= 10) return time; | ||||
|   } | ||||
|  | ||||
|   useEffect(() => { | ||||
| @@ -800,7 +809,7 @@ export const ModalTiсket = ({ | ||||
|                     name="file" | ||||
|                     id="input__file" | ||||
|                     type="file" | ||||
|                     accept="image/*,.png,.jpg,.svg,.jpeg" | ||||
|                     accept="image/*,.png,.jpg,.svg,.jpeg,.doc,.docx,.xls,.xlsx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | ||||
|                     className="input__file" | ||||
|                     onChange={handleUpload} | ||||
|                   /> | ||||
|   | ||||
| @@ -381,7 +381,7 @@ export const TicketFullScreen = () => { | ||||
|  | ||||
|   function run() { | ||||
|     updateTimerSec++; | ||||
|     if (updateTimerSec > 60) { | ||||
|     if (updateTimerSec > 59) { | ||||
|       updateTimerMinute++; | ||||
|       updateTimerSec = 0; | ||||
|     } | ||||
| @@ -399,7 +399,7 @@ export const TicketFullScreen = () => { | ||||
|  | ||||
|   function correctTimerTime(time) { | ||||
|     if (time < 10) return `0${time}`; | ||||
|     if (time > 10) return time; | ||||
|     if (time >= 10) return time; | ||||
|   } | ||||
|  | ||||
|   function deleteTaskExecutor() { | ||||
| @@ -479,17 +479,27 @@ export const TicketFullScreen = () => { | ||||
|   } | ||||
|  | ||||
|   async function handleUpload(event) { | ||||
|     const formData = new FormData(); | ||||
|     formData.append("uploadFile", event.target.files[0]); | ||||
|     const res = await fetch("https://itguild.info/api/file/upload", { | ||||
|       method: "POST", | ||||
|       body: formData, | ||||
|       headers: { ...getToken() } | ||||
|     }); | ||||
|     try { | ||||
|       const formData = new FormData(); | ||||
|       formData.append("uploadFile", event.target.files[0]); | ||||
|  | ||||
|     const data = await res.json(); | ||||
|       const res = await fetch("https://itguild.info/api/file/upload", { | ||||
|         method: "POST", | ||||
|         body: formData, | ||||
|         headers: { ...getToken() } | ||||
|       }); | ||||
|  | ||||
|     setUploadedFile(data); | ||||
|       const data = await res.json(); | ||||
|  | ||||
|       // setUploadedFile(data); | ||||
|       attachFile(data[0].id); | ||||
|     } catch { | ||||
|       showNotification({ | ||||
|         show: true, | ||||
|         text: "Неверный формат файла", | ||||
|         type: "error" | ||||
|       }); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   function attachFile() { | ||||
| @@ -774,7 +784,7 @@ export const TicketFullScreen = () => { | ||||
|                           name="file" | ||||
|                           id="input__file" | ||||
|                           type="file" | ||||
|                           accept="image/*,.png,.jpg,.svg,.jpeg" | ||||
|                           accept="image/*,.png,.jpg,.svg,.jpeg,.doc,.docx,.xls,.xlsx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | ||||
|                           className="input__file" | ||||
|                           onChange={handleUpload} | ||||
|                         /> | ||||
|   | ||||
| @@ -844,7 +844,7 @@ export const TrackerModal = ({ | ||||
|       )} | ||||
|       {modalType === "create-project" && ( | ||||
|         <div> | ||||
|           <div className="title-project"> | ||||
|           <div className="title-project" style={{ minWidth: "350px" }}> | ||||
|             <h4>{titleProject}</h4> | ||||
|             <div className="input-container"> | ||||
|               <input | ||||
|   | ||||
| @@ -88,12 +88,12 @@ export const Landing = () => { | ||||
|             регистрация | ||||
|           </div> | ||||
|           <BurgerButton active={menuActive} setActive={setMenuActive} /> | ||||
|           <div className="head__tracker"> | ||||
|           <Link className="head__tracker" to="/tracker-intro"> | ||||
|             <div> | ||||
|               <img src={tracker} alt="tracker" /> | ||||
|             </div> | ||||
|             <span>трекер</span> | ||||
|           </div> | ||||
|           </Link> | ||||
|           <SVG className="head__auth" src={authIcon} /> | ||||
|         </div> | ||||
|         <div className="landing__info"> | ||||
|   | ||||
| @@ -34,13 +34,13 @@ export const PartnerSettings = () => { | ||||
|   const [loader, setLoader] = useState(false); | ||||
|   const [tgLoader, setTgLoader] = useState(false); | ||||
|  | ||||
|   useEffect(() => { | ||||
|     apiRequest("/user-tg-bot/get-token", { | ||||
|       method: "GET" | ||||
|     }).then((data) => { | ||||
|       setTgToken(data.token); | ||||
|     }); | ||||
|   }, []); | ||||
|   // useEffect(() => { | ||||
|   //   apiRequest("/user-tg-bot/get-token", { | ||||
|   //     method: "GET" | ||||
|   //   }).then((data) => { | ||||
|   //     setTgToken(data.token); | ||||
|   //   }); | ||||
|   // }, []); | ||||
|  | ||||
|   const setSettings = () => { | ||||
|     if (inputsValue.name.length < 2) { | ||||
| @@ -92,18 +92,43 @@ export const PartnerSettings = () => { | ||||
|     }); | ||||
|   }; | ||||
|  | ||||
|   const handleCopy = async () => { | ||||
|     try { | ||||
|       await navigator.clipboard.writeText(tgToken); | ||||
|       showNotification({ | ||||
|         show: true, | ||||
|         text: "Телеграм токен успешно скопирован", | ||||
|         type: "success" | ||||
|   const handleGenerate = async () => { | ||||
|     if (tgToken == undefined) { | ||||
|       setTgLoader(true); | ||||
|       apiRequest("/user-tg-bot/get-token", { | ||||
|         method: "GET" | ||||
|       }).then((data) => { | ||||
|         setTgToken(data.token); | ||||
|         showNotification({ | ||||
|           show: true, | ||||
|           text: "Телеграм токен успешно сгенерирован", | ||||
|           type: "success" | ||||
|         }); | ||||
|         setTgLoader(false); | ||||
|       }); | ||||
|     } catch (err) { | ||||
|     } | ||||
|   }; | ||||
|  | ||||
|   const handleCopy = async () => { | ||||
|     if (tgToken !== undefined) { | ||||
|       try { | ||||
|         await navigator.clipboard.writeText(tgToken); | ||||
|         showNotification({ | ||||
|           show: true, | ||||
|           text: "Телеграм токен успешно скопирован", | ||||
|           type: "success" | ||||
|         }); | ||||
|       } catch (err) { | ||||
|         showNotification({ | ||||
|           show: true, | ||||
|           text: "Ошибка копирования", | ||||
|           type: "error" | ||||
|         }); | ||||
|       } | ||||
|     } else { | ||||
|       showNotification({ | ||||
|         show: true, | ||||
|         text: "Ошибка копирования", | ||||
|         text: "Необходимо сгенерировать код", | ||||
|         type: "error" | ||||
|       }); | ||||
|     } | ||||
| @@ -226,12 +251,18 @@ export const PartnerSettings = () => { | ||||
|                   <Loader style={"green"} width={"40px"} height={"40px"} /> | ||||
|                 ) : ( | ||||
|                   <BaseButton | ||||
|                     onClick={handleCopy} | ||||
|                     onClick={handleGenerate} | ||||
|                     styles={"settings__buttons-save"} | ||||
|                   > | ||||
|                     Скопировать | ||||
|                     Сгенерировать | ||||
|                   </BaseButton> | ||||
|                 )} | ||||
|                 <BaseButton | ||||
|                   onClick={handleCopy} | ||||
|                   styles={"settings__buttons-save"} | ||||
|                 > | ||||
|                   Скопировать | ||||
|                 </BaseButton> | ||||
|               </div> | ||||
|               <div className="settings__agreement-tg"> | ||||
|                 <a href="#" target="_blank" rel="noopener noreferrer"> | ||||
|   | ||||
| @@ -94,8 +94,7 @@ | ||||
|     width: 100%; | ||||
|     display: flex; | ||||
|     flex-direction: row; | ||||
|     justify-content: flex-start; | ||||
|     gap: 20px; | ||||
|     justify-content: space-around; | ||||
|     margin: 30px 0 20px; | ||||
|  | ||||
|     &-cancel, | ||||
| @@ -130,21 +129,11 @@ | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   @media (max-width: 800px) { | ||||
|     &__input { | ||||
|       width: 95%; | ||||
|     } | ||||
|  | ||||
|   @media (max-width: 440px) { | ||||
|     &__buttons { | ||||
|       margin: 15px 0 14px 0; | ||||
|       width: 100%; | ||||
|       flex-direction: column-reverse; | ||||
|       flex-direction: column; | ||||
|       gap: 10px; | ||||
|       align-items: center; | ||||
|       gap: 0px; | ||||
|  | ||||
|       &-save { | ||||
|         margin-bottom: 15px; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -28,6 +28,7 @@ import { WelcomePage } from "@pages/WelcomePage/WelcomePage"; | ||||
|  | ||||
| import { Calendar } from "@components/Calendar/Calendar"; | ||||
| import { Candidate } from "@components/Candidate/Candidate"; | ||||
| import TicketFullScreen from "@components/Modal/Tracker/TicketFullScreen/TicketFullScreen"; | ||||
|  | ||||
| export const PartnerPage = () => { | ||||
|   return ( | ||||
| @@ -46,6 +47,7 @@ export const PartnerPage = () => { | ||||
|       <Route exact path="/candidate/:id/form" element={<FormPage />} /> | ||||
|       <Route path="/:userId/calendar" element={<Calendar />} /> | ||||
|  | ||||
|       <Route exact path="/tracker/task/:id" element={<TicketFullScreen />} /> | ||||
|       <Route | ||||
|         exact | ||||
|         path="/tracker/project/:id/task/:taskId" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user