Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Frontend
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
402
Merge Requests
66
CI / CD
Security & Compliance
Packages
Analytics
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
26542db1
Commit
26542db1
authored
35 minutes ago
by
Olivia Madrid
Browse files
Options
Download
uncomment fake data. this is unlikely to be functional
parent
f640281d
epic/wallet-80
1 merge request
!686
WIP: Epic/wallet 80
Pipeline
#117174897
failed with stages
in 5 minutes and 58 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
133 deletions
+98
-133
src/app/modules/wallet/v2/balance-cash/balance-cash.component.html
View file @
26542db1
<div
class=
"m-walletBalance--cash"
*ngIf=
"loaded"
>
<div
class=
"m-walletTransactions__onboarding"
*ngIf=
"!hasAccount && !onSettingsTab"
>
<p>
<a
(click)=
"scrollTocCashSettings.emit()"
>
Add your bank information
</a>
</p>
<p>
Start receiving payouts by adding your bank details.
</p>
</div>
<div
*ngIf=
"!inProgress"
class=
"m-walletBalance--cash__colContainer"
>
<!-- ---PENDING BALANCE ------------------------------------------------- -->
<div
class=
"m-walletBalance--cash__col"
>
...
...
This diff is collapsed.
src/app/modules/wallet/v2/dashboard.service.ts
View file @
26542db1
...
...
@@ -242,32 +242,32 @@ export class WalletDashboardService {
async
getStripeAccount
()
{
//TODOOJM toggle
return
fakeData
.
stripe_account
.
account
;
//
const merchant = this.session.getLoggedInUser().merchant;
//
if (merchant && merchant.service === 'stripe') {
//
try {
//
const { account } = <any>(
//
await this.client.get('api/v2/payments/stripe/connect')
//
);
//
if (account && account.totalBalance) {
//
this.wallet.cash.balance =
//
(account.totalBalance.amount - account.pendingBalance.amount) / 100;
//
if (account.bankAccount) {
//
const c = account.bankAccount.currency;
//
this.wallet.cash.label = c.toUpperCase;
//
this.wallet.cash.unit = c;
//
}
//
}
//
return account;
//
} catch (e) {
//
console.error(e);
//
return;
//
}
//
} else {
//
return;
//
}
//
return fakeData.stripe_account.account;
const
merchant
=
this
.
session
.
getLoggedInUser
().
merchant
;
if
(
merchant
&&
merchant
.
service
===
'
stripe
'
)
{
try
{
const
{
account
}
=
<
any
>
(
await
this
.
client
.
get
(
'
api/v2/payments/stripe/connect
'
)
);
if
(
account
&&
account
.
totalBalance
)
{
this
.
wallet
.
cash
.
balance
=
(
account
.
totalBalance
.
amount
-
account
.
pendingBalance
.
amount
)
/
100
;
if
(
account
.
bankAccount
)
{
const
c
=
account
.
bankAccount
.
currency
;
this
.
wallet
.
cash
.
label
=
c
.
toUpperCase
;
this
.
wallet
.
cash
.
unit
=
c
;
}
}
return
account
;
}
catch
(
e
)
{
console
.
error
(
e
);
return
;
}
}
else
{
return
;
}
}
async
createStripeAccount
(
form
)
{
...
...
@@ -318,39 +318,6 @@ export class WalletDashboardService {
}
}
// async uploadDocument(fileInput: HTMLInputElement, documentType: string) {
// const file = fileInput ? fileInput.files[0] : null;
// this.editing = true;
// this.detectChanges();
// await this.upload.post(
// 'api/v2/payments/stripe/connect/document/' + documentType,
// [file]
// );
// this.editing = false;
// this.account = null;
// this.getSettings();
// }
// async updateField(fieldName: string, value: string) {
// this.editing = true;
// this.detectChanges();
// let body = {};
// body[fieldName] = value;
// await this.client.post('api/v2/payments/stripe/connect/update', body);
// this.editing = false;
// this.account = null;
// this.getSettings();
// }
// async acceptTos() {
// this.editing = true;
// this.detectChanges();
// await this.client.put('api/v2/payments/stripe/connect/terms');
// this.editing = false;
// this.account = null;
// this.getSettings();
// }
async
leaveMonetization
()
{
try
{
const
response
=
<
any
>
(
...
...
@@ -377,12 +344,13 @@ export class WalletDashboardService {
async
getStripeTransactions
(
offset
)
{
try
{
// const response = <any>(
// await this.client.get('api/v2/payments/stripe/transactions')
// );
// return response;
const
response
=
<
any
>
(
await
this
.
client
.
get
(
'
api/v2/payments/stripe/transactions
'
)
);
return
response
;
// TODOOJM toggle fake data
return
fakeData
.
tx_usd
;
//
return fakeData.tx_usd;
}
catch
(
e
)
{
console
.
error
(
e
);
return
;
...
...
@@ -391,13 +359,15 @@ export class WalletDashboardService {
async
getStripePayouts
()
{
try
{
// const response = <any>(
// await this.client.get('api/v1/monetization/service/analytics/list?offset=&limit=12&type=payouts'
// );
const
response
=
<
any
>
(
await
this
.
client
.
get
(
'
api/v1/monetization/service/analytics/list?offset=&limit=12&type=payouts
'
)
);
// TODOOJM toggle fake data
//
return response.transactions;
return
fakeData
.
stripe_payouts
;
return
response
.
transactions
;
//
return fakeData.stripe_payouts;
}
catch
(
e
)
{
console
.
error
(
e
);
return
;
...
...
@@ -408,53 +378,58 @@ export class WalletDashboardService {
const
opts
=
{
timespan
:
activeTimespanId
};
// TODOOJM toggle
// try {
// const response = <any>await this.client.post('api/v2/analytics/dashboards/engagement?metric=token_balance', opts);
// return response;
// } catch (e) {
// console.error(e);
// return e;
// }
return
fakeData
.
token_chart
;
try
{
const
response
=
<
any
>
(
await
this
.
client
.
post
(
'
api/v2/analytics/dashboards/engagement?metric=token_balance
'
,
opts
)
);
return
response
;
}
catch
(
e
)
{
console
.
error
(
e
);
return
e
;
}
// return fakeData.token_chart;
}
async
getProEarnings
()
{
return
77.3
;
//
try {
//
const response = <any>(
//
await this.client.post(
//
'api/v2/analytics/dashboards/earnings?metric=earnings_total×pan=today'
//
)
//
);
//
const earnings =
//
response.dashboard.metrics
//
.find(m => m.id === 'earnings_total')
//
.visualisation.segments[0].buckets.slice(-1)[0].value / 100;
//
return earnings;
//
} catch (e) {
//
console.error(e);
//
return e;
//
}
//
return 77.3;
try
{
const
response
=
<
any
>
(
await
this
.
client
.
post
(
'
api/v2/analytics/dashboards/earnings?metric=earnings_total×pan=today
'
)
);
const
earnings
=
response
.
dashboard
.
metrics
.
find
(
m
=>
m
.
id
===
'
earnings_total
'
)
.
visualisation
.
segments
[
0
].
buckets
.
slice
(
-
1
)[
0
].
value
/
100
;
return
earnings
;
}
catch
(
e
)
{
console
.
error
(
e
);
return
e
;
}
}
async
getTokenTransactions
(
opts
)
{
try
{
// TODOOJM uncomment
// const response
= <any>(
//
await this.client.get(`api/v2/blockchain/transactions/ledger`, opts)
//
);
//
return response;
const
response
=
<
any
>
(
await
this
.
client
.
get
(
`api/v2/blockchain/transactions/ledger`
,
opts
)
);
return
response
;
// TODOOJM remove
if
(
!
opts
.
contract
)
{
return
fakeData
.
tx_tokens
;
}
else
{
return
fakeData
.
tx_tokens_filtered
;
}
//
if (!opts.contract) {
//
return fakeData.tx_tokens;
//
} else {
//
return fakeData.tx_tokens_filtered;
//
}
}
catch
(
e
)
{
console
.
error
(
e
);
return
;
...
...
@@ -492,19 +467,19 @@ export class WalletDashboardService {
async
getDailyTokenContributionScores
(
dateRangeOpts
)
{
// TODOOJM toggle
//
try {
//
const response: any = await this.client.post(
//
'api/v2/blockchain/contributions',
//
dateRangeOpts
//
);
//
if (!response.contributions) {
//
return false;
//
}
//
return response;
//
} catch (e) {
//
console.error(e);
//
return false;
//
}
return
fakeData
.
pendingTokenRewards
;
try
{
const
response
:
any
=
await
this
.
client
.
post
(
'
api/v2/blockchain/contributions
'
,
dateRangeOpts
);
if
(
!
response
.
contributions
)
{
return
false
;
}
return
response
;
}
catch
(
e
)
{
console
.
error
(
e
);
return
false
;
}
//
return fakeData.pendingTokenRewards;
}
}
This diff is collapsed.
src/app/modules/wallet/v2/settings-cash/cash-onboarding-extras/cash-onboarding-extras.component.html
View file @
26542db1
<div
class=
"m-walletOnboardingExtrasForm"
*ngIf=
"account"
>
<!-- TODOOJM sketchy *ngIf for pending notice
.
-->
<!-- TODOOJM sketchy *ngIf for pending notice -->
<!-- <p *ngIf="!account.verified">
Your account is pending verification. Verification status updates will be
sent in your notifications.
...
...
This diff is collapsed.
src/app/modules/wallet/v2/settings-cash/cash-onboarding/cash-onboarding.component.html
View file @
26542db1
...
...
@@ -5,6 +5,7 @@
>
Set up cash payments
</m-shadowboxSubmitButton
>
</div>
<div
class=
"m-walletCashOnboardingView--form"
*ngIf=
"editing"
>
<form
[formGroup]=
"form"
>
<p>
Enter personal details to setup your cash payment account.
</p>
...
...
This diff is collapsed.
src/app/modules/wallet/v2/settings-cash/settings-cash.component.ts
View file @
26542db1
...
...
@@ -65,9 +65,7 @@ export class WalletSettingsCashComponent implements OnInit {
this
.
inProgress
=
true
;
this
.
detectChanges
();
// todoojm uncomment
// const hasMerchant = this.user && this.user.merchant.id;
const
hasMerchant
=
true
;
const
hasMerchant
=
this
.
user
&&
this
.
user
.
merchant
.
id
;
if
(
!
hasMerchant
)
{
this
.
view
=
'
onboarding
'
;
...
...
This diff is collapsed.
Please
register
or
sign in
to comment