From 2c29b716dbc179ef2cf641e4aaf60dc933acad9a Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Thu, 21 Nov 2024 19:33:37 -0500 Subject: [PATCH 01/14] feat: add tiered badges to BadgesList component --- src/components/LenderProfile/LenderBadges.vue | 104 +++++------------- src/composables/useBadgeData.js | 53 ++++++++- .../query/userAchievementProgress.graphql | 4 +- .../Portfolio/LendingStats/BadgesList.vue | 85 +++++--------- .../LendingStats/LendingStatsPage.vue | 40 +++++-- .../specs/composables/useBadgeData.spec.js | 48 ++++++++ 6 files changed, 192 insertions(+), 142 deletions(-) diff --git a/src/components/LenderProfile/LenderBadges.vue b/src/components/LenderProfile/LenderBadges.vue index 7f73727961..4ecdb0b254 100644 --- a/src/components/LenderProfile/LenderBadges.vue +++ b/src/components/LenderProfile/LenderBadges.vue @@ -1,6 +1,6 @@ - diff --git a/src/composables/useBadgeData.js b/src/composables/useBadgeData.js index 7f93611da4..a44ff87640 100644 --- a/src/composables/useBadgeData.js +++ b/src/composables/useBadgeData.js @@ -51,8 +51,8 @@ export default function useBadgeData() { * * @param apollo The current instance of Apollo */ - const fetchAchievementData = apollo => { - apollo.query({ query: userAchievementProgressQuery }) + const fetchAchievementData = (apollo, publicId = null) => { + apollo.query({ query: userAchievementProgressQuery, variables: { publicId } }) .then(result => { badgeAchievementData.value = [ ...(result.data?.userAchievementProgress?.lendingAchievements ?? []), @@ -388,6 +388,53 @@ export default function useBadgeData() { return displayedBadge ?? {}; }; + /** + * Get completed badges of a user + * + * @param badges The badges to get the completed badges from + * @returns Completed badges + */ + const getCompletedBadges = badges => { + const completedBadgesArr = []; + + badges?.forEach(badge => { + if (badge.achievementData?.tiers?.length) { + const { tiers } = badge.achievementData; + tiers.forEach(tier => { + if (tier.completedDate) { + completedBadgesArr.push({ + ...badge, + earnedAtDate: tier.completedDate, + level: tier.level, + }); + } + }); + } + if (badge?.achievementData?.milestoneProgress?.length) { + const earnedAtDate = badge.achievementData?.milestoneProgress?.[0]?.earnedAtDate; + if (earnedAtDate) { + completedBadgesArr.push({ + ...badge, + earnedAtDate, + level: 0, + }); + } + } + }); + + return completedBadgesArr; + }; + + const completedBadges = computed(() => { + const completedBadgesArr = getCompletedBadges(badgeData.value); + + completedBadgesArr.sort((a, b) => { + return new Date(a.earnedAtDate) - new Date(b.earnedAtDate); + }); + + return completedBadgesArr; + }); + return { fetchAchievementData, fetchContentfulData, @@ -400,9 +447,11 @@ export default function useBadgeData() { getBadgeWithVisibleTiers, getLastCompletedBadgeLevelData, getHighestPriorityDisplayBadge, + getCompletedBadges, badgeAchievementData, badgeData, badgeLoanIdData, isBadgeKeyValid, + completedBadges, }; } diff --git a/src/graphql/query/userAchievementProgress.graphql b/src/graphql/query/userAchievementProgress.graphql index 319de66b97..7450817ca1 100644 --- a/src/graphql/query/userAchievementProgress.graphql +++ b/src/graphql/query/userAchievementProgress.graphql @@ -1,5 +1,5 @@ -query UserAchievementProgress { - userAchievementProgress { +query UserAchievementProgress($publicId: String) { + userAchievementProgress(publicId: $publicId) { id lendingAchievements { id diff --git a/src/pages/Portfolio/LendingStats/BadgesList.vue b/src/pages/Portfolio/LendingStats/BadgesList.vue index 8ae5a04a3b..812751c0c6 100644 --- a/src/pages/Portfolio/LendingStats/BadgesList.vue +++ b/src/pages/Portfolio/LendingStats/BadgesList.vue @@ -22,16 +22,21 @@

- +
- {{ challenge.challengeName }} -

- {{ challenge.dateTagline }} + + {{ getBadgeTitle(badge) }} + +

+ {{ getBadgeDate(badge) }}

@@ -39,9 +44,8 @@ diff --git a/src/composables/useBadgeData.js b/src/composables/useBadgeData.js index 3f6f4bc741..11bc34ba5f 100644 --- a/src/composables/useBadgeData.js +++ b/src/composables/useBadgeData.js @@ -344,7 +344,7 @@ export default function useBadgeData() { levelName: contentfulData.challengeName, }; } - } else if (badge.achievementData?.tiers?.length) { + } else if (badge?.achievementData?.tiers?.length) { const tiers = JSON.parse(JSON.stringify(badge.achievementData.tiers)); tiers.sort((a, b) => new Date(a.completedDate) - new Date(b.completedDate)); const levelIndex = tiers[0].level - 1; @@ -426,6 +426,11 @@ export default function useBadgeData() { return completedBadgesArr; }; + /** + * Get completed badges sorted by earned date + * + * @returns Completed badges sorted by earned date + */ const completedBadges = computed(() => { const completedBadgesArr = getCompletedBadges(badgeData.value); diff --git a/src/pages/Portfolio/LendingStats/BadgesList.vue b/src/pages/Portfolio/LendingStats/BadgesList.vue index 812751c0c6..d11ccbf87d 100644 --- a/src/pages/Portfolio/LendingStats/BadgesList.vue +++ b/src/pages/Portfolio/LendingStats/BadgesList.vue @@ -58,10 +58,6 @@ export default { type: Array, default: () => ([]) }, - totalPossibleBadges: { - type: Number, - default: 0 - }, isLoading: { type: Boolean, default: false @@ -87,7 +83,6 @@ export default { const badgeData = badge?.contentfulData?.find(data => data.level === badge.level); return badgeData?.imageUrl ?? ''; }, - getBadgeDate(badge) { const earnedAtDate = badge.earnedAtDate ? Date.parse(badge.earnedAtDate) : new Date(); return format(earnedAtDate, 'MMM yyyy'); diff --git a/src/pages/Portfolio/LendingStats/LendingStatsPage.vue b/src/pages/Portfolio/LendingStats/LendingStatsPage.vue index 6d4cf01c3a..8aee83472a 100644 --- a/src/pages/Portfolio/LendingStats/LendingStatsPage.vue +++ b/src/pages/Portfolio/LendingStats/LendingStatsPage.vue @@ -23,7 +23,7 @@



@@ -178,6 +178,11 @@ export default { return completedBadgesArr; }, + totalPossibleBadges() { + return this.badgesData.reduce((acc, badge) => { + return acc + (badge?.contentfulData?.length ?? 0); + }, 0); + } }, methods: { getBadgesData() { diff --git a/test/unit/specs/composables/useBadgeData.spec.js b/test/unit/specs/composables/useBadgeData.spec.js index 185404c50e..5bc2114cf5 100644 --- a/test/unit/specs/composables/useBadgeData.spec.js +++ b/test/unit/specs/composables/useBadgeData.spec.js @@ -549,5 +549,28 @@ describe('useBadgeData.js', () => { } ]); }); + it('should return empty array when not badges', () => { + const { getCompletedBadges } = useBadgeData(); + expect(getCompletedBadges(null)).toEqual([]); + }); + it('should return empty array when badges are not well formatted', () => { + const { getCompletedBadges } = useBadgeData(); + expect(getCompletedBadges([ + { + achievementData: { + milestoneProgress: [ + { earnedAtDate: null } + ] + }, + }, + { + achievementData: { + milestoneProgress: [ + { earnedAtDate: undefined } + ] + }, + } + ])).toEqual([]); + }); }); }); From 36e8e0f98261dc193529d2338b2a6f818e8efa03 Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Mon, 25 Nov 2024 14:23:04 -0500 Subject: [PATCH 04/14] feat: remove totalPossibleBadges from start of badges section --- src/pages/Portfolio/LendingStats/BadgesSection.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Portfolio/LendingStats/BadgesSection.vue b/src/pages/Portfolio/LendingStats/BadgesSection.vue index b04df51c3b..449143a99b 100644 --- a/src/pages/Portfolio/LendingStats/BadgesSection.vue +++ b/src/pages/Portfolio/LendingStats/BadgesSection.vue @@ -6,7 +6,7 @@ v-if="!isLoading" class="tw-text-base tw-bg-brand tw-text-white tw-py-0.5 tw-px-1 tw-self-center" > - {{ badgesObtained }}/{{ totalPossibleBadges }} + {{ badgesObtained }} Date: Mon, 25 Nov 2024 15:04:00 -0500 Subject: [PATCH 05/14] fix: missing optional chaining --- src/composables/useBadgeData.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/composables/useBadgeData.js b/src/composables/useBadgeData.js index 11bc34ba5f..245389aacc 100644 --- a/src/composables/useBadgeData.js +++ b/src/composables/useBadgeData.js @@ -399,7 +399,7 @@ export default function useBadgeData() { const completedBadgesArr = []; badges?.forEach(badge => { - if (badge.achievementData?.tiers?.length) { + if (badge?.achievementData?.tiers?.length) { const { tiers } = badge.achievementData; tiers.forEach(tier => { if (tier.completedDate) { From 2ba6d397b7017c01401e4efc6344abab3e55f6ff Mon Sep 17 00:00:00 2001 From: Joshua Kiwiet-Pantaleoni Date: Mon, 25 Nov 2024 12:43:30 -0800 Subject: [PATCH 06/14] fix: link styles for personalized lend menu --- src/components/WwwFrame/LendMenu/LendMegaMenu.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/WwwFrame/LendMenu/LendMegaMenu.vue b/src/components/WwwFrame/LendMenu/LendMegaMenu.vue index 665cadd5a0..ae162dd715 100644 --- a/src/components/WwwFrame/LendMenu/LendMegaMenu.vue +++ b/src/components/WwwFrame/LendMenu/LendMegaMenu.vue @@ -101,8 +101,7 @@ v-if="favorites > 0" :to="{ path: '/lend', query: { lenderFavorite: userId } }" v-kv-track-event="['TopNav','click-Lend-Favorites']" - class="lend-menu-link tw-text-primary tw-text-left - tw-py-1 tw-inline-block" + class="lend-menu-link tw-text-primary tw-text-left tw-py-1 tw-inline-block" > Saved loans @@ -118,8 +117,7 @@ v-if="hasSearches" @click="openSection(savedSearchesTitle)" :aria-pressed="isOpenSection(savedSearchesTitle) ? 'true' : 'false'" - class="lend-menu-link tw-text-primary tw-text-left tw-py-1 tw-inline-block - hover:tw-text-action-highlight hover:tw-underline" + class="lend-menu-link tw-text-primary tw-text-left tw-py-1 tw-inline-block" > {{ savedSearchesTitle }} @@ -134,8 +132,7 @@ Countries I haven't lent to From cbced40904352da30bdf678776e5019879440c9d Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Mon, 25 Nov 2024 15:51:40 -0500 Subject: [PATCH 07/14] fix: remove totalPossibleBadges prop --- src/pages/Portfolio/LendingStats/BadgesSection.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/Portfolio/LendingStats/BadgesSection.vue b/src/pages/Portfolio/LendingStats/BadgesSection.vue index 449143a99b..67745f107c 100644 --- a/src/pages/Portfolio/LendingStats/BadgesSection.vue +++ b/src/pages/Portfolio/LendingStats/BadgesSection.vue @@ -16,7 +16,6 @@ From e2414fbb8f4e9e33efdf486f583e47d9215b012a Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Mon, 25 Nov 2024 16:44:41 -0500 Subject: [PATCH 08/14] fix: badges loading indicator --- src/pages/Portfolio/LendingStats/BadgesSection.vue | 10 +++------- src/pages/Portfolio/LendingStats/LendingStatsPage.vue | 8 +++----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/pages/Portfolio/LendingStats/BadgesSection.vue b/src/pages/Portfolio/LendingStats/BadgesSection.vue index 67745f107c..15256aa850 100644 --- a/src/pages/Portfolio/LendingStats/BadgesSection.vue +++ b/src/pages/Portfolio/LendingStats/BadgesSection.vue @@ -38,10 +38,9 @@ export default { type: Array, default: () => [] }, - /* total number of possible badges */ - totalPossibleBadges: { - type: Number, - default: 0 + isLoading: { + type: Boolean, + default: false }, }, components: { @@ -52,9 +51,6 @@ export default { badgesObtained() { return this.completedAchievements.length ?? 0; }, - isLoading() { - return this.totalPossibleBadges === 0; - }, }, }; diff --git a/src/pages/Portfolio/LendingStats/LendingStatsPage.vue b/src/pages/Portfolio/LendingStats/LendingStatsPage.vue index 8aee83472a..cfa6900d1a 100644 --- a/src/pages/Portfolio/LendingStats/LendingStatsPage.vue +++ b/src/pages/Portfolio/LendingStats/LendingStatsPage.vue @@ -23,7 +23,7 @@



@@ -178,10 +178,8 @@ export default { return completedBadgesArr; }, - totalPossibleBadges() { - return this.badgesData.reduce((acc, badge) => { - return acc + (badge?.contentfulData?.length ?? 0); - }, 0); + badgesLoading() { + return !this.badgesData.length; } }, methods: { From 4217368aa7c465d657718efc989e8bb8810dd477 Mon Sep 17 00:00:00 2001 From: Roger Gutierrez <94026278+roger-in-kiva@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:24:53 -0600 Subject: [PATCH 09/14] feat: bp activity fead code clean up (#5712) * feat: bp activity fead code clean up * fix: activities prop removed * fix: error message removed --- .storybook/stories/KvActivityRow.stories.js | 26 -- .../stories/KvLoanActivities.stories.js | 67 ----- package-lock.json | 59 ++-- package.json | 4 +- src/components/BorrowerProfile/LendCta.vue | 45 +-- src/components/Kv/KvActivityRow.vue | 33 --- src/components/Kv/KvLoanActivities.vue | 268 ------------------ src/pages/BorrowerProfile/BorrowerProfile.vue | 20 -- 8 files changed, 30 insertions(+), 492 deletions(-) delete mode 100644 .storybook/stories/KvActivityRow.stories.js delete mode 100644 .storybook/stories/KvLoanActivities.stories.js delete mode 100644 src/components/Kv/KvActivityRow.vue delete mode 100644 src/components/Kv/KvLoanActivities.vue diff --git a/.storybook/stories/KvActivityRow.stories.js b/.storybook/stories/KvActivityRow.stories.js deleted file mode 100644 index 992653b6ab..0000000000 --- a/.storybook/stories/KvActivityRow.stories.js +++ /dev/null @@ -1,26 +0,0 @@ -import KvActivityRow from '#src/components/Kv/KvActivityRow.vue'; - -export default { - title: 'Kv/KvActivityRow', - component: KvActivityRow, -}; - -const activity = { - lenderName: 'Stephanie', - lenderImage: 'https://www.development.kiva.org/img/s100/26e15431f51b540f31cd9f011cc54f31.jpg', - text: 'Stephanie lent $25', -}; - -const story = (args) => { - const template = (_args, { argTypes }) => ({ - props: Object.keys(argTypes), - components: { KvActivityRow }, - setup() { return args; }, - template: ``, - }) - template.args = args; - return template; -}; - -export const Default = story({ activity }); diff --git a/.storybook/stories/KvLoanActivities.stories.js b/.storybook/stories/KvLoanActivities.stories.js deleted file mode 100644 index e9a068dee5..0000000000 --- a/.storybook/stories/KvLoanActivities.stories.js +++ /dev/null @@ -1,67 +0,0 @@ -import KvLoanActivities from '#src/components/Kv/KvLoanActivities.vue'; -import cookieStoreStoryMixin from '../mixins/cookie-store-story-mixin'; -import activities from '../mock-data/activity-feed-data-mock'; - -export default { - title: 'Kv/KvLoanActivities', - component: KvLoanActivities, -}; - -const loan = { - id: 1998250, - distributionModel: 'partner', // direct, partner, both - geocode: { - city: "Cranston", - state: "RI", - country: { - name: "Malawi", - isoCode: "MW" - } - }, - image: { - hash: "d5ad26cd7acc24317edc1c04c6250074" - }, - name: "Microloan Foundation Malawi", - sector: { - name: "Services" - }, - whySpecial: "It helps Lending Partners withstand negative economic impacts of the COVID-19 pandemic.", - userProperties: { - lentTo: null - }, - use: "this Lending Partner provide loans to women in rural Malawi during the COVID-19 crisis.", - status: "fundraising", - loanAmount: "250000.00", - borrowerCount: 1, - anonymizationLevel: "none", - fullLoanUse: "A loan of $250,000 helps this Lending Partner provide loans to women in rural Malawi during the COVID-19 crisis.", - fundraisingPercent: 0.75, - unreservedAmount: '600', - loanFundraisingInfo: { - fundedAmount: "218950.00", - reservedAmount: "0.00", - isExpiringSoon: false - }, - plannedExpirationDate: "2020-09-10T19:30:13Z", - matchingText: "LISC", - matchRatio: 2, -}; - -const story = (args) => { - const template = (_args, { argTypes }) => ({ - mixins: [cookieStoreStoryMixin()], - props: Object.keys(argTypes), - components: { KvLoanActivities }, - setup() { return args; }, - template: ` -
- -
`, - }) - template.args = args; - return template; -}; - -export const Default = story({ loan, activities }); diff --git a/package-lock.json b/package-lock.json index 3ce97b6f1b..bc5e67383f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,10 +16,10 @@ "@godaddy/terminus": "^4.11.0", "@graphql-tools/load": "^7.7.0", "@graphql-tools/url-loader": "^7.17.18", - "@kiva/kv-components": "^3.109.1", + "@kiva/kv-components": "^3.109.3", "@kiva/kv-shop": "^1.12.65", "@kiva/kv-tokens": "^2.15.0", - "@mdi/js": "^7", + "@mdi/js": "^7.4.47", "@opentelemetry/api": "^1.7.0", "@opentelemetry/auto-instrumentations-node": "^0.40.2", "@opentelemetry/exporter-metrics-otlp-proto": "^0.46.0", @@ -5448,12 +5448,12 @@ "integrity": "sha512-1lNM7toQpiHWWdKrBmoXPudNLgFscU8rnk4nyBQQhbnlhSLzbjbsCcWWnA+IqXkgOCVysSpI7yEi7fuU6uLMYg==" }, "node_modules/@kiva/kv-components": { - "version": "3.109.1", - "resolved": "https://registry.npmjs.org/@kiva/kv-components/-/kv-components-3.109.1.tgz", - "integrity": "sha512-z/Me8Kdp0RrpUdG1ilodSbPQBtczth8XgISC7apSR/tojiHYZREynkhHo9rdPn17SAJxfFATFSocM9bInEdyYw==", + "version": "3.109.3", + "resolved": "https://registry.npmjs.org/@kiva/kv-components/-/kv-components-3.109.3.tgz", + "integrity": "sha512-zFjzCIVAf2mq7hRiu5+zVsnOlxL5cWsDdeC3vNUehgqwTcFUqf1Ij2MQ8IwqLHxeCVluR3UVRwBoDH8RDcm5OA==", "dependencies": { - "@kiva/kv-tokens": "^2.15.0", - "@mdi/js": "^5.9.55", + "@kiva/kv-tokens": "^2.16.0", + "@mdi/js": "^7.4.47", "@vueuse/integrations": "^7.6.0", "aria-hidden": "^1.1.3", "change-case": "^4.1.2", @@ -5477,11 +5477,6 @@ } } }, - "node_modules/@kiva/kv-components/node_modules/@mdi/js": { - "version": "5.9.55", - "resolved": "https://registry.npmjs.org/@mdi/js/-/js-5.9.55.tgz", - "integrity": "sha512-BbeHMgeK2/vjdJIRnx12wvQ6s8xAYfvMmEAVsUx9b+7GiQGQ9Za8jpwp17dMKr9CgKRvemlAM4S7S3QOtEbp4A==" - }, "node_modules/@kiva/kv-components/node_modules/vue-demi": { "version": "0.14.7", "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz", @@ -5556,9 +5551,9 @@ } }, "node_modules/@kiva/kv-tokens": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/@kiva/kv-tokens/-/kv-tokens-2.15.0.tgz", - "integrity": "sha512-V+XSN/V/Qs1HPcRtXmyKVywGWf999pe+FvsZfZ1bSn/F9flav9bmC/WbiH+Bj2k6hOW7g8PotwziXt/8tcmLqA==", + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/@kiva/kv-tokens/-/kv-tokens-2.16.0.tgz", + "integrity": "sha512-ebxNuJAPcb83G408a0Rh5Y89ArGTlnjDyjQYumUmbM9awqI2z+eOeAP8a2XLapaE58rg90nJbAyLtIp9U6uV0g==", "dependencies": { "@tailwindcss/typography": "^0.5.1", "tailwindcss": "^3.4.3" @@ -5620,9 +5615,10 @@ } }, "node_modules/@mdi/js": { - "version": "7.0.96", - "resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.0.96.tgz", - "integrity": "sha512-lNqhkV3cpPfYb/Avh+vXLFukUTbHbyHoFo4Jdc7Oc9UvURGVhamFIpgOVvEf2bNA78zvjXTZeVWExUTR+DLBfQ==" + "version": "7.4.47", + "resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.4.47.tgz", + "integrity": "sha512-KPnNOtm5i2pMabqZxpUz7iQf+mfrYZyKCZ8QNz85czgEt7cuHcGorWfdzUMWYA0SD+a6Hn4FmJ+YhzzzjkTZrQ==", + "license": "Apache-2.0" }, "node_modules/@mdx-js/react": { "version": "3.0.1", @@ -41219,12 +41215,12 @@ "integrity": "sha512-1lNM7toQpiHWWdKrBmoXPudNLgFscU8rnk4nyBQQhbnlhSLzbjbsCcWWnA+IqXkgOCVysSpI7yEi7fuU6uLMYg==" }, "@kiva/kv-components": { - "version": "3.109.1", - "resolved": "https://registry.npmjs.org/@kiva/kv-components/-/kv-components-3.109.1.tgz", - "integrity": "sha512-z/Me8Kdp0RrpUdG1ilodSbPQBtczth8XgISC7apSR/tojiHYZREynkhHo9rdPn17SAJxfFATFSocM9bInEdyYw==", + "version": "3.109.3", + "resolved": "https://registry.npmjs.org/@kiva/kv-components/-/kv-components-3.109.3.tgz", + "integrity": "sha512-zFjzCIVAf2mq7hRiu5+zVsnOlxL5cWsDdeC3vNUehgqwTcFUqf1Ij2MQ8IwqLHxeCVluR3UVRwBoDH8RDcm5OA==", "requires": { - "@kiva/kv-tokens": "^2.15.0", - "@mdi/js": "^5.9.55", + "@kiva/kv-tokens": "^2.16.0", + "@mdi/js": "^7.4.47", "@vueuse/integrations": "^7.6.0", "aria-hidden": "^1.1.3", "change-case": "^4.1.2", @@ -41239,11 +41235,6 @@ "vue-demi": "^0.14.7" }, "dependencies": { - "@mdi/js": { - "version": "5.9.55", - "resolved": "https://registry.npmjs.org/@mdi/js/-/js-5.9.55.tgz", - "integrity": "sha512-BbeHMgeK2/vjdJIRnx12wvQ6s8xAYfvMmEAVsUx9b+7GiQGQ9Za8jpwp17dMKr9CgKRvemlAM4S7S3QOtEbp4A==" - }, "vue-demi": { "version": "0.14.7", "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz", @@ -41275,9 +41266,9 @@ } }, "@kiva/kv-tokens": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/@kiva/kv-tokens/-/kv-tokens-2.15.0.tgz", - "integrity": "sha512-V+XSN/V/Qs1HPcRtXmyKVywGWf999pe+FvsZfZ1bSn/F9flav9bmC/WbiH+Bj2k6hOW7g8PotwziXt/8tcmLqA==", + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/@kiva/kv-tokens/-/kv-tokens-2.16.0.tgz", + "integrity": "sha512-ebxNuJAPcb83G408a0Rh5Y89ArGTlnjDyjQYumUmbM9awqI2z+eOeAP8a2XLapaE58rg90nJbAyLtIp9U6uV0g==", "requires": { "@tailwindcss/typography": "^0.5.1", "tailwindcss": "^3.4.3" @@ -41325,9 +41316,9 @@ } }, "@mdi/js": { - "version": "7.0.96", - "resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.0.96.tgz", - "integrity": "sha512-lNqhkV3cpPfYb/Avh+vXLFukUTbHbyHoFo4Jdc7Oc9UvURGVhamFIpgOVvEf2bNA78zvjXTZeVWExUTR+DLBfQ==" + "version": "7.4.47", + "resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.4.47.tgz", + "integrity": "sha512-KPnNOtm5i2pMabqZxpUz7iQf+mfrYZyKCZ8QNz85czgEt7cuHcGorWfdzUMWYA0SD+a6Hn4FmJ+YhzzzjkTZrQ==" }, "@mdx-js/react": { "version": "3.0.1", diff --git a/package.json b/package.json index 1ddaa40e46..0f96c1c5e5 100644 --- a/package.json +++ b/package.json @@ -43,10 +43,10 @@ "@godaddy/terminus": "^4.11.0", "@graphql-tools/load": "^7.7.0", "@graphql-tools/url-loader": "^7.17.18", - "@kiva/kv-components": "^3.109.1", + "@kiva/kv-components": "^3.109.3", "@kiva/kv-shop": "^1.12.65", "@kiva/kv-tokens": "^2.15.0", - "@mdi/js": "^7", + "@mdi/js": "^7.4.47", "@opentelemetry/api": "^1.7.0", "@opentelemetry/auto-instrumentations-node": "^0.40.2", "@opentelemetry/exporter-metrics-otlp-proto": "^0.46.0", diff --git a/src/components/BorrowerProfile/LendCta.vue b/src/components/BorrowerProfile/LendCta.vue index 7cc4dccd4f..7976ae36fa 100644 --- a/src/components/BorrowerProfile/LendCta.vue +++ b/src/components/BorrowerProfile/LendCta.vue @@ -256,24 +256,6 @@ data-testid="bp-lend-cta-jump-links" /> -
-
- - -
@@ -393,8 +375,6 @@ import LendAmountButton from '#src/components/LoanCards/Buttons/LendAmountButton import CompleteLoanWrapper from '#src/components/BorrowerProfile/CompleteLoanWrapper'; import KvIcon from '#src/components/Kv/KvIcon'; -import KvLoanActivities from '#src/components/Kv/KvLoanActivities'; -import SupportedByLenders from '#src/components/BorrowerProfile/SupportedByLenders'; import KvUiSelect from '#kv-components/KvSelect'; import KvMaterialIcon from '#kv-components/KvMaterialIcon'; import KvUiButton from '#kv-components/KvButton'; @@ -413,10 +393,6 @@ export default { type: Boolean, default: false, }, - activities: { - type: Object, - default: null, - }, enableHugeAmount: { type: Boolean, default: false, @@ -436,8 +412,6 @@ export default { JumpLinks, LoanBookmark, CompleteLoanWrapper, - KvLoanActivities, - SupportedByLenders, }, data() { return { @@ -474,7 +448,6 @@ export default { inPfp: false, userBalance: undefined, loan: null, - errorMsg: '', }; }, apollo: { @@ -575,11 +548,7 @@ export default { }, }, methods: { - async addToBasket(lendAmount = 0) { - if (lendAmount) { - this.$kvTrackEvent('Borrower profile', 'click', 'loan-activities-lend', this.loan?.id, lendAmount); - } - + async addToBasket() { if (this.teamData?.id) { const challenge = { teamId: this.teamData.id, @@ -590,8 +559,6 @@ export default { } this.isAdding = true; - this.errorMsg = ''; - this.selectedOption = Number(lendAmount) || this.selectedOption; setLendAmount({ amount: isLessThan25(this.unreservedAmount) ? this.unreservedAmount : this.selectedOption, apollo: this.apollo, @@ -608,11 +575,8 @@ export default { this.$kvTrackEvent('borrower-profile', 'add-to-basket', 'Failed to add loan. Please try again.'); } this.isAdding = false; - this.errorMsg = e[0]?.extensions?.code === 'reached_anonymous_basket_limit' && e[0]?.message - ? e[0].message - : 'There was a problem adding the loan to your basket'; - - this.$showTipMsg(this.errorMsg, 'error'); + const msg = e[0]?.extensions?.code === 'reached_anonymous_basket_limit' && e[0]?.message; + this.$showTipMsg(msg, 'error'); }); }, createWrapperObserver() { @@ -866,9 +830,6 @@ export default { isLendAmountButton() { return (this.lendButtonVisibility || this.state === 'lent-to') && (isLessThan25(this.unreservedAmount)); // eslint-disable-line max-len }, - participants() { - return this.activities?.lend?.loan?.lendingActions ?? {}; - } }, mounted() { this.createWrapperObserver(); diff --git a/src/components/Kv/KvActivityRow.vue b/src/components/Kv/KvActivityRow.vue deleted file mode 100644 index 9fd1243c89..0000000000 --- a/src/components/Kv/KvActivityRow.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - diff --git a/src/components/Kv/KvLoanActivities.vue b/src/components/Kv/KvLoanActivities.vue deleted file mode 100644 index a6e12a29cf..0000000000 --- a/src/components/Kv/KvLoanActivities.vue +++ /dev/null @@ -1,268 +0,0 @@ - - - - - diff --git a/src/pages/BorrowerProfile/BorrowerProfile.vue b/src/pages/BorrowerProfile/BorrowerProfile.vue index 41bced5294..43319b9231 100644 --- a/src/pages/BorrowerProfile/BorrowerProfile.vue +++ b/src/pages/BorrowerProfile/BorrowerProfile.vue @@ -46,7 +46,6 @@ :loan-id="loanId" :enable-five-dollars-notes="enableFiveDollarsNotes" :enable-huge-amount="enableHugeLendAmount" - :activities="activities" :team-data="teamData" >