Skip to content

Sequence diagram for updated demo redirect handling #165

@Dargon789

Description

@Dargon789

Reviewer's Guide

Updates demo redirect URL construction to use the current path and URL-encoded next path, simplifies liquid asset filename handling in the asset sync script, and introduces a basic CircleCI config for a web3/defi/game-related workflow.

Sequence diagram for updated demo redirect handling

sequenceDiagram
  actor User
  participant Browser
  participant AngularRouter
  participant handleDemoRedirect

  User->>Browser: Navigate to demo URL with next param
  Browser->>AngularRouter: Activate route with query params
  AngularRouter->>handleDemoRedirect: Call with route and router
  handleDemoRedirect->>AngularRouter: Read query param next
  handleDemoRedirect->>handleDemoRedirect: Find index in path array
  alt next matches known path
    handleDemoRedirect->>handleDemoRedirect: Set currentPath
    handleDemoRedirect->>handleDemoRedirect: Compute nextPath
    handleDemoRedirect->>handleDemoRedirect: Build redirectUrl with encodeURIComponent
    handleDemoRedirect-->>Browser: Schedule setTimeout 15000ms
    Browser-->>Browser: Wait 15000ms
    Browser->>Browser: window.location.replace redirectUrl
  else next not in path
    handleDemoRedirect-->>AngularRouter: No redirect scheduled
  end
Loading

Flow diagram for simplified Liquid asset sync file handling

graph TD
  A[Start_downloadLiquidAssets] --> B[Log Downloading assets]
  B --> C[Iterate_liquidAssets]
  C --> D[Extract file and url]
  D --> E[Set fileName_to_file]
  E --> F[Log Downloading fileName]
  F --> G[downloadFile with ASSETS_PATH_slash_fileName and url]
  G --> H[Next_asset_or_end]
  H -->|More_assets| C
  H -->|No_more_assets| I[End_downloadLiquidAssets]
Loading

File-Level Changes

Change Details Files
Improve demo redirect URL construction and safety in common Angular utility.
  • Derive the current demo path from the existing path array using the computed index.
  • Compute the next path from the same array and URL-encode it before embedding in the query string.
  • Build the redirect URL using the current path and encoded next path and reuse it in the setTimeout callback instead of interpolating directly from params.
frontend/src/app/shared/common.utils.ts
Simplify Liquid asset filename derivation in the sync-assets script.
  • Remove the redundant replace() call when computing fileName for Liquid assets.
  • Use the file field directly as the target filename for downloadFile calls.
frontend/sync-assets.js
Add a minimal CircleCI workflow configuration using a custom executor.
  • Define a reusable Docker-based executor with authenticated access to Docker Hub using environment variables.
  • Add a placeholder job that checks out the repo and logs the working directory.
  • Wire the job into a simple workflow named my-custom-workflow so it runs on the pipeline.
.circleci/web3_defi_gamefi.yml

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Originally posted by @sourcery-ai[bot] in #164 (comment)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdependenciesPull requests that update a dependency filedockerPull requests that update docker codedocumentationImprovements or additions to documentationduplicateThis issue or pull request already existsenhancementNew feature or requestgood first issueGood for newcomersinvalidThis doesn't seem rightjavascriptPull requests that update javascript codequestionFurther information is requestedwontfixThis will not be worked on

Projects

Status

Done

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions