Kaffy - a quick and flexible admin interface for phoenix applications

@aesmail
First of all, thank you for a spectacular tool!

I had recently one issue with Kaffy in the umbrella app. The Extension module was not loaded on the server start, so my css and js files were not added to the DOM. However, when server was already running, and I made any change in the Extension file, then the css and js were added to the DOM on website refresh.

After debugging the code, I found that function_exported?(ext, :stylesheets, 1) from lib/kaffy/utils.ex was giving false. Adding Code.ensure_loaded(ext) solved my issue.

I’ve created Pull Request and added more details there.

1 Like

Thank you for your valuable contribution!

Your PR has been merged and will be available on the next release :slightly_smiling_face:

Ey @aesmail!

There is some way to add this?

image

I was reading the List Actions section but it was not what I’ve imagine…

Thanks!!

This could be a good addition to have in Kaffy.
Currently this is not possible (or at least not in a clean way).
I’ll try to see if it’s possible to be added in time for the next release.

I will try to apport this feature then. If I get some free time I will send you a PR. Thanks!

1 Like

How are images handled? Or if Kaffy doesn’t have direct support for uploading images like Strapi, what would be the best way to do that?

are you still working on this?

It’s been very quiet lately but development started picking up. A new RC version has been released on hex today with a few fixes and enhancements.

v0.10.0-rc.0 (2023-09-02)

Fixes

  • Fix changeset errors PR#262
  • Fix a crash when visiting a Kaffy link after the project reloads/restarts. PR#266
  • Fix a crash when a schema has a many_to_many field.
  • Fix array fields not being saved properly.
  • Fix :readonly and :editable options for datetime fields.
  • Fix belongs_to fields being populated unintentionally.
  • Fix issue with datetime fields sometimes being updated unexpectedly.

Changed

  • Minimum Elixir version is now 1.11 (minimum supported phoenix version remains 1.5).
  • Add phoenix_view package to deps.
  • Specify the full ‘path’ for FontAwesome fonts PR#186
  • Lazy load default kaffy field value PR#255
  • Update phoenix html to address deprecated form_for PR#260
  • Use left_join when building search query PR#273
  • Remove the “- Kaffy” suffix from page titles.

Added

  • Support hiding menu entries PR#248
  • Add support for composite primary keys PR#270
  • Index page description PR#274
  • Footer note can be specified in config PR#275
  • Provide more flexibility for customizing the admin_logo and admin_logo_mini options.
  • Add the ability to “bulk delete” resources from the index page.
  • Hide save and delete buttons on the show page based on available actions.
  • Add Kaffy.Utils.auto_detect_resources/0 which returns the list of auto-detected resources (Kaffy’s attempt at discovering the list of schema/admin modules).
5 Likes

Hey there, any idea when 0.10 will release proper? I could need it this month in a project :slight_smile:

You can always do {:kaffy, "~> 0.10.0-rc.0"} to test it out.
I don’t think things will change as long as there are no serious issues.
The plan is to release 0.10.0-rc.1 a week from now with a few planned minor changes, and 0.10.0 a week after that.

2 Likes

great work :slight_smile: lazy mans tool for when you dont want to use up your time fiddling with creating UIs when it might not even be used in the end…

1 Like

in v0.10 rc2, i love that you fixed an issue with many_to_many causing kaffy to crash :slight_smile: its not shown or is any value to kaffy, but i can use it in the rest of code :wink:

1 Like

This is an important announcement for anyone using Kaffy v0.10

Please note that Kaffy v0.10.1 introduced a bug that ignored all admin modules.

v0.10.1 was released on Monday, October 9, 2023 at 11:57am GMT and v0.10.2 (which fixed the issue) was released at 12:49pm GMT (the time period between the two releases is about 52 minutes).

So if you deployed within this time period, please update Kaffy and deploy again.

Version v0.10.1 has been marked as retired and is no longer available on hex.

Apologies for any issues that this might have caused some of you.

9 Likes

hi, @aesmail - are you still maintaining Kaffy?
I’m curious to know the progress of the has_many association forms feature (if any)

regards

1 Like

I am curious to know how kaffy is validating forms with changeset and is it possible to customize the validation with different changesets in schema in admin modules

note: in my application context, admin module name is different from schema name

enterprise: [
        name: "Enterprise",
        resources: [
          plan: [
            schema: WraftDoc.Enterprise.Plan,
            admin: WraftDocWeb.PlanAdmin
          ],
          enterprise_plan: [
            schema: WraftDoc.Enterprise.Plan,
            admin: WraftDocWeb.EnterprisePlanAdmin
          ]
        ]
      ],

in WraftDocWeb.EnterprisePlanAdmin added
def create_changeset(schema, attrs) do
Plan.custom_plan_changeset(schema, attrs)
end

in plan admin with plan schema validations and everything works fine, in enterprise plan admin form validation not working, in case any changeset errors it raises error and not displaying the errors at form fields, if changeset is valid will create.

I wonder how difficult it would be to use Kaffy with an application built with Ash?

1 Like

There is ashadmin.