diff --git a/packages/app-project/src/shared/components/SubjectSetPicker/components/SubjectSetCard/SubjectSetCard.js b/packages/app-project/src/shared/components/SubjectSetPicker/components/SubjectSetCard/SubjectSetCard.js index e9b58db79d1..63203e6e16a 100644 --- a/packages/app-project/src/shared/components/SubjectSetPicker/components/SubjectSetCard/SubjectSetCard.js +++ b/packages/app-project/src/shared/components/SubjectSetPicker/components/SubjectSetCard/SubjectSetCard.js @@ -6,13 +6,15 @@ import { array, number, string } from 'prop-types' import React from 'react' function SubjectSetCard (props) { - const { display_name, id, set_member_subjects_count, subjects } = props + const { availableSubjects, display_name, id, set_member_subjects_count, subjects } = props const [subject] = subjects const { publicRuntimeConfig = {} } = getConfig() || {} const assetPrefix = publicRuntimeConfig.assetPrefix || '' const placeholderUrl = `${assetPrefix}/subject-placeholder.png` const subjectURLs = subject ? subject.locations.map(location => Object.values(location)[0]) : [] const alt = subject ? `Subject ${subject.id}` : 'Loading' + const completeness = 1 - (availableSubjects / set_member_subjects_count) + const percentComplete = parseInt(100 * completeness) return ( {`${set_member_subjects_count} subjects`} +
+ + {`${percentComplete}% complete`} +