forked from deso-protocol/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add notification transformation for NFT Transfers, fix console error when there are no fees in TransactionFeeMap (deso-protocol#526) * Fix calculation of ETH exchange rate including fee (deso-protocol#530) * add supply-stats route to show total supply and rich list (deso-protocol#531) * Fix preview and home screen icons for DeSo (deso-protocol#532) * Add support for managing sign-up bonus configurations (deso-protocol#529) * save current progress on updating admin panel * add support for modifying the sign up bonus config for a single country, update to use default jumio USD cents instead of DeSo nanos * refresh country bonuses after updating default jumio USD cents * add tooltip disclaimer about free DESO amount * update copy * simplify loops in GetMessages that handles encryption/decryption (deso-protocol#533) * simplify loops in GetMessages that handles encryption/decryption * message -> Message * Fix admin jumio checkboxes (deso-protocol#534) * use country sign up bonus config inferred from IP address when computing referral amount to display for sign up bonus (deso-protocol#535) * use flatMap to flatten array of message before decryption (deso-protocol#536) * Upload referral csv directly instead of parsing on the frontend (deso-protocol#537) * top diamonded list fix (deso-protocol#480) * use altumbase for daily gainers leaderboard (deso-protocol#538) * use altumbase for daily gainers leaderboard * fix import styling * [stable] Release 1.2.9 * add disclaimer on referrals page about amounts varying by locality of ID AND add support for setting default kickback amount (deso-protocol#539) * add disclaimer on referrals page about amounts varying by locality of ID * add support for updating the default kickback amount for referrers * add referral code, jumio starter DESO txn Hash, and referrer DeSo Txn hash to User Admin Data (deso-protocol#540) * make referral link relative to window origin (deso-protocol#541) * Ln/count keys with deso (deso-protocol#542) * save current progress * update some styling on the supply monitoring page * update supply stats page to show count of keys holding DESO * Update src/app/supply-monitoring-stats-page/supply-monitoring-stats/supply-monitoring-stats.component.html * fix admin panel jumio kickback usd cents (deso-protocol#544) * add support for NFT transfers, burns, and acceptance of transfers (deso-protocol#545) * add support for NFT transfers, burns, and acceptance of transfers * fix styling * change font color to gray for pending ownership * add fas class to fix issue with icons not appearing in select serial number component (deso-protocol#547) * Buy Now NFTs and NFT Splits (deso-protocol#546) * [stable] Release 2.0.0 (deso-protocol#550) * [stable] Release 2.0.1 Co-authored-by: Lazy Nina <[email protected]> Co-authored-by: NikolaiL <[email protected]> Co-authored-by: maebeam <[email protected]> Co-authored-by: diamondhands0 <[email protected]> Co-authored-by: diamondhands <[email protected]>
- Loading branch information
1 parent
d61d742
commit 40d96e6
Showing
64 changed files
with
2,923 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...in-jumio-edit-country-sign-up-bonus/admin-jumio-edit-country-sign-up-bonus.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<div app-theme class="p-15px"> | ||
<div class="d-flex flex-column"> | ||
<div>Update Sign-Up Bonus for {{ getCountryName() }} </div> | ||
<div class="d-flex flex-column"> | ||
<div class="d-flex py-15px"> | ||
<label for="referral-amount-override-usd" class="cursor-pointer mb-0">Referral Amount Override ($USD): </label> | ||
<input | ||
id="referral-amount-override-usd" | ||
[(ngModel)]="newReferralAmountOverrideUSD" | ||
class="form-control w-100 fs-15px lh-15px" | ||
placeholder="Enter an amount" | ||
type="number" | ||
min="0" | ||
step="0.01" | ||
/> | ||
</div> | ||
|
||
<div class="d-flex py-15px"> | ||
<label for="allow-custom-referral-amount" class="cursor-pointer mb-0">Allow Custom Referral Amount: </label> | ||
<input | ||
id="allow-custom-referral-amount" | ||
[(ngModel)]="newAllowCustomReferralAmount" | ||
type="checkbox"/> | ||
</div> | ||
|
||
<div class="d-flex py-15px"> | ||
<label for="kickback-amount-override-usd" class="cursor-pointer mb-0">Kickback Amount Override ($USD): </label> | ||
<input | ||
id="kickback-amount-override-usd" | ||
[(ngModel)]="newKickbackAmountOverrideUSD" | ||
class="form-control w-100 fs-15px lh-15px" | ||
placeholder="Enter an amount" | ||
type="number" | ||
min="0" | ||
step="0.01" | ||
/> | ||
</div> | ||
|
||
<div class="d-flex py-15px"> | ||
<label for="allow-custom-kickback-amount" class="cursor-pointer mb-0">Allow Custom Kickback Amount: </label> | ||
<input | ||
id="allow-custom-kickback-amount" | ||
[(ngModel)]="newAllowCustomKickbackAmount" | ||
type="checkbox"/> | ||
</div> | ||
</div> | ||
<div> | ||
<button | ||
class="btn btn-primary font-weight-bold ml-15px fs-14px br-12px" | ||
style="height: 36px; width: 75px; line-height: 15px" | ||
[ngClass]="{ | ||
disabled: updatingCountryLevelBonus, | ||
'btn-loading': updatingCountryLevelBonus | ||
}" | ||
(click)="updateSignUpBonus()" | ||
>Update</button> | ||
</div> | ||
</div> | ||
</div> | ||
|
98 changes: 98 additions & 0 deletions
98
...dmin-jumio-edit-country-sign-up-bonus/admin-jumio-edit-country-sign-up-bonus.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import { Component, Input, OnInit } from "@angular/core"; | ||
import { | ||
BackendApiService, | ||
CountryCodeDetails, | ||
CountryLevelSignUpBonus, | ||
CountryLevelSignUpBonusResponse, | ||
} from "../../../backend-api.service"; | ||
import { GlobalVarsService } from "../../../global-vars.service"; | ||
import { BsModalRef } from "ngx-bootstrap/modal"; | ||
import { BsModalService } from "ngx-bootstrap/modal"; | ||
import { Router } from "@angular/router"; | ||
|
||
@Component({ | ||
selector: "admin-jumio-edit-country-sign-up-bonus", | ||
templateUrl: "./admin-jumio-edit-country-sign-up-bonus.component.html", | ||
}) | ||
export class AdminJumioEditCountrySignUpBonusComponent implements OnInit { | ||
@Input() countryLevelSignUpBonusResponse: CountryLevelSignUpBonusResponse; | ||
|
||
newAllowCustomReferralAmount: boolean; | ||
newAllowCustomKickbackAmount: boolean; | ||
newReferralAmountOverrideUSD: number; | ||
newKickbackAmountOverrideUSD: number; | ||
updatingCountryLevelBonus: boolean = false; | ||
|
||
constructor( | ||
private globalVars: GlobalVarsService, | ||
private backendApi: BackendApiService, | ||
private modalService: BsModalService, | ||
private router: Router, | ||
public bsModalRef: BsModalRef | ||
) {} | ||
|
||
ngOnInit(): void { | ||
this.newAllowCustomKickbackAmount = this.getAllowCustomKickbackAmount(); | ||
this.newAllowCustomReferralAmount = this.getAllowCustomReferralAmount(); | ||
this.newReferralAmountOverrideUSD = this.getReferralAmountOverrideUSDCents() / 100; | ||
this.newKickbackAmountOverrideUSD = this.getKickbackAmountOverrideUSDCents() / 100; | ||
} | ||
|
||
getCountryCodeDetails(): CountryCodeDetails { | ||
return this.countryLevelSignUpBonusResponse.CountryCodeDetails; | ||
} | ||
|
||
getCountryLevelSignUpBonus(): CountryLevelSignUpBonus { | ||
return this.countryLevelSignUpBonusResponse.CountryLevelSignUpBonus; | ||
} | ||
|
||
getCountryName(): string { | ||
return this.getCountryCodeDetails().Name; | ||
} | ||
|
||
getCountryAlpha3(): string { | ||
return this.getCountryCodeDetails().Alpha3; | ||
} | ||
|
||
getAllowCustomReferralAmount(): boolean { | ||
return this.getCountryLevelSignUpBonus().AllowCustomReferralAmount; | ||
} | ||
|
||
getAllowCustomKickbackAmount(): boolean { | ||
return this.getCountryLevelSignUpBonus().AllowCustomKickbackAmount; | ||
} | ||
|
||
getReferralAmountOverrideUSDCents(): number { | ||
return this.getCountryLevelSignUpBonus().ReferralAmountOverrideUSDCents; | ||
} | ||
|
||
getKickbackAmountOverrideUSDCents(): number { | ||
return this.getCountryLevelSignUpBonus().KickbackAmountOverrideUSDCents; | ||
} | ||
|
||
updateSignUpBonus() { | ||
this.updatingCountryLevelBonus = true; | ||
this.backendApi | ||
.AdminUpdateJumioCountrySignUpBonus( | ||
this.globalVars.localNode, | ||
this.globalVars.loggedInUser?.PublicKeyBase58Check, | ||
this.getCountryAlpha3(), | ||
{ | ||
AllowCustomKickbackAmount: this.newAllowCustomKickbackAmount, | ||
AllowCustomReferralAmount: this.newAllowCustomReferralAmount, | ||
ReferralAmountOverrideUSDCents: Math.trunc(this.newReferralAmountOverrideUSD * 100), | ||
KickbackAmountOverrideUSDCents: Math.trunc(this.newKickbackAmountOverrideUSD * 100), | ||
} | ||
) | ||
.subscribe( | ||
() => { | ||
this.modalService.setDismissReason("sign-up-bonus-updated"); | ||
this.bsModalRef.hide(); | ||
}, | ||
(err) => { | ||
console.error(err); | ||
} | ||
) | ||
.add(() => (this.updatingCountryLevelBonus = false)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,132 @@ | ||
<div> | ||
<div class="fs-15px font-weight-bold mt-15px mb-15px px-15px"> | ||
Set Jumio Starter $DESO amount (in nanos): | ||
<div class="d-flex mt-5px"> | ||
<input | ||
[(ngModel)]="jumioDeSoNanos" | ||
(keydown.enter)="updateJumioDeSoNanos()" | ||
class="form-control w-100 fs-15px lh-15px" | ||
placeholder="Enter an amount" | ||
type="number" | ||
/> | ||
<button *ngIf="!updatingJumioDeSoNanos" (click)="updateJumioDeSoNanos()" class="btn btn-outline-primary fs-15px ml-5px"> | ||
Update | ||
</button> | ||
<button *ngIf="updatingJumioDeSoNanos" class="btn btn-primary fs-15px ml-5px" disabled> | ||
Working... | ||
</button> | ||
<tab-selector | ||
[tabs]="tabs" | ||
[activeTab]="activeTab" | ||
(tabClick)="_handleTabClick($event)"></tab-selector> | ||
<div class="p-15px fs-15px" *ngIf="activeTab === AdminJumioComponent.GENERAL"> | ||
<div class="fs-15px font-weight-bold mt-15px mb-15px px-15px"> | ||
Set Jumio Starter Amount in $USD: | ||
<div class="d-flex mt-5px"> | ||
<input | ||
[(ngModel)]="jumioUSD" | ||
(keydown.enter)="updateJumioUSDCents()" | ||
class="form-control w-100 fs-15px lh-15px" | ||
placeholder="Enter an amount" | ||
type="number" | ||
min="0" | ||
step="0.01" | ||
/> | ||
<button *ngIf="!updatingJumioUSD" (click)="updateJumioUSDCents()" class="btn btn-outline-primary fs-15px ml-5px"> | ||
Update | ||
</button> | ||
<button *ngIf="updatingJumioUSD" class="btn btn-primary fs-15px ml-5px" disabled> | ||
Working... | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="fs-15px font-weight-bold mt-15px mb-15px px-15px"> | ||
Reset Jumio for Public Key or Username: | ||
<div class="d-flex mt-5px"> | ||
<input | ||
[(ngModel)]="usernameToResetJumio" | ||
(keydown.enter)="_resetJumio()" | ||
class="form-control w-100 fs-15px lh-15px" | ||
placeholder="Enter a username or public key." | ||
/> | ||
<button *ngIf="!resettingJumio" (click)="_resetJumio()" class="btn btn-outline-primary fs-15px ml-5px"> | ||
Reset | ||
</button> | ||
<button *ngIf="resettingJumio" class="btn btn-primary fs-15px ml-5px" disabled> | ||
Working... | ||
</button> | ||
<div class="fs-15px font-weight-bold mt-15px mb-15px px-15px"> | ||
Set Jumio Kickback Amount in $USD: | ||
<div class="d-flex mt-5px"> | ||
<input | ||
[(ngModel)]="jumioKickbackUSD" | ||
(keydown.enter)="updateJumioKickbackUSDCents()" | ||
class="form-control w-100 fs-15px lh-15px" | ||
placeholder="Enter an amount" | ||
type="number" | ||
min="0" | ||
step="0.01" | ||
/> | ||
<button *ngIf="!updatingJumioKickbackUSD" (click)="updateJumioKickbackUSDCents()" class="btn btn-outline-primary fs-15px ml-5px"> | ||
Update | ||
</button> | ||
<button *ngIf="updatingJumioKickbackUSD" class="btn btn-primary fs-15px ml-5px" disabled> | ||
Working... | ||
</button> | ||
</div> | ||
</div> | ||
<div class="fs-15px font-weight-bold mt-15px mb-15px px-15px"> | ||
Reset Jumio for Public Key or Username: | ||
<div class="d-flex mt-5px"> | ||
<input | ||
[(ngModel)]="usernameToResetJumio" | ||
(keydown.enter)="_resetJumio()" | ||
class="form-control w-100 fs-15px lh-15px" | ||
placeholder="Enter a username or public key." | ||
/> | ||
<button *ngIf="!resettingJumio" (click)="_resetJumio()" class="btn btn-outline-primary fs-15px ml-5px"> | ||
Reset | ||
</button> | ||
<button *ngIf="resettingJumio" class="btn btn-primary fs-15px ml-5px" disabled> | ||
Working... | ||
</button> | ||
</div> | ||
</div> | ||
<div class="fs-15px font-weight-bold mt-15px mb-15px px-15px"> | ||
Execute Jumio Callback for Public Key or Username: | ||
<div class="d-flex mt-5px"> | ||
<div class="d-flex flex-column"> | ||
<input | ||
[(ngModel)]="usernameToExecuteJumioCallback" | ||
(keydown.enter)="_executeJumioCallback()" | ||
class="form-control w-100 fs-15px lh-15px" | ||
placeholder="Enter a username or public key." | ||
/> | ||
<select | ||
name="country" | ||
id="country-callback" | ||
[(ngModel)]="jumioCallbackCountrySelected" | ||
class="form-control selector mt-15px"> | ||
<option | ||
*ngFor="let country of countryLevelSignUpBonuses | keyvalue" | ||
[value]="country.value.CountryCodeDetails.Alpha3" | ||
[selected]="jumioCallbackCountrySelected === country.value.CountryCodeDetails.Alpha3">{{ country.key }}</option> | ||
</select> | ||
</div> | ||
<button *ngIf="!executingJumioCallback" (click)="_executeJumioCallback()" class="btn btn-outline-primary fs-15px ml-5px"> | ||
Execute | ||
</button> | ||
<button *ngIf="executingJumioCallback" class="btn btn-primary fs-15px ml-5px" disabled> | ||
Working... | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="fs-15px font-weight-bold mt-15px mb-15px px-15px"> | ||
Execute Jumio Callback for Public Key or Username: | ||
<div class="d-flex mt-5px"> | ||
<input | ||
[(ngModel)]="usernameToExecuteJumioCallback" | ||
(keydown.enter)="_executeJumioCallback()" | ||
class="form-control w-100 fs-15px lh-15px" | ||
placeholder="Enter a username or public key." | ||
/> | ||
<button *ngIf="!executingJumioCallback" (click)="_executeJumioCallback()" class="btn btn-outline-primary fs-15px ml-5px"> | ||
Execute | ||
</button> | ||
<button *ngIf="executingJumioCallback" class="btn btn-primary fs-15px ml-5px" disabled> | ||
Working... | ||
</button> | ||
<div class="p-15px fs-15px" *ngIf="activeTab === AdminJumioComponent.COUNTRY_BONUSES"> | ||
<div class="d-flex align-items-center"> | ||
<div class="col-4">Country</div> | ||
<div class="col-2">Referral Amount</div> | ||
<div class="col-2">Allow Referral Override</div> | ||
<div class="col-2">Kickback Amount</div> | ||
<div class="col-2">Allow Kickback Override</div> | ||
</div> | ||
<div *ngFor="let signUpBonus of countryLevelSignUpBonuses | keyvalue; let ii = index" class="py-15px d-flex"> | ||
<div class="col-4 d-flex align-items-center"> | ||
<i class="fa fa-pencil pr-5px" | ||
aria-hidden="true" | ||
(click)="editCountry(signUpBonus.value.CountryCodeDetails.Name, $event)" | ||
></i> | ||
<span>{{ signUpBonus.key }}</span> | ||
</div> | ||
<div class="col-2 d-flex"> | ||
{{ globalVars.formatUSD(signUpBonus.value.CountryLevelSignUpBonus.ReferralAmountOverrideUSDCents / 100, 2) }} | ||
</div> | ||
<div class="col-2 d-flex"> | ||
<input | ||
type="checkbox" | ||
[(ngModel)]="signUpBonus.value.CountryLevelSignUpBonus.AllowCustomReferralAmount" | ||
disabled | ||
/> | ||
</div> | ||
<div class="col-2 d-flex flex-column"> | ||
{{ globalVars.formatUSD(signUpBonus.value.CountryLevelSignUpBonus.KickbackAmountOverrideUSDCents / 100, 2) }} | ||
</div> | ||
<div class="col-2"> | ||
<input | ||
type="checkbox" | ||
[(ngModel)]="signUpBonus.value.CountryLevelSignUpBonus.AllowCustomKickbackAmount" | ||
disabled | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.