[PR #5197] [MERGED] Refactor ScriptItem and ConfigFile components to conditionally render config file location. Update ConfigFile to accept configPath prop instead of item. #5605

Closed
opened 2025-11-20 07:06:45 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/5197
Author: @BramSuurdje
Created: 6/16/2025
Status: Merged
Merged: 6/16/2025
Merged by: @michelroegl-brunner

Base: mainHead: fix-config-path-rendering


📝 Commits (1)

  • 9ac5429 Refactor ScriptItem and ConfigFile components to conditionally render config file location. Update ConfigFile to accept configPath prop instead of item.

📊 Changes

2 files changed (+15 additions, -14 deletions)

View changed files

📝 frontend/src/app/scripts/_components/ScriptItem.tsx (+13 -11)
📝 frontend/src/app/scripts/_components/ScriptItems/ConfigFile.tsx (+2 -3)

📄 Description

✍️ Description

This pull request refactors the handling of the ConfigFile component in the ScriptItem feature to improve clarity and maintainability. The changes include modifying the ConfigFile component's props and updating its usage in ScriptItem.

Refactoring of ConfigFile component:

Updates to ScriptItem:

Import organization:

Link: #

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

🔄 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/community-scripts/ProxmoxVE/pull/5197 **Author:** [@BramSuurdje](https://github.com/BramSuurdje) **Created:** 6/16/2025 **Status:** ✅ Merged **Merged:** 6/16/2025 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `fix-config-path-rendering` --- ### 📝 Commits (1) - [`9ac5429`](https://github.com/community-scripts/ProxmoxVE/commit/9ac5429e27e2a22216fadab23fbf30962d769b51) Refactor ScriptItem and ConfigFile components to conditionally render config file location. Update ConfigFile to accept configPath prop instead of item. ### 📊 Changes **2 files changed** (+15 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/app/scripts/_components/ScriptItem.tsx` (+13 -11) 📝 `frontend/src/app/scripts/_components/ScriptItems/ConfigFile.tsx` (+2 -3) </details> ### 📄 Description <!--🛑 New scripts must be submitted to [ProxmoxVED](https://github.com/community-scripts/ProxmoxVED) for testing. PRs without prior testing will be closed. --> ## ✍️ Description This pull request refactors the handling of the `ConfigFile` component in the `ScriptItem` feature to improve clarity and maintainability. The changes include modifying the `ConfigFile` component's props and updating its usage in `ScriptItem`. ### Refactoring of `ConfigFile` component: * [`frontend/src/app/scripts/_components/ScriptItems/ConfigFile.tsx`](diffhunk://#diff-99a62f8d8b32e919a43a0c4772a05ecc2c42ea5bf249176f603d0342ba1ef352L2-R6): Updated the `ConfigFile` component to accept a `configPath` string as a prop instead of the entire `Script` object, simplifying its interface. ### Updates to `ScriptItem`: * [`frontend/src/app/scripts/_components/ScriptItem.tsx`](diffhunk://#diff-8211dae113b207283321d206905609d73b1aa3e743d4f716e01d02b9db590438R155-R166): Modified the `ScriptItem` component to conditionally render the `ConfigFile` component only when `item.config_path` is defined. Updated the `ConfigFile` usage to pass the `config_path` property directly. ### Import organization: * [`frontend/src/app/scripts/_components/ScriptItem.tsx`](diffhunk://#diff-8211dae113b207283321d206905609d73b1aa3e743d4f716e01d02b9db590438R18-L23): Fixed the import order for the `ConfigFile` component to align with project conventions. ## 🔗 Related PR / Issue Link: # ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [x] 🐞 **Bug fix** – Resolves an issue without breaking functionality. - [ ] ✨ **New feature** – Adds new, non-breaking functionality. - [ ] 💥 **Breaking change** – Alters existing functionality in a way that may require updates. - [ ] 🆕 **New script** – A fully functional and tested script or script set. - [ ] 🌍 **Website update** – Changes to website-related JSON files or metadata. - [ ] 🔧 **Refactoring / Code Cleanup** – Improves readability or maintainability without changing functionality. - [ ] 📝 **Documentation update** – Changes to `README`, `AppName.md`, `CONTRIBUTING.md`, or other docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 07:06:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#5605