Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Phoenix.View and use the new Phoenix.Component structure #3055

Merged
merged 9 commits into from
Oct 10, 2024

Conversation

EMaksy
Copy link
Member

@EMaksy EMaksy commented Oct 8, 2024

Description

This PR has the main goal to update Trento Web console to Phoenix 1.7 standards

What has been done ?

What has been not done?

Phoenix View was not completely removed as currently Swoosh still uses it, there are ways to remove Phoenix.View, but i would prefer to do it when Swoosh officially removes Phoenix.View.

Check out the discussion and official docs

This PR relates to wanda trento-project/wanda#513

How was this tested?

  • Updated all existing tests

  • Added test for about json view

@EMaksy EMaksy added tech debt chore wip elixir Pull requests that update Elixir code removal labels Oct 8, 2024
@EMaksy EMaksy self-assigned this Oct 8, 2024
@EMaksy EMaksy removed the wip label Oct 9, 2024
@EMaksy EMaksy requested review from dottorblaster, CDimonaco and arbulu89 and removed request for dottorblaster October 9, 2024 14:10
@EMaksy EMaksy marked this pull request as ready for review October 9, 2024 14:10
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

@EMaksy It looks great.
The unique thing that we should do is to move the view functions and files to the controller folders themselves, as suggested by phoenix documentation, and we should do the same in wanda, as we forgot. (we already discussed this offline as well)

lib/trento_web.ex Outdated Show resolved Hide resolved
lib/trento_web/plugs/api_redirector.ex Show resolved Hide resolved
lib/trento_web/views/v1/prometheus_json.ex Outdated Show resolved Hide resolved
lib/trento_web.ex Show resolved Hide resolved
@EMaksy EMaksy force-pushed the migrate_phoenix_to_1.7 branch from b652ef3 to 2411447 Compare October 9, 2024 16:09
@EMaksy
Copy link
Member Author

EMaksy commented Oct 9, 2024

Thanks for the review, as mentioned by @arbulu89 opened a follow up pr on wanda
trento-project/wanda#520

@EMaksy EMaksy requested a review from janvhs October 9, 2024 16:15
@EMaksy EMaksy force-pushed the migrate_phoenix_to_1.7 branch from 2411447 to 817e573 Compare October 10, 2024 08:50
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Nice!
Thank you

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

LGTM with some minor nitpicks

lib/trento_web/controllers/v1/database_json.ex Outdated Show resolved Hide resolved
@arbulu89 arbulu89 removed the removal label Oct 10, 2024
@EMaksy EMaksy merged commit 9d6ac21 into main Oct 10, 2024
30 checks passed
@EMaksy EMaksy deleted the migrate_phoenix_to_1.7 branch October 10, 2024 12:29
nelsonkopliku pushed a commit that referenced this pull request Oct 11, 2024
* Replace Phoenix.View from config

* Update json rendering to 1.7 standards

* Update VIEW test to JSON tests

* Remove old views

* Update html structure without Phoenix.View

* Fix suse_manager_json rendering

* Clean up code

* Apply suggestions

* Refactor function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore elixir Pull requests that update Elixir code tech debt
Development

Successfully merging this pull request may close these issues.

3 participants