Skip to content

Ref: Improved Readability and Maintainability of PowerPlantsDetail implementations#110

Merged
mergify[bot] merged 17 commits intocanaryfrom
refactorings
Jan 23, 2025
Merged

Ref: Improved Readability and Maintainability of PowerPlantsDetail implementations#110
mergify[bot] merged 17 commits intocanaryfrom
refactorings

Conversation

@Marty-Byrde
Copy link
Copy Markdown
Member

@Marty-Byrde Marty-Byrde commented Jan 23, 2025

This pull request introduces significant updates to the power plant detail page and related components. The changes focus on refactoring the code to improve maintainability and readability.

Refactoring and Code Simplification:

New Components:

API Integration:

Test Updates:

mergify Bot and others added 8 commits January 23, 2025 06:51
This component is used to wrap the contents of the power-plants/[id] details page within a Context provider. This way it can be used to access properties of the context within client-side components with ease.
Externalized the buttons used within the power-plants-details page into a separate client-side component.
This component is used to render the different water-gate related options, e.g. closing, opening the gate. Note that this component is rendered conditionally, depending on whether or not the management is enabled.
This endpoint is used to simulate a fetch request of an external API to gather a given PowerPlant.
Made some major improvements to the power-plants/[id] detail page by using newly created components to improve readability and maintainability.
Reverted the introduction of the query argument to the Link component within the PowerPlantPreview component, because it is no longer needed.
The reason for this change is that the use searchParams was removed, thereby resulting in a failing test-case.
@Marty-Byrde Marty-Byrde changed the title Merge Changes into Canary Ref: Improved Readability and Maintainability of PowerPlantsDetail page Jan 23, 2025
@Marty-Byrde Marty-Byrde changed the title Ref: Improved Readability and Maintainability of PowerPlantsDetail page Ref: Improved Readability and Maintainability of PowerPlantsDetail implementations Jan 23, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
components/power-plants/PowerPlantPreview.tsx 100.00% <100.00%> (ø)

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 23, 2025

Auto-Assigned MrsicMarko as a Reviewer to this Pull Request.

@mergify mergify Bot requested a review from MrsicMarko January 23, 2025 10:10
@Marty-Byrde Marty-Byrde marked this pull request as ready for review January 23, 2025 10:17
The reason for this change is that the name is used to fetch a given power-plants information from the api and not the id.
This change was made within the PowerPlantPreview component for the name of a given powerplant.
The reason for this change is that the id property does not reflect the id of the power-plant but the id of the db-row that returned the information. This means that the id always increases by the amount of power-plants stored.
Fixed a typo in the base_endpoint property that is used to send commands to the given api. Changed the value of this property from the Database to the Control api endpoint.
Update the fetch request and response of the power-plant detail fetch retrieval to follow the api implementation.
@mergify mergify Bot merged commit 754c092 into canary Jan 23, 2025
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 23, 2025

This Pull request satisfies all status-checks and will be automatically merged soon.

@mergify mergify Bot deleted the refactorings branch January 23, 2025 15:56
@Marty-Byrde
Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 1.14.0-canary.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@Marty-Byrde
Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 1.14.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants