From 7ca99ae1d61c2737e2cfab393d92a0b33cc4bd32 Mon Sep 17 00:00:00 2001 From: Eddie Ferrer Date: Fri, 29 Sep 2023 09:30:39 -0600 Subject: [PATCH 1/2] feat: remove lend_urgency exp code --- .../BorrowerProfile/SummaryCard.vue | 7 ---- .../KivaClassicMultiCategoryCarousel.vue | 40 +------------------ src/pages/BorrowerProfile/BorrowerProfile.vue | 30 -------------- 3 files changed, 2 insertions(+), 75 deletions(-) diff --git a/src/components/BorrowerProfile/SummaryCard.vue b/src/components/BorrowerProfile/SummaryCard.vue index aebee0f65b..dc4105def8 100644 --- a/src/components/BorrowerProfile/SummaryCard.vue +++ b/src/components/BorrowerProfile/SummaryCard.vue @@ -66,7 +66,6 @@ :money-left="unreservedAmount" :progress-percent="fundraisingPercent" :time-left="timeLeft" - :urgency="showUrgencyExp && timeLeftMs > 0" :ms-left="timeLeftMs" :loan-status="inPfp ? 'pfp' : 'fundraising'" :number-of-lenders="numLenders" @@ -203,12 +202,6 @@ export default { KvLoadingPlaceholder, HeartComment, }, - props: { - showUrgencyExp: { - type: Boolean, - default: false, - }, - }, data() { return { isLoading: true, diff --git a/src/components/LoanCollections/KivaClassicMultiCategoryCarousel.vue b/src/components/LoanCollections/KivaClassicMultiCategoryCarousel.vue index 70697b2a3b..7e2cd27c82 100644 --- a/src/components/LoanCollections/KivaClassicMultiCategoryCarousel.vue +++ b/src/components/LoanCollections/KivaClassicMultiCategoryCarousel.vue @@ -19,10 +19,6 @@ import { gql } from '@apollo/client'; import KivaClassicLoanCarousel from '@/components/LoanCollections/KivaClassicLoanCarousel'; import KivaClassicLoanCategorySelector from '@/components/LoanCollections/KivaClassicLoanCategorySelector'; -import experimentVersionFragment from '@/graphql/fragments/experimentVersion.graphql'; -import experimentAssignmentQuery from '@/graphql/query/experimentAssignment.graphql'; - -const LEND_URGENCY_EXP = 'lend_urgency'; export default { name: 'KivaClassicMultiCategoryCarousel', @@ -55,25 +51,17 @@ export default { loanChannelData: [], selectedChannel: {}, showCarousel: false, - isUrgencyExpVersionShown: false }; }, computed: { - loanChannelsWithUrgencyExperiment() { - if (this.isUrgencyExpVersionShown) { - // if urgency experiment, insert ending soon as first loan channel - return [{ id: 3, shortName: 'Ending Soon' }, ...this.contentfulLoanChannels]; - } - return this.contentfulLoanChannels; - }, combinedLoanChannelData() { - return this.loanChannelsWithUrgencyExperiment.map(channel => { + return this.contentfulLoanChannels.map(channel => { const matchedLoanChannel = this.loanChannelData.find(lc => lc.id === channel.id); return { ...matchedLoanChannel, ...channel }; }); }, loanChannelIds() { - return this.loanChannelsWithUrgencyExperiment.map(channelSetting => { + return this.contentfulLoanChannels.map(channelSetting => { return channelSetting.id; }); }, @@ -93,30 +81,6 @@ export default { mounted() { this.fetchLoanChannel(); }, - apollo: { - preFetch(_, client) { - return client.query({ query: experimentAssignmentQuery, variables: { id: LEND_URGENCY_EXP } }); - }, - }, - created() { - // run urgency experiment if we are on the homepage - if (this.$route.name === 'homepage') { - const urgencyExperiment = this.apollo.readFragment({ - id: `Experiment:${LEND_URGENCY_EXP}`, - fragment: experimentVersionFragment, - }) || {}; - this.isUrgencyExpVersionShown = urgencyExperiment.version === 'shown'; - - // Fire Event for Exp ACK-291 Urgency Experiment - if (urgencyExperiment.version && urgencyExperiment.version !== 'unassigned') { - this.$kvTrackEvent( - 'Lending', - 'EXP-ACK-291-May2022', - this.isUrgencyExpVersionShown ? 'b' : 'a' - ); - } - } - }, methods: { handleCategoryClick(payload) { this.selectedChannel = this.combinedLoanChannelData.find( diff --git a/src/pages/BorrowerProfile/BorrowerProfile.vue b/src/pages/BorrowerProfile/BorrowerProfile.vue index 3a7e325ce8..752a16fa37 100644 --- a/src/pages/BorrowerProfile/BorrowerProfile.vue +++ b/src/pages/BorrowerProfile/BorrowerProfile.vue @@ -23,7 +23,6 @@ @@ -136,7 +135,6 @@ import { format, parseISO, differenceInCalendarDays } from 'date-fns'; import { gql } from '@apollo/client'; -import experimentVersionFragment from '@/graphql/fragments/experimentVersion.graphql'; import experimentAssignmentQuery from '@/graphql/query/experimentAssignment.graphql'; import fiveDollarsTest, { FIVE_DOLLARS_NOTES_EXP } from '@/plugins/five-dollars-test-mixin'; import guestComment from '@/plugins/guest-comment-mixin'; @@ -166,7 +164,6 @@ import KvLoadingPlaceholder from '~/@kiva/kv-components/vue/KvLoadingPlaceholder const getPublicId = route => route?.query?.utm_content ?? route?.query?.name ?? ''; -const LEND_URGENCY_EXP = 'lend_urgency'; const SHARE_LANGUAGE_EXP = 'share_language_bp'; const preFetchQuery = gql` @@ -179,10 +176,6 @@ const preFetchQuery = gql` $imgRetinaSize: String = "w960h720" ) { general { - lendUrgency: uiExperimentSetting(key: "lend_urgency") { - key - value - } uiExperimentSetting(key: "share_language_bp") { key value @@ -387,7 +380,6 @@ export default { showLenders: true, showTeams: true, showUpdates: true, - isUrgencyExpVersionShown: false, hasThreeDaysOrLessLeft: false, // meta fields endDate: '', @@ -456,7 +448,6 @@ export default { } return Promise.all([ - client.query({ query: experimentAssignmentQuery, variables: { id: LEND_URGENCY_EXP } }), client.query({ query: experimentAssignmentQuery, variables: { id: SHARE_LANGUAGE_EXP } }), client.query({ query: experimentAssignmentQuery, variables: { id: FIVE_DOLLARS_NOTES_EXP } }), ]); @@ -585,9 +576,6 @@ export default { } return `${name} - ${this.countryName}`; }, - showUrgencyExp() { - return this.hasThreeDaysOrLessLeft && this.isUrgencyExpVersionShown; - }, amountLeft() { return this.loanAmount - this.loanFundraisingInfo.fundedAmount; }, @@ -644,24 +632,6 @@ export default { } }, created() { - const urgencyExperiment = this.apollo.readFragment({ - id: `Experiment:${LEND_URGENCY_EXP}`, - fragment: experimentVersionFragment, - }) || {}; - - this.isUrgencyExpVersionShown = urgencyExperiment.version === 'shown'; - - if (this.hasThreeDaysOrLessLeft) { - // Fire Event for Exp ACK-291 Urgency Experiment - if (urgencyExperiment.version && urgencyExperiment.version !== 'unassigned') { - this.$kvTrackEvent( - 'Lending', - 'EXP-ACK-291-May2022', - this.isUrgencyExpVersionShown ? 'b' : 'a' - ); - } - } - const publicId = getPublicId(this.$route); this.inviterIsGuestOrAnonymous = publicId === 'anonymous' || publicId === 'guest'; From 821048a08b7e77e2583d8e26b0f212451145bf1b Mon Sep 17 00:00:00 2001 From: Eddie Ferrer Date: Fri, 29 Sep 2023 11:00:20 -0600 Subject: [PATCH 2/2] refactor: remove vue-countdown package and component --- .github/dependabot.yml | 4 -- package-lock.json | 19 +------ package.json | 1 - .../BorrowerProfile/CountdownTimer.vue | 51 ------------------- .../BorrowerProfile/LoanProgress.vue | 17 +------ .../BorrowerProfile/SummaryCard.vue | 3 -- 6 files changed, 3 insertions(+), 92 deletions(-) delete mode 100644 src/components/BorrowerProfile/CountdownTimer.vue diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bd94c299c0..cbfe343ef0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,10 +13,6 @@ updates: - dependency-name: vue-svg-loader versions: - ">= 0.15.0" - # Version 2 of this package is for Vue3 - - dependency-name: vue-countdown - versions: - - ">= 1.1.5" # clipboard-copy v4 drops IE11 support - dependency-name: clipboard-copy versions: diff --git a/package-lock.json b/package-lock.json index fe90796b5e..7b9abaefe9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,18 @@ { "name": "kvue", - "version": "2.683.0", + "version": "2.687.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "kvue", - "version": "2.683.0", + "version": "2.687.0", "license": "UNLICENSED", "dependencies": { "@apollo/client": "^3.3.21", "@babel/eslint-parser": "^7.18.2", "@babel/polyfill": "^7.10.4", "@babel/runtime": "^7.12.5", - "@chenfengyuan/vue-countdown": "^1.1.5", "@contentful/rich-text-html-renderer": "^15.13.1", "@contentful/rich-text-types": "^14.1.2", "@godaddy/terminus": "^4.11.0", @@ -2125,14 +2124,6 @@ "resolved": "https://registry.npmjs.org/@braintree/wrap-promise/-/wrap-promise-2.1.0.tgz", "integrity": "sha512-UIrJB+AfKU0CCfbMoWrsGpd2D/hBpY/SGgFI6WRHPOwhaZ3g9rz1weiJ6eb6L9KgVyunT7s2tckcPkbHw+NzeA==" }, - "node_modules/@chenfengyuan/vue-countdown": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@chenfengyuan/vue-countdown/-/vue-countdown-1.1.5.tgz", - "integrity": "sha512-BB0taTfJzxsXFUPioREWLKpMDdHOoD8EiSW6lhB3yCdJh3I7jiNQzC8Hw5dPxoPNgZekeEPMQwsdPkjQPyxIeA==", - "peerDependencies": { - "vue": "^2.6.0" - } - }, "node_modules/@cnakazawa/watch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", @@ -40920,12 +40911,6 @@ "resolved": "https://registry.npmjs.org/@braintree/wrap-promise/-/wrap-promise-2.1.0.tgz", "integrity": "sha512-UIrJB+AfKU0CCfbMoWrsGpd2D/hBpY/SGgFI6WRHPOwhaZ3g9rz1weiJ6eb6L9KgVyunT7s2tckcPkbHw+NzeA==" }, - "@chenfengyuan/vue-countdown": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@chenfengyuan/vue-countdown/-/vue-countdown-1.1.5.tgz", - "integrity": "sha512-BB0taTfJzxsXFUPioREWLKpMDdHOoD8EiSW6lhB3yCdJh3I7jiNQzC8Hw5dPxoPNgZekeEPMQwsdPkjQPyxIeA==", - "requires": {} - }, "@cnakazawa/watch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", diff --git a/package.json b/package.json index 77c273c147..c3e58424ca 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,6 @@ "@babel/eslint-parser": "^7.18.2", "@babel/polyfill": "^7.10.4", "@babel/runtime": "^7.12.5", - "@chenfengyuan/vue-countdown": "^1.1.5", "@contentful/rich-text-html-renderer": "^15.13.1", "@contentful/rich-text-types": "^14.1.2", "@godaddy/terminus": "^4.11.0", diff --git a/src/components/BorrowerProfile/CountdownTimer.vue b/src/components/BorrowerProfile/CountdownTimer.vue deleted file mode 100644 index 2d33d89415..0000000000 --- a/src/components/BorrowerProfile/CountdownTimer.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - diff --git a/src/components/BorrowerProfile/LoanProgress.vue b/src/components/BorrowerProfile/LoanProgress.vue index 6e5e2f3185..b8d2e59122 100644 --- a/src/components/BorrowerProfile/LoanProgress.vue +++ b/src/components/BorrowerProfile/LoanProgress.vue @@ -90,12 +90,7 @@