-
Notifications
You must be signed in to change notification settings - Fork 0
frontend-backend integration #12
Description
Requested Changes
We need to make frontend interact with backend. In this issue @SixDevelop you will find issues that should be solved for frontend.
Implementation Details
- add question type picking
Currently we have the following input types stored as enum in
ShortText = 0
LongText = 1
Email = ...
PhoneNumber
Label // forbidden
Integer
Decimal
Financial
MultipleChoiceOptionList // forbidden
SingleOptionSelect // forbidden
Boolean
I suggest hard coding this value to drop down select menu
- report template question entity lacks order
when sending information about report template do not forget to include order field to question. Currently you send only this information:
{
"id": "",
"title": "report title",
"questionnaires": [
{
"title": "Модуль 1",
"order": 0,
"sections": [
{
"title": "1 секция",
"order": 1,
"questions": [
{ "questionText": "1 вопрос", "inputType": 1 },
{ "questionText": "Новый вопрос", "inputType": 1 }
]
}
]
}
],
"tables": []
}which lack order field in each entity in array of questions. It may seem that this can be omitted but it does make a difference in future.
Possibly core changes should be made there:
focus-frontend/focus-frontend/src/app/create-report/module/module.component.ts
Lines 25 to 30 in 34d112c
| questions:[ | |
| { | |
| questionText: "1 вопрос", | |
| inputType: this.types[0], | |
| } | |
| ] |
and code responsible for creating new questions.
Also it might be easy to ignore this data at first and only generate when you push this to the server just before POST request.
Additional Info
Better ask questions in comments under this issue