Skip to content

Commit

Permalink
feat: Handle JSON sub-views (#216)
Browse files Browse the repository at this point in the history
* feat: Handle JSON sub views

* feat: Upgrade application_runner & fix user management

* style: Remove commented code

* style: Remove commented code
  • Loading branch information
taorepoara authored Sep 19, 2024
1 parent 45d2168 commit a8cf5b1
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 30 deletions.
46 changes: 27 additions & 19 deletions client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.17.1"
version: "1.18.0"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -427,10 +427,10 @@ packages:
dependency: transitive
description:
name: intl
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
url: "https://pub.dev"
source: hosted
version: "0.18.0"
version: "0.18.1"
js:
dependency: transitive
description:
Expand Down Expand Up @@ -501,26 +501,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev"
source: hosted
version: "0.12.15"
version: "0.12.16"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.5.0"
meta:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -754,26 +754,26 @@ packages:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
string_scanner:
dependency: transitive
description:
Expand All @@ -794,10 +794,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev"
source: hosted
version: "0.5.1"
version: "0.6.1"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -918,6 +918,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
web:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev"
source: hosted
version: "0.3.0"
win32:
dependency: transitive
description:
Expand Down Expand Up @@ -967,5 +975,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.0.0 <4.0.0"
dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=3.10.0"
2 changes: 1 addition & 1 deletion server/config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ config :dev_tools, DevTool.FakeHydra.Endpoint,
live_reload: [
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"lib/identity_web/templates/.*(eex)$"
~r"lib/dev_tool/templates/fake_hydra.*(eex)$"
]
]

Expand Down
2 changes: 0 additions & 2 deletions server/lib/dev_tool.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ defmodule DevTool do
import LenraCommonWeb.ControllerHelpers
import Plug.Conn

plug(:put_view, LenraCommonWeb.BaseView)

action_fallback(LenraCommonWeb.FallbackController)

alias DevTool.Router.Helpers, as: Routes
Expand Down
13 changes: 7 additions & 6 deletions server/lib/dev_tool/fake_hydra/controllers/oauth2_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ defmodule DevTool.FakeHydra.Oauth2Controller do

def auth(conn, %{"redirect_uri" => redirect_uri, "scope" => scope, "state" => state}) do
users =
Enum.map(Repo.all(User), fn user -> user.manual_id end)
|> Enum.sort()
case Enum.map(Repo.all(User), fn user -> user.manual_id end) do
[] ->
{:ok, _user} = UserServices.upsert_fake_user(1)
[1]

if Enum.empty?(users) do
{:ok, user} = UserServices.upsert_fake_user(1)
users = [1]
end
ids ->
Enum.sort(ids)
end

next_id = Enum.max(users) + 1

Expand Down
2 changes: 1 addition & 1 deletion server/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ defmodule DevTool.MixProject do
{:cors_plug, "~> 3.0"},
{:application_runner,
git: "https://github.com/lenra-io/server.git",
ref: "v1.4.0",
ref: "v1.6.0",
subdir: "libs/application_runner",
submodules: true},
{:distillery, "~> 2.1"}
Expand Down
2 changes: 1 addition & 1 deletion server/mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%{
"application_runner": {:git, "https://github.com/lenra-io/server.git", "05c2946f247d4a222722a6b6aa45159c71271b2c", [ref: "v1.4.0", subdir: "libs/application_runner", submodules: true]},
"application_runner": {:git, "https://github.com/lenra-io/server.git", "72d8104571e9d519d75a7f4a03ab9cdff51e16c5", [ref: "v1.6.0", subdir: "libs/application_runner", submodules: true]},
"artificery": {:hex, :artificery, "0.4.3", "0bc4260f988dcb9dda4b23f9fc3c6c8b99a6220a331534fdf5bf2fd0d4333b02", [:mix], [], "hexpm", "12e95333a30e20884e937abdbefa3e7f5e05609c2ba8cf37b33f000b9ffc0504"},
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"bypass": {:hex, :bypass, "2.1.0", "909782781bf8e20ee86a9cabde36b259d44af8b9f38756173e8f5e2e1fabb9b1", [:mix], [{:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: false]}, {:ranch, "~> 1.3", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "d9b5df8fa5b7a6efa08384e9bbecfe4ce61c77d28a4282f79e02f1ef78d96b80"},
Expand Down

0 comments on commit a8cf5b1

Please sign in to comment.