(
+ RANK_CHOICES,
+ {
+ skip: isNotDefined(rankChoicesVariables),
+ variables: rankChoicesVariables,
+ },
+ );
+
+ const choices = optionsListResponse?.private?.projectScope?.choiceCollection?.choices ?? [];
+
+ const rankChoiceRendererParams = useCallback((_: string, datum: ChoiceType) => ({
+ title: datum.label,
+ }), []);
+
return (
+ }
+ iconsContainerClassName={styles.icon}
+ >
+
+
);
}
diff --git a/src/components/questionPreviews/SelectMultipleQuestionPreview/index.module.css b/src/components/questionPreviews/SelectMultipleQuestionPreview/index.module.css
index 2f92235..dd06007 100644
--- a/src/components/questionPreviews/SelectMultipleQuestionPreview/index.module.css
+++ b/src/components/questionPreviews/SelectMultipleQuestionPreview/index.module.css
@@ -1,7 +1,6 @@
.preview {
display: flex;
flex-direction: column;
- padding: var(--dui-spacing-extra-large) var(--dui-spacing-large);
gap: var(--dui-spacing-medium);
.checkbox-list {
diff --git a/src/components/questionPreviews/SelectOneQuestionPreview/index.module.css b/src/components/questionPreviews/SelectOneQuestionPreview/index.module.css
index 8a243df..8ab04d5 100644
--- a/src/components/questionPreviews/SelectOneQuestionPreview/index.module.css
+++ b/src/components/questionPreviews/SelectOneQuestionPreview/index.module.css
@@ -1,7 +1,6 @@
.preview {
display: flex;
flex-direction: column;
- padding: var(--dui-spacing-extra-large) var(--dui-spacing-large);
gap: var(--dui-spacing-medium);
.question-list {
diff --git a/src/components/questionPreviews/TextQuestionPreview/index.module.css b/src/components/questionPreviews/TextQuestionPreview/index.module.css
index ec321db..cd5f931 100644
--- a/src/components/questionPreviews/TextQuestionPreview/index.module.css
+++ b/src/components/questionPreviews/TextQuestionPreview/index.module.css
@@ -1,6 +1,5 @@
.preview {
display: flex;
flex-direction: column;
- padding: var(--dui-spacing-extra-large) var(--dui-spacing-large);
gap: var(--dui-spacing-medium);
}
diff --git a/src/components/questionPreviews/TimeQuestionPreview/index.module.css b/src/components/questionPreviews/TimeQuestionPreview/index.module.css
index ec321db..cd5f931 100644
--- a/src/components/questionPreviews/TimeQuestionPreview/index.module.css
+++ b/src/components/questionPreviews/TimeQuestionPreview/index.module.css
@@ -1,6 +1,5 @@
.preview {
display: flex;
flex-direction: column;
- padding: var(--dui-spacing-extra-large) var(--dui-spacing-large);
gap: var(--dui-spacing-medium);
}
diff --git a/src/views/QuestionnaireEdit/DateQuestionForm/index.module.css b/src/views/QuestionnaireEdit/DateQuestionForm/index.module.css
index 77597e1..249c579 100644
--- a/src/views/QuestionnaireEdit/DateQuestionForm/index.module.css
+++ b/src/views/QuestionnaireEdit/DateQuestionForm/index.module.css
@@ -6,6 +6,7 @@
.preview {
border: var(--dui-width-separator-thin) solid var(--dui-color-separator);
border-radius: var(--dui-border-radius-card);
+ padding: var(--dui-spacing-extra-large);
}
.edit-section {
display: flex;
diff --git a/src/views/QuestionnaireEdit/FileQuestionForm/index.module.css b/src/views/QuestionnaireEdit/FileQuestionForm/index.module.css
index 88a597a..97261c0 100644
--- a/src/views/QuestionnaireEdit/FileQuestionForm/index.module.css
+++ b/src/views/QuestionnaireEdit/FileQuestionForm/index.module.css
@@ -6,6 +6,7 @@
.preview {
border: var(--dui-width-separator-thin) solid var(--dui-color-separator);
border-radius: var(--dui-border-radius-card);
+ padding: var(--dui-spacing-extra-large);
}
.edit-section {
diff --git a/src/views/QuestionnaireEdit/ImageQuestionForm/index.module.css b/src/views/QuestionnaireEdit/ImageQuestionForm/index.module.css
index 88a597a..97261c0 100644
--- a/src/views/QuestionnaireEdit/ImageQuestionForm/index.module.css
+++ b/src/views/QuestionnaireEdit/ImageQuestionForm/index.module.css
@@ -6,6 +6,7 @@
.preview {
border: var(--dui-width-separator-thin) solid var(--dui-color-separator);
border-radius: var(--dui-border-radius-card);
+ padding: var(--dui-spacing-extra-large);
}
.edit-section {
diff --git a/src/views/QuestionnaireEdit/IntegerQuestionForm/index.module.css b/src/views/QuestionnaireEdit/IntegerQuestionForm/index.module.css
index 77597e1..249c579 100644
--- a/src/views/QuestionnaireEdit/IntegerQuestionForm/index.module.css
+++ b/src/views/QuestionnaireEdit/IntegerQuestionForm/index.module.css
@@ -6,6 +6,7 @@
.preview {
border: var(--dui-width-separator-thin) solid var(--dui-color-separator);
border-radius: var(--dui-border-radius-card);
+ padding: var(--dui-spacing-extra-large);
}
.edit-section {
display: flex;
diff --git a/src/views/QuestionnaireEdit/NoteQuestionForm/index.module.css b/src/views/QuestionnaireEdit/NoteQuestionForm/index.module.css
index 88a597a..97261c0 100644
--- a/src/views/QuestionnaireEdit/NoteQuestionForm/index.module.css
+++ b/src/views/QuestionnaireEdit/NoteQuestionForm/index.module.css
@@ -6,6 +6,7 @@
.preview {
border: var(--dui-width-separator-thin) solid var(--dui-color-separator);
border-radius: var(--dui-border-radius-card);
+ padding: var(--dui-spacing-extra-large);
}
.edit-section {
diff --git a/src/views/QuestionnaireEdit/QuestionPreview/index.module.css b/src/views/QuestionnaireEdit/QuestionPreview/index.module.css
index c8f3629..e9520e4 100644
--- a/src/views/QuestionnaireEdit/QuestionPreview/index.module.css
+++ b/src/views/QuestionnaireEdit/QuestionPreview/index.module.css
@@ -1,15 +1,18 @@
.preview {
+ --input-width: 35rem;
border: none !important;
background-color: var(--dui-color-background);
overflow-y: auto;
gap: var(--dui-spacing-large);
.question-wrapper {
- padding: var(--dui-spacing-medium);
+ align-items: flex-start;
+ padding: var(--dui-spacing-extra-large);
+ gap: var(--dui-spacing-extra-large);
}
.question-item {
flex-grow: 1;
- padding: var(--dui-spacing-extra-large);
+ max-width: var(--input-width);
}
}
diff --git a/src/views/QuestionnaireEdit/QuestionPreview/index.tsx b/src/views/QuestionnaireEdit/QuestionPreview/index.tsx
index 8f78eb7..3fc08dc 100644
--- a/src/views/QuestionnaireEdit/QuestionPreview/index.tsx
+++ b/src/views/QuestionnaireEdit/QuestionPreview/index.tsx
@@ -5,10 +5,12 @@ import {
import {
isNotDefined,
isDefined,
+ noOp,
} from '@togglecorp/fujs';
import {
TabPanel,
Element,
+ Checkbox,
QuickActionDropdownMenu,
DropdownMenuItem,
} from '@the-deep/deep-ui';
@@ -70,6 +72,14 @@ function QuestionPreview(props: QuestionProps) {
>
+ )}
actions={(
}
@@ -98,11 +108,13 @@ function QuestionPreview(props: QuestionProps) {
hint={question.hint}
/>
)}
- {(question.type === 'RANK') && (
+ {(question.type === 'RANK') && isDefined(projectId) && (
)}
{(question.type === 'DATE') && (
diff --git a/src/views/QuestionnaireEdit/RankQuestionForm/index.module.css b/src/views/QuestionnaireEdit/RankQuestionForm/index.module.css
index 88a597a..97261c0 100644
--- a/src/views/QuestionnaireEdit/RankQuestionForm/index.module.css
+++ b/src/views/QuestionnaireEdit/RankQuestionForm/index.module.css
@@ -6,6 +6,7 @@
.preview {
border: var(--dui-width-separator-thin) solid var(--dui-color-separator);
border-radius: var(--dui-border-radius-card);
+ padding: var(--dui-spacing-extra-large);
}
.edit-section {
diff --git a/src/views/QuestionnaireEdit/RankQuestionForm/index.tsx b/src/views/QuestionnaireEdit/RankQuestionForm/index.tsx
index fa3e42e..d6550c5 100644
--- a/src/views/QuestionnaireEdit/RankQuestionForm/index.tsx
+++ b/src/views/QuestionnaireEdit/RankQuestionForm/index.tsx
@@ -33,8 +33,9 @@ import {
QuestionUpdateInput,
QuestionTypeEnum,
} from '#generated/types';
-import TextQuestionPreview from '#components/questionPreviews/TextQuestionPreview';
+import RankQuestionPreview from '#components/questionPreviews/RankQuestionPreview';
import PillarSelectInput from '#components/PillarSelectInput';
+import ChoiceCollectionSelectInput from '#components/ChoiceCollectionSelectInput';
import {
QUESTION_FRAGMENT,
@@ -110,6 +111,10 @@ const schema: FormSchema = {
required: true,
requiredValidation: requiredStringCondition,
},
+ choiceCollection: {
+ required: true,
+ requiredValidation: requiredStringCondition,
+ },
group: {
required: true,
requiredValidation: requiredStringCondition,
@@ -179,6 +184,7 @@ function RankQuestionForm(props: Props) {
label: questionResponse?.label,
group: questionResponse?.groupId,
hint: questionResponse?.hint,
+ choiceCollection: questionResponse?.choiceCollection?.id,
});
},
},
@@ -284,10 +290,12 @@ function RankQuestionForm(props: Props) {
return (