Use Description to populate the description on tiles and Use Type to populate Products, Projects, and Services on the DTS website - #131
Conversation
| // The `labels` column is a comma-separated string of labels, so we use wildcard string searching | ||
| const QUERY = | ||
| "$limit=100000&$where=(labels like '%Project Index%' or labels like '%Product Index%' or labels like '%Service Index%') and labels not like '%Archived Project%' and (pipeline != 'Icebox' or pipeline is null)"; | ||
| "$limit=100000&$where=(type like '%Project%' or type like '%Product%' or type like '%Service%') and type not like '%Archived Project%' and (pipeline != 'Icebox' or pipeline is null)"; |
There was a problem hiding this comment.
@katelunceford @amenity will we still be using "Archived Project" as a type?
There was a problem hiding this comment.
it looks like archived project will not be a Type, will it still be used as a Label?
| : []; | ||
| newIssue.type = getIssueType(newIssue.labels); | ||
| // labelType is found in the label | ||
| newIssue.labelType = getLabelType(newIssue.labels); |
There was a problem hiding this comment.
we already had a field called "type" before which i have renamed to labelType, bc it exists in the Labels field. ie: "Type: DevOps"
| body.match(reDescriptionSentence)?.[0] || | ||
| body.match(reDescriptionLinebreak)?.[0]; | ||
| const reImg = /(?:!\[(.*?)\]\((.*?)\))/; | ||
| function parseImage(body) { |
There was a problem hiding this comment.
we dont need to parse the body test for the description anymore now that we are using the description field, so this function becomes entirely about parsing the image
frankhereford
left a comment
There was a problem hiding this comment.
I think this code looks good, but I have identified a couple of things that need to get worked out before this goes live. I think the issues are not in this code, however. I believe you may need to coordinate with @katelunceford to get upstream issues fixed which will cause this code to start to work as written.
The first item is concerning the issues' images that I wrote about below, and the second item is that I think that there is an issue with the set of issues that have the GHP label type set to Service. It seems like there are a good chunk of them pertaining to Maximo.
I think it's important to get that source data correct before any of this merges into production.
@katelunceford & @roseeichelmann: Please let me know if any of this doesn't make sense - I would be happy to sync over these issues anytime. Thanks!
| function parseImage(body) { | ||
| // find the first img (if one exists) | ||
| const reImg = /(?:!\[(.*?)\]\((.*?)\))/; | ||
| const imgMatch = body.match(reImg); | ||
| let img = null; | ||
| if (imgMatch && imgMatch.length > 0) { | ||
| img = { alt: imgMatch[1], src: imgMatch[2] }; | ||
| } | ||
| return [description, img]; | ||
| return img; | ||
| } |
There was a problem hiding this comment.
When I spun this up, I was surprised to see that only one Service card had an image because I knew that @katelunceford had added some to, at least, the dev services. I looked at the issues for these service cards, and it looks like the images have been added using an image tag (example 1) instead of a markdown tag shown below in example 2.
Example 1:
<img width="1382" height="921" alt="Image" src="https://github.com/user-attachments/assets/a21bab84-2377-4547-9bac-ed69085cdf40" />
Example 2:

I think it'd be cleaner to use a consistent mechanism (Example 2 style) in our GitHub issues, and I think getting those issues' images converted should block this going live.
There was a problem hiding this comment.
Thanks, @frankhereford - this has always caused us trouble; see #16240. 😢 Unfortunately, the Markdown syntax doesn't work consistently either.
If necessary, I'd prefer to standardize to Example 1, as that's the default a user gets when dragging an image from their desktop. Then we'd need to go through the 250+ existing indices to identify and update those using Markdown. I could probably sic Claude on it to expedite save human time on it.
All those Maximo tiles are because a lot of issues were miscategorized as Service types:

There was a problem hiding this comment.
Should we make a spinoff issue to update the code to handle a markdown or html image tag? I can't recall why we've never tried to do that.
There was a problem hiding this comment.
Rose and I sync'd on this, and we discussed this as an option and looked at some example code that does exactly this. I'll sync up with her and ask if we can go in this direction.
There was a problem hiding this comment.
Just realized that the old bug report I pulled up had the right issue # but the wrong link. 🙃 Corrected above, and for the record and an excuse to use John's Chrome extension:
#16240 - [Bug] Occasional project index images do not display on the website
johnclary
left a comment
There was a problem hiding this comment.
looks great! Nice to see this piece of the updates fall into place 🚀
| // The `labels` column is a comma-separated string of labels, so we use wildcard string searching | ||
| const QUERY = | ||
| "$limit=100000&$where=(labels like '%Project Index%' or labels like '%Product Index%' or labels like '%Service Index%') and labels not like '%Archived Project%' and (pipeline != 'Icebox' or pipeline is null)"; | ||
| "$limit=100000&$where=(type like '%Project%' or type like '%Product%' or type like '%Service%') and type not like '%Archived Project%' and (pipeline != 'Icebox' or pipeline is null)"; |
There was a problem hiding this comment.
Heads-up @katelunceford that there are currently two Product Index issues without the Product type.
https://github.com/cityofaustin/atd-data-tech/issues?q=is%3Aissue%20state%3Aopen%20no%3Atype%20label%3A%22Product%20Index%22
There was a problem hiding this comment.
@johnclary those are being converted into a single Service: AMANDA support!
| function parseImage(body) { | ||
| // find the first img (if one exists) | ||
| const reImg = /(?:!\[(.*?)\]\((.*?)\))/; | ||
| const imgMatch = body.match(reImg); | ||
| let img = null; | ||
| if (imgMatch && imgMatch.length > 0) { | ||
| img = { alt: imgMatch[1], src: imgMatch[2] }; | ||
| } | ||
| return [description, img]; | ||
| return img; | ||
| } |
There was a problem hiding this comment.
Should we make a spinoff issue to update the code to handle a markdown or html image tag? I can't recall why we've never tried to do that.
|
@roseeichelmann @frankhereford - would you like me to make the handle-rowdy-image code issue? Also, Rose, would you please parse out
|
|
@amenity that would be great if you could make that issue, and ill go ahead and start on handling the other image types! and thanks for pointing out the need to parse out the Service: -- ill push an update for that |
katelunceford
left a comment
There was a problem hiding this comment.
Thanks for this work @roseeichelmann !
I agree that we need to parse out Service: before merging this.
We can fix the image problem with a separate issue, which doesn't need to block this (at least from a product perspective).


Closes cityofaustin/atd-data-tech#28909
Closes cityofaustin/atd-data-tech#28888
Testing:
Netlify preview