Skip to content

Fix port not being displayed in UI if a hostname is provided#1971

Merged
255kb merged 1 commit intomainfrom
bugfix/1910-hostname-port-display
Nov 21, 2025
Merged

Fix port not being displayed in UI if a hostname is provided#1971
255kb merged 1 commit intomainfrom
bugfix/1910-hostname-port-display

Conversation

@255kb
Copy link
Member

@255kb 255kb commented Nov 20, 2025

Closes #1910

Technical implementation details

Checklist

  • data migration added (@mockoon/commons)
  • commons lib tests added (@mockoon/commons)
  • commons-server lib tests added (@mockoon/commons-server)
  • CLI tests added (@mockoon/cli)
  • desktop UI automated tests added (@mockoon/app)

Closes #{issue_number}

Copilot AI review requested due to automatic review settings November 20, 2025 14:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where the port number was not displayed in the UI when a custom hostname was provided. The original logic would show either the hostname (without port) OR localhost:port, but never hostname:port.

Key Changes

  • Fixed the buildApiUrl function to always append the port to the hostname, defaulting to 'localhost' when no hostname is provided
  • Migrated Angular template syntax from *ngIf/*ngFor to the newer @if/@for control flow syntax in environment-settings component
  • Changed onMessage method visibility from private to protected in auth-iframe-modal component (best practice for @HostListener decorated methods)

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/app/src/renderer/app/libs/utils.lib.ts Fixed URL construction to always include port with hostname
packages/app/src/renderer/app/components/modals/auth-iframe-modal/auth-iframe-modal.component.ts Updated method visibility modifier from private to protected for @HostListener method
packages/app/src/renderer/app/components/environment-settings/environment-settings.component.ts Removed unused NgIf import after template migration
packages/app/src/renderer/app/components/environment-settings/environment-settings.component.html Migrated from *ngIf to @if control flow syntax

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@255kb 255kb merged commit f56949c into main Nov 21, 2025
21 checks passed
@255kb 255kb deleted the bugfix/1910-hostname-port-display branch November 21, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port is not displayed on dashboard when custom address is specified in env settings

2 participants