django-watchman icon indicating copy to clipboard operation
django-watchman copied to clipboard

Fix HTML ids

Open jbenua opened this issue 4 years ago • 13 comments

Add optional id for check to use in HTML template, else slugify check name to avoid silent modal popup crash.

jbenua avatar Apr 01 '21 13:04 jbenua

@jbenua thanks for the submission!

The reformatting makes it a little tricky to review the logical change here - could you split those out into a separate commit?

Could you also clarify the cases where the current configuration is causing a problem for you? Is this for some of the built-in checks or for custom checks that you're writing?

Thanks!

mwarkentin avatar Apr 01 '21 14:04 mwarkentin

Hi! yeah, custom checks, e.g. ping redis instances - titles are host:port values, and none of dots(.) or colons (:) are allowed in html ids.

jbenua avatar Apr 01 '21 14:04 jbenua

Coverage Status

Coverage remained the same at 90.975% when pulling 3267ab7809ed53476e959c86a63c3c122ed8e754 on jbenua:html-ids-fix into 445a5af0d80dbea89a3df602a2f6ecfb5af85913 on mwarkentin:master.

coveralls avatar Apr 01 '21 14:04 coveralls

Could you add an example of setting a check ID to the custom checks readme as well?

I'm curious - are there places where slugify on its own wouldn't be enough and you'd need to override with your own id?

mwarkentin avatar Apr 01 '21 14:04 mwarkentin

Imagine a situation when you have several very alike urls, for example 127.0.0.11:80 and 127.0.0.1:180:) slugify will generate the same string from them:

>>> slugify("127.0.0.11:80")
'127001180'
>>> slugify("127.0.0.1:180")
'127001180'

jbenua avatar Apr 01 '21 15:04 jbenua

Cool, thanks :)

jbenua avatar Apr 02 '21 10:04 jbenua

@jbenua looks like my CI on travis isn't working anymore, going to need to look into that before I do a full release. If it's helpful I could put out a pre-release on pypi that you could use if this is urgent for you.

mwarkentin avatar Apr 08 '21 13:04 mwarkentin

No need to hurry:)

jbenua avatar Apr 09 '21 12:04 jbenua

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 26 '21 02:06 stale[bot]

Not stale.

mwarkentin avatar Jun 26 '21 12:06 mwarkentin

@jbenua really sorry.. a little (lot) slower than I'd hoped, but I'm starting to prep a release of django-watchman, and I was wondering if you're still interested in getting this change merged and released?

mwarkentin avatar Jan 11 '22 18:01 mwarkentin

Not really, but i hope it helps others.

jbenua avatar Jan 12 '22 10:01 jbenua

@jbenua Sounds good, thanks again!

mwarkentin avatar Jan 13 '22 14:01 mwarkentin