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: onetime flag removed from ui components #4990

Merged
merged 1 commit into from
Sep 28, 2023
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
1 change: 0 additions & 1 deletion src/components/Checkout/AutoDepositUpsell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ const eligibilityCheckQuery = gql`query autoDepositEligibilityQuery {
autoDeposit {
id
isSubscriber
isOnetime
}
subscriptions {
values {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ export default {
type: String,
default: ''
},
isOneTime: {
type: Boolean,
default: false
},
currentNonce: {
type: String,
default: ''
Expand Down Expand Up @@ -171,7 +167,6 @@ export default {
donateAmount: numeral(this.donateAmount).format('0.00'),
dayOfMonth: numeral(this.dayOfMonth).value(),
category: this.category,
isOnetime: this.isOneTime,
deviceData,
}
}).then(kivaBraintreeResponse => {
Expand Down
24 changes: 2 additions & 22 deletions src/components/Settings/SubscriptionsSettingsCards.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
<template>
<div class="subscriptions-settings-page">
<!-- One Time Settings -->
<subscriptions-one-time
v-if="isOnetime"
@cancel-subscription="showConfirmationPrompt('Contribution')"
@unsaved-changes="setUnsavedChanges"
ref="subscriptionsOneTimeComponent"
/>

<!-- Monthly Good Settings -->
<subscriptions-monthly-good
v-if="!isOnetime"
@cancel-subscription="cancelSubscription"
@unsaved-changes="setUnsavedChanges"
ref="subscriptionsMonthlyGoodComponent"
/>

<!-- Auto Deposit Settings -->
<subscriptions-auto-deposit
v-if="!isOnetime && !isMonthlyGoodSubscriber && !isLegacySubscriber && !hasModernSub"
v-if="!isMonthlyGoodSubscriber && !isLegacySubscriber && !hasModernSub"
@cancel-subscription="showConfirmationPrompt('Auto Deposit')"
@unsaved-changes="setUnsavedChanges"
ref="subscriptionsAutoDepositComponent"
/>

<!-- Legacy Subscriptions-->
<subscriptions-legacy
v-if="!isOnetime && !isMonthlyGoodSubscriber && isLegacySubscriber"
v-if="!isMonthlyGoodSubscriber && isLegacySubscriber"
/>

<!-- Are you sure? -->
Expand Down Expand Up @@ -79,7 +70,6 @@ import { gql } from '@apollo/client';
import KvLoadingOverlay from '@/components/Kv/KvLoadingOverlay';

import SubscriptionsMonthlyGood from '@/components/Subscriptions/SubscriptionsMonthlyGood';
import SubscriptionsOneTime from '@/components/Subscriptions/SubscriptionsOneTime';
import SubscriptionsAutoDeposit from '@/components/Subscriptions/SubscriptionsAutoDeposit';
import SubscriptionsLegacy from '@/components/Subscriptions/SubscriptionsLegacy';
import KvButton from '~/@kiva/kv-components/vue/KvButton';
Expand All @@ -91,7 +81,6 @@ const pageQuery = gql`query subscriptionSettingsPage {
autoDeposit {
id
isSubscriber
isOnetime
}
subscriptions {
values {
Expand Down Expand Up @@ -120,7 +109,6 @@ export default {
SubscriptionsAutoDeposit,
SubscriptionsLegacy,
SubscriptionsMonthlyGood,
SubscriptionsOneTime,
},
inject: ['apollo', 'cookieStore'],
data() {
Expand All @@ -129,7 +117,6 @@ export default {
isChanged: false,
isLegacySubscriber: false,
isMonthlyGoodSubscriber: false,
isOnetime: false,
isSaving: false,
showLightbox: false,
showLoadingOverlay: false,
Expand All @@ -141,7 +128,6 @@ export default {
query: pageQuery,
preFetch: true,
result({ data }) {
this.isOnetime = data?.my?.autoDeposit?.isOnetime ?? false;
this.isMonthlyGoodSubscriber = data?.my?.autoDeposit?.isSubscriber ?? false;

const legacySubs = data?.my?.subscriptions?.values ?? [];
Expand Down Expand Up @@ -192,12 +178,6 @@ export default {
},
saveSubscription() {
this.isSaving = true;
// Calls the save method in the component if component isChanged is true.
if (this.$refs?.subscriptionsOneTimeComponent?.isChanged) {
this.$refs.subscriptionsOneTimeComponent.saveOneTime().finally(() => {
this.isSaving = false;
});
}
if (this.$refs?.subscriptionsMonthlyGoodComponent?.isChanged) {
this.$refs.subscriptionsMonthlyGoodComponent.saveMonthlyGood().finally(() => {
this.isSaving = false;
Expand Down
Loading
Loading