Closed dianamartin closed 4 years ago
@dianamartin I spent a little bit of time on this, and here is the code that I wrote to get these statuses highlighted with the status colors. The code is in TEST (lines 88-100 and 121-124) if you want to try it out and give me any feedback.
// Change table data background colors by status
function changeTableFieldColor(field, color_map) {
var fields = $(field);
fields.each(function() {
var value = this.innerText;
if (color_map[value]) {
$(this).css({
"background-color": color_map[value].background_color,
color: color_map[value].color
});
}
});
}
$(document).on("knack-view-render.any", function() {
// SERVICE REQUESTS | Markings | Work Order Status
changeTableFieldColor("td.field_2181", colorMapOne);
});
@mddilley I see that changes in Test. So I noticed that the On Hold
status also is getting highlighted. When I go to the Closed tab, that doesn't get highlighted. I wonder if it's bc it's not called out a a variable.
@dianamartin - yep, we can add that easily. Just need a color, and I can add it to the others in colorMapOne
.
@mddilley The color is: #777777 you can find it on this page: https://builder.knack.com/atd/4-dec-2019--test-signs-and-markings-operations#pages/scene_808/views/view_2107
@dianamartin - I updated this code in TEST
with a separate color object so that On Hold
won't be highlighted and we can more easily control what highlighting happens in this column. The updates have work order status Final Review
highlighted in #4daf4a
and Closed
highlighted in #777777
in all tabs. Here is a screenshot of where things are at right now.
@mddilley would you assign an estimate to this and close it, please?
@dianamartin - go ahead and deploy this in PROD, but document in Github first and look at the compare to make sure we're not overwriting any changes that have happened since then.
@dianamartin @amenity - all changes have been compared to staging and production in the repo and merged into staging
and production
branches. Code is good to be deployed in the Knack app.
@mddilley @amenity I've copied Mike's updated code and pasted into the Signs and Markings PROD environment. Tested that the "Final Review" records are in indeed highlighted green.
Page:
I want to be able to see
Final Review
highlighted on the Markings SR pageThis would be similar to what we have in place already on the Signs and Markings application. The difference is that the JS highlights a background color on a field in a page details page.
https://builder.knack.com/atd/signs-markings#settings/api
line 45 - 62