Skip to content

Commit 54c75a7

Browse files
committed
fix non-diff resource table
1 parent e40a0f5 commit 54c75a7

File tree

3 files changed

+44
-37
lines changed

3 files changed

+44
-37
lines changed

frontend/src/pages/org/archived-item-qa/archived-item-qa.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,11 +832,11 @@ export class ArchivedItemQA extends BtrixElement {
832832
this.qaDataRegistered,
833833
],
834834
() =>
835-
until(
835+
html`${until(
836836
this.replaySwReg.then((reg) => {
837837
return html`${iframe(reg)}${rwp(reg)}`;
838838
}),
839-
),
839+
)}`,
840840
);
841841
}
842842

frontend/src/pages/org/archived-item-qa/ui/resources.ts

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function resourceTable(
2525
columns.push(msg("Good During Analysis"), msg("Bad During Analysis"));
2626
}
2727

28-
let rows = [
28+
const rows = [
2929
[
3030
html`<span class="font-semibold capitalize"
3131
>${msg("All Resources")}</span
@@ -37,6 +37,46 @@ function resourceTable(
3737
>${localize.number(crawlResources[TOTAL].bad)}</span
3838
>`,
3939
],
40+
...Object.keys(qaResources || crawlResources)
41+
.filter((key) => key !== TOTAL)
42+
.map((key) => [
43+
html`<span
44+
class=${["json", "html"].includes(key)
45+
? tw`uppercase`
46+
: tw`capitalize`}
47+
>${key}</span
48+
>`,
49+
html`${Object.prototype.hasOwnProperty.call(crawlResources, key)
50+
? localize.number(crawlResources[key].good)
51+
: 0}`,
52+
html`${Object.prototype.hasOwnProperty.call(crawlResources, key)
53+
? localize.number(crawlResources[key].bad)
54+
: 0}`,
55+
...(qaResources
56+
? [
57+
html`<span
58+
class=${Object.prototype.hasOwnProperty.call(
59+
crawlResources,
60+
key,
61+
) && crawlResources[key].good === qaResources[key].good
62+
? tw`text-neutral-400`
63+
: tw`text-danger`}
64+
>
65+
${localize.number(qaResources[key].good)}
66+
</span>`,
67+
html`<span
68+
class=${Object.prototype.hasOwnProperty.call(
69+
crawlResources,
70+
key,
71+
) && crawlResources[key].bad === qaResources[key].bad
72+
? tw`text-neutral-400`
73+
: tw`font-semibold text-danger`}
74+
>
75+
${localize.number(qaResources[key].bad)}
76+
</span>`,
77+
]
78+
: []),
79+
]),
4080
];
4181

4282
if (qaResources) {
@@ -62,36 +102,6 @@ function resourceTable(
62102
${localize.number(qaResources[TOTAL].bad)}
63103
</span>`,
64104
);
65-
rows = [
66-
...rows,
67-
...Object.keys(qaResources)
68-
.filter((key) => key !== TOTAL)
69-
.map((key) => [
70-
html`<span class="capitalize">${key}</span>`,
71-
html`${Object.prototype.hasOwnProperty.call(crawlResources, key)
72-
? localize.number(crawlResources[key].good)
73-
: 0}`,
74-
html`${Object.prototype.hasOwnProperty.call(crawlResources, key)
75-
? localize.number(crawlResources[key].bad)
76-
: 0}`,
77-
html`<span
78-
class=${Object.prototype.hasOwnProperty.call(crawlResources, key) &&
79-
crawlResources[key].good === qaResources[key].good
80-
? tw`text-neutral-400`
81-
: tw`text-danger`}
82-
>
83-
${localize.number(qaResources[key].good)}
84-
</span>`,
85-
html`<span
86-
class=${Object.prototype.hasOwnProperty.call(crawlResources, key) &&
87-
crawlResources[key].bad === qaResources[key].bad
88-
? tw`text-neutral-400`
89-
: tw`font-semibold text-danger`}
90-
>
91-
${localize.number(qaResources[key].bad)}
92-
</span>`,
93-
]),
94-
];
95105
}
96106

97107
return html`

frontend/src/pages/org/workflow-detail.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,11 +694,9 @@ export class WorkflowDetail extends BtrixElement {
694694

695695
if (this.groupedWorkflowTab === WorkflowTab.LatestCrawl && latestCrawl) {
696696
const latestCrawlId = latestCrawl.id;
697-
const logTotals = this.logTotalsTask.value;
698697
const authToken = this.authState?.headers.Authorization.split(" ")[1];
699698
const disableDownload = this.isRunning;
700699
const disableReplay = !latestCrawl.fileSize;
701-
const disableLogs = !(logTotals?.errors || logTotals?.behaviors);
702700
const replayHref = `/api/orgs/${this.orgId}/all-crawls/${latestCrawlId}/download?auth_bearer=${authToken}`;
703701
const replayFilename = `browsertrix-${latestCrawlId}.wacz`;
704702

@@ -738,7 +736,7 @@ export class WorkflowDetail extends BtrixElement {
738736
slot="trigger"
739737
size="small"
740738
caret
741-
?disabled=${disableReplay && disableLogs}
739+
?disabled=${disableDownload}
742740
>
743741
<sl-visually-hidden
744742
>${msg("Download options")}</sl-visually-hidden
@@ -764,7 +762,6 @@ export class WorkflowDetail extends BtrixElement {
764762
</btrix-menu-item-link>
765763
<btrix-menu-item-link
766764
href=${`/api/orgs/${this.orgId}/crawls/${this.lastCrawlId}/logs?auth_bearer=${authToken}`}
767-
?disabled=${disableLogs}
768765
download
769766
>
770767
<sl-icon

0 commit comments

Comments
 (0)