[Enhancement] Add option for a source to only use cookies when needed (#640)

* Updated model with new attribute

* Update app logic to use new cookie logic

* lots of tests

* Updated UI and renamed attribute

* Updated tests
This commit is contained in:
Kieran 2025-03-05 15:32:15 -08:00 committed by GitHub
parent 59f8aa69cd
commit ac895944a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 247 additions and 65 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 KiB

After

Width:  |  Height:  |  Size: 497 KiB

Before After
Before After

View file

@ -0,0 +1,18 @@
defmodule Pinchflat.Repo.Migrations.AddCookieBehaviourToSources do
use Ecto.Migration
def change do
alter table(:sources) do
add :cookie_behaviour, :string, null: false, default: "disabled"
end
execute(
"UPDATE sources SET cookie_behaviour = 'all_operations' WHERE use_cookies = TRUE",
"UPDATE sources SET use_cookies = TRUE WHERE cookie_behaviour = 'all_operations'"
)
alter table(:sources) do
remove :use_cookies, :boolean, null: false, default: false
end
end
end