Skip to content
Snippets Groups Projects
Verified Commit 0c8ff207 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: empty datatable head

parent 247af8d1
Branches
No related tags found
No related merge requests found
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</header> </header>
<monster-state> <monster-state>
<a href="mmmm" data-attributes="href path:anchors.mmmm.href,title path:anchors.mmmm.title,hreflang path:anchors.mmmm.hreflang" data-bob-reference="mmmm"><img width="16" height="16" alt="tick" title="yes" src="data:image/gif;base64,R0lGODdhEAAQAMwAAPj7+FmhUYjNfGuxYYDJdYTIeanOpT+DOTuANXi/bGOrWj6CONzv2sPjv2Cm <a href="mmmm" data-attributes="title path:anchors.mmmm.title,href path:anchors.mmmm.href,hreflang path:anchors.mmmm.hreflang" data-bob-reference="mmmm"><img width="16" height="16" alt="tick" title="yes" src="data:image/gif;base64,R0lGODdhEAAQAMwAAPj7+FmhUYjNfGuxYYDJdYTIeanOpT+DOTuANXi/bGOrWj6CONzv2sPjv2Cm
V1unU4zPgI/Sg6DJnJ3ImTh8Mtbs00aNP1CZSGy0YqLEn47RgXW8amasW7XWsmmvX2iuXiwAAAAAEAAQAAAFVyAgjmRpnihqGCkpDQ V1unU4zPgI/Sg6DJnJ3ImTh8Mtbs00aNP1CZSGy0YqLEn47RgXW8amasW7XWsmmvX2iuXiwAAAAAEAAQAAAFVyAgjmRpnihqGCkpDQ
PbGkNUOFk6DZqgHCNGg2T4QAQBoIiRSAwBE4VA4FACKgkB5NGReASFZEmxsQ0whPDi9BiACYQAInXhwOUtgCUQoORFCGt/g4QAIQA7" id="tickyesdata-image-gi-4013311193" data-bob-reference="tickyesdata-image-gi-3753669760" data-attributes="src path:content.tickyesdata-image-gi-3753669760.src,alt path:content.tickyesdata-image-gi-3753669760.alt,title path:content.tickyesdata-image-gi-3753669760.title"/></a> PbGkNUOFk6DZqgHCNGg2T4QAQBoIiRSAwBE4VA4FACKgkB5NGReASFZEmxsQ0whPDi9BiACYQAInXhwOUtgCUQoORFCGt/g4QAIQA7" id="tickyesdata-image-gi-4013311193" data-bob-reference="tickyesdata-image-gi-3753669760" data-attributes="src path:content.tickyesdata-image-gi-3753669760.src,alt path:content.tickyesdata-image-gi-3753669760.alt,title path:content.tickyesdata-image-gi-3753669760.title"/></a>
<h1 class="deco"><span data-bob-reference="bad-request" data-replace-self="path:text.bad-request.text">Bad Request</span></h1> <h1 class="deco"><span data-bob-reference="bad-request" data-replace-self="path:text.bad-request.text">Bad Request</span></h1>
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
<div data-monster-head="channel order number" data-monster-replace="path:datatable-order-list-row.channelOrderID" data-bob-reference="channel-order-number" data-attributes="data-monster-head path:text.channel-order-number.text"></div> <div data-monster-head="channel order number" data-monster-replace="path:datatable-order-list-row.channelOrderID" data-bob-reference="channel-order-number" data-attributes="data-monster-head path:text.channel-order-number.text"></div>
<div data-monster-head="resubmissionDate" data-monster-mode="hidden" data-bob-reference="resubmission-date" data-attributes="data-monster-head path:text.resubmission-date.text"></div> <div data-monster-head="resubmissionDate" data-monster-mode="hidden" data-bob-reference="resubmission-date" data-attributes="data-monster-head path:text.resubmission-date.text"></div>
<div data-monster-head="payment type" data-monster-replace="path:datatable-order-list-row.localStrings.paymentType" data-bob-reference="payment-type" data-attributes="data-monster-head path:text.payment-type.text"></div> <div data-monster-head="payment type" data-monster-replace="path:datatable-order-list-row.localStrings.paymentType" data-bob-reference="payment-type" data-attributes="data-monster-head path:text.payment-type.text"></div>
<div data-monster-head=" " data-monster-replace="path:datatable-order-list-row.localStrings.paymentType" data-attributes="data-monster-head path:text.payment-type.text"></div>
</template> </template>
</monster-datatable> </monster-datatable>
......
...@@ -554,7 +554,21 @@ func checkMonsterDatatableHead(n *html.Node, storage *types.PageData) { ...@@ -554,7 +554,21 @@ func checkMonsterDatatableHead(n *html.Node, storage *types.PageData) {
for _, div := range list { for _, div := range list {
for i, attr := range div.Attr {
if attr.Key == constants.DataBobReferenceAttributeKey && attr.Val == "" {
div.Attr = append(div.Attr[:i], div.Attr[i+1:]...)
}
}
head := util.GetAttribute(div.Attr, "data-monster-head") head := util.GetAttribute(div.Attr, "data-monster-head")
trimHead := strings.TrimSpace(head)
if trimHead == "" {
log.Warn("The head '" + buildLogContent(div, "") + "' has no content! Will use the content of the head as a key.")
continue
}
logContent := buildLogContent(div, head) logContent := buildLogContent(div, head)
id := util.GetOrCreateReference(div, head) id := util.GetOrCreateReference(div, head)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment