Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add callouts to resources #3701

Open
10 tasks
Paul-Bob opened this issue Feb 28, 2025 · 0 comments
Open
10 tasks

Add callouts to resources #3701

Paul-Bob opened this issue Feb 28, 2025 · 0 comments

Comments

@Paul-Bob
Copy link
Contributor

Feature

Let's add native support for resources banner that should look similar to the tutorial custom implementation from https://ticketing.avodemo.com/

Image

Must have

  • Option to define title
  • Option to define body, with html_safe support
  • Option to define icon
  • Option to define type: :info, :warning, :error, :success, which will set the color of the banner
  • Option to define visibility
  • Option to define URL to redirect to when clicked
  • A way to use custom component where all the options are passed as attributes

Nice to have

  • Option to define position: :top, :bottom
  • Option to define timeout (how long the banner should be visible)
  • Option to define custom color instead of using the type color

Exploratory DSL

self.callouts = [
    {
      type: :info, # :warning, :error, :success;
      visible: -> { true },
      icon: "",
      title: -> {
        "Warning sir"
      },
      body: -> {
        "alert(#{params[:id]})"
        "<span>hey</span>".html_safe
        render partial: "avo/callouts/user_callout"
        render Avo::Callouts::UserCallout.new(record: record)
      },
      # or
      renderable: -> { render partial: "avo/callouts/user_callout" },
      renderable: -> { Avo::Callouts::UserCallout.new(record: record) },
    },
  ]
@Paul-Bob Paul-Bob moved this to To Do in Issues Feb 28, 2025
@adrianthedev adrianthedev moved this from To Do to Backlog in Issues Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant