[PR #2260] [CLOSED] Fix issue 2251: conditionally render advanced settings button only for newt method #11712

Closed
opened 2026-05-06 16:22:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosrl/pangolin/pull/2260
Author: @K0lin
Created: 1/17/2026
Status: Closed

Base: mainHead: refactor/newt-conditional-rendering


📝 Commits (1)

  • 30fd15c refactor: conditionally render advanced settings button only for newt method

📊 Changes

1 file changed (+66 additions, -63 deletions)

View changed files

📝 src/app/[orgId]/settings/sites/create/page.tsx (+66 -63)

📄 Description

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

This PR addresses issue #2251 by modifying the conditional rendering of the advanced settings button and associated form field in the site creation page (src/app/[orgId]/settings/sites/create/page.tsx).

Changes Made:

  • Wrapped the advanced settings button and client address form field in a conditional block that only renders when form.watch("method") === "newt".
  • The button is now inside a <> React Fragment, along with the conditional form field.
  • This ensures the UI elements are only displayed when the site method is "newt", eliminating the previous behavior where the button was always rendered.

Analysis of Change:

  • Before: The button and form field were always rendered in the DOM, but hidden when form.watch("method") !== "newt".
  • After: The entire block is conditionally rendered only when the method is "newt", ensuring the UI accurately reflects the current state.

How to test?

  1. Navigate to the site creation page in the application.
  2. Select different site methods using the strategy select (newt, wireguard, local).
  3. Verify that the "Advanced Settings" button (with chevron icon) only appears when "newt" is selected.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fosrl/pangolin/pull/2260 **Author:** [@K0lin](https://github.com/K0lin) **Created:** 1/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `refactor/newt-conditional-rendering` --- ### 📝 Commits (1) - [`30fd15c`](https://github.com/fosrl/pangolin/commit/30fd15c0c6efceb4a759c270a4ad960674b981e4) refactor: conditionally render advanced settings button only for newt method ### 📊 Changes **1 file changed** (+66 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `src/app/[orgId]/settings/sites/create/page.tsx` (+66 -63) </details> ### 📄 Description ## Community Contribution License Agreement By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content. ## Description This PR addresses issue #2251 by modifying the conditional rendering of the advanced settings button and associated form field in the site creation page (`src/app/[orgId]/settings/sites/create/page.tsx`). **Changes Made:** - Wrapped the advanced settings button and client address form field in a conditional block that only renders when `form.watch("method") === "newt"`. - The button is now inside a `<>` React Fragment, along with the conditional form field. - This ensures the UI elements are only displayed when the site method is "newt", eliminating the previous behavior where the button was always rendered. **Analysis of Change:** - **Before:** The button and form field were always rendered in the DOM, but hidden when `form.watch("method") !== "newt"`. - **After:** The entire block is conditionally rendered only when the method is "newt", ensuring the UI accurately reflects the current state. ## How to test? 1. Navigate to the site creation page in the application. 2. Select different site methods using the strategy select (newt, wireguard, local). 3. Verify that the "Advanced Settings" button (with chevron icon) only appears when "newt" is selected. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 16:22:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#11712