Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Michael Lang
    @mwlang
    LOL This one's not Lucky's fault. And honestly, I haven't had to modify a postgres HBA file in almost 8 years
    Jeremy Woertink
    @jwoertink
    nice! @akadusei Thanks for sharing!
    N Atta Kusi Adusei
    @akadusei
    @jwoertink You welcome :-)
    Ghost
    @ghost~56ba344de610378809c0a277
    @akadusei Is it easy to migrate a project based on authentic to shield?
    N Atta Kusi Adusei
    @akadusei
    @snadon I can't tell from experience. (:facepalm: I should have thought about this). What I intend to do the coming week, is build a basic Lucky app based on Authentic, and try to migrate to Shield. I'll update the documentation to reflect what I learn.
    Stephen Dolan
    @stephendolan
    Have any of y'all successfully created a wrapper Component for a link in Lucky? I've been trying with something like what's below, but it's trying to match the union type to a signature in Lucky::LinkHelpers rather than each individual type and throwing a compile error :(
    class UI::CardActionHeader < BaseComponent
      needs title : String
      needs link_text : String
      needs link_target : Lucky::Action.class | Lucky::RouteHelper | String
    
      def render
        div class: "-ml-4 -mt-2 flex items-center justify-between flex-wrap sm:flex-no-wrap" do
          div class: "ml-4 mt-2" do
            h3 class: "text-lg leading-6 font-medium text-gray-900" do
              text title
            end
          end
          div class: "ml-4 mt-2 flex-shrink-0" do
            span class: "inline-flex rounded-md shadow-sm" do
              link link_text, to: link_target, class: "a lot of classes"
            end
          end
        end
      end
    end
    Ends up throwing this:
    web          |  15 | link link_text, to: link_target, class: "a lot of classes"
    web          |       ^---
    web          | Error: no overload matches 'UI::CardActionHeader#link' with types String, to: (Lucky::Action.class | Lucky::RouteHelper | String), class: String
    web          |
    web          | Overloads are:
    web          |  - Lucky::LinkHelpers#link(text, to : Lucky::RouteHelper, attrs : Array(Symbol) = [] of Symbol, **html_options)
    web          |  - Lucky::LinkHelpers#link(text, to : Lucky::Action.class, attrs : Array(Symbol) = [] of Symbol, **html_options)
    web          |  - Lucky::LinkHelpers#link(to : Lucky::RouteHelper, attrs : Array(Symbol) = [] of Symbol, **html_options, &block)
    web          |  - Lucky::LinkHelpers#link(to : Lucky::Action.class, attrs : Array(Symbol) = [] of Symbol, **html_options, &block)
    web          |  - Lucky::LinkHelpers#link(to : Lucky::RouteHelper, attrs : Array(Symbol) = [] of Symbol, **html_options)
    web          |  - Lucky::LinkHelpers#link(to : Lucky::Action.class, attrs : Array(Symbol) = [] of Symbol, **html_options)
    web          |  - Lucky::LinkHelpers#link(text, to : String, attrs : Array(Symbol) = [] of Symbol, **html_options)
    web          |  - Lucky::LinkHelpers#link(to : String, attrs : Array(Symbol) = [] of Symbol, **html_options, &block)
    Matthew McGarvey
    @matthewmcgarvey
    I've been shown Laravel's Telescope tool and it makes me all the more excited for Breeze :tada: :tada: :tada: :tada:
    Håkan Nylén
    @confact
    @stephendolan if you find a solution to that please tell me. Got the same issue when I want to loop through links for navigation :D
    Stephen Dolan
    @stephendolan
    I did figure it out! Not to do exactly that, but another way to accomplish the same thing. Going to be posting a LuckyCast on it in the next week or so!
    Paul Smith
    @paulcsmith
    @stephendolan @confact This is what I was going to recommend (not tested yet) https://gist.github.com/paulcsmith/180bf202509b926c914e92bd137700de
    Similar pattern to Shared::Field. This allows you to pass any option you want and use other methods like a or button instead of link. But I haven't test yet so not sure. Might be worth exploring. Looking forward to seeing what you came up with @stephendolan!
    D'oh I totally misrememebered what I read from your snippet yesterday, but the gist is that you can pass a block to with_defaults and that seems to work pretty well!
    Paul Smith
    @paulcsmith
    @stephendolan Updated gist with a slightly different pattern. This is more "composalbe" in that you can pass in any button you want, or list of buttons, etc. https://gist.github.com/paulcsmith/180bf202509b926c914e92bd137700de
    So you pass in a Proc for the actiosn and use a Button component to share common classes
    LMK what you think and if that even works for what you're trying to do :P
    3 replies
    Stephen Dolan
    @stephendolan
    Here's the first LuckyCast that actually may help out some folks that frequent the Gitter on named slots: https://www.youtube.com/watch?v=KoiKOD63tRQ
    Still experimenting with tone, editing, and length, but pretty happy with how concise this one felt! Enjoy!
    Edward Loveall
    @edwardloveall
    nice work @stephendolan
    Paul Smith
    @paulcsmith
    Nice! I loved it! I enjoy that the page looks nice and was pretty surprised wehn all of a sudden the dashboard looked like a real (and beautiful dashboard!)
    I think maybe lining to what a Proc is and what the Void part is would be cool, but even as-is I think it is super helpful. Nice work!
    Stephen Dolan
    @stephendolan
    Ty! Haha yeah, all thanks to tailwindui.com :P
    Jeremy Woertink
    @jwoertink
    Wow! I love that these are short and sweet, but so clear and easy to digest
    Stephen Dolan
    @stephendolan
    I think I have to hit some arbitrary YouTube milestone to link out to external links (right now I can only link to vids), but I have a Trello card for diving into Procs and plan to add a little link in this video once it's published :)
    Jeremy Woertink
    @jwoertink
    Stephen Dolan
    @stephendolan
    No idea that even existed, thanks @jwoertink !
    It's hard because I'm not sure how much to "spam" the Crystal community at large with Lucky-specific screencasts
    (Don't worry, I'll have no mercy on this chat :wink: )
    Jeremy Woertink
    @jwoertink
    Yeah, if you look through that forum, you'll see other youtube vids that get posted. I'd say posting one a week would keep wanting more, and not make people feel overwhelmed
    yeah, spam our chat with these! :rocket:
    Stephen Dolan
    @stephendolan
    Cool, that's been the strategy so far! With work and house renovations I wouldn't be able to crank out more than one per week anyways :smile:
    But maybe one day....
    Paul Smith
    @paulcsmith
    @stephendolan Yeah I'd post to the Crystal stuff. Lucky is cool so Crystal people should like it :P 😂
    Also I'd be curious to hear what you think of the gist I posted. I haven't used it or the version you posted so I'd be very curious to hear which one you prefer and why so we can help explain the different approaches and pros/cons
    2 replies
    Paul Smith
    @paulcsmith
    @stephendolan in reference to https://gist.github.com/paulcsmith/180bf202509b926c914e92bd137700de where I used with_defaults similar to the Shared::Field component. This way the classes are set automatically which I think is kinda cool
    But also the Proc for passing actions, but mostly looking for feedback on with_defaults for use with buttons
    Stephen Dolan
    @stephendolan
    Ah, right! The only thing I struggle with is how you let the component define the classes on the link itself, since wrapping a link in a button won't make the whole clickable button area an href
    Like I'd need a way to produce <a class="btn" href="#">Test</a>, rather than <button class="btn"><a href="#">Test</a></button>
    Unless this is just me needing to learn more CSS/Tailwind :smile:
    Paul Smith
    @paulcsmith
    I’m not totally sure I understand. When using “with defaults” you can use whatever method with it. So you can use “link” and it’ll apply the class to it. So the whole thing will be clickable :)
    Stephen Dolan
    @stephendolan
    OH, no you're right
    Idk what is so difficult about that structure for my brain to comprehend, lol
    Paul Smith
    @paulcsmith
    It is weird. Definitely not just you.
    Stephen Dolan
    @stephendolan
    For some reason I just find calling the proc with args much more straightforward, but your approach feels cleaner
    Paul Smith
    @paulcsmith
    I try to avoid it but I think for inputs and buttons it works. Just because there are so many tags you can use with it and so many options
    Stephen Dolan
    @stephendolan
    Right, like if my component wants to make the target="_blank"
    I'd have to add a new param to every caller
    Paul Smith
    @paulcsmith
    It’s weird but flexible and a bit more concise.
    Stephen Dolan
    @stephendolan
    Rather than just keeping the signature the same
    Paul Smith
    @paulcsmith
    Yeah exactly