Skip to content

Commit 968a6c2

Browse files
Merge pull request #7781 from iotaledger/release/desktop-iota-2.0.4
release: desktop iota 2.0.4
2 parents 10af2c2 + 12e4d05 commit 968a6c2

File tree

102 files changed

+3885
-3747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+3885
-3747
lines changed

.github/ISSUE_TEMPLATE/create-task.yml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,4 @@ body:
1818
label: Task description
1919
description: Describe the task that needs to be completed.
2020
validations:
21-
required: true
22-
23-
- type: textarea
24-
id: requirements
25-
attributes:
26-
label: Requirements
27-
description: What are the requirements for this task, this could be a checklist of subtasks.
28-
validations:
29-
required: true
30-
31-
- type: checkboxes
32-
id: checklist
33-
attributes:
34-
label: Creation checklist
35-
description: 'Before submitting this task please ensure you have done the following if necessary:'
36-
options:
37-
- label: I have assigned this task to the correct people
38-
required: false
39-
- label: I have added the most appropriate labels
40-
required: false
41-
- label: I have linked the correct milestone and/or project
42-
required: false
21+
required: true

.prettierrc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ singleQuote: true
88
tabWidth: 4
99
trailingComma: es5
1010
useTabs: false
11+
plugins:
12+
- prettier-plugin-svelte
13+
overrides:
14+
- files: '*.svelte'
15+
options:
16+
parser: 'svelte'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"check-types:shared": "cd packages/shared && tsc --project tsconfig.base.json --pretty --noEmit",
3030
"docs:start": "cd docs/ && retype start",
3131
"format": "yarn format:write",
32-
"format:check": "prettier -c \"**/*.{ts,js,json,scss,css,svelte}\"",
33-
"format:write": "prettier -w \"**/*.{ts,js,json,scss,css,svelte}\"",
32+
"format:check": "prettier --plugin prettier-plugin-svelte -c \"**/*.{ts,js,json,scss,css,svelte}\"",
33+
"format:write": "prettier --plugin prettier-plugin-svelte -w \"**/*.{ts,js,json,scss,css,svelte}\"",
3434
"lint": "yarn lint:fix",
3535
"lint:check": "eslint . --cache",
3636
"lint:fix": "eslint . --cache --fix",

packages/desktop/components/modals/AccountActionsMenu.svelte

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
import { selectedAccount } from '@core/account/stores'
55
import { localize } from '@core/i18n'
6-
import { activeAccounts, isActiveLedgerProfile, visibleActiveAccounts } from '@core/profile/stores'
6+
import { activeAccounts, activeProfile, isActiveLedgerProfile, visibleActiveAccounts } from '@core/profile/stores'
77
import { deleteAccount } from '@core/profile-manager/actions'
88
99
import { Icon } from '@auxiliary/icon/enums'
@@ -12,6 +12,7 @@
1212
import { checkOrConnectLedger } from '@core/ledger'
1313
import { showAppNotification } from '@auxiliary/notification'
1414
import { handleError } from '@core/error/handlers'
15+
import { NetworkId } from '@core/network/enums'
1516
1617
export let modal: Modal = undefined
1718
@@ -28,6 +29,11 @@
2829
modal?.close()
2930
}
3031
32+
function onViewAddressHistoryClick(): void {
33+
openPopup({ id: PopupId.AddressHistory })
34+
modal?.close()
35+
}
36+
3137
function onVerifyAddressClick(): void {
3238
const ADDRESS_INDEX = 0
3339
checkOrConnectLedger(() => {
@@ -66,6 +72,13 @@
6672
<Modal bind:this={modal} {...$$restProps}>
6773
<account-actions-menu class="flex flex-col">
6874
<MenuItem icon={Icon.Doc} title={localize('actions.viewBalanceBreakdown')} onClick={onViewBalanceClick} />
75+
{#if $activeProfile?.network?.id === NetworkId.Iota}
76+
<MenuItem
77+
icon={Icon.Timer}
78+
title={localize('actions.viewAddressHistory')}
79+
onClick={onViewAddressHistoryClick}
80+
/>
81+
{/if}
6982
<MenuItem icon={Icon.Customize} title={localize('actions.customizeAcount')} onClick={onCustomiseAccountClick} />
7083
{#if $isActiveLedgerProfile}
7184
<MenuItem

packages/desktop/components/popups/ActivityDetailsPopup.svelte

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
<script lang="ts">
2+
import { PopupId, closePopup, openPopup } from '@auxiliary/popup'
3+
import { openUrlInBrowser } from '@core/app'
24
import { localize } from '@core/i18n'
5+
import { ExplorerEndpoint } from '@core/network'
36
import { getOfficialExplorerUrl } from '@core/network/utils'
4-
import {
5-
Text,
6-
Button,
7-
FontWeight,
8-
TextType,
9-
BasicActivityDetails,
10-
AliasActivityDetails,
11-
FoundryActivityDetails,
12-
GovernanceActivityDetails,
13-
NftActivityDetails,
14-
ConsolidationActivityDetails,
15-
ActivityInformation,
16-
} from 'shared/components'
17-
import { openUrlInBrowser } from '@core/app'
7+
import { activeProfile, checkActiveProfileAuth } from '@core/profile'
8+
import { setClipboard, truncateString } from '@core/utils'
189
import {
1910
ActivityAsyncStatus,
2011
ActivityDirection,
@@ -23,13 +14,21 @@
2314
rejectActivity,
2415
selectedAccountActivities,
2516
} from '@core/wallet'
26-
import { activeProfile, checkActiveProfileAuth } from '@core/profile'
27-
import { setClipboard } from '@core/utils'
28-
import { truncateString } from '@core/utils'
29-
import { closePopup, openPopup, PopupId } from '@auxiliary/popup'
30-
import { onMount } from 'svelte'
31-
import { ExplorerEndpoint } from '@core/network'
17+
import {
18+
ActivityInformation,
19+
AliasActivityDetails,
20+
BasicActivityDetails,
21+
Button,
22+
ConsolidationActivityDetails,
23+
FontWeight,
24+
FoundryActivityDetails,
25+
GovernanceActivityDetails,
26+
NftActivityDetails,
27+
Text,
28+
TextType,
29+
} from 'shared/components'
3230
import { TextHintVariant } from 'shared/components/enums'
31+
import { onMount } from 'svelte'
3332
3433
export let activityId: string
3534
export let _onMount: (..._: any[]) => Promise<void> = async () => {}
@@ -45,7 +44,13 @@
4544
activity?.asyncData?.asyncStatus === ActivityAsyncStatus.Unclaimed
4645
4746
function onExplorerClick(): void {
48-
openUrlInBrowser(`${explorerUrl}/${ExplorerEndpoint.Transaction}/${activity?.transactionId}`)
47+
let url: string
48+
if (activity?.type === ActivityType.Vesting) {
49+
url = `${explorerUrl}/${ExplorerEndpoint.Output}/${activity?.outputId}`
50+
} else {
51+
url = `${explorerUrl}/${ExplorerEndpoint.Transaction}/${activity?.transactionId}`
52+
}
53+
openUrlInBrowser(url)
4954
}
5055
5156
function onTransactionIdClick(): void {
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<script lang="ts">
2+
import { getSelectedAccount } from '@core/account'
3+
import { localize } from '@core/i18n'
4+
import { truncateString } from '@core/utils'
5+
import { AccountAddress } from '@iota/sdk/out/types'
6+
import VirtualList from '@sveltejs/svelte-virtual-list'
7+
import { FontWeight, KeyValueBox, Spinner, Text, TextType } from 'shared/components'
8+
import { onMount } from 'svelte'
9+
10+
let addressList: AccountAddress[] | undefined = undefined
11+
12+
onMount(() => {
13+
getSelectedAccount()
14+
?.addresses()
15+
.then((_addressList) => {
16+
addressList = _addressList?.sort((a, b) => a.keyIndex - b.keyIndex) ?? []
17+
})
18+
.catch((err) => {
19+
console.error(err)
20+
addressList = []
21+
})
22+
})
23+
</script>
24+
25+
<div class="flex flex-col space-y-6">
26+
<Text type={TextType.h3} fontWeight={FontWeight.semibold} lineHeight="6">
27+
{localize('popups.addressHistory.title')}
28+
</Text>
29+
<Text fontSize="15" color="gray-700" classes="text-left">{localize('popups.addressHistory.disclaimer')}</Text>
30+
{#if addressList}
31+
{#if addressList.length > 0}
32+
<div class="w-full flex-col space-y-2 virtual-list-wrapper">
33+
<VirtualList items={addressList} let:item>
34+
<div class="mb-1">
35+
<KeyValueBox
36+
isCopyable
37+
classes="flex items-center w-full py-4"
38+
keyText={truncateString(item?.address, 15, 15)}
39+
valueText={localize('popups.addressHistory.indexAndType', {
40+
values: {
41+
index: item.keyIndex,
42+
internal: item.internal,
43+
},
44+
})}
45+
copyValue={item.address}
46+
backgroundColor="gray-50"
47+
darkBackgroundColor="gray-900"
48+
/>
49+
</div>
50+
</VirtualList>
51+
</div>
52+
{:else}
53+
<Text secondary classes="text-center">-</Text>
54+
{/if}
55+
{:else}
56+
<div class="flex items-center justify-center">
57+
<Spinner />
58+
</div>
59+
{/if}
60+
</div>
61+
62+
<style lang="scss">
63+
.virtual-list-wrapper :global(svelte-virtual-list-viewport) {
64+
margin-right: -1rem !important;
65+
flex: auto;
66+
overflow-y: scroll;
67+
padding-right: 1.5rem !important;
68+
min-height: 52px;
69+
max-height: 300px;
70+
}
71+
72+
.virtual-list-wrapper :global(svelte-virtual-list-contents) {
73+
margin-right: -1rem !important;
74+
}
75+
</style>

packages/desktop/components/popups/LedgerAppGuidePopup.svelte

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
import { LedgerAppName, ledgerAppName } from '@core/ledger'
55
import { localize } from '@core/i18n'
66
import { IllustrationEnum } from '@auxiliary/illustration'
7+
import { Icon } from '@auxiliary/icon'
78
89
let stepIndex = 0
9-
const stepAnimations = [
10+
const stepIlustrations = [
1011
IllustrationEnum.LedgerLiveUpdatedDesktop,
1112
IllustrationEnum.LedgerConnected2Desktop,
1213
$ledgerAppName === LedgerAppName.Shimmer
@@ -16,6 +17,14 @@
1617
IllustrationEnum.LedgerCloseLiveDesktop,
1718
]
1819
20+
const stepIconWithIlustrations = [
21+
undefined,
22+
undefined,
23+
undefined,
24+
$ledgerAppName === LedgerAppName.Shimmer ? Icon.Shimmer : Icon.Iota,
25+
undefined,
26+
]
27+
1928
function changeIndex(increment: number): void {
2029
stepIndex += increment
2130
}
@@ -29,7 +38,12 @@
2938
{localize('popups.ledgerAppGuide.title', { values: { legacy: $ledgerAppName } })}
3039
</Text>
3140
<div class="w-full flex flex-row flex-wrap">
32-
<LedgerAnimation illustration={stepAnimations[stepIndex]} classes="illustration-wrapper" bgClasses="top-6" />
41+
<LedgerAnimation
42+
illustration={stepIlustrations[stepIndex]}
43+
iconNetwork={stepIconWithIlustrations[stepIndex]}
44+
classes="illustration-wrapper"
45+
bgClasses="top-6"
46+
/>
3347
<div class="w-full text-center my-9 px-10">
3448
<Text secondary>
3549
{localize(`popups.ledgerAppGuide.steps.${stepIndex}`, { values: { legacy: $ledgerAppName } })}

packages/desktop/components/popups/LedgerConnectionGuidePopup.svelte

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,24 @@
44
import { closePopup } from '@auxiliary/popup'
55
import { localize } from '@core/i18n'
66
import { IllustrationEnum } from '@auxiliary/illustration'
7-
import { ledgerAppName } from '@core/ledger'
7+
import { LedgerAppName, ledgerAppName } from '@core/ledger'
8+
import { Icon } from '@auxiliary/icon'
89
910
let stepIndex = 0
10-
const stepAnimations = [
11+
const stepIllustrations = [
1112
IllustrationEnum.LedgerBackgroundLiveDesktop,
1213
IllustrationEnum.LedgerPinDesktop,
1314
IllustrationEnum.LedgerOpenAppDesktop,
1415
IllustrationEnum.LedgerSupport,
1516
]
1617
18+
const stepIconWithIlustrations = [
19+
undefined,
20+
undefined,
21+
$ledgerAppName === LedgerAppName.Shimmer ? Icon.Shimmer : Icon.Iota,
22+
undefined,
23+
]
24+
1725
function changeIndex(increment: number): void {
1826
stepIndex += increment
1927
}
@@ -25,7 +33,12 @@
2533

2634
<Text type={TextType.h4} classes="mb-6">{localize('popups.ledgerConnectionGuide.title')}</Text>
2735
<div class="w-full flex flex-row flex-wrap relative z-0">
28-
<LedgerAnimation illustration={stepAnimations[stepIndex]} classes="illustration-wrapper" bgClasses="top-7" />
36+
<LedgerAnimation
37+
illustration={stepIllustrations[stepIndex]}
38+
iconNetwork={stepIconWithIlustrations[stepIndex]}
39+
classes="illustration-wrapper"
40+
bgClasses="top-7"
41+
/>
2942
<div class="w-full text-center my-9 px-10 z-10">
3043
{#if typeof localize(`popups.ledgerConnectionGuide.steps.${stepIndex}`) === 'string'}
3144
<Text secondary classes="inline-block"

packages/desktop/components/popups/Popup.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import ActivityDetailsPopup from './ActivityDetailsPopup.svelte'
1313
import AddNodePopup from './AddNodePopup.svelte'
1414
import AddProposalPopup from './AddProposalPopup.svelte'
15+
import AddressHistoryPopup from './AddressHistoryPopup.svelte'
1516
import AliasConfirmationPopup from './AliasConfirmationPopup.svelte'
1617
import BackupStrongholdPopup from './BackupStrongholdPopup.svelte'
1718
import BurnNativeTokensPopup from './BurnNativeTokensPopup.svelte'
@@ -97,6 +98,7 @@
9798
[PopupId.ActivityDetails]: ActivityDetailsPopup,
9899
[PopupId.AddNode]: AddNodePopup,
99100
[PopupId.AddProposal]: AddProposalPopup,
101+
[PopupId.AddressHistory]: AddressHistoryPopup,
100102
[PopupId.AliasConfirmation]: AliasConfirmationPopup,
101103
[PopupId.BackupStronghold]: BackupStrongholdPopup,
102104
[PopupId.BurnNativeTokens]: BurnNativeTokensPopup,

0 commit comments

Comments
 (0)