https://avo.cool logo
Join Discord
Powered by
# avo-2
  • r

    ripe-article-50191

    03/17/2023, 1:17 PM
    Is this possible inside AVIO?
  • l

    lemon-spoon-80671

    03/17/2023, 3:38 PM
    hi all, I have been working on authorizations lately, following the docs here: https://docs.avohq.io/2.0/authorization.html I achieved the behavior I wanted, everything is working fine until I deploy. There is an issue I cannot reproduce: I have two roles (data manager and user), data manager can create, edit and destroy a record while user can only view it. Locally, it works all as intended, but as soon as I deploy, when I log in as a user, for some records I see the edit and destroy icons, but when I click on them I get the notification "you are not authorized to perform this action". It seems that I am missing something central in my implementation, but I cannot find out what. Has someone experienced a similar issue? How did you go about it? Thanks!
    l
    • 2
    • 31
  • c

    creamy-ghost-62907

    03/17/2023, 7:36 PM
    I'm running into an issue using custom Stimulus controllers. I'm using Propshaft/jsbundling-rails/cssbundling-rails/esbuild. I've made a custom _head, and included the relevant bits. The issue basically comes down to: If I want the controllers to actually be registered and available, I need to go through the whole shebang of what happens in controllers/index.js -- I.E. initializing Stimulus. This produces an error in the console about it being initialized twice. If I don't do the whole process then the controller never gets registered properly because it can't see the existing window.Stimulus instance. Anyone have any thoughts about this?
    l
    • 2
    • 45
  • k

    kind-jewelry-65180

    03/18/2023, 5:38 PM
    Hey! Just a fast question, if i want to have inside a resource, inside tabs a has_many field duplicated, but with different scopes, just to separate the results, how can i do it? Becuse i have this:
    Copy code
    tabs do
        field :notes, as: :has_many, scope: -> do
          query.annotation
        end, name: 'Notas'
        field :notes, as: :has_many, scope: -> do
          query.annotation
        end, name: 'Observaciones'
      end
    But the second field the scope doesnt work, i just a replica of the first has_many field
    l
    • 2
    • 4
  • Hi there is there any way to filter
    k

    kind-bear-97086

    03/20/2023, 2:57 PM
    Hi there, is there any way to filter record by date as on active admin ?
    l
    s
    • 3
    • 10
  • s

    straight-pager-31449

    03/22/2023, 2:33 PM
    @lemon-wall-20836 When I use a limit(777) in the resolve_query_scope method, the count of that limit is displayed in the search dialog. The search is executable. Is there a best way to limit the number of items displayed on the default index screen?
    l
    • 2
    • 16
  • b

    blue-hospital-77159

    03/27/2023, 9:18 AM
    Hi @lemon-wall-20836 ! How's it going. I'm having a weird issue that I never got before, maybe it's the way I'm setting things up this time. Hoping you've come across it before or maybe someone else here did and is willing to provide some insight. The issue then. I have a rails 7 app set up with jsbundling and cssbundling and all of my assets are compiled properly. Avo's on the other hand, not so much. All of the settings in the avo initializer work in development but do not get compiled when in a production environment through the assets:precompile command. My last resource is gonna be move everything from jsbundling and cssbundling to Vite. I've tried using the gem directly from rubygems as well as from github + manual compiling and my settings are never applied. Not entirely sure what I can be missing here. Let me know if there's any other info I can provide.
    l
    • 2
    • 10
  • v

    victorious-kangaroo-12568

    03/27/2023, 2:48 PM
    Hi guys, I need some help here! is there a way to query belongs_to field based on another model id? For example, I have 3 tables, User, User Category, and Company User belongs_to user_category and company UserCategory belongs_to Company and has_many users Company has_many users and user_categories in my case, I would like to show only company user categories in the user form, like In the new user form 1- first select the company 2- select the user_category where company_id is the company_id that I previous selected Ty @lemon-wall-20836 for this amazing job ❤️
    l
    • 2
    • 6
  • k

    kind-jewelry-65180

    03/27/2023, 9:00 PM
    Heeeey, im here again 🖖 Just a fast quesion, if i want to have in the menu resources with a filter applied, how should i do? Example:
    Copy code
    section "Clients", icon: "heroicons/solid/archive-box" do
          resource :clients, label: "Active"
          resource :clients, label: "Rejected"
        end
    l
    • 2
    • 5
  • m

    microscopic-dream-82397

    03/30/2023, 2:26 AM
    Hey guys! Could you comment on how they solved some problems that it was not possible to solve with all the facilities that Avo offers, for example: 1) With a Custom Tool, can I create a completely customized MVC, as if it were an application without Avo?; 2) How do I create two master-detail (countries-cities) type dropdowns ; 3) Where you could customize a mask for a given field, for example, a numerical field 12345-678, or 123.456.789-00; 4) If I needed to move the user's icon to the top, how could I customize it?
    l
    • 2
    • 8
  • r

    ripe-article-50191

    03/30/2023, 5:41 AM
    Can I access to resource.model on pundit policy? I mean, if I have post_policy.rb, can I access to Post.attribute in the
    Class Scope < Scope
    inside
    def resolve
    ?
    l
    • 2
    • 7
  • m

    microscopic-dream-82397

    03/31/2023, 3:30 PM
    Hey guys! Has anyone experienced this problem? >> When I set a field to read-only after assigning a value to it: field :user, as: :belongs_to, default: -> { Avo::App.context[:current_user].id }, readonly: true ------------------- >> Avo reports the following message when trying to save - You might have missed something. Please check the form. - Validation failed: User must exist >> Although Avo indicates the presence of a mandatory field, the system saves the record normally, >> as if it had not given any validation error ------------------- >> Looks like Avo doesn't accept receiving parameter set to read-only Started POST "/avo/resources/schedulings?via_relation=room&via_relation_class=Room&via_resource_id=4" for 127.0.0.1 at 2023-03-31 12:08:35 -0300 User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]] Processing by Avo::SchedulingsController#create as TURBO_STREAM Parameters: {"authenticity_token"=>"[FILTERED]", "via_resource_id"=>"4", "via_relation"=>"room", "scheduling"=>{"room_id"=>"4", "user_id"=>"1", "booked_at"=>"2023-04-02T13:00:00.000-03:00", "booked_for"=>"8"}, "fake_booked_at"=>{"fake"=>"2023-04-02 13:00:00"}, "button"=>"", "via_relation_class"=>"Room"} Unpermitted parameter: :user_id. Context: { controller: Avo::SchedulingsController, action: create, request: #, params: {"authenticity_token"=>"[FILTERED]", "via_resource_id"=>"4", "via_relation"=>"room", "scheduling"=>{"room_id"=>"4", "user_id"=>"1", "booked_at"=>"2023-04-02T13:00:00.000-03:00", "booked_for"=>"8"}, "fake_booked_at"=>{"fake"=>"2023-04-02 13:00:00"}, "button"=>"", "via_relation_class"=>"Room", "controller"=>"avo/schedulings", "action"=>"create"} } ------------------- >> However, when I remove the read-only setting, the system saves normally, without error message field :user, as: :belongs_to, default: -> { Avo::App.context[:current_user].id }
    l
    • 2
    • 8
  • m

    microscopic-dream-82397

    03/31/2023, 3:30 PM
    Avo 2.29.1
  • a

    able-needle-51274

    04/04/2023, 3:30 PM
    Is the pundit gem required once we add our avo pro license?
    l
    • 2
    • 2
  • a

    able-needle-51274

    04/04/2023, 4:59 PM
    Has anyone ever seen any issues with the index view displaying one value but the show view displaying a different one for the same field? (select field)
    l
    c
    • 3
    • 15
  • q

    quaint-pencil-2979

    04/06/2023, 7:45 PM
    Hello guys, i have one secret field for my resource that is not a password field, is there some way to use like devise_password_optional config for another field?
    Copy code
    ruby
    class ProjectResource < Avo::BaseResource
      self.devise_password_optional = true # THis option but for github_secret
    
      field :github_secret, as: :password
    end
    The problem is that if a not update this field (github_secret) in avo edit, this field is updated to a blank string
    l
    • 2
    • 9
  • b

    big-sunset-95620

    04/12/2023, 6:17 PM
    hi all
  • Belongs to
    b

    big-sunset-95620

    04/12/2023, 6:18 PM
    I am having a problem finding how to submit a model where the model belongs_to:user.
    l
    l
    • 3
    • 56
  • b

    big-sunset-95620

    04/12/2023, 6:19 PM
    Is there a link or some code I need to change?
  • w

    wide-art-99889

    04/12/2023, 7:21 PM
    Greetings all, I am trying out the new location field type and I think I'm missing some important step to get it to work as expected. Here are the steps I have taken: 1. Update avo to release 2.30.0 2. Add a new field to my resource class:
    field :coordinates, as: :location, stored_as: [:latitude, :longitude]
    (I already had latitude and longitude attributes on the model) 3. Add
    def coordinates
    and
    def coordinates=()
    methods to my model class. 4. Add the
    mapkick
    gem to my rails application. When I visit the show page for one of the so-modified resources, I expect to see a map on the page. Instead, I see the following error:
    Copy code
    undefined method `js_map' for #<Avo::Fields::LocationField::ShowComponent:0x00000001173d99c0 @compact=false, @field=#<Avo::Fields::LocationField:0x00000001302b5288 @show_on_index=false, @show_on_show=true, @show_on_new=true, @show_on_edit=true, @id=:coordinates, @name=nil, @translation_key=nil, @block=nil,
    I took most of my inspiration from looking at the changes made to the dummy app in the commit, so I'm not sure what else I need to do for the
    js_map
    method from the gem to be available within avo.
    l
    i
    • 3
    • 8
  • i

    incalculable-psychiatrist-85460

    04/13/2023, 1:04 AM
    I was DMed about this. We chatted a bit about the use-case. I believe we're still awaiting confirmation that the Mapbox API key was present when this error appeared.
  • i

    incalculable-psychiatrist-85460

    04/13/2023, 1:06 AM
    Are API key confirmations/checks a common feature?
  • n

    nice-ambulance-76519

    04/13/2023, 5:01 AM
    Hi everyone, From time to time I'm experiencing an issue with Avo where I cannot see the relationships(has_many) that I've set in the resources file. I only see a loading animation that keeps running forever like one of the images attached. At the same time, the search bar colapses(attached) and there is an error on the Chrome console(attached). I've already tried to clear the cache and switch to a different browser, but the problem still shows up from time to time. Has anyone faced this issue before?
    l
    m
    • 3
    • 53
  • b

    billowy-easter-81499

    04/14/2023, 5:30 PM
    I am looking for a way to enable "external" users who are not actual Avo app users in order to digitially execute (sign) a contract within Avo. App users would send an email to external/non-app users containing a URL they can visit within Avo to execute (sign) an agreement. These "external" users would only need access to one particular show page where they could click an action button, enter their name in the modal and consent to some terms. I am seeking the simplest solution. We're using devise for authentication. Perhaps setting up one devise user account any external/non-app user could use to authenticate with? Is it possible to give access to unauthenticated users? Thanks in advance!
    l
    • 2
    • 5
  • l

    lemon-wall-20836

    04/18/2023, 10:19 AM
    has anyone mounted Avo to a subdomain? Can you help out with this issue? https://github.com/avo-hq/avo/issues/1692
  • b

    boundless-printer-62821

    04/18/2023, 8:56 PM
    Hi everyone! Just starting to build on Avo 🙂 Ran into an issue that Im not sure if is a known one. I setup as per instructions but am seeing
    <svg><!-- SVG file not found: 'resources.svg' --></svg>
    in the HTML of the navigation, and this breaks the layout (the 'Resources" span is pushed off the right and overflows the container). I am using
    propshaft
    with Rails 7,
    cssbundling-rails
    and
    jsbundling-rails
    l
    • 2
    • 9
  • b

    bright-tomato-27372

    04/19/2023, 6:51 AM
    Anyone know how to add the dividers as shown in the docs for the sample Action? Seeing the image from https://docs.avohq.io/2.0/actions.html#overview and I don't see anything in the code that would display a divider / horizontal line. I've tried adding a
    boolean
    and a
    textarea
    to see if it is done automatically from different fields but that doesn't seem to work.
    l
    • 2
    • 13
  • b

    boundless-printer-62821

    04/19/2023, 11:40 AM
    I added my first resource but not seeing anything on the index page except the title section. If I put a breakpoint in
    views/avo/base/index.html.erb
    on the component render statements they are hit (and there is def content to render), but the output never seems to be appended to the page output. Im pretty sure this is caused by the fact I am using ViewComponent 3 (v3.0.0.rc5), and the slots in avo would need renaming to include
    with_
    when called (https://viewcomponent.org/CHANGELOG.html#300rc1 "BREAKING: Remove deprecated slots setter methods. Use with_SLOT_NAME instead.") ... is it possible that Avo V3 has been updated to support Viewcomponent 3?
    l
    • 2
    • 29
  • e

    early-knife-34520

    04/19/2023, 11:55 AM
    Hi! I want to create a nested record (has_many), so I found this guide in Avo docs (https://docs.avohq.io/2.0/recipes/nested-records-when-creating.html) Here is custom template with needed fields in step 5, but in my case, I need almost all model fields. And I already have Avo resource for nested model. Is it possible to render resource instead of duplicating all these model fields into erb template? Or better way to implement desired logic?
    l
    • 2
    • 6
  • f

    flat-sugar-59156

    04/19/2023, 7:49 PM
    Does anyone know if actions are hidden by policies?
    l
    • 2
    • 5
1...565758...64Latest