Merge branch 'new-api-version' into dev
This commit is contained in:
commit
dfc5d648f9
@ -19,7 +19,7 @@ type AddedQuizImagesResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const API_URL = `${process.env.REACT_APP_DOMAIN}/squiz`;
|
const API_URL = `${process.env.REACT_APP_DOMAIN}/squiz`;
|
||||||
const IMAGES_URL = `${process.env.REACT_APP_DOMAIN}/squizstorer`;
|
const IMAGES_URL = `${process.env.REACT_APP_DOMAIN}/squizstorer/v1.0.0`;
|
||||||
|
|
||||||
export const createQuiz = async (
|
export const createQuiz = async (
|
||||||
body?: Partial<CreateQuizRequest>,
|
body?: Partial<CreateQuizRequest>,
|
||||||
|
|||||||
@ -13,7 +13,7 @@ type SendFileResponse = {
|
|||||||
message: string;
|
message: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const API_URL = `${process.env.REACT_APP_DOMAIN}/heruvym`;
|
const API_URL = `${process.env.REACT_APP_DOMAIN}/heruvym/v1.0.0`;
|
||||||
|
|
||||||
export const sendTicketMessage = async (
|
export const sendTicketMessage = async (
|
||||||
ticketId: string,
|
ticketId: string,
|
||||||
@ -67,7 +67,7 @@ export const sendFile = async (
|
|||||||
|
|
||||||
const sendResponse = await makeRequest<FormData, SendFileResponse>({
|
const sendResponse = await makeRequest<FormData, SendFileResponse>({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: `${process.env.REACT_APP_DOMAIN}/heruvym/sendFiles`,
|
url: `${API_URL}/sendFiles`,
|
||||||
body,
|
body,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,4 @@
|
|||||||
import {
|
import { Box, useMediaQuery, useTheme } from "@mui/material";
|
||||||
Box,
|
|
||||||
useMediaQuery,
|
|
||||||
useTheme,
|
|
||||||
} from "@mui/material";
|
|
||||||
import { updateQuiz, setCurrentStep } from "@root/quizes/actions";
|
import { updateQuiz, setCurrentStep } from "@root/quizes/actions";
|
||||||
import { useCurrentQuiz } from "@root/quizes/hooks";
|
import { useCurrentQuiz } from "@root/quizes/hooks";
|
||||||
import { useQuizStore } from "@root/quizes/store";
|
import { useQuizStore } from "@root/quizes/store";
|
||||||
|
|||||||
@ -450,7 +450,7 @@ export const uploadQuestionImage = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const imageId = values[0];
|
const imageId = values[0];
|
||||||
const imageUrl = `https://storage.yandexcloud.net/squizimages/${quizQid}/${imageId}`;
|
const imageUrl = `https://3c580be9-cf31f296-d055-49cf-b39e-30c7959dc17b.s3.timeweb.cloud/angesight/squizimages/${quizQid}/${imageId}`;
|
||||||
|
|
||||||
updateQuestion(questionId, (question) => {
|
updateQuestion(questionId, (question) => {
|
||||||
updateFn(question, imageUrl);
|
updateFn(question, imageUrl);
|
||||||
|
|||||||
@ -305,7 +305,7 @@ export const uploadQuizImage = async (
|
|||||||
updateQuiz(quizId, (quiz) => {
|
updateQuiz(quizId, (quiz) => {
|
||||||
updateFn(
|
updateFn(
|
||||||
quiz,
|
quiz,
|
||||||
`https://storage.yandexcloud.net/squizimages/${quiz.qid}/${imageId}`,
|
`https://3c580be9-cf31f296-d055-49cf-b39e-30c7959dc17b.s3.timeweb.cloud/angesight/squizimages/${quiz.qid}/${imageId}`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -98,7 +98,7 @@ export default function ChatDocument({
|
|||||||
</svg>
|
</svg>
|
||||||
<Link
|
<Link
|
||||||
download
|
download
|
||||||
href={`https://storage.yandexcloud.net/pair/${file}`}
|
href={`https://3c580be9-cf31f296-d055-49cf-b39e-30c7959dc17b.s3.timeweb.cloud/angesight/pair/${file}`}
|
||||||
style={{
|
style={{
|
||||||
color: "#7E2AEA",
|
color: "#7E2AEA",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
|||||||
@ -110,7 +110,7 @@ export default function ChatImage({
|
|||||||
height: "217px",
|
height: "217px",
|
||||||
width: "217px",
|
width: "217px",
|
||||||
}}
|
}}
|
||||||
src={`https://storage.yandexcloud.net/pair/${file}`}
|
src={`https://3c580be9-cf31f296-d055-49cf-b39e-30c7959dc17b.s3.timeweb.cloud/angesight/pair/${file}`}
|
||||||
/>
|
/>
|
||||||
</ButtonBase>
|
</ButtonBase>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export default function ChatImageNewWindow() {
|
|||||||
maxHeight: "100vh",
|
maxHeight: "100vh",
|
||||||
maxWidth: "100vw",
|
maxWidth: "100vw",
|
||||||
}}
|
}}
|
||||||
src={`https://storage.yandexcloud.net/pair/${srcImage}`}
|
src={`https://3c580be9-cf31f296-d055-49cf-b39e-30c7959dc17b.s3.timeweb.cloud/angesight/pair/${srcImage}`}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -113,7 +113,9 @@ export default function ChatImage({
|
|||||||
}}
|
}}
|
||||||
controls
|
controls
|
||||||
>
|
>
|
||||||
<source src={`https://storage.yandexcloud.net/pair/${file}`} />
|
<source
|
||||||
|
src={`https://3c580be9-cf31f296-d055-49cf-b39e-30c7959dc17b.s3.timeweb.cloud/angesight/pair/${file}`}
|
||||||
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@ -6,12 +6,18 @@ import {
|
|||||||
QuizType,
|
QuizType,
|
||||||
} from "@model/quizSettings";
|
} from "@model/quizSettings";
|
||||||
|
|
||||||
const ContactFormPage = lazy(() => import("../pages/ContactFormPage/ContactFormPage"));
|
const ContactFormPage = lazy(
|
||||||
|
() => import("../pages/ContactFormPage/ContactFormPage"),
|
||||||
|
);
|
||||||
const InstallQuiz = lazy(() => import("../pages/InstallQuiz/InstallQuiz"));
|
const InstallQuiz = lazy(() => import("../pages/InstallQuiz/InstallQuiz"));
|
||||||
const FormQuestionsPage = lazy(() => import("../pages/Questions/Form/FormQuestionsPage"));
|
const FormQuestionsPage = lazy(
|
||||||
|
() => import("../pages/Questions/Form/FormQuestionsPage"),
|
||||||
|
);
|
||||||
const QuestionsPage = lazy(() => import("../pages/Questions/QuestionsPage"));
|
const QuestionsPage = lazy(() => import("../pages/Questions/QuestionsPage"));
|
||||||
const ResultPage = lazy(() => import("../pages/ResultPage/ResultPage"));
|
const ResultPage = lazy(() => import("../pages/ResultPage/ResultPage"));
|
||||||
const StartPageSettings = lazy(() => import("../pages/startPage/StartPageSettings"));
|
const StartPageSettings = lazy(
|
||||||
|
() => import("../pages/startPage/StartPageSettings"),
|
||||||
|
);
|
||||||
const StepOne = lazy(() => import("../pages/startPage/stepOne"));
|
const StepOne = lazy(() => import("../pages/startPage/stepOne"));
|
||||||
const Steptwo = lazy(() => import("../pages/startPage/steptwo"));
|
const Steptwo = lazy(() => import("../pages/startPage/steptwo"));
|
||||||
|
|
||||||
@ -38,26 +44,56 @@ export default function SwitchStepPages({
|
|||||||
}: Props) {
|
}: Props) {
|
||||||
switch (activeStep) {
|
switch (activeStep) {
|
||||||
case 0: {
|
case 0: {
|
||||||
if (!quizType) return <LazyLoading><StepOne /></LazyLoading>;
|
if (!quizType)
|
||||||
if (!quizStartPageType) return <LazyLoading><Steptwo /></LazyLoading>;
|
return (
|
||||||
return <LazyLoading><StartPageSettings /></LazyLoading>;
|
<LazyLoading>
|
||||||
|
<StepOne />
|
||||||
|
</LazyLoading>
|
||||||
|
);
|
||||||
|
if (!quizStartPageType)
|
||||||
|
return (
|
||||||
|
<LazyLoading>
|
||||||
|
<Steptwo />
|
||||||
|
</LazyLoading>
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<LazyLoading>
|
||||||
|
<StartPageSettings />
|
||||||
|
</LazyLoading>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
return quizType === "form" ? (
|
return quizType === "form" ? (
|
||||||
<LazyLoading><FormQuestionsPage /></LazyLoading>
|
<LazyLoading>
|
||||||
|
<FormQuestionsPage />
|
||||||
|
</LazyLoading>
|
||||||
) : (
|
) : (
|
||||||
<LazyLoading><QuestionsPage
|
<LazyLoading>
|
||||||
openBranchingPage={openBranchingPage}
|
<QuestionsPage
|
||||||
setOpenBranchingPage={setOpenBranchingPage}
|
openBranchingPage={openBranchingPage}
|
||||||
widthMain={widthMain}
|
setOpenBranchingPage={setOpenBranchingPage}
|
||||||
/></LazyLoading>
|
widthMain={widthMain}
|
||||||
|
/>
|
||||||
|
</LazyLoading>
|
||||||
);
|
);
|
||||||
case 2:
|
case 2:
|
||||||
return <LazyLoading><ResultPage /></LazyLoading>;
|
return (
|
||||||
|
<LazyLoading>
|
||||||
|
<ResultPage />
|
||||||
|
</LazyLoading>
|
||||||
|
);
|
||||||
case 3:
|
case 3:
|
||||||
return <LazyLoading><ContactFormPage /></LazyLoading>;
|
return (
|
||||||
|
<LazyLoading>
|
||||||
|
<ContactFormPage />
|
||||||
|
</LazyLoading>
|
||||||
|
);
|
||||||
case 4:
|
case 4:
|
||||||
return <LazyLoading><InstallQuiz /></LazyLoading>;
|
return (
|
||||||
|
<LazyLoading>
|
||||||
|
<InstallQuiz />
|
||||||
|
</LazyLoading>
|
||||||
|
);
|
||||||
default:
|
default:
|
||||||
throw new Error(`Invalid quiz setup step: ${activeStep}`);
|
throw new Error(`Invalid quiz setup step: ${activeStep}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user