fix: Use correct job type in crawl settings (#2028)
Fixes https://github.com/webrecorder/browsertrix/issues/2027 ### Changes Fixes crawl settings for archived item not showing the correct fields based on job type.
This commit is contained in:
parent
4c7f1aa3ca
commit
6ce565b5f7
@ -90,7 +90,7 @@ export class ArchivedItemDetail extends BtrixElement {
|
|||||||
qaRuns?: QARun[];
|
qaRuns?: QARun[];
|
||||||
|
|
||||||
@state()
|
@state()
|
||||||
private crawl?: ArchivedItem;
|
crawl?: ArchivedItem;
|
||||||
|
|
||||||
@state()
|
@state()
|
||||||
private workflow?: Workflow;
|
private workflow?: Workflow;
|
||||||
@ -159,7 +159,10 @@ export class ArchivedItemDetail extends BtrixElement {
|
|||||||
void this.fetchQARuns();
|
void this.fetchQARuns();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (changedProperties.has("workflowId") && this.workflowId) {
|
if (
|
||||||
|
(changedProperties.has("workflowId") && this.workflowId) ||
|
||||||
|
(changedProperties.has("crawl") && this.crawl?.cid)
|
||||||
|
) {
|
||||||
void this.fetchWorkflow();
|
void this.fetchWorkflow();
|
||||||
}
|
}
|
||||||
if (changedProperties.has("qaRuns")) {
|
if (changedProperties.has("qaRuns")) {
|
||||||
@ -1004,7 +1007,7 @@ ${this.crawl?.description}
|
|||||||
return html`
|
return html`
|
||||||
<div aria-live="polite" aria-busy=${!this.crawl || !this.seeds}>
|
<div aria-live="polite" aria-busy=${!this.crawl || !this.seeds}>
|
||||||
${when(
|
${when(
|
||||||
this.crawl && this.seeds && (!this.workflowId || this.workflow),
|
this.crawl && this.seeds && this.workflow,
|
||||||
() => html`
|
() => html`
|
||||||
<btrix-config-details
|
<btrix-config-details
|
||||||
.crawlConfig=${{
|
.crawlConfig=${{
|
||||||
@ -1177,9 +1180,18 @@ ${this.crawl?.description}
|
|||||||
|
|
||||||
private async fetchWorkflow(): Promise<void> {
|
private async fetchWorkflow(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
this.workflow = await this.getWorkflow();
|
const id = this.workflowId || this.crawl?.cid;
|
||||||
|
if (!id) {
|
||||||
|
console.debug("no workflow id");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.workflow = await this.getWorkflow(id);
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
console.debug(e);
|
this.notify.toast({
|
||||||
|
message: msg("Sorry, couldn't load all crawl settings."),
|
||||||
|
variant: "warning",
|
||||||
|
icon: "exclamation-circle",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1198,10 +1210,8 @@ ${this.crawl?.description}
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getWorkflow(): Promise<Workflow> {
|
private async getWorkflow(id: string): Promise<Workflow> {
|
||||||
return this.api.fetch<Workflow>(
|
return this.api.fetch<Workflow>(`/orgs/${this.orgId}/crawlconfigs/${id}`);
|
||||||
`/orgs/${this.orgId}/crawlconfigs/${this.workflowId}`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async fetchCrawlLogs(
|
private async fetchCrawlLogs(
|
||||||
|
Loading…
Reference in New Issue
Block a user