Начальное отображение
5
.dockerignore
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
/build
|
||||||
|
Makefile
|
||||||
|
README.md
|
||||||
|
compose.yml
|
||||||
|
/.git
|
38
.gitlab-ci.yml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
include:
|
||||||
|
- project: "devops/pena-continuous-integration"
|
||||||
|
file: "/templates/docker/build-template.gitlab-ci.yml"
|
||||||
|
- project: "devops/pena-continuous-integration"
|
||||||
|
file: "/templates/docker/clean-template.gitlab-ci.yml"
|
||||||
|
- project: "devops/pena-continuous-integration"
|
||||||
|
file: "/templates/docker/deploy-template.gitlab-ci.yml"
|
||||||
|
stages:
|
||||||
|
- clean
|
||||||
|
- build
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
clear-old-images:
|
||||||
|
extends: .clean_template
|
||||||
|
variables:
|
||||||
|
STAGING_BRANCH: "main"
|
||||||
|
PRODUCTION_BRANCH: "main"
|
||||||
|
image:
|
||||||
|
name: docker/compose:1.28.0
|
||||||
|
entrypoint: [""]
|
||||||
|
before_script:
|
||||||
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||||
|
- docker images
|
||||||
|
script:
|
||||||
|
- docker system prune -af
|
||||||
|
build-app:
|
||||||
|
extends: .build_template
|
||||||
|
variables:
|
||||||
|
DOCKER_BUILD_PATH: "./Dockerfile"
|
||||||
|
STAGING_BRANCH: "main"
|
||||||
|
PRODUCTION_BRANCH: "main"
|
||||||
|
|
||||||
|
deploy-to-staging:
|
||||||
|
extends: .deploy_template
|
||||||
|
variables:
|
||||||
|
DEPLOY_TO: "staging"
|
||||||
|
BRANCH: "main"
|
||||||
|
|
4
.vscode/settings.json
vendored
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"typescript.enablePromptUseWorkspaceTsdk": true,
|
|
||||||
"typescript.tsdk": "node_modules/typescript/lib"
|
|
||||||
}
|
|
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM node:20.10-alpine3.18 as build
|
||||||
|
|
||||||
|
RUN apk update && rm -rf /var/cache/apk/*
|
||||||
|
WORKDIR /usr/app
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN yarn install --ignore-scripts --non-interactive --frozen-lockfile && yarn cache clean
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
|
|
||||||
|
FROM nginx:latest as result
|
||||||
|
WORKDIR /usr/share/nginx/html
|
||||||
|
COPY --from=build /usr/app/build/ /usr/share/nginx/html
|
||||||
|
COPY hub.conf /etc/nginx/conf.d/default.conf
|
93
README.md
@ -1,93 +0,0 @@
|
|||||||
# SquzAnswerer
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Getting started
|
|
||||||
|
|
||||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
|
||||||
|
|
||||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
|
||||||
|
|
||||||
## Add your files
|
|
||||||
|
|
||||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
|
||||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd existing_repo
|
|
||||||
git remote add origin https://penahub.gitlab.yandexcloud.net/frontend/squzanswerer.git
|
|
||||||
git branch -M main
|
|
||||||
git push -uf origin main
|
|
||||||
```
|
|
||||||
|
|
||||||
## Integrate with your tools
|
|
||||||
|
|
||||||
- [ ] [Set up project integrations](https://penahub.gitlab.yandexcloud.net/frontend/squzanswerer/-/settings/integrations)
|
|
||||||
|
|
||||||
## Collaborate with your team
|
|
||||||
|
|
||||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
|
||||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
|
||||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
|
||||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
|
||||||
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
|
||||||
|
|
||||||
## Test and Deploy
|
|
||||||
|
|
||||||
Use the built-in continuous integration in GitLab.
|
|
||||||
|
|
||||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
|
||||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
|
||||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
|
||||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
|
||||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
# Editing this README
|
|
||||||
|
|
||||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
|
||||||
|
|
||||||
## Suggestions for a good README
|
|
||||||
|
|
||||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
|
||||||
|
|
||||||
## Name
|
|
||||||
Choose a self-explaining name for your project.
|
|
||||||
|
|
||||||
## Description
|
|
||||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
|
||||||
|
|
||||||
## Badges
|
|
||||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
|
||||||
|
|
||||||
## Visuals
|
|
||||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
|
||||||
|
|
||||||
## Support
|
|
||||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
|
||||||
|
|
||||||
## Roadmap
|
|
||||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
State if you are open to contributions and what your requirements are for accepting them.
|
|
||||||
|
|
||||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
|
||||||
|
|
||||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
|
||||||
|
|
||||||
## Authors and acknowledgment
|
|
||||||
Show your appreciation to those who have contributed to the project.
|
|
||||||
|
|
||||||
## License
|
|
||||||
For open source projects, say how it is licensed.
|
|
||||||
|
|
||||||
## Project status
|
|
||||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
|
0
craco.config.js
Normal file → Executable file
10
cypress.config.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { defineConfig } from "cypress";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
e2e: {
|
||||||
|
baseUrl: 'http://localhost:3000',
|
||||||
|
viewportWidth: 1440,
|
||||||
|
viewportHeight: 900,
|
||||||
|
supportFile: false,
|
||||||
|
},
|
||||||
|
});
|
13
deployments/staging/docker-compose.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
services:
|
||||||
|
squiz:
|
||||||
|
container_name: squiz
|
||||||
|
restart: unless-stopped
|
||||||
|
image: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
||||||
|
networks:
|
||||||
|
- marketplace_penahub_frontend
|
||||||
|
hostname: squiz
|
||||||
|
tty: true
|
||||||
|
networks:
|
||||||
|
marketplace_penahub_frontend:
|
||||||
|
external: true
|
||||||
|
|
12
hub.conf
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
64
package.json
Normal file → Executable file
@ -1,42 +1,43 @@
|
|||||||
{
|
{
|
||||||
"name": "squzanswerer",
|
"name": "squidward",
|
||||||
"version": "1.0.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": "git@penahub.gitlab.yandexcloud.net:frontend/squzanswerer.git",
|
|
||||||
"author": "ryletd",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@craco/craco": "^7.1.0",
|
"@craco/craco": "^7.0.0",
|
||||||
"@emotion/react": "^11.11.1",
|
"@emotion/react": "^11.10.5",
|
||||||
"@emotion/styled": "^11.11.0",
|
"@emotion/styled": "^11.10.5",
|
||||||
"@frontend/kitui": "^1.0.54",
|
"@frontend/kitui": "^1.0.54",
|
||||||
"@mui/icons-material": "^5.15.0",
|
"@mui/icons-material": "^5.10.14",
|
||||||
"@mui/material": "^5.15.0",
|
"@mui/material": "^5.10.14",
|
||||||
"@mui/x-date-pickers": "^6.18.4",
|
"@mui/x-date-pickers": "^6.16.1",
|
||||||
"axios": "^1.6.2",
|
"@types/node": "^16.7.13",
|
||||||
|
"@types/react": "^18.0.0",
|
||||||
|
"@types/react-dom": "^18.0.0",
|
||||||
|
"axios": "^1.5.1",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
|
"emoji-mart": "^5.5.2",
|
||||||
|
"formik": "^2.4.5",
|
||||||
|
"immer": "^10.0.3",
|
||||||
|
"nanoid": "^5.0.3",
|
||||||
"notistack": "^3.0.1",
|
"notistack": "^3.0.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-rnd": "^10.4.1",
|
"react-error-boundary": "^4.0.11",
|
||||||
"react-router-dom": "^6.21.0",
|
"react-router-dom": "^6.6.2",
|
||||||
"react-scripts": "^5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"swr": "^2.2.4",
|
"swr": "^2.2.4",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.2.2",
|
||||||
"use-debounce": "^10.0.0",
|
"use-debounce": "^9.0.4",
|
||||||
"zustand": "^4.4.7"
|
"web-vitals": "^2.1.0",
|
||||||
},
|
"yup": "^1.3.2",
|
||||||
"devDependencies": {
|
"zustand": "^4.3.8"
|
||||||
"@emoji-mart/data": "^1.1.2",
|
|
||||||
"@emoji-mart/react": "^1.1.1",
|
|
||||||
"@types/node": "^20.10.4",
|
|
||||||
"@types/react": "^18.2.45",
|
|
||||||
"@types/react-dom": "^18.2.18",
|
|
||||||
"craco-alias": "^3.0.1"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "craco start",
|
"start": "craco start",
|
||||||
"build": "craco build"
|
"build": "craco build",
|
||||||
|
"test": "craco test",
|
||||||
|
"eject": "craco eject",
|
||||||
|
"cypress:open": "cypress open"
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
"production": [
|
"production": [
|
||||||
@ -49,5 +50,14 @@
|
|||||||
"last 1 firefox version",
|
"last 1 firefox version",
|
||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@emoji-mart/data": "^1.1.2",
|
||||||
|
"@emoji-mart/react": "^1.1.1",
|
||||||
|
"@types/cytoscape-popper": "^2.0.4",
|
||||||
|
"@types/react-beautiful-dnd": "^13.1.4",
|
||||||
|
"@types/react-cytoscapejs": "^1.2.4",
|
||||||
|
"craco-alias": "^3.0.1",
|
||||||
|
"cypress": "^13.6.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
public/android-chrome-192x192.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
public/android-chrome-512x512.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
public/apple-touch-icon.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
9
public/browserconfig.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<browserconfig>
|
||||||
|
<msapplication>
|
||||||
|
<tile>
|
||||||
|
<square150x150logo src="/mstile-150x150.png"/>
|
||||||
|
<TileColor>#da532c</TileColor>
|
||||||
|
</tile>
|
||||||
|
</msapplication>
|
||||||
|
</browserconfig>
|
BIN
public/favicon-16x16.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
public/favicon-32x32.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
0
public/index.html
Normal file → Executable file
0
public/manifest.json
Normal file → Executable file
BIN
public/mstile-150x150.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
0
public/robots.txt
Normal file → Executable file
48
public/safari-pinned-tab.svg
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||||
|
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||||
|
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="576.000000pt" height="576.000000pt" viewBox="0 0 576.000000 576.000000"
|
||||||
|
preserveAspectRatio="xMidYMid meet">
|
||||||
|
<metadata>
|
||||||
|
Created by potrace 1.14, written by Peter Selinger 2001-2017
|
||||||
|
</metadata>
|
||||||
|
<g transform="translate(0.000000,576.000000) scale(0.100000,-0.100000)"
|
||||||
|
fill="#000000" stroke="none">
|
||||||
|
<path d="M1980 5475 c-206 -46 -387 -146 -578 -320 -83 -75 -199 -195 -272
|
||||||
|
-281 -48 -56 -136 -162 -155 -186 -39 -50 -211 -264 -215 -268 -4 -4 -155
|
||||||
|
-192 -188 -235 -19 -25 -131 -185 -164 -235 -46 -70 -131 -221 -161 -285 -37
|
||||||
|
-77 -75 -163 -85 -190 -6 -16 -17 -43 -23 -60 -7 -16 -13 -32 -14 -35 -2 -11
|
||||||
|
-27 -86 -32 -100 -3 -8 -8 -24 -10 -34 -2 -10 -12 -53 -23 -95 -10 -42 -21
|
||||||
|
-94 -25 -116 -3 -23 -8 -52 -10 -65 -28 -137 -27 -633 0 -798 3 -15 7 -43 10
|
||||||
|
-62 3 -19 8 -53 11 -75 7 -44 62 -265 76 -305 3 -8 16 -44 28 -80 107 -313
|
||||||
|
338 -619 641 -850 71 -55 243 -170 253 -170 3 0 28 -14 56 -30 28 -17 57 -30
|
||||||
|
65 -30 8 0 15 -4 15 -10 0 -5 9 -10 20 -10 11 0 20 -4 20 -9 0 -5 10 -11 23
|
||||||
|
-14 12 -3 65 -22 117 -42 136 -53 311 -95 465 -112 98 -11 321 -5 411 11 94
|
||||||
|
16 212 54 270 87 20 11 36 14 39 9 7 -12 684 -14 686 -2 1 4 2 169 2 368 l2
|
||||||
|
361 32 40 c87 106 95 114 117 107 12 -4 23 -10 26 -14 6 -8 147 -68 230 -98
|
||||||
|
323 -115 754 -107 1080 20 102 40 294 138 310 159 3 3 15 12 28 18 25 13 25
|
||||||
|
14 118 90 120 97 289 289 335 380 8 14 16 28 19 31 25 25 117 225 148 320 25
|
||||||
|
78 49 173 57 220 2 19 9 62 14 95 9 58 7 350 -3 407 -2 16 -7 47 -11 70 -21
|
||||||
|
133 -75 291 -151 443 -114 230 -275 416 -509 590 -84 62 -342 193 -359 182 -1
|
||||||
|
-1 -9 3 -17 10 -8 6 -41 19 -74 28 -185 51 -307 68 -485 67 -64 0 -131 -3
|
||||||
|
-150 -5 -19 -3 -57 -9 -85 -12 -39 -6 -225 -51 -280 -69 -43 -13 -187 -78
|
||||||
|
-231 -102 l-48 -27 -22 26 c-46 54 -154 244 -312 547 -94 181 -107 205 -114
|
||||||
|
208 -5 2 -8 8 -8 13 0 10 -79 140 -90 149 -4 3 -11 12 -16 21 -35 62 -167 197
|
||||||
|
-241 247 -72 48 -156 87 -208 98 -11 2 -31 7 -45 10 -55 14 -246 13 -310 -1z
|
||||||
|
m2295 -1799 c49 -5 125 -22 155 -34 8 -3 17 -6 20 -7 40 -14 157 -69 184 -87
|
||||||
|
202 -132 334 -305 395 -518 12 -41 26 -86 30 -100 8 -28 7 -276 -2 -325 -31
|
||||||
|
-171 -136 -372 -254 -488 -118 -116 -282 -209 -428 -243 -117 -27 -345 -37
|
||||||
|
-345 -15 0 5 44 35 98 66 96 58 322 203 332 214 3 3 28 24 55 45 75 59 176
|
||||||
|
165 220 231 40 61 88 174 100 235 9 46 10 187 2 225 -16 76 -20 90 -39 134
|
||||||
|
-42 94 -123 196 -223 281 -36 31 -184 134 -205 143 -8 4 -28 16 -45 26 -32 21
|
||||||
|
-153 88 -275 154 -41 22 -77 42 -79 44 -9 7 6 12 54 18 28 4 51 8 52 9 4 3
|
||||||
|
152 -3 198 -8z"/>
|
||||||
|
<path d="M3470 4818 c-28 -10 -80 -62 -81 -81 0 -7 -3 -24 -5 -39 -7 -40 19
|
||||||
|
-91 59 -122 28 -22 45 -27 79 -25 80 5 129 51 135 128 5 52 -18 98 -61 126
|
||||||
|
-30 20 -91 26 -126 13z"/>
|
||||||
|
<path d="M3759 967 c-149 -63 -230 -177 -232 -327 -2 -96 2 -114 36 -180 138
|
||||||
|
-265 520 -262 650 4 34 69 48 162 34 226 -28 127 -97 216 -207 267 -81 38
|
||||||
|
-204 43 -281 10z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.9 KiB |
39
src/App.tsx
@ -1,43 +1,10 @@
|
|||||||
import dayjs from "dayjs";
|
|
||||||
import "dayjs/locale/ru";
|
|
||||||
import { ViewPage } from "./pages/ViewPublicationPage";
|
import { ViewPage } from "./pages/ViewPublicationPage";
|
||||||
import { BrowserRouter, Route, Routes } from "react-router-dom";
|
|
||||||
import "./index.css";
|
|
||||||
|
|
||||||
import {
|
|
||||||
clearAuthToken,
|
|
||||||
getMessageFromFetchError,
|
|
||||||
useUserFetcher,
|
|
||||||
} from "@frontend/kitui";
|
|
||||||
import { clearUserData, setUser, useUserStore } from "@root/user";
|
|
||||||
import { enqueueSnackbar } from "notistack";
|
|
||||||
|
|
||||||
|
import dayjs from "dayjs";
|
||||||
dayjs.locale("ru");
|
dayjs.locale("ru");
|
||||||
|
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
const userId = useUserStore((state) => state.userId);
|
|
||||||
|
|
||||||
useUserFetcher({
|
return <ViewPage />;
|
||||||
url: `https://hub.pena.digital/user/${userId}`,
|
|
||||||
userId,
|
|
||||||
onNewUser: setUser,
|
|
||||||
onError: (error) => {
|
|
||||||
const errorMessage = getMessageFromFetchError(error);
|
|
||||||
if (errorMessage) {
|
|
||||||
enqueueSnackbar(errorMessage);
|
|
||||||
clearUserData();
|
|
||||||
clearAuthToken();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<BrowserRouter>
|
|
||||||
<Routes>
|
|
||||||
<Route path="/view" element={<ViewPage />} />
|
|
||||||
</Routes>
|
|
||||||
</BrowserRouter>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
import axios from "axios";
|
|
||||||
|
|
||||||
const domen = window.location.hostname === "localhost" ? "squiz.pena.digital" : window.location.hostname
|
|
||||||
|
|
||||||
export function sendContactFormRequest(body: {
|
|
||||||
|
|
||||||
contact: string;
|
|
||||||
whoami: string;
|
|
||||||
}) {
|
|
||||||
return axios(`https://${domen}/feedback/callme`, {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,71 +0,0 @@
|
|||||||
import { makeRequest } from "@frontend/kitui";
|
|
||||||
import { CreateQuestionRequest } from "model/question/create";
|
|
||||||
import { RawQuestion } from "model/question/question";
|
|
||||||
import { GetQuestionListRequest, GetQuestionListResponse } from "@model/question/getList";
|
|
||||||
import { EditQuestionRequest, EditQuestionResponse } from "@model/question/edit";
|
|
||||||
import { DeleteQuestionRequest, DeleteQuestionResponse } from "@model/question/delete";
|
|
||||||
import { CopyQuestionRequest, CopyQuestionResponse } from "@model/question/copy";
|
|
||||||
|
|
||||||
|
|
||||||
const baseUrl = process.env.NODE_ENV === "production" ? "/squiz" : "https://squiz.pena.digital/squiz";
|
|
||||||
|
|
||||||
function createQuestion(body: CreateQuestionRequest) {
|
|
||||||
return makeRequest<CreateQuestionRequest, RawQuestion>({
|
|
||||||
url: `${baseUrl}/question/create`,
|
|
||||||
body,
|
|
||||||
method: "POST",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getQuestionList(body?: Partial<GetQuestionListRequest>) {
|
|
||||||
console.log("body" , body)
|
|
||||||
if (!body?.quiz_id) return null;
|
|
||||||
|
|
||||||
const response = await makeRequest<GetQuestionListRequest, GetQuestionListResponse>({
|
|
||||||
url: `${baseUrl}/question/getList`,
|
|
||||||
body: { ...defaultGetQuestionListBody, ...body },
|
|
||||||
method: "POST",
|
|
||||||
});
|
|
||||||
|
|
||||||
return response.items;
|
|
||||||
}
|
|
||||||
|
|
||||||
function editQuestion(body: EditQuestionRequest, signal?: AbortSignal) {
|
|
||||||
return makeRequest<EditQuestionRequest, EditQuestionResponse>({
|
|
||||||
url: `${baseUrl}/question/edit`,
|
|
||||||
body,
|
|
||||||
method: "PATCH",
|
|
||||||
signal,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function copyQuestion(questionId: number, quizId: number) {
|
|
||||||
return makeRequest<CopyQuestionRequest, CopyQuestionResponse>({
|
|
||||||
url: `${baseUrl}/question/copy`,
|
|
||||||
body: { id: questionId, quiz_id: quizId },
|
|
||||||
method: "POST",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteQuestion(id: number) {
|
|
||||||
return makeRequest<DeleteQuestionRequest, DeleteQuestionResponse>({
|
|
||||||
url: `${baseUrl}/question/delete`,
|
|
||||||
body: { id },
|
|
||||||
method: "DELETE",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export const questionApi = {
|
|
||||||
create: createQuestion,
|
|
||||||
getList: getQuestionList,
|
|
||||||
edit: editQuestion,
|
|
||||||
copy: copyQuestion,
|
|
||||||
delete: deleteQuestion,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
const defaultGetQuestionListBody: GetQuestionListRequest = {
|
|
||||||
"limit": 100,
|
|
||||||
"offset": 0,
|
|
||||||
"type": "",
|
|
||||||
};
|
|
118
src/api/quiz.ts
@ -1,118 +0,0 @@
|
|||||||
import { makeRequest } from "@frontend/kitui";
|
|
||||||
import { defaultQuizConfig } from "@model/quizSettings";
|
|
||||||
import { CopyQuizRequest, CopyQuizResponse } from "model/quiz/copy";
|
|
||||||
import { CreateQuizRequest } from "model/quiz/create";
|
|
||||||
import { DeleteQuizRequest, DeleteQuizResponse } from "model/quiz/delete";
|
|
||||||
import { EditQuizRequest, EditQuizResponse } from "model/quiz/edit";
|
|
||||||
import { GetQuizRequest, GetQuizResponse } from "model/quiz/get";
|
|
||||||
import { GetQuizListRequest, GetQuizListResponse } from "model/quiz/getList";
|
|
||||||
import { RawQuiz } from "model/quiz/quiz";
|
|
||||||
|
|
||||||
|
|
||||||
const baseUrl = process.env.NODE_ENV === "production" ? "/squiz" : "https://squiz.pena.digital/squiz";
|
|
||||||
const imagesUrl = process.env.NODE_ENV === "production" ? "/squizstorer" : "https://squiz.pena.digital/squizstorer";
|
|
||||||
|
|
||||||
function createQuiz(body?: Partial<CreateQuizRequest>) {
|
|
||||||
return makeRequest<CreateQuizRequest, RawQuiz>({
|
|
||||||
url: `${baseUrl}/quiz/create`,
|
|
||||||
body: { ...defaultCreateQuizBody, ...body },
|
|
||||||
method: "POST",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getQuizList(body?: Partial<GetQuizListRequest>) {
|
|
||||||
const response = await makeRequest<GetQuizListRequest, GetQuizListResponse>({
|
|
||||||
url: `${baseUrl}/quiz/getList`,
|
|
||||||
body: { ...defaultGetQuizListBody, ...body },
|
|
||||||
method: "POST",
|
|
||||||
});
|
|
||||||
|
|
||||||
return response.items;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getQuiz(body?: Partial<GetQuizRequest>) {
|
|
||||||
return makeRequest<GetQuizRequest, GetQuizResponse>({
|
|
||||||
url: `${baseUrl}/quiz/get`,
|
|
||||||
body: { ...defaultGetQuizBody, ...body },
|
|
||||||
method: "GET",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function editQuiz(body: EditQuizRequest, signal?: AbortSignal) {
|
|
||||||
return makeRequest<EditQuizRequest, EditQuizResponse>({
|
|
||||||
url: `${baseUrl}/quiz/edit`,
|
|
||||||
body,
|
|
||||||
method: "PATCH",
|
|
||||||
signal,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function copyQuiz(id: number) {
|
|
||||||
return makeRequest<CopyQuizRequest, CopyQuizResponse>({
|
|
||||||
url: `${baseUrl}/quiz/copy`,
|
|
||||||
body: { id },
|
|
||||||
method: "POST",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteQuiz(id: number) {
|
|
||||||
return makeRequest<DeleteQuizRequest, DeleteQuizResponse>({
|
|
||||||
url: `${baseUrl}/quiz/delete`,
|
|
||||||
body: { id },
|
|
||||||
method: "DELETE",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function addQuizImages(quizId: number, image: Blob) {
|
|
||||||
const formData = new FormData();
|
|
||||||
|
|
||||||
formData.append("quiz", quizId.toString());
|
|
||||||
formData.append("image", image);
|
|
||||||
|
|
||||||
return makeRequest<FormData, { [key: string]: string; }>({
|
|
||||||
url: `${imagesUrl}/quiz/putImages`,
|
|
||||||
body: formData,
|
|
||||||
method: "PUT",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export const quizApi = {
|
|
||||||
create: createQuiz,
|
|
||||||
getList: getQuizList,
|
|
||||||
get: getQuiz,
|
|
||||||
edit: editQuiz,
|
|
||||||
copy: copyQuiz,
|
|
||||||
delete: deleteQuiz,
|
|
||||||
addImages: addQuizImages,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
const defaultCreateQuizBody: CreateQuizRequest = {
|
|
||||||
"fingerprinting": true,
|
|
||||||
"repeatable": true,
|
|
||||||
"note_prevented": true,
|
|
||||||
"mail_notifications": false,
|
|
||||||
"unique_answers": true,
|
|
||||||
"name": "",
|
|
||||||
"description": "",
|
|
||||||
"config": JSON.stringify(defaultQuizConfig),
|
|
||||||
"status": "stop",
|
|
||||||
"limit": 0,
|
|
||||||
"due_to": 0,
|
|
||||||
"time_of_passing": 0,
|
|
||||||
"pausable": false,
|
|
||||||
"super": false,
|
|
||||||
"group_id": 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
const defaultGetQuizBody: GetQuizRequest = {
|
|
||||||
"quiz_id": "string",
|
|
||||||
"limit": 0,
|
|
||||||
"page": 0,
|
|
||||||
"need_config": true,
|
|
||||||
};
|
|
||||||
|
|
||||||
const defaultGetQuizListBody: GetQuizListRequest = {
|
|
||||||
"limit": 100,
|
|
||||||
"offset": 0,
|
|
||||||
};
|
|
0
src/assets/card-1.png
Normal file → Executable file
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
0
src/assets/card-2.png
Normal file → Executable file
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
0
src/assets/card-3.png
Normal file → Executable file
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
0
src/assets/icons/AlignLeftIcon.tsx
Normal file → Executable file
0
src/assets/icons/AlignRightIcon.tsx
Normal file → Executable file
0
src/assets/icons/ArrowDownIcon.tsx
Normal file → Executable file
0
src/assets/icons/BackArrowIcon.tsx
Normal file → Executable file
0
src/assets/icons/ChartIcon.tsx
Normal file → Executable file
0
src/assets/icons/ChartPieIcon.tsx
Normal file → Executable file
0
src/assets/icons/CollapseMenuIcon.tsx
Normal file → Executable file
0
src/assets/icons/ContactBookIcon.tsx
Normal file → Executable file
0
src/assets/icons/ExpandIcon.tsx
Normal file → Executable file
0
src/assets/icons/EyeIcon.tsx
Normal file → Executable file
0
src/assets/icons/FlowArrowIcon.tsx
Normal file → Executable file
0
src/assets/icons/GearIcon.tsx
Normal file → Executable file
0
src/assets/icons/InfoIcon.tsx
Normal file → Executable file
0
src/assets/icons/LayoutCenteredIcon.tsx
Normal file → Executable file
0
src/assets/icons/LayoutExpandedIcon.tsx
Normal file → Executable file
0
src/assets/icons/LayoutIcon.tsx
Normal file → Executable file
0
src/assets/icons/LayoutIconBig.tsx
Normal file → Executable file
0
src/assets/icons/LayoutStandartIcon.tsx
Normal file → Executable file
0
src/assets/icons/LinkIcon.tsx
Normal file → Executable file
0
src/assets/icons/LogoutIcon.tsx
Normal file → Executable file
0
src/assets/icons/MegaphoneIcon.tsx
Normal file → Executable file
0
src/assets/icons/MobilePhoneIcon.tsx
Normal file → Executable file
0
src/assets/icons/PencilCircleIcon.tsx
Normal file → Executable file
0
src/assets/icons/PencilIcon.tsx
Normal file → Executable file
0
src/assets/icons/PuzzlePieceIcon.tsx
Normal file → Executable file
0
src/assets/icons/QuestionIcon.tsx
Normal file → Executable file
0
src/assets/icons/SearchIcon.tsx
Normal file → Executable file
0
src/assets/icons/SendIcon.tsx
Normal file → Executable file
0
src/assets/icons/TagIcon.tsx
Normal file → Executable file
0
src/assets/icons/UploadIcon.tsx
Normal file → Executable file
0
src/assets/icons/WalletIcon.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/CopyIcon.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/OneIcon.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/PointsIcon.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/addPlus.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/answer.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/arrowLeft.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/branching.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/clue.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/date.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/deleteIcon.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/download.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/drop_down.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/emoji.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/enterIcon.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/hideIcon.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/imgIcon.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/input.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/options_and_pict.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/options_pict.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/page.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/rating.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/settingIcon.tsx
Normal file → Executable file
0
src/assets/icons/questionsPage/slider.tsx
Normal file → Executable file
0
src/assets/quiz-creation-1.png
Normal file → Executable file
Before Width: | Height: | Size: 191 KiB After Width: | Height: | Size: 191 KiB |
0
src/assets/quiz-creation-2.png
Normal file → Executable file
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
0
src/assets/quiz-template-1.png
Normal file → Executable file
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 124 KiB |
0
src/assets/quiz-template-2.png
Normal file → Executable file
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
0
src/assets/quiz-template-3.png
Normal file → Executable file
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |
0
src/assets/quiz-template-4.png
Normal file → Executable file
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
0
src/assets/quiz-template-5.png
Normal file → Executable file
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 124 KiB |
0
src/assets/quiz-template-6.png
Normal file → Executable file
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
@ -1,29 +0,0 @@
|
|||||||
import type { QuizQuestionBase, QuestionBranchingRuleMain } from "../model/questionTypes/shared";
|
|
||||||
|
|
||||||
|
|
||||||
export const QUIZ_QUESTION_BASE: Omit<QuizQuestionBase, "id" | "backendId"> = {
|
|
||||||
quizId: 0,
|
|
||||||
description: "",
|
|
||||||
page: 0,
|
|
||||||
title: "",
|
|
||||||
expanded: true,
|
|
||||||
openedModalSettings: false,
|
|
||||||
deleted: false,
|
|
||||||
deleteTimeoutId: 0,
|
|
||||||
content: {
|
|
||||||
id: "",
|
|
||||||
hint: {
|
|
||||||
text: "",
|
|
||||||
video: "",
|
|
||||||
},
|
|
||||||
rule: {
|
|
||||||
children: [],
|
|
||||||
main: [] as QuestionBranchingRuleMain[],
|
|
||||||
parentId: "",
|
|
||||||
default: ""
|
|
||||||
},
|
|
||||||
back: "",
|
|
||||||
originalBack: "",
|
|
||||||
autofill: false,
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,16 +0,0 @@
|
|||||||
import { QUIZ_QUESTION_BASE } from "./base";
|
|
||||||
|
|
||||||
import type { QuizQuestionDate } from "../model/questionTypes/date";
|
|
||||||
|
|
||||||
export const QUIZ_QUESTION_DATE: Omit<QuizQuestionDate, "id" | "backendId"> = {
|
|
||||||
...QUIZ_QUESTION_BASE,
|
|
||||||
type: "date",
|
|
||||||
content: {
|
|
||||||
...QUIZ_QUESTION_BASE.content,
|
|
||||||
required: false,
|
|
||||||
innerNameCheck: false,
|
|
||||||
innerName: "",
|
|
||||||
dateRange: false,
|
|
||||||
time: false,
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,30 +0,0 @@
|
|||||||
import { QuestionType } from "@model/question/question";
|
|
||||||
import { AnyTypedQuizQuestion } from "@model/questionTypes/shared";
|
|
||||||
import { QUIZ_QUESTION_DATE } from "./date";
|
|
||||||
import { QUIZ_QUESTION_EMOJI } from "./emoji";
|
|
||||||
import { QUIZ_QUESTION_FILE } from "./file";
|
|
||||||
import { QUIZ_QUESTION_IMAGES } from "./images";
|
|
||||||
import { QUIZ_QUESTION_NUMBER } from "./number";
|
|
||||||
import { QUIZ_QUESTION_PAGE } from "./page";
|
|
||||||
import { QUIZ_QUESTION_RATING } from "./rating";
|
|
||||||
import { QUIZ_QUESTION_SELECT } from "./select";
|
|
||||||
import { QUIZ_QUESTION_TEXT } from "./text";
|
|
||||||
import { QUIZ_QUESTION_VARIANT } from "./variant";
|
|
||||||
import { QUIZ_QUESTION_VARIMG } from "./varimg";
|
|
||||||
import { QUIZ_QUESTION_RESULT } from "./result";
|
|
||||||
|
|
||||||
|
|
||||||
export const defaultQuestionByType: Record<QuestionType, Omit<AnyTypedQuizQuestion, "id" | "backendId">> = {
|
|
||||||
"date": QUIZ_QUESTION_DATE,
|
|
||||||
"emoji": QUIZ_QUESTION_EMOJI,
|
|
||||||
"file": QUIZ_QUESTION_FILE,
|
|
||||||
"images": QUIZ_QUESTION_IMAGES,
|
|
||||||
"number": QUIZ_QUESTION_NUMBER,
|
|
||||||
"page": QUIZ_QUESTION_PAGE,
|
|
||||||
"rating": QUIZ_QUESTION_RATING,
|
|
||||||
"select": QUIZ_QUESTION_SELECT,
|
|
||||||
"text": QUIZ_QUESTION_TEXT,
|
|
||||||
"variant": QUIZ_QUESTION_VARIANT,
|
|
||||||
"varimg": QUIZ_QUESTION_VARIMG,
|
|
||||||
"result": QUIZ_QUESTION_RESULT,
|
|
||||||
} as const;
|
|
@ -1,26 +0,0 @@
|
|||||||
import { QUIZ_QUESTION_BASE } from "./base";
|
|
||||||
|
|
||||||
import type { QuizQuestionEmoji } from "../model/questionTypes/emoji";
|
|
||||||
import { nanoid } from "nanoid";
|
|
||||||
|
|
||||||
export const QUIZ_QUESTION_EMOJI: Omit<QuizQuestionEmoji, "id" | "backendId"> = {
|
|
||||||
...QUIZ_QUESTION_BASE,
|
|
||||||
type: "emoji",
|
|
||||||
content: {
|
|
||||||
...QUIZ_QUESTION_BASE.content,
|
|
||||||
multi: false,
|
|
||||||
own: false,
|
|
||||||
innerNameCheck: false,
|
|
||||||
innerName: "",
|
|
||||||
required: false,
|
|
||||||
variants: [
|
|
||||||
{
|
|
||||||
id: nanoid(),
|
|
||||||
answer: "",
|
|
||||||
extendedText: "",
|
|
||||||
hints: "",
|
|
||||||
originalImageUrl: "",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,15 +0,0 @@
|
|||||||
import { QUIZ_QUESTION_BASE } from "./base";
|
|
||||||
|
|
||||||
import type { QuizQuestionFile } from "../model/questionTypes/file";
|
|
||||||
|
|
||||||
export const QUIZ_QUESTION_FILE: Omit<QuizQuestionFile, "id" | "backendId"> = {
|
|
||||||
...QUIZ_QUESTION_BASE,
|
|
||||||
type: "file",
|
|
||||||
content: {
|
|
||||||
...QUIZ_QUESTION_BASE.content,
|
|
||||||
required: false,
|
|
||||||
innerNameCheck: false,
|
|
||||||
innerName: "",
|
|
||||||
type: "picture",
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,30 +0,0 @@
|
|||||||
import { QUIZ_QUESTION_BASE } from "./base";
|
|
||||||
|
|
||||||
import type { QuizQuestionImages } from "../model/questionTypes/images";
|
|
||||||
import { nanoid } from "nanoid";
|
|
||||||
|
|
||||||
export const QUIZ_QUESTION_IMAGES: Omit<QuizQuestionImages, "id" | "backendId"> = {
|
|
||||||
...QUIZ_QUESTION_BASE,
|
|
||||||
type: "images",
|
|
||||||
content: {
|
|
||||||
...QUIZ_QUESTION_BASE.content,
|
|
||||||
own: false,
|
|
||||||
multi: false,
|
|
||||||
xy: "1:1",
|
|
||||||
innerNameCheck: false,
|
|
||||||
innerName: "",
|
|
||||||
large: false,
|
|
||||||
format: "carousel",
|
|
||||||
required: false,
|
|
||||||
variants: [
|
|
||||||
{
|
|
||||||
id: nanoid(),
|
|
||||||
answer: "",
|
|
||||||
extendedText: "",
|
|
||||||
originalImageUrl: "",
|
|
||||||
hints: ""
|
|
||||||
},
|
|
||||||
],
|
|
||||||
largeCheck: false,
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,21 +0,0 @@
|
|||||||
import { QUIZ_QUESTION_BASE } from "./base";
|
|
||||||
|
|
||||||
import type { QuizQuestionNumber } from "../model/questionTypes/number";
|
|
||||||
|
|
||||||
export const QUIZ_QUESTION_NUMBER: Omit<QuizQuestionNumber, "id" | "backendId"> = {
|
|
||||||
...QUIZ_QUESTION_BASE,
|
|
||||||
type: "number",
|
|
||||||
content: {
|
|
||||||
...QUIZ_QUESTION_BASE.content,
|
|
||||||
required: false,
|
|
||||||
innerNameCheck: false,
|
|
||||||
innerName: "",
|
|
||||||
range: "1—100",
|
|
||||||
defaultValue: 0,
|
|
||||||
step: 1,
|
|
||||||
steps: 5,
|
|
||||||
start: 50,
|
|
||||||
chooseRange: false,
|
|
||||||
form: "star",
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,17 +0,0 @@
|
|||||||
import { QUIZ_QUESTION_BASE } from "./base";
|
|
||||||
|
|
||||||
import type { QuizQuestionPage } from "../model/questionTypes/page";
|
|
||||||
|
|
||||||
export const QUIZ_QUESTION_PAGE: Omit<QuizQuestionPage, "id" | "backendId"> = {
|
|
||||||
...QUIZ_QUESTION_BASE,
|
|
||||||
type: "page",
|
|
||||||
content: {
|
|
||||||
...QUIZ_QUESTION_BASE.content,
|
|
||||||
innerNameCheck: false,
|
|
||||||
innerName: "",
|
|
||||||
text: "",
|
|
||||||
picture: "",
|
|
||||||
originalPicture: "",
|
|
||||||
video: "",
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,19 +0,0 @@
|
|||||||
import { QUIZ_QUESTION_BASE } from "./base";
|
|
||||||
|
|
||||||
import type { QuizQuestionRating } from "../model/questionTypes/rating";
|
|
||||||
|
|
||||||
export const QUIZ_QUESTION_RATING: Omit<QuizQuestionRating, "id" | "backendId"> = {
|
|
||||||
...QUIZ_QUESTION_BASE,
|
|
||||||
type: "rating",
|
|
||||||
content: {
|
|
||||||
...QUIZ_QUESTION_BASE.content,
|
|
||||||
required: false,
|
|
||||||
innerNameCheck: false,
|
|
||||||
innerName: "",
|
|
||||||
steps: 5,
|
|
||||||
ratingExpanded: false,
|
|
||||||
form: "star",
|
|
||||||
ratingNegativeDescription: "",
|
|
||||||
ratingPositiveDescription: "",
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,17 +0,0 @@
|
|||||||
import { QUIZ_QUESTION_BASE } from "./base";
|
|
||||||
|
|
||||||
import type { QuizQuestionResult } from "../model/questionTypes/result";
|
|
||||||
import { nanoid } from "nanoid";
|
|
||||||
|
|
||||||
export const QUIZ_QUESTION_RESULT: Omit<QuizQuestionResult, "id" | "backendId"> = {
|
|
||||||
...QUIZ_QUESTION_BASE,
|
|
||||||
type: "result",
|
|
||||||
content: {
|
|
||||||
...QUIZ_QUESTION_BASE.content,
|
|
||||||
video: "",
|
|
||||||
innerName: "",
|
|
||||||
text: "",
|
|
||||||
price: [0],
|
|
||||||
useImage: true
|
|
||||||
},
|
|
||||||
};
|
|