6 Commits

Author SHA1 Message Date
7b4b4f37fc fixes tasks 2024-08-14 17:12:11 +03:00
33af4ebbd6 fixes tasks 2024-08-14 17:12:03 +03:00
5608e4e4f2 Merge pull request 'developer_resume' (#42) from developer_resume into main
Reviewed-on: #42
2024-08-09 21:10:16 +03:00
1254557a08 Merge branch 'main' of https://git.itguild.info/apuc/guild_front 2024-08-09 15:45:30 +03:00
c22f26f6fe fix timer(Tracker/ModalTicket) fix fileUpload
(Tracker/ModalTicket) fix tgToken(PartnerSettings)
2024-08-09 15:43:51 +03:00
9cb59b61d6 Merge pull request 'developer_resume' (#41) from developer_resume into main
Reviewed-on: #41
2024-08-07 18:07:22 +03:00
8 changed files with 105 additions and 64 deletions

View File

@ -39,13 +39,13 @@ export const AuthHeader = () => {
<div className="auth-nav"> <div className="auth-nav">
<ul> <ul>
<li> <li>
<NavLink to={"/stack"}>аутстафинг</NavLink> <NavLink to={"/stack"}>Аутстафинг</NavLink>
</li> </li>
<li> <li>
<NavLink to={"/tracker-intro"}>трекер</NavLink> <NavLink to={"/tracker-intro"}>Трекер</NavLink>
</li> </li>
<li> <li>
<NavLink to={"/auth-candidate"}>работа в IT</NavLink> <NavLink to={"/auth-candidate"}>Работа в IT</NavLink>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -490,8 +490,10 @@ export const ModalTiсket = ({
}, [taskTags]); }, [taskTags]);
async function handleUpload(event) { async function handleUpload(event) {
try {
const formData = new FormData(); const formData = new FormData();
formData.append("uploadFile", event.target.files[0]); formData.append("uploadFile", event.target.files[0]);
const res = await fetch("https://itguild.info/api/file/upload", { const res = await fetch("https://itguild.info/api/file/upload", {
method: "POST", method: "POST",
body: formData, body: formData,
@ -502,6 +504,13 @@ export const ModalTiсket = ({
// setUploadedFile(data); // setUploadedFile(data);
attachFile(data[0].id); attachFile(data[0].id);
} catch {
showNotification({
show: true,
text: "Неверный формат файла",
type: "error"
});
}
} }
// function deleteLoadedFile() { // function deleteLoadedFile() {
@ -543,7 +552,7 @@ export const ModalTiсket = ({
function run() { function run() {
updateTimerSec++; updateTimerSec++;
if (updateTimerSec > 60) { if (updateTimerSec > 59) {
updateTimerMinute++; updateTimerMinute++;
updateTimerSec = 0; updateTimerSec = 0;
} }
@ -561,7 +570,7 @@ export const ModalTiсket = ({
function correctTimerTime(time) { function correctTimerTime(time) {
if (time < 10) return `0${time}`; if (time < 10) return `0${time}`;
if (time > 10) return time; if (time >= 10) return time;
} }
useEffect(() => { useEffect(() => {
@ -800,7 +809,7 @@ export const ModalTiсket = ({
name="file" name="file"
id="input__file" id="input__file"
type="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" className="input__file"
onChange={handleUpload} onChange={handleUpload}
/> />

View File

@ -381,7 +381,7 @@ export const TicketFullScreen = () => {
function run() { function run() {
updateTimerSec++; updateTimerSec++;
if (updateTimerSec > 60) { if (updateTimerSec > 59) {
updateTimerMinute++; updateTimerMinute++;
updateTimerSec = 0; updateTimerSec = 0;
} }
@ -399,7 +399,7 @@ export const TicketFullScreen = () => {
function correctTimerTime(time) { function correctTimerTime(time) {
if (time < 10) return `0${time}`; if (time < 10) return `0${time}`;
if (time > 10) return time; if (time >= 10) return time;
} }
function deleteTaskExecutor() { function deleteTaskExecutor() {
@ -479,8 +479,10 @@ export const TicketFullScreen = () => {
} }
async function handleUpload(event) { async function handleUpload(event) {
try {
const formData = new FormData(); const formData = new FormData();
formData.append("uploadFile", event.target.files[0]); formData.append("uploadFile", event.target.files[0]);
const res = await fetch("https://itguild.info/api/file/upload", { const res = await fetch("https://itguild.info/api/file/upload", {
method: "POST", method: "POST",
body: formData, body: formData,
@ -489,7 +491,15 @@ export const TicketFullScreen = () => {
const data = await res.json(); const data = await res.json();
setUploadedFile(data); // setUploadedFile(data);
attachFile(data[0].id);
} catch {
showNotification({
show: true,
text: "Неверный формат файла",
type: "error"
});
}
} }
function attachFile() { function attachFile() {
@ -774,7 +784,7 @@ export const TicketFullScreen = () => {
name="file" name="file"
id="input__file" id="input__file"
type="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" className="input__file"
onChange={handleUpload} onChange={handleUpload}
/> />

View File

@ -844,7 +844,7 @@ export const TrackerModal = ({
)} )}
{modalType === "create-project" && ( {modalType === "create-project" && (
<div> <div>
<div className="title-project"> <div className="title-project" style={{ minWidth: "350px" }}>
<h4>{titleProject}</h4> <h4>{titleProject}</h4>
<div className="input-container"> <div className="input-container">
<input <input

View File

@ -88,12 +88,12 @@ export const Landing = () => {
регистрация регистрация
</div> </div>
<BurgerButton active={menuActive} setActive={setMenuActive} /> <BurgerButton active={menuActive} setActive={setMenuActive} />
<div className="head__tracker"> <Link className="head__tracker" to="/tracker-intro">
<div> <div>
<img src={tracker} alt="tracker" /> <img src={tracker} alt="tracker" />
</div> </div>
<span>трекер</span> <span>трекер</span>
</div> </Link>
<SVG className="head__auth" src={authIcon} /> <SVG className="head__auth" src={authIcon} />
</div> </div>
<div className="landing__info"> <div className="landing__info">

View File

@ -34,13 +34,13 @@ export const PartnerSettings = () => {
const [loader, setLoader] = useState(false); const [loader, setLoader] = useState(false);
const [tgLoader, setTgLoader] = useState(false); const [tgLoader, setTgLoader] = useState(false);
useEffect(() => { // useEffect(() => {
apiRequest("/user-tg-bot/get-token", { // apiRequest("/user-tg-bot/get-token", {
method: "GET" // method: "GET"
}).then((data) => { // }).then((data) => {
setTgToken(data.token); // setTgToken(data.token);
}); // });
}, []); // }, []);
const setSettings = () => { const setSettings = () => {
if (inputsValue.name.length < 2) { if (inputsValue.name.length < 2) {
@ -92,7 +92,25 @@ export const PartnerSettings = () => {
}); });
}; };
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);
});
}
};
const handleCopy = async () => { const handleCopy = async () => {
if (tgToken !== undefined) {
try { try {
await navigator.clipboard.writeText(tgToken); await navigator.clipboard.writeText(tgToken);
showNotification({ showNotification({
@ -107,6 +125,13 @@ export const PartnerSettings = () => {
type: "error" type: "error"
}); });
} }
} else {
showNotification({
show: true,
text: "Необходимо сгенерировать код",
type: "error"
});
}
}; };
return ( return (
@ -225,13 +250,19 @@ export const PartnerSettings = () => {
{tgLoader ? ( {tgLoader ? (
<Loader style={"green"} width={"40px"} height={"40px"} /> <Loader style={"green"} width={"40px"} height={"40px"} />
) : ( ) : (
<BaseButton
onClick={handleGenerate}
styles={"settings__buttons-save"}
>
Сгенерировать
</BaseButton>
)}
<BaseButton <BaseButton
onClick={handleCopy} onClick={handleCopy}
styles={"settings__buttons-save"} styles={"settings__buttons-save"}
> >
Скопировать Скопировать
</BaseButton> </BaseButton>
)}
</div> </div>
<div className="settings__agreement-tg"> <div className="settings__agreement-tg">
<a href="#" target="_blank" rel="noopener noreferrer"> <a href="#" target="_blank" rel="noopener noreferrer">

View File

@ -94,8 +94,7 @@
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: space-around;
gap: 20px;
margin: 30px 0 20px; margin: 30px 0 20px;
&-cancel, &-cancel,
@ -130,21 +129,11 @@
} }
} }
@media (max-width: 800px) { @media (max-width: 440px) {
&__input {
width: 95%;
}
&__buttons { &__buttons {
margin: 15px 0 14px 0; flex-direction: column;
width: 100%; gap: 10px;
flex-direction: column-reverse;
align-items: center; align-items: center;
gap: 0px;
&-save {
margin-bottom: 15px;
}
} }
} }
} }

View File

@ -28,6 +28,7 @@ import { WelcomePage } from "@pages/WelcomePage/WelcomePage";
import { Calendar } from "@components/Calendar/Calendar"; import { Calendar } from "@components/Calendar/Calendar";
import { Candidate } from "@components/Candidate/Candidate"; import { Candidate } from "@components/Candidate/Candidate";
import TicketFullScreen from "@components/Modal/Tracker/TicketFullScreen/TicketFullScreen";
export const PartnerPage = () => { export const PartnerPage = () => {
return ( return (
@ -46,6 +47,7 @@ export const PartnerPage = () => {
<Route exact path="/candidate/:id/form" element={<FormPage />} /> <Route exact path="/candidate/:id/form" element={<FormPage />} />
<Route path="/:userId/calendar" element={<Calendar />} /> <Route path="/:userId/calendar" element={<Calendar />} />
<Route exact path="/tracker/task/:id" element={<TicketFullScreen />} />
<Route <Route
exact exact
path="/tracker/project/:id/task/:taskId" path="/tracker/project/:id/task/:taskId"