Commit f8bd92e2 authored by Olivia Madrid's avatar Olivia Madrid

remove comments and todos

1 merge request!686WIP: Epic/wallet 80
Pipeline #119316173 running with stages
......@@ -6,7 +6,6 @@ import {
Input,
Output,
EventEmitter,
OnDestroy,
} from '@angular/core';
import { Client } from '../../../../services/api/client';
import { Session } from '../../../../services/session';
......@@ -15,9 +14,7 @@ import {
WalletCurrency,
SplitBalance,
} from '../dashboard.service';
import { ActivatedRoute, ParamMap } from '@angular/router';
import * as moment from 'moment';
import { Subscription } from 'rxjs';
import { ConfigsService } from '../../../../common/services/configs.service';
@Component({
selector: 'm-walletBalance--cash',
......@@ -29,10 +26,10 @@ export class WalletBalanceCashComponent implements OnInit {
@Input() viewId: string;
@Input() cashWallet: WalletCurrency;
// TODOOJM
// private _cashWallet: WalletCurrency;
// @Input() set cashWallet(value: WalletCurrency) {
// this._cashWallet = value;
// this.load();
// }
// get wallet(): WalletCurrency {
// return this._cashWallet;
......@@ -52,28 +49,31 @@ export class WalletBalanceCashComponent implements OnInit {
protected cd: ChangeDetectorRef,
protected session: Session,
protected walletService: WalletDashboardService,
// protected route: ActivatedRoute,
private configs: ConfigsService
) {}
ngOnInit() {
// TODOOJM confirm that Mark has migrated all stripe accts to monthly intervals
// TODOOJM OR just get the payout date from the stripe account itself
this.load();
// TODO confirm that Mark has migrated all stripe accts to monthly intervals
// OR just get the payout date from the stripe account itself
this.nextPayoutDate = moment()
.endOf('month')
.format('ddd Do MMM');
if (this.configs.get('pro')) {
this.getProEarnings();
}
this.init = true;
this.detectChanges();
}
load() {
this.hasAccount = this.cashWallet.stripeDetails.hasAccount;
this.hasBank = this.cashWallet.stripeDetails.hasBank;
this.pendingBalance = this.cashWallet.stripeDetails.pendingBalanceSplit;
this.totalPaidOut = this.cashWallet.stripeDetails.totalPaidOutSplit;
this.currency = this.hasBank ? this.cashWallet.label : 'USD';
if (this.configs.get('pro')) {
this.getProEarnings();
}
this.init = true;
this.detectChanges();
}
......
<ng-container *ngIf="!inProgress && dashboard">
<!-- <ng-container *ngIf="!inProgress && dashboard">
<m-timespanFilter
[timespans]="dashboard.timespans"
[activeTimespanId]="activeTimespan.id"
......@@ -14,4 +14,4 @@
</ng-container>
<div *ngIf="inProgress || !dashboard" class="m-wallet__spinner">
<div class="mdl-spinner mdl-js-spinner is-active" [mdl]></div>
</div>
</div> -->
......@@ -79,7 +79,6 @@
*ngIf="activeCurrencyId === 'tokens'"
></m-walletTransactions--tokens>
<m-walletTransactions--cash
[cashWallet]="wallet.cash"
*ngIf="activeCurrencyId === 'cash'"
[noAccount]="wallet.cash.address === null"
></m-walletTransactions--cash>
......
......@@ -224,7 +224,6 @@ export class WalletDashboardService {
this.wallet.cash.stripeDetails = this.stripeDetails;
account = { ...account, ...this.stripeDetails };
console.log(account);
return account;
} catch (e) {
console.error(e);
......@@ -237,28 +236,14 @@ export class WalletDashboardService {
}
async createStripeAccount(form) {
console.log('~~~service: createStripeAccount');
this.client
.put('api/v2/wallet/usd/account', form)
.then((response: any) => {
console.log('~~~service: createStripeAccount: response', response);
return response;
})
.catch(e => {
console.error(e.message);
});
// try {
// const response = <any>(
// await this.client.put('api/v2/wallet/usd/account', form)
// );
// console.log('~~~service: createStripeAccount: response', response);
// return response;
// } catch (e) {
// console.error(e);
// return e;
// }
}
async addStripeBank(form) {
......
......@@ -11,12 +11,7 @@
To start earning rewards, you will need to enter a unique phone number.
</p>
</div>
<!-- TODOOJM: check on the enter key behavior -->
<form
[formGroup]="form"
(keyup.enter)="onSubmit()"
class="m-walletButtonLayout--buttonInline"
>
<form [formGroup]="form" class="m-walletButtonLayout--buttonInline">
<div class="m-walletForm__fieldsContainer">
<div class="m-walletForm__field--text stretchedField" *ngIf="!confirming">
<div class="m-walletForm__row--label">
......@@ -74,22 +69,6 @@
</div>
</div>
</div>
<!-- <m-shadowboxSubmitButton
*ngIf="!confirming"
[disabled]="inProgress"
[saving]="inProgress"
(click)="onSubmit()"
>
Send Verification
</m-shadowboxSubmitButton>
<m-shadowboxSubmitButton
*ngIf="confirming"
[disabled]="inProgress"
[saving]="inProgress"
(click)="onSubmit()"
>
Verify Code
</m-shadowboxSubmitButton> -->
<m-shadowboxSubmitButton
[disabled]="inProgress"
[saving]="inProgress"
......
......@@ -21,16 +21,7 @@ m-walletPhoneVerification {
}
}
// m-shadowboxSubmitButton {
// width: 147px;
// button {
// width: 100%;
// }
// }
@media screen and (max-width: 771px) {
// m-shadowboxSubmitButton {
// margin: 0 0 21px 0;
// }
.stretchedField {
.m-walletForm__row--label m-tooltip {
.m-tooltip--bubble {
......@@ -38,7 +29,6 @@ m-walletPhoneVerification {
width: 174px;
}
}
// TODOOJM look into this
[class*='m-walletForm__row'] {
&:not(.m-phoneInput__wrapper) {
flex-flow: row wrap;
......
......@@ -8,7 +8,7 @@ m-walletRewardsPopup {
line-height: 18px;
@include m-theme() {
background-color: themed($m-white);
color: themed($m-textColor--secondary);
color: themed($m-textColor--tertiary);
box-shadow: 0 0 10px 0 rgba(themed($m-black), 0.1);
}
......
......@@ -59,7 +59,7 @@ export class WalletSettingsBTCComponent implements OnInit {
}
validateAddressFormat(control: AbstractControl) {
// This allows for some false positives bc bech32 format allows for longer length
// This allows for some false positives because bech32 format allows for longer length
// but will catch some negatives so is better than nothing
if (
control.value.length &&
......@@ -84,7 +84,6 @@ export class WalletSettingsBTCComponent implements OnInit {
this.currentAddress = this.addressInput.value;
this.showForm = false;
} catch (e) {
// TODOOJM get rid of form toast
this.formToastService.error(e);
console.error(e);
} finally {
......
......@@ -93,7 +93,6 @@ export class WalletCashBankFormComponent implements OnInit {
this.walletService
.addStripeBank(this.form.value)
.then((response: any) => {
console.log('addBank response', response);
this.editing = false;
if (response.status !== 'error') {
......@@ -137,6 +136,7 @@ export class WalletCashBankFormComponent implements OnInit {
this.detectChanges();
}
// DISABLED b/c 'remove' button makes it redundant
// async leaveMonetization() {
// this.showModal = false;
// this.inProgress = true;
......
......@@ -82,7 +82,6 @@ export class WalletCashOnboardingComponent implements OnInit {
service: 'stripe',
};
this.detectChanges();
// this.router.navigate(['/wallet/usd/']);
} catch (e) {
this.inProgress = false;
this.error = e.message;
......@@ -90,47 +89,6 @@ export class WalletCashOnboardingComponent implements OnInit {
}
}
// async createAccount() {
// if (!this.form.valid) {
// return;
// }
// this.inProgress = true;
// this.error = '';
// this.detectChanges();
// console.log('createAccountFormval', this.form.value);
// this.walletService
// .createStripeAccount(this.form.value)
// .then((response: any) => {
// console.log('createAccount response', response);
// if (response && response.status !== 'error') {
// if (!this.user.programs) {
// this.user.programs = [];
// }
// this.user.programs.push('affiliate');
// this.user.merchant = {
// id: response.id,
// service: 'stripe',
// };
// this.inProgress = false;
// this.detectChanges();
// console.log('submit event');
// this.submitted.emit();
// }
// })
// .catch(e => {
// // TODO backend should include e.param and handle errors inline
// this.error = e.message;
// console.log('catch');
// this.inProgress = false;
// this.detectChanges();
// });
// }
cancelForm() {
if (!this.inProgress) {
this.showModal = true;
......
......@@ -19,7 +19,6 @@ export class WalletSettingsCashComponent implements OnInit {
private _cashWallet: WalletCurrency;
@Input() set cashWallet(c: WalletCurrency) {
console.log('SettingsCash.ts : wallet input has been updated');
this._cashWallet = c;
this.detectChanges();
if (this.init) {
......@@ -75,15 +74,8 @@ export class WalletSettingsCashComponent implements OnInit {
}
async setView() {
console.log('setting cashSettings view_________');
const previousView = this.view || 'onboarding';
// const user = this.session.getLoggedInUser();
// const hasMerchant = user && user.merchant.service === 'stripe';
// if (!hasMerchant) {
if (!this.cashWallet.stripeDetails.hasAccount) {
console.log('view is: onboarding');
this.view = 'onboarding';
} else {
this.inProgress = true;
......@@ -93,16 +85,13 @@ export class WalletSettingsCashComponent implements OnInit {
this.walletService
.getStripeAccount()
.then((account: any) => {
console.log('cashSettings getStripeAccount response', account);
this.account = account;
if (
!this.account.requirement ||
this.account.requirement.indexOf('external_account') > -1
) {
console.log('view is: bank');
this.view = 'bank';
} else {
console.log('view is: extras');
this.view = 'extras';
}
......@@ -111,14 +100,12 @@ export class WalletSettingsCashComponent implements OnInit {
.catch(e => {
this.error = e.message;
this.view = 'error';
console.log('view is: error');
this.detectChanges();
});
}
this.inProgress = false;
this.detectChanges();
if (this.init && previousView !== this.view && this.view !== 'error') {
console.log('**Event Emitter: accountChanged');
this.accountChanged.emit();
}
}
......
......@@ -88,11 +88,6 @@ export class WalletSettingsTokensComponent implements OnInit, OnDestroy {
}
ngOnInit() {
//TODOOJM remove
console.log(
'*** tksettings-- session.user.rewards:',
this.session.getLoggedInUser().rewards
);
this.form = new FormGroup({
addressInput: new FormControl('', {
validators: [Validators.required, this.validateAddressFormat],
......
......@@ -21,7 +21,6 @@ import * as moment from 'moment';
})
export class WalletTransactionsCashComponent implements OnInit {
@Input() noAccount: boolean = false;
@Input() cashWallet: WalletCurrency; // TODOOJM USE ME
init: boolean = false;
inProgress: boolean = true;
......
......@@ -54,6 +54,7 @@ import { FeaturesService } from '../../services/features.service';
import { ConfigsService } from '../../common/services/configs.service';
import { WalletDashboardComponent } from './v2/dashboard.component';
import { BlockchainConsoleComponent } from '../blockchain/console/console.component';
import { AnalyticsModule } from '../analytics/analytics.module';
export const WALLET_ROUTES: Routes = [
{
......@@ -175,6 +176,7 @@ export const WALLET_ROUTES: Routes = [
ModalsModule,
ReferralsModule,
WalletV2Module,
AnalyticsModule,
],
declarations: [
WalletComponent,
......
Please register or to comment