Skip to content

Conversation

@The-Best-Joke
Copy link
Contributor

@The-Best-Joke The-Best-Joke commented Dec 19, 2025

Adds the getCategoriesProgressByYear and getCategoryLoanCountByYear to the useGoalData composable and applies template changes to dynamically determine the subheadings for both the NextYearGoalCard and the GoalSelector components based on the current year's women-category loans.

Adds the getCategoryLoansByYear to the useGoalData composable and
applies template changes to dynamically determine the subheadings for
both the NextYearGoalCard and the GoalSelector components based on the
current year's women-category loans.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the goal-setting experience for users who have already made loans in the current year by displaying their year-to-date progress alongside goal suggestions. The implementation adds a new getCategoryLoansByYear function to the useGoalData composable and updates both NextYearGoalCard and GoalSelector components to dynamically adjust their messaging based on the user's current year lending activity.

Key changes:

  • Added getCategoryLoansByYear function to fetch tiered lending achievement progress for a specific year
  • Refactored loadProgress to use the new shared function for better code reusability
  • Updated goal suggestion logic to adjust recommendations when current year loans exceed last year's total

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/composables/useGoalData.js Adds getCategoryLoansByYear function for fetching yearly category loan data and refactors loadProgress to use it; exports the new function
src/components/MyKiva/NextYearGoalCard.vue Loads and displays current year women's loans count to inform users of their progress when setting goals
src/components/MyKiva/GoalSetting/GoalSelector.vue Dynamically updates subtitle text and goal suggestions based on current year lending activity, adjusting recommendations when users exceed last year's total
Comments suppressed due to low confidence (1)

src/composables/useGoalData.js:266

  • The refactored loadProgress function now calls getCategoryLoansByYear, but the error handling is problematic. If getCategoryLoansByYear returns null due to an error, this will set currentYearProgress.value to null instead of keeping its previous value. The catch block will never execute because getCategoryLoansByYear catches its own errors. Consider handling the null return value from getCategoryLoansByYear or let errors propagate to maintain consistent error handling behavior.
		try {
			const response = await apolloClient.query({ query: useGoalDataQuery, fetchPolicy });
			const prefsData = response.data?.my?.userPreferences || null;
			totalLoanCount.value = response.data?.my?.loans?.totalCount || 0;
			userPreferences.value = prefsData;
			return prefsData ? JSON.parse(prefsData.preferences || '{}') : {};
		} catch (error) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@dyersituations dyersituations requested a review from a team December 22, 2025 17:11
Copy link
Collaborator

@christian14b christian14b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I have just one comment regarding currentYearProgress

@The-Best-Joke The-Best-Joke merged commit 7e82cb8 into main Dec 22, 2025
5 checks passed
@The-Best-Joke The-Best-Joke deleted the MP-2329 branch December 22, 2025 22:05
@kiva-robot
Copy link
Collaborator

🎉 This PR is included in version 3.48.0-rc.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@kiva-robot
Copy link
Collaborator

🎉 This PR is included in version 3.48.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants