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

Removed eula popup notification #2512

Merged
merged 11 commits into from
Apr 25, 2024
Merged

Conversation

chrisb1s
Copy link
Contributor

Description

Completely removed the Eula popup message from the web app. This includes:

  • the elexir files
  • the redux javascript part
  • the migration of the database

How was this tested?

Tested with the tests provided by the module/tests.

@chrisb1s chrisb1s marked this pull request as ready for review April 17, 2024 11:50
@stefanotorresi
Copy link
Member

I think we need to leverage api versioning for the endpoint removal, right @arbulu89 @CDimonaco ?

Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

There is some extra eula related frontend items that might be removed.

Besides this GET /api/v1/settings needs to be bumped to v2.
Not sure if the removal of the other two APIs is breaking BC (guess so)

==========================================================================
==                            API CHANGE LOG                            ==
==========================================================================
                                  Trento                                  
--------------------------------------------------------------------------
--                            What's Deleted                            --
--------------------------------------------------------------------------
- POST   /api/v1/accept_eula
- POST   /api/v1/settings/accept_eula

--------------------------------------------------------------------------
--                            What's Changed                            --
--------------------------------------------------------------------------
- GET    /api/v1/settings
  Return Type:
    - Changed 200 OK
      Media types:
        - Changed application/json
          Schema: Broken compatibility
          Missing property: eula_accepted (boolean)
--------------------------------------------------------------------------
--                                Result                                --
--------------------------------------------------------------------------
                 API changes broke backward compatibility                 
--------------------------------------------------------------------------

assets/js/state/sagas/index.js Show resolved Hide resolved
assets/js/state/settings.js Outdated Show resolved Hide resolved
lib/trento_web/openapi/v1/schema/platform.ex Show resolved Hide resolved
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.

Hey @chrisb1s ,
The removal looks good so far. Some comments from my side
I'm not that sure if we can just remove a endpoint without bumping the controller or schemas version.
We can take that risk, but users using it might start getting failures.
I guess we need to discuss that.


def change do
alter table(:settings) do
remove :installation_settings_eula_accepted
Copy link
Contributor

Choose a reason for hiding this comment

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

@CDimonaco doing this is safe in our new STI design, right? Just double-checking

@@ -0,0 +1,9 @@
defmodule Trento.Repo.Migrations.DropColumnInstallationSettingsEulaAccepted do
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't call this Drop..., i would call Remove... as we do with every other remove migration

assets/js/state/sagas/index.js Show resolved Hide resolved
assets/js/state/sagas/index.js Show resolved Hide resolved
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.

Hey @chrisb1s
The openapi part looking better. Just some additional requests

@@ -26,6 +26,10 @@ defmodule Trento.Settings do
installation_id
end

def accept_eula do
Copy link
Contributor

Choose a reason for hiding this comment

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

We can safely remove this function.

@@ -21,11 +21,29 @@ defmodule TrentoWeb.V1.SettingsController do
def settings(conn, _) do
render(conn, "settings.json",
settings: %{
eula_accepted: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's better return false


@spec accept_eula(Plug.Conn.t(), any) :: Plug.Conn.t()
def accept_eula(conn, _) do
:ok = Settings.accept_eula()
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to run this dummy function. Just return the empty json

@@ -3,12 +3,10 @@ defmodule TrentoWeb.V1.SettingsView do

def render("settings.json", %{
settings: %{
eula_accepted: eula_accepted,
Copy link
Contributor

Choose a reason for hiding this comment

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

We cannot remove this 2 lines. It will just return what the controller returns, a hardcoded false

@arbulu89 arbulu89 added removal env Create an ephimeral environment for the pr branch and removed env Create an ephimeral environment for the pr branch labels Apr 25, 2024
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.

It looks good now!
Thank you @chrisb1s

@arbulu89 arbulu89 merged commit 04765b4 into trento-project:main Apr 25, 2024
69 of 75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants