734dde02cf470fb185706ac6ed8954f9dc3f3465
chmalee
  Wed Jul 31 16:28:27 2019 -0700
Making track hub errors show up in red from hubCheck

diff --git src/hg/utils/hubCheck/hubCheck.c src/hg/utils/hubCheck/hubCheck.c
index aaf42dcb8..eaefeb2 100644
--- src/hg/utils/hubCheck/hubCheck.c
+++ src/hg/utils/hubCheck/hubCheck.c
@@ -463,31 +463,31 @@
 /* Construct a folder item for one of the jstree arrays */
 {
 struct dyString *folderString = dyStringNew(0);
 dyStringPrintf(folderString, "{icon: '../../images/folderC.png', id: '%s', "
     "text:\"%s\", parent:'%s',"
     "li_attr:{title:'%s'}, children:%s, state: {opened: %s}}",
     id, text, parent, title, children ? "true" : "false", openFolder ? "true" : "false");
 return dyStringCannibalize(&folderString);
 }
 
 char *makeChildObjectString(char *id, char *title, char *shortLabel, char *longLabel,
     char *color, char *name, char *text, char *parent)
 /* Construct a single child item for one of the jstree arrays */
 {
 struct dyString *item = dyStringNew(0);
-dyStringPrintf(item, "{icon: 'fa fa-plus', id:'%s', li_attr:{title: '%s', "
+dyStringPrintf(item, "{icon: 'fa fa-plus', id:'%s', li_attr:{class: 'hubError', title: '%s', "
         "shortLabel: '%s', longLabel: '%s', color: '%s', name:'%s'}, "
         "text:\"%s\", parent: '%s', state: {opened: true}}",
         id, title, shortLabel, longLabel, color, name, text, parent);
 return dyStringCannibalize(&item);
 }
 
 void hubErr(struct dyString *errors, char *message, struct trackHub *hub)
 /* Construct the right javascript for the jstree for a top level hub.txt error. */
 {
 char *sl;
 char *strippedMessage = NULL;
 static int count = 0; // force a unique id for the jstree object
 char id[512];
 //TODO: Choose better default labels
 if (hub && hub->shortLabel != NULL)
@@ -528,39 +528,40 @@
 dyStringPrintf(errors, "trackData['%s'] = [%s", genomeName,
     makeChildObjectString(id, "Error Getting TrackDb", genomeName, genomeName, "#550073", genomeName, strippedMessage, genomeName));
 count++;
 }
 
 void trackDbErr(struct dyString *errors, char *message, struct trackHubGenome *genome, struct trackDb *tdb, boolean doHtml)
 /* Adds the right object for a jstree object of trackDb configuration errors.  */
 {
 if (!doHtml)
     {
     dyStringPrintf(errors, "%s", message);
     }
 else
     {
     char *strippedMessage = NULL;
-    char *parentOrTrackString = trackHubSkipHubName(tdb->track);
+    char parentOrTrackString[512];
     char id[512];
     static int count = 0; // forces unique ID's which the jstree object needs
 
     if (message)
         strippedMessage = cloneString(message);
 
     stripChar(strippedMessage, '\n');
     safef(id, sizeof(id), "%s%d", trackHubSkipHubName(tdb->track), count);
+    safef(parentOrTrackString, sizeof(parentOrTrackString), "%s_%s", trackHubSkipHubName(genome->name), trackHubSkipHubName(tdb->track));
     dyStringPrintf(errors, "%s,",
             makeChildObjectString(id, "TrackDb Error", tdb->shortLabel, tdb->longLabel,
             "#550073", trackHubSkipHubName(tdb->track), strippedMessage, parentOrTrackString));
     count++;
     }
 }
 
 boolean checkEmptyMembersForAll(membersForAll_t *membersForAll, struct trackDb *parentTdb)
 /* membersForAll may be allocated and exist but not have any actual members defined. */
 {
 int i;
 for (i = 0; i < ArraySize(membersForAll->members); i++)
     {
     if (membersForAll->members[i] != NULL)
         return TRUE;
@@ -922,31 +923,31 @@
     dyStringPrintf(errors, "trackData['#'] = [");
 
 int numGenomeErrors = 0;
 char genomeTitleString[128];
 struct dyString *genomeErrors = dyStringNew(0);
 for (genome = hub->genomeList; genome != NULL; genome = genome->next)
     {
     numGenomeErrors = hubCheckGenome(hub, genome, options, genomeErrors);
     if (options->htmlOut)
         {
         char *genomeName = trackHubSkipHubName(genome->name);
         safef(genomeTitleString, sizeof(genomeTitleString),
             "%s (%d configuration error%s)", genomeName, numGenomeErrors,
             numGenomeErrors == 1 ? "" : "s");
         dyStringPrintf(errors, "%s,", makeFolderObjectString(genomeName, genomeTitleString, "#",
-            "Click to open node", TRUE, TRUE));
+            "Click to open node", TRUE, numGenomeErrors > 0 ? TRUE : FALSE));
         }
     retVal |= numGenomeErrors;
     }
 if (options->htmlOut)
     dyStringPrintf(errors, "];\n");
 dyStringPrintf(errors, "%s", dyStringCannibalize(&genomeErrors));
 trackHubClose(&hub);
 return retVal;
 }
 
 
 static void addExtras(char *extraFile, struct trackHubCheckOptions *checkOptions)
 /* Add settings from extra file (e.g. for specific hub display site) */
 {
 verbose(2, "Accepting extra settings in '%s'\n", extraFile);