Skip to content
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

feat: bp activity fead code clean up #5712

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .storybook/stories/KvActivityRow.stories.js

This file was deleted.

67 changes: 0 additions & 67 deletions .storybook/stories/KvLoanActivities.stories.js

This file was deleted.

59 changes: 25 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
45 changes: 3 additions & 42 deletions src/components/BorrowerProfile/LendCta.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,24 +256,6 @@
data-testid="bp-lend-cta-jump-links"
/>
</div>
<div v-if="!!activities && !isSticky">
<hr
class="tw-block tw-border-tertiary tw-w-full tw-my-2"
>
<supported-by-lenders
:participants="participants"
/>
<kv-loan-activities
class="tw-w-full"
:loan="loan"
:activities="activities"
:basket-items="basketItems"
:user-balance="userBalance"
:error-msg="errorMsg"
:is-adding="isAdding"
@add-to-basket="addToBasket"
/>
</div>
</div>
</kv-grid>

Expand Down Expand Up @@ -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';
Expand All @@ -413,10 +393,6 @@ export default {
type: Boolean,
default: false,
},
activities: {
type: Object,
default: null,
},
enableHugeAmount: {
type: Boolean,
default: false,
Expand All @@ -436,8 +412,6 @@ export default {
JumpLinks,
LoanBookmark,
CompleteLoanWrapper,
KvLoanActivities,
SupportedByLenders,
},
data() {
return {
Expand Down Expand Up @@ -474,7 +448,6 @@ export default {
inPfp: false,
userBalance: undefined,
loan: null,
errorMsg: '',
};
},
apollo: {
Expand Down Expand Up @@ -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);
dyersituations marked this conversation as resolved.
Show resolved Hide resolved
}

async addToBasket() {
if (this.teamData?.id) {
const challenge = {
teamId: this.teamData.id,
Expand All @@ -590,8 +559,6 @@ export default {
}

this.isAdding = true;
this.errorMsg = '';
this.selectedOption = Number(lendAmount) || this.selectedOption;
dyersituations marked this conversation as resolved.
Show resolved Hide resolved
setLendAmount({
amount: isLessThan25(this.unreservedAmount) ? this.unreservedAmount : this.selectedOption,
apollo: this.apollo,
Expand All @@ -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() {
Expand Down Expand Up @@ -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();
Expand Down
33 changes: 0 additions & 33 deletions src/components/Kv/KvActivityRow.vue

This file was deleted.

Loading
Loading