Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 246e65c
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Wed Aug 21 16:09:35 2024 +0200

    Revert "style: Import button redesign"

    This reverts commit fb9907d.

commit 9ddec40
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Wed Aug 21 16:08:53 2024 +0200

    Fix loading imported tokens before the NNS account was created.

commit 87042ae
Merge: 9efce2c 845afe3
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Tue Aug 20 15:18:46 2024 +0200

    Merge branch 'main' into mstr/imported-tokens-form

commit 845afe3
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue Aug 20 12:14:36 2024 +0200

    Explicitly upload checklist file in release-sop (#5334)

    # Motivation

    In the NNS dapp release SOP checklist there is a step:
    > gh release upload "proposal-$PROPOSAL_ID"
    scripts/nns-dapp/Release-*.json

    To upload the release-sop JSON file to the release assets. Using `*`
    makes it easy to copy/paste the command but in the `release-sop` script
    we can be more precise and avoid matching other JSON.

    When running the test there is a different JSON file but if an actual
    release is ongoing the test would see that file too.

    # Changes

    1. Explicitly upload the checklist file for the current release instead
    of using wild cards.
    2. Drive-by: Fix typos of "relese" to "release".

    # Tests

    1. The existing `release-sop.test` still passes.
    2. I tried running the test after doing `touch
    scripts/nns-dapp/Release-2024-02-29.json` and it failed without the
    change and passed with the change.

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit 1d9487b
Author: David de Kloet <122978264+dskloetd@users.noreply.github.com>
Date:   Tue Aug 20 11:20:26 2024 +0200

    NNS1-3250: Dispatch event for click on non-link table row (#5333)

    # Motivation

    In the staking projects table, when you click on a project for which you
    don't have any neurons, instead of navigating to the (empty) neurons
    table for that project, we want to open the staking modal.
    This means that those rows should not be links (which would cause
    navigation) but should clicks should instead dispatch an event which can
    be used to open the modal.

    This PR only implements dispatching the event for non-link rows and does
    not yet do anything with it.

    # Changes

    When a non-link row is clicked in the `ResponsiveTable`, dispatch an
    `nnsAction` event with the `rowData` for that row as event payload.

    # Tests

    1. Unit test added.
    2. Tested manually in another branch which already has the staking modal
    implemented:
    https://qsgjb-riaaa-aaaaa-aaaga-cai.dskloet-ingress.devenv.dfinity.network/staking/

    # Todos

    - [ ] Add entry to changelog (if necessary).
    not necessary

commit f3cabd2
Author: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com>
Date:   Mon Aug 19 15:06:29 2024 +0200

    Update changelog after release (#5328)

    # Motivation

    A release has been deployed to production.

    # Changes

    - Changelog - split out the changes included in the release.
    - A single entry (Fixed incorrect interpretation of ICRC fees), was
    added manually because we forgot to update the changelog in the fix PR.
    - Increment the patch version of the nns-dapp.

commit 0540daf
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Aug 19 08:24:32 2024 +0000

    Bump ic-cdk from 0.15.0 to 0.15.1 (#5324)

    Bumps [ic-cdk](https://github.com/dfinity/cdk-rs) from 0.15.0 to 0.15.1.
    <details>
    <summary>Commits</summary>
    <ul>
    <li>See full diff in <a
    href="https://github.com/dfinity/cdk-rs/commits">compare view</a></li>
    </ul>
    </details>
    <br />

    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ic-cdk&package-manager=cargo&previous-version=0.15.0&new-version=0.15.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

    You can trigger a rebase of this PR by commenting `@dependabot rebase`.

    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)

    ---

    <details>
    <summary>Dependabot commands and options</summary>
    <br />

    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)

    </details>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 4cc2cee
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Aug 19 10:23:48 2024 +0200

    Bump serde_json from 1.0.124 to 1.0.125 (#5325)

    Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.124 to
    1.0.125.
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/serde-rs/json/releases">serde_json's
    releases</a>.</em></p>
    <blockquote>
    <h2>1.0.125</h2>
    <ul>
    <li>Speed up \uXXXX parsing and improve handling of unpaired surrogates
    when deserializing to bytes (<a
    href="https://redirect.github.com/serde-rs/json/issues/1172">#1172</a>,
    <a
    href="https://redirect.github.com/serde-rs/json/issues/1175">#1175</a>,
    thanks <a
    href="https://github.com/purplesyringa"><code>@​purplesyringa</code></a>)</li>
    </ul>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/serde-rs/json/commit/6130f9b358dea483f10e671343f0098fbe55611b"><code>6130f9b</code></a>
    Release 1.0.125</li>
    <li><a
    href="https://github.com/serde-rs/json/commit/cc7a1608c9bb7736c884926e016421af41a1ebe7"><code>cc7a160</code></a>
    Touch up PR 1175</li>
    <li><a
    href="https://github.com/serde-rs/json/commit/0f942e5b5235a3b586e20e4c00bfe5b1a56f16d8"><code>0f942e5</code></a>
    Merge pull request 1175 from iex-rs/faster-backslash-u</li>
    <li><a
    href="https://github.com/serde-rs/json/commit/d8921cd29b5eef6263c20cf87eab25d961237f94"><code>d8921cd</code></a>
    Merge pull request <a
    href="https://redirect.github.com/serde-rs/json/issues/1172">#1172</a>
    from iex-rs/faster-hex</li>
    <li><a
    href="https://github.com/serde-rs/json/commit/b4bc6436acdf874729a7b425b3c2e48f8b16b398"><code>b4bc643</code></a>
    Merge pull request <a
    href="https://redirect.github.com/serde-rs/json/issues/1176">#1176</a>
    from dtolnay/miriname</li>
    <li><a
    href="https://github.com/serde-rs/json/commit/94a2aad7b79543454da3ecdb2e6170b98773ccc2"><code>94a2aad</code></a>
    Improve job names for miri jobs</li>
    <li><a
    href="https://github.com/serde-rs/json/commit/8073fc16b89f508f2443b95d925ce59dca745d43"><code>8073fc1</code></a>
    Merge pull request <a
    href="https://redirect.github.com/serde-rs/json/issues/1174">#1174</a>
    from iex-rs/miri-on-ci</li>
    <li><a
    href="https://github.com/serde-rs/json/commit/96ae60445df67f6903b53b2fcfe1d60f3bd8f778"><code>96ae604</code></a>
    Correct WTF-8 parsing</li>
    <li><a
    href="https://github.com/serde-rs/json/commit/236cc8247d32a5cb337850d75f68265fdb4bc14e"><code>236cc82</code></a>
    Simplify unicode escape handling</li>
    <li><a
    href="https://github.com/serde-rs/json/commit/2f28d106e68e214cfa19043e65b1bd178b3c2ced"><code>2f28d10</code></a>
    Use the same UTF-8/WTF-8 impl for surrogates</li>
    <li>Additional commits viewable in <a
    href="https://github.com/serde-rs/json/compare/v1.0.124...1.0.125">compare
    view</a></li>
    </ul>
    </details>
    <br />

    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.124&new-version=1.0.125)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

    You can trigger a rebase of this PR by commenting `@dependabot rebase`.

    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)

    ---

    <details>
    <summary>Dependabot commands and options</summary>
    <br />

    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)

    </details>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 6a67787
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Aug 19 10:23:16 2024 +0200

    Bump serde from 1.0.206 to 1.0.208 (#5326)

    Bumps [serde](https://github.com/serde-rs/serde) from 1.0.206 to
    1.0.208.
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/serde-rs/serde/releases">serde's
    releases</a>.</em></p>
    <blockquote>
    <h2>v1.0.208</h2>
    <ul>
    <li>Support serializing and deserializing unit structs in a
    <code>flatten</code> field (<a
    href="https://redirect.github.com/serde-rs/serde/issues/2802">#2802</a>,
    thanks <a
    href="https://github.com/jonhoo"><code>@​jonhoo</code></a>)</li>
    </ul>
    <h2>v1.0.207</h2>
    <ul>
    <li>Improve interactions between <code>flatten</code> attribute and
    <code>skip_serializing</code>/<code>skip_deserializing</code> (<a
    href="https://redirect.github.com/serde-rs/serde/issues/2795">#2795</a>,
    thanks <a
    href="https://github.com/Mingun"><code>@​Mingun</code></a>)</li>
    </ul>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/serde-rs/serde/commit/026e91a68cdb00ed89bae5f566852ecbd7525315"><code>026e91a</code></a>
    Release 1.0.208</li>
    <li><a
    href="https://github.com/serde-rs/serde/commit/bfbedac91940b7cbe268bf686b93812b3020129c"><code>bfbedac</code></a>
    Merge pull request <a
    href="https://redirect.github.com/serde-rs/serde/issues/2802">#2802</a>
    from jonhoo/flatten-unit-struct</li>
    <li><a
    href="https://github.com/serde-rs/serde/commit/4036ff88edc2ee85f288e8c9bc6d9a0f393cf96e"><code>4036ff8</code></a>
    Support (de-)serializing flattened unit struct</li>
    <li><a
    href="https://github.com/serde-rs/serde/commit/1b4da41f970555e111f471633205bbcb4dadbc63"><code>1b4da41</code></a>
    Release 1.0.207</li>
    <li><a
    href="https://github.com/serde-rs/serde/commit/f61d452814d6c7bf32d139e747d18c21592d702a"><code>f61d452</code></a>
    Touch up PR 2795</li>
    <li><a
    href="https://github.com/serde-rs/serde/commit/f9866097a084e2e549e40c4d47f7ee171e0a6aaf"><code>f986609</code></a>
    Merge pull request <a
    href="https://redirect.github.com/serde-rs/serde/issues/2795">#2795</a>
    from Mingun/has-flatten-rework</li>
    <li><a
    href="https://github.com/serde-rs/serde/commit/77a6a9d4e193c82439aa0c35dfdbbb34fafdf38e"><code>77a6a9d</code></a>
    Take into account only not skipped flatten fields when choose
    serialization form</li>
    <li><a
    href="https://github.com/serde-rs/serde/commit/547d843ccaa1349b074991f5ceeda722cf245824"><code>547d843</code></a>
    Remove dead code - serialize_struct_as_map always called when
    cattrs.has_flat...</li>
    <li><a
    href="https://github.com/serde-rs/serde/commit/005cb84593e73cb3ba263232cc5f09b77859ec5b"><code>005cb84</code></a>
    Fail with an understandable message is number of fields for
    serialization is ...</li>
    <li><a
    href="https://github.com/serde-rs/serde/commit/fd5b5e9aa561e29d9312ecef2019ec670b4bc334"><code>fd5b5e9</code></a>
    Correctly calculate <code>has_flatten</code> attribute in all cases for
    deserialization</li>
    <li>Additional commits viewable in <a
    href="https://github.com/serde-rs/serde/compare/v1.0.206...v1.0.208">compare
    view</a></li>
    </ul>
    </details>
    <br />

    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde&package-manager=cargo&previous-version=1.0.206&new-version=1.0.208)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

    You can trigger a rebase of this PR by commenting `@dependabot rebase`.

    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)

    ---

    <details>
    <summary>Dependabot commands and options</summary>
    <br />

    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)

    </details>

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 2426cae
Author: jasonz-dfinity <133917836+jasonz-dfinity@users.noreply.github.com>
Date:   Fri Aug 16 18:24:32 2024 +0200

    Remove integration test setup code and script (#5322)

    # Motivation

    The integration tests using PocketIC was added for stable structure
    migration. The tests themselves are already removed in
    #4814, while the test setup and
    the github workflow is still there.

    # Changes

    * Remove the test setup code
    * Remove the github workflow
    * Remove test script
    * Remove related documentation

    # Tests

    N/A

    # Todos

    - [x] Add entry to changelog (if necessary).

commit 9efce2c
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Fri Aug 16 10:05:43 2024 +0200

    Remove redundant lables

commit f9011dd
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Fri Aug 16 09:53:28 2024 +0200

    Fix type warnings

commit 7e1cf6b
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Fri Aug 16 09:42:44 2024 +0200

    Fix type warnings

commit 10cf9ce
Author: Max Strasinsky <maksims.strasinskis@dfinity.org>
Date:   Fri Aug 16 09:40:20 2024 +0200

    Formatting

commit 6f5d3b8
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Fri Aug 16 13:09:32 2024 +0200

    bot: Update SNS Aggregator Response (#5318)

    # Motivation
    We would like to keep the ProdLaunchpad.spec up to date with mainnet
    data.

    # Changes
    * Update the files used for the fetch mock in ProdLaunchpad.spec.

    # Tests
    Only test changes.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>

commit 1072976
Author: sa-github-api <138766536+sa-github-api@users.noreply.github.com>
Date:   Fri Aug 16 11:17:40 2024 +0200

    bot: Update snsdemo to release-2024-08-14 (#5323)

    # Motivation
    We would like to keep the testing environment, provided by snsdemo, up
    to date.

    # Changes
    * Updated `snsdemo` version in `dfx.json`.
    * Ensured that the `dfx` version in `dfx.json` matches `snsdemo`.

    # Tests
    CI should pass.

    Co-authored-by: gix-bot <gix-bot@users.noreply.github.com>
  • Loading branch information
mstrasinskis committed Aug 21, 2024
1 parent cd1d8f2 commit 17a3711
Show file tree
Hide file tree
Showing 24 changed files with 227 additions and 327 deletions.
17 changes: 1 addition & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -435,21 +435,6 @@ jobs:
scripts/sns/aggregator/test-fast
- name: Stop replica
run: dfx stop
integration:
name: "Integration tests"
needs: build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Get docker build outputs
uses: actions/download-artifact@v4
with:
name: out
path: out
- name: Install pocket-ic
run: curl -sSL https://github.com/dfinity/pocketic/releases/download/3.0.1/pocket-ic-x86_64-linux.gz | gunzip | install -m 755 /dev/stdin pocket-ic
- name: Run integration tests
run: ./scripts/test-integration
assets:
name: "Upload assets"
needs: build
Expand Down Expand Up @@ -522,7 +507,7 @@ jobs:
) | tee -a $GITHUB_STEP_SUMMARY
(( wasm_size <= max_size )) || { echo "The WASM is too large" ; exit 1 ; }
build-pass:
needs: ["build", "test-playwright-e2e-shard-1-of-2", "test-playwright-e2e-shard-2-of-2", "test-rest", "network_independent_wasm", "aggregator_test", "assets", "test-upgrade-downgrade", "test-test-account-api", "test-upgrade-stable", "integration"]
needs: ["build", "test-playwright-e2e-shard-1-of-2", "test-playwright-e2e-shard-2-of-2", "test-rest", "network_independent_wasm", "aggregator_test", "assets", "test-upgrade-downgrade", "test-test-account-api", "test-upgrade-stable"]
if: ${{ always() }}
runs-on: ubuntu-20.04
steps:
Expand Down
8 changes: 2 additions & 6 deletions CHANGELOG-Nns-Dapp-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,8 @@ proposal is successful, the changes it released will be moved from this file to

#### Added

* Parse and trim proposal payload for `InstallCode` within the `get_proposal_payload` back-end endpoint.
* Support rendering `InstallCode` proposal payload by calling `get_proposal_payload`.

#### Changed

* Round neuron stake and maturity to 2 decimals in tables.
* Show detailed stake amount in neuron details page.

#### Deprecated

#### Removed
Expand All @@ -43,6 +37,8 @@ proposal is successful, the changes it released will be moved from this file to

#### Removed

* Integration test setup code and related script and documentation.

#### Fixed

#### Security
20 changes: 20 additions & 0 deletions CHANGELOG-Nns-Dapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ The NNS Dapp is released through proposals in the Network Nervous System. Theref
Unreleased changes are added to `CHANGELOG-Nns-Dapp-unreleased.md` and moved
here after a successful release.

## Proposal 131754

### Application

#### Added

* Parse and trim proposal payload for `InstallCode` within the `get_proposal_payload` back-end endpoint.
* Support rendering `InstallCode` proposal payload by calling `get_proposal_payload`.

#### Changed

* Round neuron stake and maturity to 2 decimals in tables.
* Show detailed stake amount in neuron details page.

#### Fixed

* Fixed incorrect interpretation of ICRC fees (#5314).

### Operations

## Proposal 131698

### Application
Expand Down
30 changes: 15 additions & 15 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ members = [
resolver = "2"

[workspace.package]
version = "2.0.86"
version = "2.0.87"

[workspace.dependencies]
ic-cdk = "0.15.0"
ic-cdk = "0.15.1"
ic-cdk-macros = "0.15.0"

cycles-minting-canister = { git = "https://github.com/dfinity/ic", rev = "799cf9f94c0fbaeae9c328f64da03640d37b0480" }
Expand Down
6 changes: 0 additions & 6 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,3 @@ Tests are found in `rs/backend/src/accounts_store/tests.rs`.
```bash
$ cargo test --lib
```

### Integration tests

```bash
$ ./scripts/test-integration
```
2 changes: 1 addition & 1 deletion dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
"DIDC_VERSION": "2024-05-14",
"POCKETIC_VERSION": "3.0.1",
"CARGO_SORT_VERSION": "1.0.9",
"SNSDEMO_RELEASE": "release-2024-08-07",
"SNSDEMO_RELEASE": "release-2024-08-14",
"IC_COMMIT_FOR_PROPOSALS": "release-2024-08-02_01-30-base",
"IC_COMMIT_FOR_SNS_AGGREGATOR": "release-2024-08-02_01-30-base"
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/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 frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dfinity/nns-dapp",
"version": "2.0.86",
"version": "2.0.87",
"private": true,
"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/lib/components/ui/ResponsiveTableRow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import type { ResponsiveTableColumn } from "$lib/types/responsive-table";
import { getCellGridAreaName } from "$lib/utils/responsive-table.utils";
import { isNullish, nonNullish } from "@dfinity/utils";
import { createEventDispatcher } from "svelte";
export let rowData: RowDataType;
export let columns: ResponsiveTableColumn<RowDataType>[];
Expand All @@ -20,6 +21,16 @@
$: middleColumns = columns.slice(1, -1);
$: lastColumn = columns.at(-1);
const dispatcher = createEventDispatcher();
const onRowClick = () => {
if (nonNullish(rowData.rowHref)) {
// We don't interfere with normal link behavior.
return;
}
dispatcher("nnsAction", { rowData });
};
const getCellStyle = ({
column,
index,
Expand All @@ -40,6 +51,7 @@
role="row"
tabindex="0"
data-tid="responsive-table-row-component"
on:click={onRowClick}
{style}
>
{#if firstColumn}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/pages/Tokens.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { i18n } from "$lib/stores/i18n";
import type { UserToken } from "$lib/types/tokens-page";
import { heightTransition } from "$lib/utils/transition.utils";
import { IconAddCircle, IconSettings } from "@dfinity/gix-components";
import { IconPlus, IconSettings } from "@dfinity/gix-components";
import { Popover } from "@dfinity/gix-components";
import { nonNullish, TokenAmountV2 } from "@dfinity/utils";
import { ENABLE_IMPORT_TOKEN } from "$lib/stores/feature-flags.store";
Expand Down Expand Up @@ -85,10 +85,10 @@
{#if shownImportTokenButton}
<button
data-tid="import-token-button"
class="secondary with-icon import-token-button"
class="ghost with-icon import-token-button"
on:click={() => (showImportTokenModal = true)}
>
<IconAddCircle />{$i18n.import_token.import_token}
<IconPlus />{$i18n.import_token.import_token}
</button>
{/if}
</div>
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/lib/services/app.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ export const initAppPrivateData = async (): Promise<void> => {
// Reload the SNS projects even if they were loaded.
// Get latest data and create wrapper caches for the logged in identity.
const initSns: Promise<void>[] = [loadSnsProjects()];
const initImportedTokens: Promise<void>[] = get(ENABLE_IMPORT_TOKEN)
? [loadImportedTokens()]
: [];

// TODO: load imported tokens after Nns.
/**
* If Nns load but ImportedTokens or Sns load fails it is "fine" to go on because Nns are core features.
*/
await Promise.allSettled([
Promise.all(initNns),
Promise.all(initImportedTokens),
Promise.all(initNns).then(() =>
// When you log in with a new account for the first time, the account is created in the NNS dapp.
// If you request imported tokens before the account is created, an `AccountNotFound` error will be thrown.
// To avoid this, the imported tokens should only be requested after the NNS accounts have been initialized.
Promise.all(get(ENABLE_IMPORT_TOKEN) ? [loadImportedTokens()] : [])
),
Promise.all(initSns),
]);

Expand Down
38 changes: 36 additions & 2 deletions frontend/src/tests/lib/components/ui/ResponsiveTable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import TestTableNameCell from "$tests/lib/components/ui/TestTableNameCell.svelte
import { ResponsiveTablePo } from "$tests/page-objects/ResponsiveTable.page-object";
import { JestPageObjectElement } from "$tests/page-objects/jest.page-object";
import { render } from "$tests/utils/svelte.test-utils";
import { nonNullish } from "@dfinity/utils";

describe("ResponsiveTable", () => {
type TestRowData = {
Expand Down Expand Up @@ -68,8 +69,25 @@ describe("ResponsiveTable", () => {
},
];

const renderComponent = (props) => {
const { container } = render(ResponsiveTable, props);
beforeEach(() => {
vi.restoreAllMocks();

// Clicking on the rows that are links causes JSDOM to output an error about
// navigation not being implemented. But the error is not logged immediately
// and can happen during a different test. So we dissable error logging for
// all tests.
vi.spyOn(console, "error").mockImplementation((arg) => {
expect(arg).toMatch(/Error: Not implemented: navigation/);
});
});

const renderComponent = ({ onNnsAction = null, ...props }) => {
const { container, component } = render(ResponsiveTable, props);
if (nonNullish(onNnsAction)) {
component.$on("nnsAction", ({ detail }) => {
onNnsAction({ detail });
});
}
return ResponsiveTablePo.under(new JestPageObjectElement(container));
};

Expand Down Expand Up @@ -145,6 +163,22 @@ describe("ResponsiveTable", () => {
expect(await rows[2].getTagName()).toBe("DIV");
});

it("should dispatch nnsAction, only for click on non-link row", async () => {
const onNnsAction = vi.fn();
const po = renderComponent({ columns, tableData, onNnsAction });
const rows = await po.getRows();
expect(rows).toHaveLength(3);

expect(onNnsAction).not.toBeCalled();
await rows[0].click();
expect(onNnsAction).not.toBeCalled();
await rows[1].click();
expect(onNnsAction).not.toBeCalled();
await rows[2].click();
expect(onNnsAction).toBeCalledTimes(1);
expect(onNnsAction).toBeCalledWith({ detail: { rowData: tableData[2] } });
});

it("should render classes based on column alignment", async () => {
const po = renderComponent({ columns, tableData });
const rows = await po.getRows();
Expand Down
Loading

0 comments on commit 17a3711

Please sign in to comment.