Fix workflow edit page not loading (#848)
* fix workflow not loading * don't add hash if editing * remove controller
This commit is contained in:
parent
98d82184e6
commit
f250293794
@ -103,8 +103,6 @@ export class WorkflowDetail extends LiteElement {
|
|||||||
|
|
||||||
private isPanelHeaderVisible?: boolean;
|
private isPanelHeaderVisible?: boolean;
|
||||||
|
|
||||||
// Use to cancel requests
|
|
||||||
private getWorkflowController: AbortController | null = null;
|
|
||||||
private getWorkflowPromise?: Promise<Workflow>;
|
private getWorkflowPromise?: Promise<Workflow>;
|
||||||
|
|
||||||
private readonly jobTypeLabels: Record<JobType, string> = {
|
private readonly jobTypeLabels: Record<JobType, string> = {
|
||||||
@ -173,6 +171,8 @@ export class WorkflowDetail extends LiteElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getActivePanelFromHash = () => {
|
private getActivePanelFromHash = () => {
|
||||||
|
if (this.isEditing) return;
|
||||||
|
|
||||||
const hashValue = window.location.hash.slice(1);
|
const hashValue = window.location.hash.slice(1);
|
||||||
if (SECTIONS.includes(hashValue as any)) {
|
if (SECTIONS.includes(hashValue as any)) {
|
||||||
this.activePanel = hashValue as Tab;
|
this.activePanel = hashValue as Tab;
|
||||||
@ -265,13 +265,6 @@ export class WorkflowDetail extends LiteElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private cancelInProgressGetWorkflow() {
|
|
||||||
if (this.getWorkflowController) {
|
|
||||||
this.getWorkflowController.abort(ABORT_REASON_CANCLED);
|
|
||||||
this.getWorkflowController = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.isEditing && this.isCrawler) {
|
if (this.isEditing && this.isCrawler) {
|
||||||
return html`
|
return html`
|
||||||
@ -1196,15 +1189,10 @@ export class WorkflowDetail extends LiteElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async getWorkflow(): Promise<Workflow> {
|
private async getWorkflow(): Promise<Workflow> {
|
||||||
this.getWorkflowController = new AbortController();
|
|
||||||
const data: Workflow = await this.apiFetch(
|
const data: Workflow = await this.apiFetch(
|
||||||
`/orgs/${this.orgId}/crawlconfigs/${this.workflowId}`,
|
`/orgs/${this.orgId}/crawlconfigs/${this.workflowId}`,
|
||||||
this.authState!,
|
this.authState!
|
||||||
{
|
|
||||||
signal: this.getWorkflowController.signal,
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
this.getWorkflowController = null;
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1254,7 +1242,6 @@ export class WorkflowDetail extends LiteElement {
|
|||||||
|
|
||||||
private stopPoll() {
|
private stopPoll() {
|
||||||
window.clearTimeout(this.timerId);
|
window.clearTimeout(this.timerId);
|
||||||
this.cancelInProgressGetWorkflow();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getCrawl(crawlId: Crawl["id"]): Promise<Crawl> {
|
private async getCrawl(crawlId: Crawl["id"]): Promise<Crawl> {
|
||||||
|
Loading…
Reference in New Issue
Block a user