Skip to content

Commit 869edef

Browse files
committed
Remove Elm application Feeds
Replace last functionality that had not been ported to LiveView yet by regular <form>.
1 parent 9671a04 commit 869edef

File tree

9 files changed

+21
-351
lines changed

9 files changed

+21
-351
lines changed

assets/elm/app/App/Feeds.elm

-128
This file was deleted.

assets/elm/app/Feeds/Icons.elm

-34
This file was deleted.

assets/elm/app/Feeds/Model.elm

-22
This file was deleted.

assets/elm/app/Feeds/Options.elm

-62
This file was deleted.

assets/elm/app/Feeds/Options/Discovery.elm

+1-68
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
module Feeds.Options.Discovery exposing
22
( addableFeed
3-
, discoverFeedFieldset
4-
, discoverFeedsFieldset
53
, requestFieldset
64
)
75

8-
import Dict exposing (Dict)
96
import Feeds.Discovery as Discovery exposing (Discovery)
10-
import Feeds.Model exposing (..)
11-
import Feeds.Msg exposing (..)
7+
import Feeds.Msg exposing (Msg)
128
import Html as H exposing (Html)
139
import Html.Attributes as A
1410
import Html.Events as E
15-
import Http
1611
import Json.Decode as Decode
1712
import Request exposing (..)
1813
import Types.Feed exposing (..)
@@ -41,68 +36,6 @@ onEnter msg =
4136
E.on "keydown" <| Decode.andThen isEnter E.keyCode
4237

4338

44-
discoverFeedsFieldset : String -> Html Msg
45-
discoverFeedsFieldset discoveryUrl =
46-
H.fieldset [ A.class "border-2 p-2" ]
47-
[ H.legend [] [ H.text "Discover feeds on a site" ]
48-
, H.label
49-
[ A.for "feed-url" ]
50-
[ H.text "Address to discover feeds on" ]
51-
, H.input
52-
[ A.id "feed-url"
53-
, A.type_ "url"
54-
, A.value discoveryUrl
55-
, E.onInput SetDiscoveryUrl
56-
, onEnter <| DiscoverFeeds discoveryUrl
57-
]
58-
[]
59-
, H.button
60-
[ A.class "px-4 py-2 text-sm font-extrabold bg-blue-700 text-white"
61-
, E.onClick <| DiscoverFeeds discoveryUrl
62-
]
63-
[ H.text "Discover" ]
64-
, H.p
65-
[]
66-
[ H.text "Enter the address of a site that contains one or more feeds. "
67-
, H.text "Make sure it starts with "
68-
, H.code [] [ H.text "http://" ]
69-
, H.text " or "
70-
, H.code [] [ H.text "https://" ]
71-
, H.text "."
72-
]
73-
]
74-
75-
76-
discoverFeedFieldset : Html Msg
77-
discoverFeedFieldset =
78-
H.fieldset [ A.class "border-2 p-2" ]
79-
[ H.legend [] [ H.text "Add feed by address" ]
80-
, H.form [ A.method "GET", A.action "/feeds/new/" ]
81-
[ H.label [ A.for "add-feed-url" ] [ H.text "Address of the feed" ]
82-
, H.input
83-
[ A.id "add-feed-url"
84-
, A.type_ "url"
85-
, A.name "url"
86-
]
87-
[]
88-
, H.input
89-
[ A.class "px-4 py-2 text-sm font-extrabold bg-blue-700 text-white"
90-
, A.type_ "submit"
91-
, A.value "Discover"
92-
]
93-
[]
94-
]
95-
, H.p []
96-
[ H.text "Enter the address of an RSS or Atom feed. "
97-
, H.text "Make sure it starts with "
98-
, H.code [] [ H.text "http://" ]
99-
, H.text " or "
100-
, H.code [] [ H.text "https://" ]
101-
, H.text "."
102-
]
103-
]
104-
105-
10639
inProgressFieldset : String -> Html Msg
10740
inProgressFieldset url =
10841
H.fieldset [ A.class "border-2 p-2" ]

assets/elm/app/Feeds/View.elm

-15
This file was deleted.

assets/js/app.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import Feeds from '../elm/app/App/Feeds.elm';
21
import NewFeed from '../elm/app/App/NewFeed.elm';
32

43
import { Socket } from '../../deps/phoenix';
@@ -30,7 +29,7 @@ liveSocket.connect();
3029
window.liveSocket = liveSocket;
3130

3231
const Elm = {
33-
App: { Feeds: Feeds.Elm.App.Feeds, NewFeed: NewFeed.Elm.App.NewFeed },
32+
App: { NewFeed: NewFeed.Elm.App.NewFeed },
3433
};
3534

3635
const mountElmModules = () => {

lib/ex_rss_web/feed_live/index.ex

-16
Original file line numberDiff line numberDiff line change
@@ -188,22 +188,6 @@ defmodule ExRssWeb.FeedLive.Index do
188188
end
189189
end
190190

191-
# 2024-12-03
192-
# This `use` is needed for `content_tag` to be available in `elm_module`.
193-
use PhoenixHTMLHelpers
194-
195-
def elm_module(module, params \\ %{}, attrs \\ []) do
196-
{tag, attrs} = Keyword.pop(attrs, :tag, :div)
197-
198-
data_attributes = [
199-
"data-elm-module": module,
200-
"data-elm-params": html_escape(Jason.encode!(params)),
201-
"phx-hook": "ElmModules"
202-
]
203-
204-
content_tag(tag, "", Keyword.merge(attrs, data_attributes))
205-
end
206-
207191
attr :entry, Entry, required: true
208192

209193
def entry(assigns) do

0 commit comments

Comments
 (0)