Rename remaining crawl templates -> crawl configs (#509)

This commit is contained in:
sua yoo 2023-01-18 20:18:08 -08:00 committed by GitHub
parent c0fdf738e4
commit 5b6c53b48e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 35 additions and 43 deletions

View File

@ -672,7 +672,7 @@ export class App extends LiteElement {
<nav class="-ml-3 flex items-end overflow-x-auto">
${this.renderNavTab({ tabName: "crawls", label: msg("Crawls") })}
${this.renderNavTab({
tabName: "crawl-templates",
tabName: "crawl-configs",
label: msg("Crawl Configs"),
})}
${this.renderNavTab({

View File

@ -157,7 +157,7 @@ export class BrowserProfilesDetail extends LiteElement {
class="text-neutral-600 hover:underline"
href=${`/orgs/${
this.profile!.oid
}/crawl-templates/config/${id}`}
}/crawl-configs/config/${id}`}
>
${name}
</a>

View File

@ -1674,7 +1674,7 @@ https://example.net`}
if (crawlId) {
this.navTo(`/orgs/${this.orgId}/crawls/crawl/${crawlId}`);
} else {
this.navTo(`/orgs/${this.orgId}/crawl-templates/config/${data.added}`);
this.navTo(`/orgs/${this.orgId}/crawl-configs/config/${data.added}`);
}
} catch (e: any) {
if (e?.isApiError) {

View File

@ -11,7 +11,7 @@ import { humanizeNextDate } from "../../utils/cron";
/**
* Usage:
* ```ts
* <btrix-crawl-templates-detail></btrix-crawl-templates-detail>
* <btrix-crawl-configs-detail></btrix-crawl-configs-detail>
* ```
*/
@localized()
@ -113,7 +113,7 @@ export class CrawlTemplatesDetail extends LiteElement {
this.crawlConfig && !this.crawlConfig.inactive,
() => html`
<sl-button
href=${`/orgs/${this.orgId}/crawl-templates/config/${
href=${`/orgs/${this.orgId}/crawl-configs/config/${
this.crawlConfig!.id
}?edit`}
variant="primary"
@ -168,7 +168,7 @@ export class CrawlTemplatesDetail extends LiteElement {
<nav class="col-span-1">
<a
class="text-gray-600 hover:text-gray-800 text-sm font-medium"
href=${`/orgs/${this.orgId}/crawl-templates${
href=${`/orgs/${this.orgId}/crawl-configs${
configId ? `/config/${configId}` : ""
}`}
@click=${this.navLink}
@ -206,9 +206,7 @@ export class CrawlTemplatesDetail extends LiteElement {
.authState=${this.authState}
@reset=${(e: Event) =>
this.navTo(
`/orgs/${this.orgId}/crawl-templates/config/${
this.crawlConfig!.id
}`
`/orgs/${this.orgId}/crawl-configs/config/${this.crawlConfig!.id}`
)}
></btrix-crawl-config-editor>
`;
@ -425,9 +423,7 @@ export class CrawlTemplatesDetail extends LiteElement {
private getNewerVersion() {
const versionId = this.crawlConfig?.newId;
if (!versionId) return;
this.navTo(
`/orgs/${this.orgId}/crawl-templates/config/${versionId}`
);
this.navTo(`/orgs/${this.orgId}/crawl-configs/config/${versionId}`);
}
private async getCrawlTemplate(configId: string): Promise<CrawlConfig> {
@ -463,7 +459,7 @@ export class CrawlTemplatesDetail extends LiteElement {
tags: this.crawlConfig.tags,
};
this.navTo(`/orgs/${this.orgId}/crawl-templates/new`, {
this.navTo(`/orgs/${this.orgId}/crawl-configs/new`, {
crawlTemplate,
});
@ -521,7 +517,7 @@ export class CrawlTemplatesDetail extends LiteElement {
}
);
this.navTo(`/orgs/${this.orgId}/crawl-templates`);
this.navTo(`/orgs/${this.orgId}/crawl-configs`);
this.notify({
message: isDeactivating
@ -564,8 +560,7 @@ export class CrawlTemplatesDetail extends LiteElement {
<br />
<a
class="underline hover:no-underline"
href="/orgs/${this
.orgId}/crawls/crawl/${data.started}#watch"
href="/orgs/${this.orgId}/crawls/crawl/${data.started}#watch"
@click=${this.navLink.bind(this)}
>Watch crawl</a
>`
@ -584,4 +579,4 @@ export class CrawlTemplatesDetail extends LiteElement {
}
}
customElements.define("btrix-crawl-templates-detail", CrawlTemplatesDetail);
customElements.define("btrix-crawl-configs-detail", CrawlTemplatesDetail);

View File

@ -36,7 +36,7 @@ const sortableFieldLabels = {
/**
* Usage:
* ```ts
* <btrix-crawl-templates-list></btrix-crawl-templates-list>
* <btrix-crawl-configs-list></btrix-crawl-configs-list>
* ```
*/
@localized()
@ -169,7 +169,7 @@ export class CrawlTemplatesList extends LiteElement {
<div class="grow-0 mb-4">
<sl-button
href=${`/orgs/${this.orgId}/crawl-templates/new`}
href=${`/orgs/${this.orgId}/crawl-configs/new`}
variant="primary"
@click=${this.navLink}
>
@ -308,7 +308,7 @@ export class CrawlTemplatesList extends LiteElement {
return html`<a
class="block col-span-1 p-1 border shadow hover:shadow-sm hover:bg-zinc-50/50 hover:text-primary rounded text-sm transition-colors"
aria-label=${t.name}
href=${`/orgs/${this.orgId}/crawl-templates/config/${t.id}`}
href=${`/orgs/${this.orgId}/crawl-configs/config/${t.id}`}
@click=${this.navLink}
>
<header class="flex">
@ -455,9 +455,7 @@ export class CrawlTemplatesList extends LiteElement {
role="menuitem"
@click=${(e: any) => {
e.target.closest("sl-dropdown").hide();
this.navTo(
`/orgs/${this.orgId}/crawl-templates/config/${t.id}?edit`
);
this.navTo(`/orgs/${this.orgId}/crawl-configs/config/${t.id}?edit`);
}}
>
<sl-icon
@ -613,7 +611,7 @@ export class CrawlTemplatesList extends LiteElement {
tags: template.tags,
};
this.navTo(`/orgs/${this.orgId}/crawl-templates/new`, {
this.navTo(`/orgs/${this.orgId}/crawl-configs/new`, {
crawlTemplate,
});
@ -702,8 +700,7 @@ export class CrawlTemplatesList extends LiteElement {
html`Started crawl from <strong>${template.name}</strong>. <br />
<a
class="underline hover:no-underline"
href="/orgs/${this
.orgId}/crawls/crawl/${data.started}#watch"
href="/orgs/${this.orgId}/crawls/crawl/${data.started}#watch"
@click=${this.navLink.bind(this)}
>Watch crawl</a
>`
@ -777,4 +774,4 @@ export class CrawlTemplatesList extends LiteElement {
}
}
customElements.define("btrix-crawl-templates-list", CrawlTemplatesList);
customElements.define("btrix-crawl-configs-list", CrawlTemplatesList);

View File

@ -25,7 +25,7 @@ const defaultValue = {
/**
* Usage:
* ```ts
* <btrix-crawl-templates-new></btrix-crawl-templates-new>
* <btrix-crawl-configs-new></btrix-crawl-configs-new>
* ```
*/
@localized()
@ -55,7 +55,7 @@ export class CrawlTemplatesNew extends LiteElement {
<nav class="mb-5">
<a
class="text-gray-600 hover:text-gray-800 text-sm font-medium"
href=${`/orgs/${this.orgId}/crawl-templates`}
href=${`/orgs/${this.orgId}/crawl-configs`}
@click=${this.navLink}
>
<sl-icon
@ -155,4 +155,4 @@ export class CrawlTemplatesNew extends LiteElement {
}
}
customElements.define("btrix-crawl-templates-new", CrawlTemplatesNew);
customElements.define("btrix-crawl-configs-new", CrawlTemplatesNew);

View File

@ -373,7 +373,7 @@ export class CrawlDetail extends LiteElement {
role="menuitem"
@click=${() => {
this.navTo(
`/orgs/${this.crawl?.oid}/crawl-templates/config/${this.crawlTemplateId}?edit`
`/orgs/${this.crawl?.oid}/crawl-configs/config/${this.crawlTemplateId}?edit`
);
}}
>

View File

@ -736,7 +736,7 @@ export class CrawlsList extends LiteElement {
tags: template.tags,
};
this.navTo(`/orgs/${crawl.oid}/crawl-templates/new`, {
this.navTo(`/orgs/${crawl.oid}/crawl-configs/new`, {
crawlTemplate,
});

View File

@ -8,9 +8,9 @@ import type { OrgData } from "../../utils/orgs";
import LiteElement, { html } from "../../utils/LiteElement";
import { needLogin } from "../../utils/auth";
import { isOwner, AccessCode } from "../../utils/orgs";
import "./crawl-templates-detail";
import "./crawl-templates-list";
import "./crawl-templates-new";
import "./crawl-configs-detail";
import "./crawl-configs-list";
import "./crawl-configs-new";
import "./crawl-detail";
import "./crawls-list";
import "./browser-profiles-detail";
@ -19,7 +19,7 @@ import "./browser-profiles-new";
export type OrgTab =
| "crawls"
| "crawl-templates"
| "crawl-configs"
| "browser-profiles"
| "members";
@ -119,7 +119,7 @@ export class Org extends LiteElement {
case "crawls":
tabPanelContent = this.renderCrawls();
break;
case "crawl-templates":
case "crawl-configs":
tabPanelContent = this.renderCrawlTemplates();
break;
case "browser-profiles":
@ -173,32 +173,32 @@ export class Org extends LiteElement {
private renderCrawlTemplates() {
if (this.crawlConfigId) {
return html`
<btrix-crawl-templates-detail
<btrix-crawl-configs-detail
class="col-span-5 mt-6"
.authState=${this.authState!}
.orgId=${this.orgId!}
.crawlConfigId=${this.crawlConfigId}
.isEditing=${this.isEditing}
></btrix-crawl-templates-detail>
></btrix-crawl-configs-detail>
`;
}
if (this.isNewResourceTab) {
const crawlTemplate = this.viewStateData?.crawlTemplate;
return html` <btrix-crawl-templates-new
return html` <btrix-crawl-configs-new
class="col-span-5 mt-6"
.authState=${this.authState!}
.orgId=${this.orgId!}
.initialCrawlTemplate=${crawlTemplate}
></btrix-crawl-templates-new>`;
></btrix-crawl-configs-new>`;
}
return html`<btrix-crawl-templates-list
return html`<btrix-crawl-configs-list
.authState=${this.authState!}
.orgId=${this.orgId!}
userId=${this.userInfo!.id}
></btrix-crawl-templates-list>`;
></btrix-crawl-configs-list>`;
}
private renderBrowserProfiles() {