Skip to content

Commit

Permalink
Add missing field costInUsd and remove last 3 tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaKhatri committed Jan 25, 2024
1 parent 57165cd commit b7f8253
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions app/gqlFragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ export const ASSESSMENT_REGISTRY_FRAGMENT = gql`
bgPreparedness
clientId
confidentiality
costEstimatesUsd
coordinatedJoint
dataCollectionEndDate
dataCollectionStartDate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ interface MethodologyType {
description?: string | null;
}[] | null;
value: {
adminLevelId: number
geoArea: number;
adminLevelId: string;
geoArea: string;
count: number;
region: number;
region: string;
dataCollectionTechnique?: AssessmentRegistryDataCollectionTechniqueTypeEnum;
samplingApproach?: AssessmentRegistrySamplingApproachTypeEnum;
unitOfAnanlysis?: AssessmentRegistryUnitOfAnalysisTypeEnum;
Expand Down Expand Up @@ -238,7 +238,7 @@ function GeographicalAreaMethodology(props: Props) {
const attributeValue = methodologyDataMap[category].value?.filter(
(technique) => technique.dataCollectionTechnique === subCategory,
)?.map((selection) => ({
id: selection.geoArea,
id: Number(selection.geoArea),
value: selection.count,
}));

Expand All @@ -248,7 +248,7 @@ function GeographicalAreaMethodology(props: Props) {
const attributeValue = methodologyDataMap[category].value?.filter(
(technique) => technique.samplingApproach === subCategory,
)?.map((selection) => ({
id: selection.geoArea,
id: Number(selection.geoArea),
value: selection.count,
}));
return attributeValue;
Expand All @@ -257,7 +257,7 @@ function GeographicalAreaMethodology(props: Props) {
const attributeValue = methodologyDataMap[category].value?.filter(
(technique) => technique.unitOfAnanlysis === subCategory,
)?.map((selection) => ({
id: selection.geoArea,
id: Number(selection.geoArea),
value: selection.count,
}));
return attributeValue;
Expand All @@ -266,7 +266,7 @@ function GeographicalAreaMethodology(props: Props) {
const attributeValue = methodologyDataMap[category].value?.filter(
(technique) => technique.unitOfReporting === subCategory,
)?.map((selection) => ({
id: selection.geoArea,
id: Number(selection.geoArea),
value: selection.count,
}));
return attributeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function GeographicalAreaQualityScore(props: Props) {
const assessmentCountAttribute = useMemo(() => (
data?.medianQualityScoreByGeoArea?.map(
(selection) => ({
id: selection.geoArea,
id: Number(selection.geoArea),
value: selection.finalScore,
}),
) ?? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function GeographicalAreaAssessments(props: Props) {
const assessmentCountAttribute = useMemo(() => (
data?.assessmentGeographicAreas?.map(
(selection) => ({
id: selection.geoArea,
id: Number(selection.geoArea),
value: selection.count,
}),
) ?? []
Expand Down
2 changes: 2 additions & 0 deletions app/views/AryDashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ function AryDashboard(props: Props) {
>
How was it assessed?
</Tab>
{/*
<Tab
name="quality"
transparentBorder
Expand All @@ -416,6 +417,7 @@ function AryDashboard(props: Props) {
>
What are the main findings?
</Tab>
*/}
</TabList>
<TabPanel
name="what"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ function MetadataForm(props: Props) {
labelSelector={enumLabelSelector}
options={coordinationJointOptions}
/>
<NumberInput
label="Cost Estimates in USD"
name="costEstimatesUsd"
value={value.costEstimatesUsd}
onChange={setFieldValue}
error={error?.costEstimatesUsd}
/>
</div>
</div>
<div className={styles.formElement}>
Expand Down
1 change: 1 addition & 0 deletions app/views/EditAry/AssessmentRegistryForm/formSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const schema: FormSchema = {
confidentiality: [requiredCondition],
language: [requiredCondition],
noOfPages: [],
costEstimatesUsd: [],
dataCollectionStartDate: [],
dataCollectionEndDate: [],
publicationDate: [],
Expand Down
1 change: 1 addition & 0 deletions app/views/EditAry/AssessmentRegistryForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const fieldsInMetadata: { [key in keyof PartialFormType]?: true } = {
dataCollectionEndDate: true,
publicationDate: true,
stakeholders: true,
costEstimatesUsd: true,
};

const fieldsInAdditionalDocuments: { [key in keyof PartialFormType]?: true } = {
Expand Down

0 comments on commit b7f8253

Please sign in to comment.