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

1.0.3 release #1495

Merged
merged 41 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e2f0353
Merge pull request #1427 from nemgrouplimited/main
rg911 Apr 14, 2021
5eee307
read finance pk from config
OlegMakarenko Apr 23, 2021
443be8f
created opt-in transaction component
OlegMakarenko Apr 23, 2021
873e4b9
add styles
OlegMakarenko Apr 23, 2021
19ce6b2
add optin logo
OlegMakarenko Apr 23, 2021
e485403
add check if the tx announcer is finance
OlegMakarenko Apr 23, 2021
7a9335e
add optin detail table
OlegMakarenko Apr 23, 2021
3868859
add optin tx status and en translation
OlegMakarenko Apr 23, 2021
4f462c2
fix copy
OlegMakarenko Apr 23, 2021
c63c1d5
add amount and nis address display
OlegMakarenko Apr 26, 2021
d80fae2
improve styles
OlegMakarenko Apr 26, 2021
9b3867c
rollback styles
OlegMakarenko Apr 26, 2021
21e085c
style fix
OlegMakarenko Apr 26, 2021
28a0942
fix copy
OlegMakarenko Apr 26, 2021
5e510ef
fix bonded tx details overlaps cosign form bug
OlegMakarenko Apr 26, 2021
915186e
add optin tx icon. Add opt-in tx caption to the transaction list. Fix…
OlegMakarenko Apr 26, 2021
85621b0
lint
OlegMakarenko Apr 26, 2021
c689c38
Merge pull request #1457 from nemgrouplimited/optin-tx
rg911 Apr 27, 2021
9de53af
fix opt-in tx cosign
OlegMakarenko Apr 27, 2021
ff041b4
lint
OlegMakarenko Apr 27, 2021
e9dbdad
check wehter tx needs signature
OlegMakarenko Apr 27, 2021
87769e7
add console error for config reading. Change address compare
OlegMakarenko Apr 27, 2021
e9733f3
add optional chaining for address compare
OlegMakarenko Apr 27, 2021
5c72e73
Merge pull request #1462 from nemgrouplimited/optin-tx
rg911 Apr 28, 2021
6e9a31a
add support of multiple opt-in transfers
OlegMakarenko Apr 30, 2021
6387efd
lint
OlegMakarenko Apr 30, 2021
444a3e6
add address counter
OlegMakarenko Apr 30, 2021
081aae3
Merge pull request #1470 from OlegMakarenko/optin-tx
rg911 Apr 30, 2021
28ef532
hide cosignatory QR for Opt-in tx
OlegMakarenko May 6, 2021
499f1b4
lint
OlegMakarenko May 6, 2021
94b5113
Merge pull request #1481 from OlegMakarenko/optin-tx
AdriaCarrera May 7, 2021
776606c
Added changelog and increased version
AdriaCarrera May 10, 2021
cff27a7
add OptinTransaction screen for confirmed transactions
OlegMakarenko May 11, 2021
5075f42
add the opt-in Aggregate Bonded tx type check
OlegMakarenko May 11, 2021
7a1d283
update translation
OlegMakarenko May 11, 2021
cf5d90a
lint
OlegMakarenko May 11, 2021
3e6e47c
Merge pull request #1486 from OlegMakarenko/optin-tx
AdriaCarrera May 11, 2021
6df0a9a
Merge pull request #1484 from nemgrouplimited/1.0.3-release
AdriaCarrera May 11, 2021
0165e56
Release translations
AdriaCarrera May 13, 2021
38d38cf
Merge pull request #1494 from nemgrouplimited/fix/post_opt_translations
AdriaCarrera May 13, 2021
8e0ba10
updated version in package-lock.json
rg911 May 17, 2021
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: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ __mocks__/**/*.js
template.config.js
.env
keys-whitelist.json
keys-finance.json
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.

The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [1.0.3][v1.0.3] - 10-May-2021

### Milestone: Post-launch Opt-in

- Added a custom view for Opt-in payout transactions

## [1.0.2][v1.0.2] - 13-Apr-2021

### Milestone: New testnet update
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "symbol-desktop-wallet",
"description": "Symbol Wallet",
"homepage": "https://github.com/nemgrouplimited/symbol-desktop-wallet",
"version": "1.0.2",
"version": "1.0.3",
"repository": {
"type": "git",
"url": "https://github.com/nemgrouplimited/symbol-desktop-wallet.git"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ActionDisplay/ActionDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/>
</div>
<div class="bottom overflow_ellipsis">
<span>{{ $t(`transaction_descriptor_${transaction.type}`) }}</span>
<span>{{ $t(`transaction_descriptor_${transaction.type}${isOptinPayoutTransaction ? '_optin' : ''}`) }}</span>
<span v-if="needsCosignature" class="click-to-cosign">({{ $t('click_to_cosign') }})</span>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/components/ActionDisplay/ActionDisplayTs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export class ActionDisplayTs extends Vue {
*/
public transactionType = TransactionType;

/**
* Whether the transaction is the Opt-in Payment
* @type {boolean}
*/
@Prop({ default: false }) isOptinPayoutTransaction: boolean;

/**
* @protected
* @type {boolean}
Expand Down
1 change: 0 additions & 1 deletion src/components/TransactionDetails/TransactionDetails.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

.transaction-details-outer-container {
padding: 0 !important;
max-height: 4rem;
height: 100%;
position: relative;
display: block;
Expand Down
275 changes: 275 additions & 0 deletions src/components/TransactionDetails/TransactionOptinPayoutDetails.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
<template>
<div class="root">
<div v-if="!isLoading" class="row">
<div class="image-container">
<img :src="OptinLogo" class="image" />
</div>
<div class="text-container">
<div class="title-text">
{{ $t('optin_postlaunch_tx_title') }}
</div>
<div class="content-text text-description">
{{ completed ? $t('optin_postlaunch_tx_completed_description') : $t('optin_postlaunch_tx_pending_description') }}
</div>
<div v-if="hasTransfers" class="content-text">
<table>
<tr>
<td class="table-header-text">
{{ completed ? $t('optin_postlaunch_tx_completed_amount') : $t('optin_postlaunch_tx_pending_amount') }}
</td>
<td class="amount-text">
<MosaicAmountDisplay
v-if="amount !== null"
:id="mosaicId"
:absolute-amount="amount"
:show-ticker="true"
color="green"
/>
</td>
</tr>
<tr v-for="(address, index) in NISAddresses" :key="'' + index + 'nisaddr'">
<td class="table-header-text">
{{ $t('optin_postlaunch_tx_nis_address') }} {{ NISAddresses.length > 1 ? index + 1 : '' }}:
</td>
<td class="address-text">{{ address }}</td>
</tr>
</table>
</div>
</div>
</div>
<div class="column">
<div class="details-button" @click="onDetailsClick">
{{ isDetailsShown ? $t('hide_details') : $t('show_details') }}
</div>
<transition name="collapse">
<div v-if="isDetailsShown" class="transaction-details" :class="{ 'transaction-details-expanded': isExpanded }">
<TransactionDetails :transaction="transaction" />
</div>
</transition>
</div>
<Spin v-if="isLoading" size="large" fix class="absolute" />
</div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import {
AggregateTransaction,
UInt64,
Mosaic,
TransactionStatus,
TransactionType,
TransferTransaction,
UnresolvedMosaicId,
} from 'symbol-sdk';
import { AccountModel } from '@/core/database/entities/AccountModel';
import { optinImages } from '@/views/resources/Images';
import TransactionDetails from '@/components/TransactionDetails/TransactionDetails.vue';
import { TransactionView } from '@/core/transactions/TransactionView';
import MosaicAmountDisplay from '@/components/MosaicAmountDisplay/MosaicAmountDisplay.vue';

@Component({
components: {
MosaicAmountDisplay,
TransactionDetails,
},
})
export default class TransactionOptinPayoutDetails extends Vue {
@Prop({ required: true }) readonly transaction: AggregateTransaction;
@Prop({ required: true }) readonly currentAccount: AccountModel;

private OptinLogo = optinImages.optinLogo;
private isDetailsShown = false;
private isExpanded = false;
private isLoading = false;
private transactionDetails: AggregateTransaction = null;

private get referenceInnerTransactions(): Array<TransferTransaction> {
const currentAddress = this.currentAccount.address;
const innerTransactions = this.transaction.innerTransactions.length
? this.transaction.innerTransactions
: this.transactionDetails?.innerTransactions || [];

const transactions = innerTransactions.filter(
(innerTransaction) =>
innerTransaction.type === TransactionType.TRANSFER &&
(innerTransaction as TransferTransaction).recipientAddress?.plain() === currentAddress &&
(innerTransaction as TransferTransaction).mosaics?.length,
);

return transactions as Array<TransferTransaction>;
}

private get hasTransfers(): boolean {
return !!this.referenceInnerTransactions.length;
}

private get completed(): boolean {
return TransactionView.getTransactionStatus(this.transaction) === 'confirmed';
}

private get transferredMosaics(): Array<Mosaic> {
return this.referenceInnerTransactions.map((transaction) => transaction.mosaics[0]);
}

private get amount(): UInt64 {
let sumAmount = UInt64.fromNumericString('0');
this.transferredMosaics?.forEach((mosaic) => (sumAmount = sumAmount.add(mosaic.amount)));

return sumAmount;
}

private get mosaicId(): UnresolvedMosaicId {
return this.transferredMosaics[0]?.id;
}

private get NISAddresses(): Array<string> {
let NISAddresses = [];

try {
NISAddresses = this.referenceInnerTransactions
.map((transaction) => JSON.parse(transaction?.message.payload || '{}').nisAddress)
.filter((nisAddress) => !!nisAddress);
} catch (e) {
console.log('Opt-in payment transaction. Failed to get NIS1 address', e);
}

return NISAddresses;
}

public async fetchTransactionDetails() {
this.isLoading = true;

try {
const transactionHash = this.transaction.transactionInfo.hash;
const transactionStatus: TransactionStatus = (await this.$store.dispatch('transaction/FETCH_TRANSACTION_STATUS', {
transactionHash,
})) as TransactionStatus;

if (transactionStatus.group !== 'failed') {
this.transactionDetails = (await this.$store.dispatch('transaction/LOAD_TRANSACTION_DETAILS', {
group: transactionStatus.group,
transactionHash,
})) as AggregateTransaction;
}
} catch (error) {
console.log(error);
}

this.isLoading = false;
}

private onDetailsClick() {
this.isDetailsShown = !this.isDetailsShown;
setTimeout(() => {
this.isExpanded = this.isDetailsShown;
}, 500);
}

private mounted() {
this.isDetailsShown = false;
this.isExpanded = false;
this.isLoading = false;
this.fetchTransactionDetails();
}
}
</script>

<style lang="less" scoped>
@import '../../views/resources/css/variables.less';

.root {
padding-bottom: 0.1rem;
}

.row {
display: flex;
flex-direction: row;
}

.column {
display: flex;
flex-direction: column;
}

.image-container {
display: flex;
flex-direction: column;
justify-content: flex-start;
width: 1.92rem;
margin-top: -1px;
margin-left: 0.1rem;
margin-right: 0.3rem;
}

.image {
width: 1.92rem;
height: auto;
}

.text-container {
flex: 1;
color: @primary;
font-size: @normalFont;
}

.title-text {
font-family: @symbolFontBold;
font-size: 40px;
margin: 0;
}

.content-text {
font-family: @symbolFontMedium;
margin: 16px 0;
line-height: 24px;
}

.text-description {
font-family: @symbolFontSemiBold;
margin-bottom: 0.6rem;
}

.table-header-text {
padding-right: 0.3rem;
}

.address-text {
color: @purpleLightest;
}

.amount-text {
color: @accentGreen;
}

.details-button {
font-family: @symbolFontSemiBold;
color: @accentPink;
margin-right: 0.1rem;
align-self: flex-end;
cursor: pointer;
}

.transaction-details {
border-top-style: solid;
border-top-width: 1px;
border-top-color: @line;
padding-top: 0.4rem;
margin-top: 0.4rem;
max-height: 3rem;
}

.transaction-details-expanded {
max-height: 100rem;
}

.collapse-enter-active,
.collapse-leave-active {
transition: max-height 0.3s;
}

.collapse-enter,
.collapse-leave-to {
max-height: 0;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<!-- SECOND COLUMN -->
<div class="address-cell">
<ActionDisplay :transaction="transaction" />
<ActionDisplay :transaction="transaction" :is-optin-payout-transaction="isOptinPayoutTransaction" />
</div>

<!-- THIRD COLUMN -->
Expand Down
Loading