Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable questionnaire export #53

Merged
merged 3 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions src/components/EditQuestionnaireModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import {
QuestionnaireCreateInput,
QuestionnaireMetadataQuery,
QuestionnaireMetadataQueryVariables,
QuestionnarePriorityLevelTypeEnum,
QuestionnareEnumeratorSkillTypeEnum,
QuestionnareDataCollectionMethodTypeEnum,
QuestionnairePriorityLevelTypeEnum,
QuestionnaireEnumeratorSkillTypeEnum,
QuestionnaireDataCollectionMethodTypeEnum,
} from '#generated/types';

import {
Expand Down Expand Up @@ -105,19 +105,19 @@ const QUESTIONNAIRE_DETAIL = gql`

const QUESTIONNAIRE_METADATA = gql`
query QuestionnaireMetadata {
questionnarePriorityLevelTypeOptions: __type(name: "QuestionnarePriorityLevelTypeEnum") {
questionnairePriorityLevelTypeOptions: __type(name: "QuestionnairePriorityLevelTypeEnum") {
enumValues {
name
description
}
}
questionnareEnumeratorSkillTypeOptions: __type(name: "QuestionnareEnumeratorSkillTypeEnum") {
questionnaireEnumeratorSkillTypeOptions: __type(name: "QuestionnaireEnumeratorSkillTypeEnum") {
enumValues {
name
description
}
}
questionnareDataCollectionMethodTypeOptions: __type(name: "QuestionnareDataCollectionMethodTypeEnum") {
questionnaireDataCollectionMethodTypeOptions: __type(name: "QuestionnaireDataCollectionMethodTypeEnum") {
enumValues {
name
description
Expand Down Expand Up @@ -213,11 +213,12 @@ function EditQuestionnaireModal(props: Props) {
QUESTIONNAIRE_METADATA,
);

const priorityLevelOptions = metadataResponse?.questionnarePriorityLevelTypeOptions?.enumValues;
const priorityLevelOptions = metadataResponse
?.questionnairePriorityLevelTypeOptions?.enumValues;
const enumeratorSkillOptions = metadataResponse
?.questionnareEnumeratorSkillTypeOptions?.enumValues;
?.questionnaireEnumeratorSkillTypeOptions?.enumValues;
const dataCollectionMethods = metadataResponse
?.questionnareDataCollectionMethodTypeOptions?.enumValues;
?.questionnaireDataCollectionMethodTypeOptions?.enumValues;

const [
triggerQuestionnaireCreate,
Expand Down Expand Up @@ -360,7 +361,7 @@ function EditQuestionnaireModal(props: Props) {
onChange={setFieldValue}
value={formValue?.priorityLevel}
error={fieldError?.priorityLevel}
options={priorityLevelOptions as EnumOptions<QuestionnarePriorityLevelTypeEnum>}
options={priorityLevelOptions as EnumOptions<QuestionnairePriorityLevelTypeEnum>}
keySelector={enumKeySelector}
labelSelector={enumLabelSelector}
/>
Expand All @@ -370,7 +371,9 @@ function EditQuestionnaireModal(props: Props) {
onChange={setFieldValue}
value={formValue?.enumeratorSkill}
error={fieldError?.enumeratorSkill}
options={enumeratorSkillOptions as EnumOptions<QuestionnareEnumeratorSkillTypeEnum>}
options={
enumeratorSkillOptions as EnumOptions<QuestionnaireEnumeratorSkillTypeEnum>
}
keySelector={enumKeySelector}
labelSelector={enumLabelSelector}
/>
Expand All @@ -381,7 +384,7 @@ function EditQuestionnaireModal(props: Props) {
value={formValue?.dataCollectionMethod}
error={fieldError?.dataCollectionMethod}
options={
dataCollectionMethods as EnumOptions<QuestionnareDataCollectionMethodTypeEnum>
dataCollectionMethods as EnumOptions<QuestionnaireDataCollectionMethodTypeEnum>
}
keySelector={enumKeySelector}
labelSelector={enumLabelSelector}
Expand Down
16 changes: 8 additions & 8 deletions src/views/About/index.module.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.about {
display: flex;
flex-direction: column;
overflow-y: auto;
height: 100vh;
overflow-y: auto;
--color-headers: var(--dui-color-secondary);
--color-cells: #dad4f1;

Expand Down Expand Up @@ -32,12 +32,12 @@
gap: var(--dui-spacing-small);

.parent {
border: var(--dui-color-separator) solid var(--dui-width-separator-thin);
background-color: #f5f5f5;
padding: var(--dui-spacing-medium);
width: 100%;
text-align: center;
font-weight: var(--dui-font-weight-bold);
background-color: #f5f5f5;
border: var(--dui-color-separator) solid var(--dui-width-separator-thin);
}
.sub-pillars{
display: flex;
Expand All @@ -58,10 +58,10 @@
}

.cell-header {
border: var(--dui-color-separator) solid var(--dui-width-separator-thin);
background-color: #f5f5f5;
padding: 0 var(--dui-spacing-medium);
font-weight: var(--dui-font-weight-bold);
background-color: #f5f5f5;
border: var(--dui-color-separator) solid var(--dui-width-separator-thin);
}

.cell {
Expand All @@ -75,10 +75,10 @@
flex-grow: 1;
border: none;
border-radius: 0;
text-align: center;
background-color: var(--color-cells);
color: var(--dui-color-primary);
min-height: 1.6rem;
text-align: center;
color: var(--dui-color-primary);

>* {
justify-content: center;
Expand All @@ -91,8 +91,8 @@
display: flex;
flex-direction: column;
flex-shrink: 0;
background-color: #fafafa;
border: var(--dui-width-separator-thin) solid var(--dui-color-separator);
background-color: #fafafa;
padding: var(--dui-spacing-large) var(--dui-spacing-extra-large);
width: 30vw;
max-width: 30rem;
Expand Down
15 changes: 15 additions & 0 deletions src/views/Home/QuestionnaireItem/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,18 @@
width: 100%;
}
}
.modal-body{
display: flex;
flex-direction: column;
justify-content: space-between;
gap: var(--dui-spacing-medium);

.buttons {
display: flex;
gap: var(--dui-spacing-medium);
}

.iframe {
flex-grow: 1;
}
}
Loading