Skip to content

Commit

Permalink
Merge branch 'staging' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
German Martinez committed Nov 12, 2024
2 parents e0abc18 + cdc51db commit ebbf218
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 16 deletions.
1 change: 1 addition & 0 deletions onecgiar-pr-server/src/api/m-qap/dtos/m-qap.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export class MQAPResultDto {
repo: string;
'Geographic location': CgRegion | CgRegion[];
agrovoc_keywords: AgrovocKeywords;
'AGROVOC Keywords': AgrovocKeywords;
Commodities: string[];
handle_altmetric: AltmetricData;
DOI_Info: DOIInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export class ResultsKnowledgeProductMapper {
return author;
});

const keywords = dto?.agrovoc_keywords?.results;
const keywords =
dto?.agrovoc_keywords?.results ?? dto?.['AGROVOC Keywords'].results ?? [];
knowledgeProductDto.keywords = (keywords ?? [])
.filter((k) => !k.is_agrovoc)
.map((k) => k.keyword);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,15 @@ export class resultValidationRepository
AND (
SELECT
CASE
WHEN (
SELECT COUNT(*)
FROM result_answers ra
LEFT JOIN result_questions rq345 on ra.result_question_id = rq345.result_question_id
WHERE ra.result_id = r.id
AND rq345.parent_question_id IN (2, 3)
AND ra.result_question_id NOT IN (4,8)
AND ra.answer_boolean = TRUE
) > 0 THEN 1
WHEN (
SELECT COUNT(*)
FROM result_answers ra
Expand Down Expand Up @@ -1404,21 +1413,39 @@ export class resultValidationRepository
)
AND (
SELECT
COUNT(*)
FROM
result_answers ra
LEFT JOIN result_questions rq ON rq.result_question_id = ra.result_question_id
WHERE
ra.result_id = r.id
AND ra.result_question_id = 47
AND (
coalesce(ra.answer_boolean, 0) = 0
OR(
ra.answer_boolean = TRUE
AND COALESCE(TRIM(ra.answer_text), '') <> ''
)
)
) > 0
CASE
WHEN (
SELECT
COUNT(*)
FROM
result_answers ra
LEFT JOIN result_questions rq ON rq.result_question_id = ra.result_question_id
WHERE
ra.result_id = r.id
AND rq.parent_question_id = 38
AND ra.answer_boolean = TRUE
AND ra.result_question_id <> 39
) > 0 THEN 1
WHEN (
SELECT
COUNT(*)
FROM
result_answers ra
LEFT JOIN result_questions rq ON rq.result_question_id = ra.result_question_id
WHERE
ra.result_id = r.id
AND ra.result_question_id = 47
AND (
coalesce(ra.answer_boolean, 0) = 0
OR(
ra.answer_boolean = TRUE
AND COALESCE(TRIM(ra.answer_text), '') <> ''
)
)
) > 0 THEN 1
ELSE 0
END
)
)
AND (
#megatrends
Expand Down

0 comments on commit ebbf218

Please sign in to comment.