-
Notifications
You must be signed in to change notification settings - Fork 284
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
Add documentation score #1339
Add documentation score #1339
Conversation
backend/core/views.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
if (always_enabled) { | ||
$isScored = true; | ||
} | ||
|
||
export let is_scored = $isScored; | ||
export let score = $value; | ||
export let documentation_score = $documentationScore; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the Score
component generic by moving the documentation score logic to the parent component where it's specifically needed.
<Score | ||
form={superForm(requirementAssessment.scoreForm)} | ||
form={superForm(requirementAssessment.scoreForm, { id: requirementAssessment.id })} | ||
min_score={data.compliance_assessment.min_score} | ||
max_score={data.compliance_assessment.max_score} | ||
scores_definition={data.compliance_assessment.scores_definition} | ||
show_documentation_score={data.compliance_assessment.show_documentation_score} | ||
field="score" | ||
label="" | ||
styles="w-full p-1" | ||
bind:score={requirementAssessment.score} | ||
bind:is_scored={requirementAssessment.is_scored} | ||
bind:score={requirementAssessment.score} | ||
bind:documentation_score={requirementAssessment.documentation_score} | ||
on:change={() => updateScore(requirementAssessment)} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's split this into two separate Score components: one for score and one for documentation_score. Having both in one component creates unnecessary coupling, thus reducing reusability and maintainability.
e358ada
to
7226ca2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
We will update report generation in a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Would appreciate @Mohamed-Hacene's eyes for reviewing the changes made to the Score
component, particularly regarding its interactions with the table-mode page.
472f660
to
2007b71
Compare
0k. The caching effect can sometimes make the documentation score still visible in a requirementAssessment for a very short time after it has been deactivated (and vice versa when activated). This will be fixed by another PR on cache invalidation. |
To pick up on @Mohamed-Hacene's last comment, this is a tradeoff. |
No description provided.