Code Monkey home page Code Monkey logo

kaffy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kaffy's Issues

[PROPOSAL] Count performance on index page

In relation to #57 I wanted to shared other points to keep track for future improvements.

I have tested Kaffy with 10 millions records.
In my use case, I will often have some big tables, in those case count can become a huge pain in the neck, unfortunately unavoidable.

One good hack I use with django-admin.
https://stackoverflow.com/questions/39851915/faster-django-admin-paginator-cannot-get-this-django-snippet-to-work#39852663
This allows you to have an estimated count which is very cheap, although not exact, this will not work with filters of course, but most of the time, the admin will open an index page and start from there, so if we can improve that first view that's a big win.

It would be great if we could overload with our own paginator or having an option to select a different one for some view. It doesn't make sense for all tables, so definitely something you would want to use only when table are huge.

More info about count performance, here a good read:
https://www.citusdata.com/blog/2016/10/12/count-performance/

Resource with two words doesn't save properly

When I submit a form for a resource with two words in the name, I receive an error that all required forms are blank.

It appears in might be an error with the two words not separated with an underscore in the parameters:

  Parameters: %{"_csrf_token" => "XiADUzgRR1JoGh4TRC8YCgEPETRoK1l5hMV7Yy341lQ87Zs26W_N_jdD", "championship_result" => %{"championship_id" => "52", "fantasy_player_id" => "531", "id" => "", "inserted_at" => %{"day" => "1", "hour" => "0", "minute" => "0", "month" => "1", "year" => "2015"}, "points" => "8", "rank" => "1", "updated_at" => %{"day" => "1", "hour" => "0", "minute" => "0", "month" => "1", "year" => "2015"}}, "context" => "ex338", "resource" => "championshipresult", "submit" => "Save"}

See "championship_result" => %{"data" => "data"} & "resource" => "championshipresult".

I was able to save my "owners" resource, but also couldn't save my "fantasy_leagues" resource.

Successful owners resource:

  Parameters: %{"_csrf_token" => "bz0tFhQPPDlrLwx-JR8iWg4rJz1_Lw5lYPxrugH_2YCUVjIb9siGHn3X", "context" => "ex338", "owner" => %{"fantasy_team_id" => "53", "id" => "", "inserted_at" => %{"day" => "1", "hour" => "0", "minute" => "0", "month" => "1", "year" => "2015"}, "updated_at" => %{"day" => "1", "hour" => "0", "minute" => "0", "month" => "1", "year" => "2015"}, "user_id" => "2"}, "resource" => "owner", "submit" => "Save"}

[PROPOSAL] provide support for telemetry

Since telemetry is becoming the de facto package for metrics and instrumentations in elixir, I feel it's going to provide a huge benefit for developers/admins using Kaffy if we have built-in support for it.

Also note the the official phoenix_live_dashboard uses this to provide useful metrics.

[FEATURE-REQUEST] Use different Admin Template mobile friendly (Tailwind CSS/Bootstrap4)

The dashboard looks nice, but probably tailwindcss will provide a higher level of customization.
Additionally I found that SB-Admin is not very nice on mobile, I know there is a small audience using backend on mobile, nevertheless if we could tackle this early rather than later it would be awesome

[https://www.creative-tim.com/learning-lab/tailwind-starter-kit/dashboard]
image

Above Create-Tim is providing a skel for Dashboard which is MIT licensed. It might be a good fit, although it would be worth doing more research.

[BUG] all side menu items are always active (expanded) when visiting the dashboard page

@areski do you have any idea what's going on here?
I went crazy yesterday because of this. I'm not sure if this is css or js related since adding/removing classes to the items doesn't seem to change anything.

Versions Used
Kaffy: v0.8.0 (master)

What's actually happening?
When clicking on the dashboard page link, all the items below it are marked as active and they are expanded.

What should happen instead?
Clicking on the dashboard link should only make the dashboard item active (white) while closing all the other menu items.

Screenshots
Screen Shot 2020-05-30 at 16 37 28

Manually listing schemas with keys different than the actual schema module name leads to unexpected behavior

When we have Blogs.Post and Rooms.Room schemas and define them like this in kaffy:

resources: [
    room: [
      name: "Room",
      schemas: [
        example: [schema: ChitChat.Chat.Room, admin: ChitChatWeb.RoomAdmin]
      ]
    ],
    blog: [
      name: "Blog",
      schemas: [
        test: [schema: ChitChat.Blog.Post]
      ]
    ]
  ]

Kaffy will not be able to create/update schemas correctly.
Currently, kaffy uses the schemas keys to construct URLs which it shouldn't.

We need a fix for now, but we also need to evaluate having atom keys in the schemas list since they are becoming irrelevant. The previous example could be written as follows:

resources: [
    rooms: [
      name: "Room",
      schemas: [
        [schema: ChitChat.Chat.Room, admin: ChitChatWeb.RoomAdmin]
      ]
    ],
    blogs: [
      name: "Blog",
      schemas: [
        [schema: ChitChat.Blog.Post]
      ]
    ]
  ]

[FEATURE-REQUEST] Create custom link

It would be great to have the ability to create a custom link in the menu.
For instance if you want a link that point to Phoenix LiveDashboard, or an API Swagger UI.

Field permission: editing an existing element vs create new element

Imagine the scenario when you want to allow a field to be created but not edited.
If you use something like:

def form_fields(_) do
    [
      username: %{permission: :read},
...

Then the field cannot be introduced when you create the resource.

Is there a way to tackle this problem or should we consider introducing different permission mechanism:

:permission - can be :editable, :read-only or :create-only

[BUG] finding assets

Kaffy: Master branch
Phoenix: 1.5

It seems there is an issue with the current master branch, it cannot find the asset.

iex [10:14 :: 4] > [info] GET /kaffy/assets/vendors/css/vendor.bundle.base.css
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /kaffy/assets/vendors/css/vendor.bundle.base.css (ChitChatWeb.Router)
    (chit_chat 0.1.0) lib/phoenix/router.ex:402: ChitChatWeb.Router.call/2
    (chit_chat 0.1.0) lib/chit_chat_web/endpoint.ex:1: ChitChatWeb.Endpoint.plug_builder_call/2
    (chit_chat 0.1.0) lib/plug/debugger.ex:132: ChitChatWeb.Endpoint."call (overridable 3)"/2
    (chit_chat 0.1.0) lib/chit_chat_web/endpoint.ex:1: ChitChatWeb.Endpoint.call/2
    (phoenix 1.5.3) lib/phoenix/endpoint/cowboy2_handler.ex:65: Phoenix.Endpoint.Cowboy2Handler.init/4 
    (cowboy 2.7.0) /home/areski/projects/phoenix/ex-chitchat/deps/cowboy/src/cowboy_handler.erl:41: :cowboy_handler.execute/2
    (cowboy 2.7.0) /home/areski/projects/phoenix/ex-chitchat/deps/cowboy/src/cowboy_stream_h.erl:320: :cowboy_stream_h.execute/3
    (cowboy 2.7.0) /home/areski/projects/phoenix/ex-chitchat/deps/cowboy/src/cowboy_stream_h.erl:302: :cowboy_stream_h.request_process/3
    (stdlib 3.11) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Screenshots
If applicable, add screenshots to help explain your problem.
image

Add Tests

  • Tests for ResourceSchema
  • Tests for ResourceForm
  • Tests for ResourceAdmin
  • Tests for ResourceQuery
  • Tests for Utils

[0.3.1] kaffy doesn't compile for elixir < 1.10 due to Kernel.is_struct

...
* Getting kaffy (Hex package)
...
➜  kaffy_test (master) ✗ mix compile
==> kaffy
Compiling 12 files (.ex)

== Compilation error in file lib/kaffy/resource.ex ==
** (CompileError) lib/kaffy/resource.ex:35: undefined function is_struct/1
    (elixir) src/elixir_locals.erl:108: :elixir_locals."-ensure_no_undefined_local/3-lc$^0/1-0-"/2
    (elixir) src/elixir_locals.erl:108: anonymous fn/3 in :elixir_locals.ensure_no_undefined_local/3
    (stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
    (elixir) lib/kernel/parallel_compiler.ex:229: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7

[FEATURE-REQUEST] Add export functionality

I'm interested in exporting data as csv.

Maybe something like:

def export_fields(schema, params) do
  entries = Kaffy.ResourceAdmin.list_resource(schema, params)
  fields = [:id, :title, :status, :inserted_at]
  for entry <- entries do
    # ...
  end
end

Add license, please )

Thanks for sharing this project!
I believe it would get more support and adoption if you add a license like MIT for example.

Custom admin actions for single resources

The ability to add custom actions to be performed on single resources.
For example, I need to send an email for a commenter to inform them that their comment was approved (etc).

Change route parameter names to minimize conflict

We're using /:context/:resource/...
Using these names might potentially introduce some naming conflicts especially with some url/form parameters.

Should change it to something else like /:kaffy_context/:kaffy_resource/...

Support phoenix < 1.5

Since phoenix 1.3 and 1.4 are still widely used, we should probably make sure kaffy runs fine with those versions.

The main issue currently is how templates are using @inner_content instead of the old way.

Handle search_fields from relationships

Hi @aesmail - hope you're well.

Imagine this scenario
User belongs to Profile

User has got email and a couple of other fields
Profile has got first name, last name etc.
on Kaffy I'm not gonna have two resource tabs called Users and Profiles. I will only have Users, right?
Users resource will show also user's profile first/last name, etc.

I would like to be able to search by user's profile first/last name, email, etc

if that make sense? 👍

Add filtration

Filtration should be extensible and configurable.

I'm thinking something like:

def search_fields(_schema) do
  [
    title: nil,
    inserted_at: nil,
    # etc
  ]
end

Not sure though what would be passed as values.
If nothing should be passed, we should use normal lists instead of keyword lists.

ID returns ERROR for some resources

I've added kaffy to my exisiting project, see branch: https://github.com/axelclark/ex338/tree/kaffy.

For some resources, the ID field on the form page displays ERROR when I click on the ID in the index list. For example Ex338.Trade, Ex338.User, and Ex338.FantasyTeam.

I don't receive the error for Ex338.SportsLeague, Ex338.FantasyPlayer, and Ex338.DraftPick.

Any ideas what the issue could be?

[FEATURE-REQUEST] Create custom page

It would be great to have the ability to create your own custom page, eg to build a custom report, or something very specific for someone business needs.

That customer page should be displayed inside the kaffy-admin, not on a different page.
Would love to see that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.