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

feat: add new pet tooltip #1220 #1267

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mgrigoriev8109
Copy link
Contributor

🔗 Issue

[](#1220)

✍️ Description

Adds two new tooltips for Staff users that are creating a new pet:

  1. Application Paused: "If applications are paused the public can see the pet, but cannot submit an adoption application."note that I moved the comma around because it sounded a bit better, but I can keep the original wording if it's preferred
  2. Published: 'If a pet is published it is visible to the public.'
Screenshot 2024-12-16 at 9 07 28 PM

Also fixes a broken tooltip that was present under Adoption Applications. It was supposed to render properly when the New Adoption button was disabled, but wasn't.
Screenshot 2024-12-16 at 9 07 48 PM

A note - I'm not familiar with this repo and its asset pipeline, and wasn't sure the best way to apply the two javascript scripts to these views. I saw in another Ruby For Good repo that uses tooltips they just threw the script directly into the view, and it worked that way. I tried adding a app/javascript/controllers/pets_controller.js with

import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  connect() {
  const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
  const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
  }
}

buuuuut it didn't work at all. If there's a better place for me to add in the javascript please let me know.

@kasugaijin
Copy link
Collaborator

@mgrigoriev8109 can't we use the data attributes and classes that are used by our theme? See the example link I provided in the issue.

@kasugaijin
Copy link
Collaborator

@mgrigoriev8109 per the meeting tonight, let's just add the text in parentheses next to each radio. We should make sure the radios are always on separate lines at all widths so it looks OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants