exclusions editor fix: (#692)
- backend: fix updating model after exclusions change - frontend: don't check for new_cid, just success - fixes #691
This commit is contained in:
		
							parent
							
								
									7528f2ec6d
								
							
						
					
					
						commit
						de9212eec7
					
				@ -619,7 +619,7 @@ class CrawlOps:
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        await self.crawls.find_one_and_update(
 | 
			
		||||
            {"_id": crawl_id, "oid": org.id}, {"$set": {"config": new_config}}
 | 
			
		||||
            {"_id": crawl_id, "oid": org.id}, {"$set": {"config": new_config.dict()}}
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        resp = {"success": True}
 | 
			
		||||
 | 
			
		||||
@ -157,7 +157,7 @@ export class ExclusionEditor extends LiteElement {
 | 
			
		||||
        }
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
      if (data.new_cid) {
 | 
			
		||||
      if (data.success) {
 | 
			
		||||
        this.notify({
 | 
			
		||||
          message: msg(html`Removed exclusion: <code>${regex}</code>`),
 | 
			
		||||
          variant: "success",
 | 
			
		||||
@ -165,9 +165,7 @@ export class ExclusionEditor extends LiteElement {
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        this.dispatchEvent(
 | 
			
		||||
          new CustomEvent("on-success", {
 | 
			
		||||
            detail: { cid: data.new_cid },
 | 
			
		||||
          })
 | 
			
		||||
          new CustomEvent("on-success")
 | 
			
		||||
        );
 | 
			
		||||
      } else {
 | 
			
		||||
        throw data;
 | 
			
		||||
@ -229,7 +227,7 @@ export class ExclusionEditor extends LiteElement {
 | 
			
		||||
        }
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
      if (data.new_cid) {
 | 
			
		||||
      if (data.success) {
 | 
			
		||||
        this.notify({
 | 
			
		||||
          message: msg("Exclusion added."),
 | 
			
		||||
          variant: "success",
 | 
			
		||||
@ -242,9 +240,7 @@ export class ExclusionEditor extends LiteElement {
 | 
			
		||||
 | 
			
		||||
        onSuccess();
 | 
			
		||||
        this.dispatchEvent(
 | 
			
		||||
          new CustomEvent("on-success", {
 | 
			
		||||
            detail: { cid: data.new_cid },
 | 
			
		||||
          })
 | 
			
		||||
          new CustomEvent("on-success")
 | 
			
		||||
        );
 | 
			
		||||
      } else {
 | 
			
		||||
        throw data;
 | 
			
		||||
 | 
			
		||||
@ -22,7 +22,7 @@ const defaultValue = {
 | 
			
		||||
  },
 | 
			
		||||
  tags: [],
 | 
			
		||||
  crawlTimeout: null,
 | 
			
		||||
  jobType: "custom",
 | 
			
		||||
  jobType: undefined,
 | 
			
		||||
  scale: 1,
 | 
			
		||||
} as WorkflowParams;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -31,7 +31,7 @@ export type SeedConfig = Pick<
 | 
			
		||||
export type JobType = "url-list" | "seed-crawl" | "custom";
 | 
			
		||||
 | 
			
		||||
export type WorkflowParams = {
 | 
			
		||||
  jobType: JobType;
 | 
			
		||||
  jobType?: JobType;
 | 
			
		||||
  name: string;
 | 
			
		||||
  schedule: string;
 | 
			
		||||
  scale: number;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user