Skip to content

Commit

Permalink
Merge branch 'develop' into clear-comment
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez authored Dec 11, 2024
2 parents 332c546 + b45cbce commit 432f8c4
Show file tree
Hide file tree
Showing 301 changed files with 8,601 additions and 2,951 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/apps_wallet_prod_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
jobs:
wallet-prod-build:
permissions:
contents: read
contents: write
runs-on: [self-hosted]
steps:
- name: Checking out the repository
Expand Down Expand Up @@ -59,29 +59,27 @@ jobs:
run: |
if [ "${{ env.PREV_TAG }}" = "none" ]; then
echo "No previous tag found. Skipping changelog generation."
echo "changelog=No previous tag found. Changelog generation skipped." >> $GITHUB_ENV
echo "changelog=No previous tag found. Changelog generation skipped." >> $GITHUB_OUTPUT
else
git log ${{ env.PREV_TAG }}..${{ env.CURRENT_TAG }} --pretty=format:"- %s by @%an in #%h" -- ./apps/wallet > CHANGELOG.md
changelog=$(cat CHANGELOG.md)
echo "changelog=$changelog" >> $GITHUB_ENV
echo "## Changelog" >> CHANGELOG.md
git log ${{ env.PREV_TAG }}..${{ env.CURRENT_TAG }} --pretty=format:"- %s in #%h" -- ./apps/wallet > CHANGELOG.md
fi
- name: Get version from tag
id: version
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/wallet-v}"

- name: Create GitHub Release
uses: elgohr/Github-Release-Action@c5ea99036abb741a89f8bf1f2cd7fba845e3313a # v5.0.0
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.CURRENT_TAG }}
release_name: IOTA Wallet v${{ steps.version.outputs.version }}
body: |
## Changelog
{{ env.changelog }}
name: IOTA Wallet v${{ steps.version.outputs.version }}
draft: true
prerelease: false
body_path: CHANGELOG.md

- name: Upload artifacts
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
Expand Down
2 changes: 1 addition & 1 deletion apps/apps-backend/src/features/features.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class FeaturesController {
defaultValue: false,
},
[Feature.StardustMigration]: {
defaultValue: false,
defaultValue: true,
},
[Feature.SupplyIncreaseVesting]: {
defaultValue: true,
Expand Down
23 changes: 23 additions & 0 deletions apps/core/src/components/buttons/ViewTxnOnExplorerButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import React, { JSX } from 'react';
import { Button, ButtonType, LoadingIndicator } from '@iota/apps-ui-kit';
import { ArrowTopRight } from '@iota/ui-icons';

interface ViewTxnOnExplorerButtonProps {
digest?: string;
}

export function ViewTxnOnExplorerButton({ digest }: ViewTxnOnExplorerButtonProps): JSX.Element {
return (
<Button
type={ButtonType.Outlined}
text="View on Explorer"
fullWidth
icon={digest ? <ArrowTopRight /> : <LoadingIndicator data-testid="loading-indicator" />}
iconAfterText
disabled={!digest}
/>
);
}
4 changes: 4 additions & 0 deletions apps/core/src/components/buttons/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

export * from './ViewTxnOnExplorerButton';
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,55 @@
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import {
CoinItem,
getRecognizedUnRecognizedTokenChanges,
type BalanceChange,
type BalanceChangeSummary,
} from '@iota/core';
import { useMemo } from 'react';
import React, { useMemo } from 'react';
import { Divider, Header, KeyValueInfo, Panel } from '@iota/apps-ui-kit';
import { ExplorerLink, ExplorerLinkType } from '_src/ui/app/components';
import type { BalanceChangeSummary, RenderExplorerLink } from '../../types';
import { ExplorerLinkType } from '../../enums';
import { formatAddress } from '@iota/iota-sdk/utils';
import { CoinItem } from '../coin';
import { RecognizedBadge } from '@iota/ui-icons';
import { getRecognizedUnRecognizedTokenChanges } from '../../utils';
import { BalanceChange } from '../../interfaces';

interface BalanceChangesProps {
renderExplorerLink: RenderExplorerLink;
changes?: BalanceChangeSummary;
}

export function BalanceChanges({ changes, renderExplorerLink: ExplorerLink }: BalanceChangesProps) {
if (!changes) return null;

return (
<>
{Object.entries(changes).map(([owner, changes]) => {
return (
<Panel key={owner} hasBorder>
<div className="flex flex-col gap-y-sm overflow-hidden rounded-xl">
<Header title="Balance Changes" />
<BalanceChangeEntries changes={changes} />
<div className="flex flex-col gap-y-sm px-md pb-md">
<Divider />
<KeyValueInfo
keyText="Owner"
value={
<ExplorerLink
type={ExplorerLinkType.Address}
address={owner}
>
{formatAddress(owner)}
</ExplorerLink>
}
fullwidth
/>
</div>
</div>
</Panel>
);
})}
</>
);
}

function BalanceChangeEntry({ change }: { change: BalanceChange }) {
const { amount, coinType, unRecognizedToken } = change;
return (
Expand Down Expand Up @@ -54,37 +87,3 @@ function BalanceChangeEntries({ changes }: { changes: BalanceChange[] }) {
</>
);
}

export function BalanceChanges({ changes }: BalanceChangesProps) {
if (!changes) return null;

return (
<>
{Object.entries(changes).map(([owner, changes]) => {
return (
<Panel key={owner} hasBorder>
<div className="flex flex-col gap-y-sm overflow-hidden rounded-xl">
<Header title="Balance Changes" />
<BalanceChangeEntries changes={changes} />
<div className="flex flex-col gap-y-sm px-md pb-md">
<Divider />
<KeyValueInfo
keyText="Owner"
value={
<ExplorerLink
type={ExplorerLinkType.Address}
address={owner}
>
{formatAddress(owner)}
</ExplorerLink>
}
fullwidth
/>
</div>
</div>
</Panel>
);
})}
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,28 @@
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import { ExplorerLink, ExplorerLinkType } from '_components';
import { type IotaObjectChangeWithDisplay, ImageIcon } from '@iota/core';

import React from 'react';
import { type IotaObjectChangeWithDisplay, ExplorerLinkType, ImageIcon } from '../../';
import { Card, CardAction, CardActionType, CardBody, CardImage, CardType } from '@iota/apps-ui-kit';
import { ArrowTopRight } from '@iota/ui-icons';
import { RenderExplorerLink } from '../../types';

export function ObjectChangeDisplay({ change }: { change: IotaObjectChangeWithDisplay }) {
interface ObjectChangeDisplayProps {
renderExplorerLink: RenderExplorerLink;
change?: IotaObjectChangeWithDisplay;
}
export function ObjectChangeDisplay({
change,
renderExplorerLink: ExplorerLink,
}: ObjectChangeDisplayProps) {
const display = change?.display?.data;
const name = display?.name ?? '';
const objectId = 'objectId' in change && change?.objectId;
const objectId = change && 'objectId' in change && change?.objectId;

if (!display) return null;

return (
<ExplorerLink
className="text-hero-dark no-underline"
objectID={objectId?.toString() ?? ''}
type={ExplorerLinkType.Object}
>
<ExplorerLink objectID={objectId?.toString() ?? ''} type={ExplorerLinkType.Object}>
<Card type={CardType.Default} isHoverable>
<CardImage>
<ImageIcon src={display.image_url ?? ''} label={name} fallback="NFT" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
// Copyright (c) Mysten Labs, Inc.
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
import { ExplorerLink, ExplorerLinkType } from '_components';
import React, { useState } from 'react';
import {
getObjectChangeLabel,
type ObjectChangesByOwner,
type ObjectChangeSummary,
type IotaObjectChangeTypes,
type IotaObjectChangeWithDisplay,
} from '@iota/core';
ExplorerLinkType,
} from '../../';
import { formatAddress } from '@iota/iota-sdk/utils';
import cx from 'clsx';
import { ExpandableList } from '../../ExpandableList';
import { ObjectChangeDisplay } from './objectSummary/ObjectChangeDisplay';
import { Collapsible } from '../../collapse';
import { ExpandableList } from '../lists';
import { Collapsible } from '../collapsible';
import { ObjectChangeDisplay } from './ObjectChangeDisplay';
import {
Badge,
BadgeType,
Expand All @@ -23,16 +24,17 @@ import {
Title,
TitleSize,
} from '@iota/apps-ui-kit';
import { useState } from 'react';
import { TriangleDown } from '@iota/ui-icons';
import { RenderExplorerLink } from '../../types';

interface ObjectDetailProps {
change: IotaObjectChangeWithDisplay;
ownerKey: string;
renderExplorerLink: RenderExplorerLink;
display?: boolean;
}

export function ObjectDetail({ change, display }: ObjectDetailProps) {
export function ObjectDetail({ change, renderExplorerLink: ExplorerLink }: ObjectDetailProps) {
if (change.type === 'transferred' || change.type === 'published') {
return null;
}
Expand Down Expand Up @@ -127,9 +129,14 @@ export function ObjectDetail({ change, display }: ObjectDetailProps) {
interface ObjectChangeEntryProps {
type: IotaObjectChangeTypes;
changes: ObjectChangesByOwner;
renderExplorerLink: RenderExplorerLink;
}

export function ObjectChangeEntry({ changes, type }: ObjectChangeEntryProps) {
export function ObjectChangeEntry({
changes,
type,
renderExplorerLink: ExplorerLink,
}: ObjectChangeEntryProps) {
const [open, setOpen] = useState(new Set());
return (
<>
Expand Down Expand Up @@ -169,35 +176,29 @@ export function ObjectChangeEntry({ changes, type }: ObjectChangeEntryProps) {
{!!changes.changesWithDisplay.length && (
<div className="flex flex-1 flex-col gap-2 overflow-y-auto">
<ExpandableList
initialShowAll={isOpen}
defaultItemsToShow={5}
items={
isOpen
? changes.changesWithDisplay.map(
(change) => (
<ObjectChangeDisplay
change={change}
/>
),
)
: []
}
items={changes.changesWithDisplay.map((change) => (
<ObjectChangeDisplay
change={change}
renderExplorerLink={ExplorerLink}
/>
))}
/>
</div>
)}

<div className="flex w-full flex-col gap-2">
<ExpandableList
defaultItemsToShow={5}
items={
open
? changes.changes.map((change) => (
<ObjectDetail
ownerKey={owner}
change={change}
/>
))
: []
}
initialShowAll={isOpen}
items={changes.changes.map((change) => (
<ObjectDetail
renderExplorerLink={ExplorerLink}
ownerKey={owner}
change={change}
/>
))}
/>
</div>
</>
Expand Down Expand Up @@ -227,9 +228,10 @@ export function ObjectChangeEntry({ changes, type }: ObjectChangeEntryProps) {

interface ObjectChangesProps {
changes?: ObjectChangeSummary | null;
renderExplorerLink: RenderExplorerLink;
}

export function ObjectChanges({ changes }: ObjectChangesProps) {
export function ObjectChanges({ changes, renderExplorerLink }: ObjectChangesProps) {
if (!changes) return null;

return (
Expand All @@ -240,6 +242,7 @@ export function ObjectChanges({ changes }: ObjectChangesProps) {
key={type}
type={type as keyof ObjectChangeSummary}
changes={changes}
renderExplorerLink={renderExplorerLink}
/>
);
})}
Expand Down
5 changes: 5 additions & 0 deletions apps/core/src/components/cards/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

export * from './BalanceChanges';
export * from './ObjectChanges';
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import React, { useState, type ReactNode } from 'react';
import { Accordion, AccordionContent, AccordionHeader, Title, TitleSize } from '@iota/apps-ui-kit';
import { useState, type ReactNode } from 'react';

interface CollapsibleProps {
interface CollapsibleProps extends React.PropsWithChildren {
title?: string;
defaultOpen?: boolean;
children: ReactNode | ReactNode[];
isOpen?: boolean;
onOpenChange?: (isOpen: boolean) => void;
titleSize?: TitleSize;
Expand Down
4 changes: 4 additions & 0 deletions apps/core/src/components/collapsible/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

export * from './Collapsible';
Loading

0 comments on commit 432f8c4

Please sign in to comment.