diff --git a/frontend/src/index.ts b/frontend/src/index.ts
index f1038911..4b3614f0 100644
--- a/frontend/src/index.ts
+++ b/frontend/src/index.ts
@@ -578,6 +578,7 @@ export class App extends LiteElement {
case "browser":
case "crawlTemplate":
case "crawlTemplateEdit":
+ case "crawlTemplateNew":
return html``;
diff --git a/frontend/src/pages/org/crawl-config-editor.ts b/frontend/src/pages/org/crawl-config-editor.ts
index 6abbeb8a..ad8c1da1 100644
--- a/frontend/src/pages/org/crawl-config-editor.ts
+++ b/frontend/src/pages/org/crawl-config-editor.ts
@@ -100,7 +100,7 @@ type FormState = {
const getDefaultProgressState = (hasConfigId = false): ProgressState => {
let activeTab: StepName = "crawlSetup";
- if (hasConfigId && window.location.hash) {
+ if (window.location.hash) {
const hashValue = window.location.hash.slice(1);
if (STEPS.includes(hashValue as any)) {
diff --git a/frontend/src/pages/org/crawl-configs-detail.ts b/frontend/src/pages/org/crawl-configs-detail.ts
index 956a81d1..5a2037ac 100644
--- a/frontend/src/pages/org/crawl-configs-detail.ts
+++ b/frontend/src/pages/org/crawl-configs-detail.ts
@@ -459,9 +459,12 @@ export class CrawlTemplatesDetail extends LiteElement {
tags: this.crawlConfig.tags,
};
- this.navTo(`/orgs/${this.orgId}/crawl-configs/new`, {
- crawlTemplate,
- });
+ this.navTo(
+ `/orgs/${this.orgId}/crawl-configs/new?jobType=${crawlTemplate.jobType}`,
+ {
+ crawlTemplate,
+ }
+ );
this.notify({
message: msg(str`Copied crawl configuration to new template.`),
diff --git a/frontend/src/pages/org/crawl-configs-list.ts b/frontend/src/pages/org/crawl-configs-list.ts
index 175b34b1..0d5e3ed4 100644
--- a/frontend/src/pages/org/crawl-configs-list.ts
+++ b/frontend/src/pages/org/crawl-configs-list.ts
@@ -169,7 +169,7 @@ export class CrawlTemplatesList extends LiteElement {
@@ -611,9 +611,12 @@ export class CrawlTemplatesList extends LiteElement {
tags: template.tags,
};
- this.navTo(`/orgs/${this.orgId}/crawl-configs/new`, {
- crawlTemplate,
- });
+ this.navTo(
+ `/orgs/${this.orgId}/crawl-configs/new?jobType=${crawlTemplate.jobType}`,
+ {
+ crawlTemplate,
+ }
+ );
this.notify({
message: msg(str`Copied crawl configuration to new template.`),
diff --git a/frontend/src/pages/org/crawl-configs-new.ts b/frontend/src/pages/org/crawl-configs-new.ts
index 4d178072..39983b30 100644
--- a/frontend/src/pages/org/crawl-configs-new.ts
+++ b/frontend/src/pages/org/crawl-configs-new.ts
@@ -50,21 +50,38 @@ export class CrawlTemplatesNew extends LiteElement {
@state()
private jobType?: JobType;
+ connectedCallback() {
+ super.connectedCallback();
+ if (!this.jobType) {
+ const url = new URL(window.location.href);
+ this.jobType = (url.searchParams.get("jobType") as JobType) || undefined;
+ }
+ }
+
private renderHeader() {
+ let href = `/orgs/${this.orgId}/crawl-configs`;
+ let label = msg("Back to Crawl Configs");
+
+ // Allow user to go back to choose crawl type if new (not duplicated) config
+ if (this.jobType && !this.initialCrawlTemplate.jobType) {
+ href = `/orgs/${this.orgId}/crawl-configs/new`;
+ label = msg("Choose Crawl Type");
+ }
return html`
`;
@@ -116,10 +133,14 @@ export class CrawlTemplatesNew extends LiteElement {
`;
}
diff --git a/frontend/src/pages/org/crawls-list.ts b/frontend/src/pages/org/crawls-list.ts
index d12c37f9..e14e1793 100644
--- a/frontend/src/pages/org/crawls-list.ts
+++ b/frontend/src/pages/org/crawls-list.ts
@@ -736,9 +736,12 @@ export class CrawlsList extends LiteElement {
tags: template.tags,
};
- this.navTo(`/orgs/${crawl.oid}/crawl-configs/new`, {
- crawlTemplate,
- });
+ this.navTo(
+ `/orgs/${crawl.oid}/crawl-configs/new?jobType=${crawlTemplate.jobType}`,
+ {
+ crawlTemplate,
+ }
+ );
this.notify({
message: msg(str`Copied crawl configuration to new template.`),
diff --git a/frontend/src/routes.ts b/frontend/src/routes.ts
index a22c02af..8eb363fe 100644
--- a/frontend/src/routes.ts
+++ b/frontend/src/routes.ts
@@ -19,6 +19,7 @@ export const ROUTES = {
"/orgs/:id/:tab/profile/browser/:browserId?name&description&profileId&navigateUrl",
crawlTemplate: "/orgs/:id/:tab/config/:crawlConfigId",
crawlTemplateEdit: "/orgs/:id/:tab/config/:crawlConfigId?edit",
+ crawlTemplateNew: "/orgs/:id/:tab/new?jobType",
users: "/users",
usersInvite: "/users/invite",
crawls: "/crawls",