Skip to content

Commit

Permalink
Merge pull request #696 from adshares/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
m-pilarczyk authored Sep 30, 2019
2 parents 4c808de + 572d015 commit ac5e483
Show file tree
Hide file tree
Showing 41 changed files with 354 additions and 221 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.4] - 2019-09-30
### Added
- Admin wallet info
### Changed
- Publisher panel texts

## [1.2.1] - 2019-09-20
### Added
- Billing history filtering
Expand Down Expand Up @@ -122,7 +128,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Advertiser features (Campaigns & Ads)
- Publisher features (Sites & AdUnits)

[Unreleased]: https://github.com/adshares/adpanel/compare/v1.2.1...develop
[Unreleased]: https://github.com/adshares/adpanel/compare/v1.2.4...develop
[1.2.4]: https://github.com/adshares/adpanel/compare/v1.2.1...v1.2.4
[1.2.1]: https://github.com/adshares/adpanel/compare/v0.11.0...v1.2.1
[0.11.0]: https://github.com/adshares/adpanel/compare/v0.10.0...v0.11.0
[0.10.0]: https://github.com/adshares/adpanel/compare/v0.9.0...v0.10.0
Expand Down
7 changes: 6 additions & 1 deletion src/app/admin/admin.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import {
AdminPrivacyAndTermsSettingsResponse,
AdminSettings,
AdminSettingsResponse,
AdminWalletResponse,
UserInfoStats
} from 'models/settings.model';
import { environment } from 'environments/environment';
import { adsToClicks } from "common/utilities/helpers";
import { adsToClicks } from 'common/utilities/helpers';
import { SitesTotals } from 'models/site.model';

@Injectable()
Expand All @@ -34,6 +35,10 @@ export class AdminService {
return this.http.get<AdminSettingsResponse>(`${environment.serverUrl}/admin/settings`);
}

getAdminWallet(): Observable<AdminWalletResponse> {
return this.http.get<AdminWalletResponse>(`${environment.serverUrl}/admin/wallet`);
}

getTermsAndConditions(): Observable<AdminPrivacyAndTermsSettingsResponse> {
return this.http.get<AdminPrivacyAndTermsSettingsResponse>(`${environment.serverUrl}/admin/terms`);
}
Expand Down
11 changes: 6 additions & 5 deletions src/app/admin/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class DashboardComponent extends HandleSubscription implements OnInit {
licenseDetailUrl: string = null;
settings = [
{
title: 'General Settings',
title: 'General settings',
description: '',
link: '/admin/dashboard/general',
values: [
Expand All @@ -27,16 +27,17 @@ export class DashboardComponent extends HandleSubscription implements OnInit {
],
},
{
title: 'Finance Settings',
title: 'Finance settings',
description: '',
link: '/admin/dashboard/finance',
values: [
{name: 'Set your commissions', icon: 'assets/images/wallet--gray.svg'},
{name: 'Wallet status', icon: 'assets/images/wallet--gray.svg'},
{name: 'Set your thresholds', icon: 'assets/images/wallet--gray.svg'},
],
},
{
title: 'Privacy Settings',
title: 'Privacy settings',
description: '',
link: '/admin/dashboard/privacy',
values: [
Expand All @@ -53,11 +54,11 @@ export class DashboardComponent extends HandleSubscription implements OnInit {
],
},
{
title: 'Account Settings',
title: 'Account settings',
description: '',
link: '/admin/dashboard/account',
values: [
{name: 'Email & Password', icon: 'assets/images/preferences.svg'},
{name: 'Email & password', icon: 'assets/images/preferences.svg'},
{name: 'Referrer', icon: 'assets/images/preferences.svg'},
],
},
Expand Down
32 changes: 31 additions & 1 deletion src/app/admin/finances/finances-settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,36 @@
</app-earnings-settings>
</article>

<article class="dwmth-box finances-settings__cold-wallet">
<section class="row justify-between align-center">
<h1 class="dwmth-heading dwmth-heading--primary finances-settings__header">Wallet status</h1>
</section>
<p class="row justify-between dwmth-copy dwmth-copy--large finances-settings__wallet-entry">
<span>
Total balance:
</span>
<span>
{{wallet.balance | formatMoney:4:crypto:code}}
</span>
</p>
<p class="row justify-between dwmth-copy">
It is the total balance of all users' accounts.
It is an amount that should be at least equal to the sum of funds stored on hot and cold ADS wallets.
The amount exceeding this value is operator's profit.
</p>
<p class="row justify-between dwmth-copy dwmth-copy--large finances-settings__wallet-entry">
<span>
Unused bonuses:
</span>
<span>
{{wallet.unusedBonuses | formatMoney:4:crypto:code}}
</span>
</p>
<p class="row justify-between dwmth-copy">
It is the total amount of all bonuses that were added to users' accounts but have not been used so far.
</p>
</article>

<article class="dwmth-box finances-settings__cold-wallet">
<section class="row justify-between align-center">
<h1 class="dwmth-heading dwmth-heading--primary finances-settings__header">Cold wallet settings</h1>
Expand All @@ -39,7 +69,7 @@ <h1 class="dwmth-heading dwmth-heading--primary finances-settings__header">Cold
</mat-checkbox>
</section>
<p *ngIf="settings.coldWalletIsActive"
class="dwmth-copy dwmth-copy--large finances-settings__desc">
class="dwmth-copy dwmth-copy--medium">
<!--placeholder for settings general description-->
</p>
<div *ngIf="settings.coldWalletIsActive"
Expand Down
4 changes: 4 additions & 0 deletions src/app/admin/finances/finances-settings.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
padding: 20px;
}

&__wallet-entry {
padding-top: 16px;
}

&__format {
height: calc(100% - 16px);
display: flex;
Expand Down
21 changes: 17 additions & 4 deletions src/app/admin/finances/finances-settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { Component, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppState } from 'models/app-state.model';
import { HandleSubscription } from 'common/handle-subscription';
import { SetAdminSettings, SetAdminSettingsFailure } from "store/admin/admin.actions";
import { AdminSettings } from "models/settings.model";
import { environment } from "environments/environment";
import { LoadAdminWallet, SetAdminSettings, SetAdminSettingsFailure } from 'store/admin/admin.actions';
import { AdminSettings, AdminWallet } from 'models/settings.model';
import { environment } from 'environments/environment';
import { CODE, CRYPTO } from 'common/utilities/consts';

@Component({
selector: 'app-finances-settings',
Expand All @@ -13,21 +14,33 @@ import { environment } from "environments/environment";
host: {'class': 'app-finances'},
})
export class FinancesSettingsComponent extends HandleSubscription implements OnInit {
cryptoCode:string = environment.cryptoCode;
cryptoCode: string = environment.cryptoCode;
crypto: string = CRYPTO;
code: string = CODE;
settings: AdminSettings;
wallet: AdminWallet;
canSubmit: boolean = false;

constructor(private store: Store<AppState>) {
super();
}

ngOnInit() {
this.store.dispatch(new LoadAdminWallet());

const adminStoreSettingsSubscription = this.store.select('state', 'admin', 'settings')
.subscribe((settings: AdminSettings) => {
this.settings = settings;
});

this.subscriptions.push(adminStoreSettingsSubscription);

const adminStoreWalletSubscription = this.store.select('state', 'admin', 'wallet')
.subscribe((wallet: AdminWallet) => {
this.wallet = wallet;
});

this.subscriptions.push(adminStoreWalletSubscription);
}

updateSettings(value: number | boolean | string, key: string): void {
Expand Down
2 changes: 1 addition & 1 deletion src/app/advertiser/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
dwmth-heading
dwmth-heading--primary"
>
Create your First Campaign
Create your first campaign
</h2>
</div>
<a
Expand Down
10 changes: 5 additions & 5 deletions src/app/common/components/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
dwmth-icon--prepend"
src="assets/images/plus-circle.svg"
>
<span *ngIf="activeUserType === userRolesEnum.ADVERTISER">Create new Campaign</span>
<span *ngIf="activeUserType === userRolesEnum.PUBLISHER">Add new Site</span>
<span *ngIf="activeUserType === userRolesEnum.ADVERTISER">Create new campaign</span>
<span *ngIf="activeUserType === userRolesEnum.PUBLISHER">Add new site</span>
</button>
<div
*ngIf="activeUserType !== userRolesEnum.ADMIN"
Expand Down Expand Up @@ -187,22 +187,22 @@
close"
src="assets/images/plus-circle.svg"
>
Add Funds
Deposit funds
</button>
</li>
<li
class="settings-menu__item"
routerLink="/settings/general"
data-test="header-account-settings-button"
>
Account Settings
Account settings
</li>
<li
class="settings-menu__item"
routerLink="/settings/billing"
data-test="header-billing-payments-button"
>
Billing & Payments
Billing & payments
</li>
<li class="settings-menu__item">
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class TableNavigationComponent implements OnInit {

campaignListNavigationItems = [
{title: 'Status', columnWidth: 'status-cell-width', keys: ['basicInformation', 'status'], sortAsc: true},
{title: 'Campaign Title', columnWidth: 'col-xs-2', keys: ['basicInformation', 'name'], sortAsc: true},
{title: 'Campaign title', columnWidth: 'col-xs-2', keys: ['basicInformation', 'name'], sortAsc: true},
{title: 'Budget', columnWidth: 'col-xs-1', keys: ['basicInformation', 'budget'], sortAsc: true},
{title: 'Cost', columnWidth: 'col-xs-1', keys: ['cost'], sortAsc: true},
{title: 'Clicks', columnWidth: 'col-xs-1', keys: ['clicks'], sortAsc: true},
Expand All @@ -40,8 +40,8 @@ export class TableNavigationComponent implements OnInit {

siteListNavigationItems = [
{title: 'Status', columnWidth: 'status-cell-width', keys: ['status'], sortAsc: true},
{title: 'Website Name', columnWidth: 'col-xs-3', keys: ['name'], sortAsc: true},
{title: 'Est. Revenue', columnWidth: 'col-xs-1', keys: ['revenue'], sortAsc: true},
{title: 'Website name', columnWidth: 'col-xs-3', keys: ['name'], sortAsc: true},
{title: 'Est. revenue', columnWidth: 'col-xs-1', keys: ['revenue'], sortAsc: true},
{title: 'Clicks', columnWidth: 'col-xs-1', keys: ['clicks'], sortAsc: true},
{title: 'Views', columnWidth: 'col-xs-1', keys: ['impressions'], sortAsc: true},
{title: 'CTR', columnWidth: 'col-xs-1', keys: ['ctr'], sortAsc: true},
Expand All @@ -59,7 +59,7 @@ export class TableNavigationComponent implements OnInit {
{title: 'Name', columnWidth: 'col-xs-1', keys: ['name'], sortAsc: true},
{title: 'Size', columnWidth: 'col-xs-1', hideArrows: true},
{title: 'Tags', columnWidth: 'col-xs-2', hideArrows: true},
{title: 'Est. Revenue', columnWidth: 'col-xs-1', keys: ['revenue'], sortAsc: true},
{title: 'Est. revenue', columnWidth: 'col-xs-1', keys: ['revenue'], sortAsc: true},
{title: 'Clicks', columnWidth: 'col-xs-1', keys: ['clicks'], sortAsc: true},
{title: 'Views', columnWidth: 'col-xs-1', keys: ['impressions'], sortAsc: true},
{title: 'CTR', columnWidth: 'col-xs-1', keys: ['ctr'], sortAsc: true},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
dwmth-heading
dwmth-heading--primary"
>
Add Funds
Deposit funds
</h1>

<p
Expand All @@ -21,7 +21,7 @@
dwmth-copy--large
dialog-description"
>
Below are information needed to add funds to Your account.
Here is the information required to deposit funds to your account.
</p>

<div
Expand All @@ -35,7 +35,7 @@
for="adshares-address"
class="dwmth-form-label"
>
Our Adshares Address
Adshares’ account address:
</label>
<input
id="adshares-address"
Expand All @@ -56,7 +56,8 @@
dwmth-copy--blue
add-funds-dialog__hint"
>
You need to send transfer to this address
Please transfer your ADS coins to this address.
Remember to add a message, otherwise your funds will not be deposited.
</p>
<div
class="
Expand Down Expand Up @@ -101,8 +102,8 @@
dwmth-copy--blue
add-funds-dialog__hint"
>
The message allows us to add transferred funds to your account.
We will send you a notification when we receive a transfer.
The message is necessary to deposit ADS coins to your account.
Please add the message above to your transfer.
</p>
<div
class="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { MatDialogRef } from '@angular/material';
import { HandleSubscription } from 'common/handle-subscription';
import { DepositInfo } from 'models/settings.model';
import { ApiService } from "app/api/api.service";
import { SessionService } from "app/session.service";
import { ApiService } from 'app/api/api.service';
import { SessionService } from 'app/session.service';

@Component({
selector: 'app-add-funds-dialog',
Expand All @@ -25,7 +25,6 @@ export class AddFundsDialogComponent extends HandleSubscription implements OnIni
}

ngOnInit() {

const user = this.session.getUser();
this.isEmailConfirmed = user.isEmailConfirmed;

Expand All @@ -36,7 +35,7 @@ export class AddFundsDialogComponent extends HandleSubscription implements OnIni
});
}

copyInput(input: HTMLInputElement):void {
copyInput(input: HTMLInputElement): void {
input.select();
document.execCommand('copy');
input.setSelectionRange(0, 0);
Expand Down
Loading

0 comments on commit ac5e483

Please sign in to comment.