cityofaustin / atd-knack-signs-markings

https://atd-knack-signs-markings.netlify.com/
Other
1 stars 0 forks source link

Feature: Would like the related "Work Order Status" to be highlighted in a "green" color #303

Closed dianamartin closed 4 years ago

dianamartin commented 4 years ago

Page:

I want to be able to see Final Review highlighted on the Markings SR page

This 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

mddilley commented 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); 
});

Screenshot

Screen Shot 2019-12-12 at 5 10 00 PM

dianamartin commented 4 years ago

@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.

mddilley commented 4 years ago

@dianamartin - yep, we can add that easily. Just need a color, and I can add it to the others in colorMapOne.

dianamartin commented 4 years ago

@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

mddilley commented 4 years ago

@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.

"All Issues" tab

Screen Shot 2019-12-16 at 11 11 10 AM

amenity commented 4 years ago

@mddilley would you assign an estimate to this and close it, please?

mddilley commented 4 years ago

Updates to highlight Markings SR statuses live in TEST. Closing.

amenity commented 4 years ago

@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.

mddilley commented 4 years ago

@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.

dianamartin commented 4 years ago

@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.