@equinor/subsurface-app-management 5.4.3 → 5.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/models/LinearScaleVm.d.ts +18 -0
- package/dist/api/models/MultipleChoiceVm.d.ts +8 -0
- package/dist/api/models/QuestionVm.d.ts +6 -16
- package/dist/api/models/UserSurveyVm.d.ts +1 -1
- package/dist/hooks/useActiveSurvey.d.ts +3 -8
- package/dist/hooks/useActiveSurvey.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type LinearScaleVm = {
|
|
2
|
+
/**
|
|
3
|
+
* Minimum value for LinearScale questions.
|
|
4
|
+
*/
|
|
5
|
+
minValue: number;
|
|
6
|
+
/**
|
|
7
|
+
* Maximum value for LinearScale questions.
|
|
8
|
+
*/
|
|
9
|
+
maxValue: number;
|
|
10
|
+
/**
|
|
11
|
+
* Label for the minimum value in LinearScale questions.
|
|
12
|
+
*/
|
|
13
|
+
minLabel: string;
|
|
14
|
+
/**
|
|
15
|
+
* Label for the maximum value in LinearScale questions.
|
|
16
|
+
*/
|
|
17
|
+
maxLabel: string;
|
|
18
|
+
};
|
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
import type { AnswerVm } from './AnswerVm';
|
|
2
|
+
import type { LinearScaleVm } from './LinearScaleVm';
|
|
3
|
+
import type { MultipleChoiceVm } from './MultipleChoiceVm';
|
|
2
4
|
import type { QuestionId } from './QuestionId';
|
|
3
|
-
import type { QuestionOptionDto } from './QuestionOptionDto';
|
|
4
5
|
import type { QuestionType } from './QuestionType';
|
|
5
6
|
export type QuestionVm = {
|
|
6
7
|
questionId: QuestionId;
|
|
7
8
|
type: QuestionType;
|
|
8
|
-
order: number;
|
|
9
9
|
/**
|
|
10
10
|
* The text answer provided for text questions.
|
|
11
|
-
* Only populated if the question type is Text.
|
|
12
|
-
*/
|
|
13
|
-
text: string;
|
|
14
|
-
/**
|
|
15
|
-
* The list of selected option IDs for choice questions.
|
|
16
|
-
* Only populated if the question type is MultipleChoice.
|
|
17
11
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
maxValue: number;
|
|
23
|
-
minLabel: string;
|
|
24
|
-
minValue: number;
|
|
25
|
-
};
|
|
12
|
+
questionText: string;
|
|
13
|
+
linearScaleVm?: LinearScaleVm;
|
|
14
|
+
multipleChoiceVm?: MultipleChoiceVm;
|
|
15
|
+
order: number;
|
|
26
16
|
answer?: AnswerVm;
|
|
27
17
|
};
|
|
@@ -2,7 +2,7 @@ import type { QuestionVm } from './QuestionVm';
|
|
|
2
2
|
import type { SurveyId } from './SurveyId';
|
|
3
3
|
import type { SurveyResponseId } from './SurveyResponseId';
|
|
4
4
|
import type { SurveyResponseStatus } from './SurveyResponseStatus';
|
|
5
|
-
import { SurveyType } from './SurveyType';
|
|
5
|
+
import type { SurveyType } from './SurveyType';
|
|
6
6
|
export type UserSurveyVm = {
|
|
7
7
|
surveyId: SurveyId;
|
|
8
8
|
surveyResponseId?: SurveyResponseId;
|
|
@@ -3,15 +3,10 @@ export declare function useActiveSurvey(): import("@tanstack/react-query").UseQu
|
|
|
3
3
|
options: import("../api").QuestionOptionDto[] | undefined;
|
|
4
4
|
questionId: import("../api").QuestionId;
|
|
5
5
|
type: import("../api").QuestionType;
|
|
6
|
+
questionText: string;
|
|
7
|
+
linearScaleVm?: import("../api/models/LinearScaleVm").LinearScaleVm;
|
|
8
|
+
multipleChoiceVm?: import("../api/models/MultipleChoiceVm").MultipleChoiceVm;
|
|
6
9
|
order: number;
|
|
7
|
-
text: string;
|
|
8
|
-
maxSelections?: number | null;
|
|
9
|
-
linearScaleVm?: {
|
|
10
|
-
maxLabel: string;
|
|
11
|
-
maxValue: number;
|
|
12
|
-
minLabel: string;
|
|
13
|
-
minValue: number;
|
|
14
|
-
};
|
|
15
10
|
answer?: import("../api").AnswerVm;
|
|
16
11
|
}[];
|
|
17
12
|
surveyId: import("../api").SurveyId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useQuery as e}from"@tanstack/react-query";import"../api/core/OpenAPI.js";import"../api/models/ApplicationCategory.js";import"../api/models/ServiceNowUrgency.js";import"../api/models/TutorialPosition.js";import"../api/models/QuestionType.js";import"../api/models/SurveyType.js";import"../api/models/SurveyResponseStatus.js";import"../api/models/WorkItemType.js";import"../api/models/BugSeverity.js";import"../api/models/SamWorkItemState.js";import"../types/Environment.js";import"../types/ReleaseNotes.js";import{SurveysPublicService as o}from"../api/services/SurveysPublicService.js";import{GET_SURVEY_FOR_APP as
|
|
1
|
+
import{useQuery as e}from"@tanstack/react-query";import"../api/core/OpenAPI.js";import"../api/models/ApplicationCategory.js";import"../api/models/ServiceNowUrgency.js";import"../api/models/TutorialPosition.js";import"../api/models/QuestionType.js";import"../api/models/SurveyType.js";import"../api/models/SurveyResponseStatus.js";import"../api/models/WorkItemType.js";import"../api/models/BugSeverity.js";import"../api/models/SamWorkItemState.js";import"../types/Environment.js";import"../types/ReleaseNotes.js";import{SurveysPublicService as o}from"../api/services/SurveysPublicService.js";import{GET_SURVEY_FOR_APP as t}from"../constants/queryKeys.js";import{getAppName as r}from"../utils/environment.js";function i(){return e({queryKey:[t],queryFn:()=>o.getActiveSurveyForApplication(r(import.meta.env.VITE_NAME)),select:e=>null===e?null:{...e,questions:e.questions.toSorted(((e,o)=>e.order-o.order)).map((e=>({...e,options:e.multipleChoiceVm?.options.toSorted(((e,o)=>e.order-o.order))})))}})}export{i as useActiveSurvey};
|