diff --git a/frontend/src/components/config-details.ts b/frontend/src/components/config-details.ts index a6baeda6..ef419c0f 100644 --- a/frontend/src/components/config-details.ts +++ b/frontend/src/components/config-details.ts @@ -45,6 +45,7 @@ export class ConfigDetails extends LiteElement { render() { const crawlConfig = this.crawlConfig; const exclusions = crawlConfig?.config.exclude || []; + return html`
${this.renderSetting(msg("Name"), crawlConfig?.name)} + ${this.renderSetting( + msg("Description"), + html` +

${crawlConfig?.description}

+ ` + )} ${this.hideTags ? "" : this.renderSetting( @@ -180,7 +187,8 @@ export class ConfigDetails extends LiteElement { (url: any) => html`
  • ${url}
  • ` )} - ` + `, + true )} ${this.renderSetting( msg("Include Any Linked Page"), @@ -201,7 +209,7 @@ export class ConfigDetails extends LiteElement { } const includeUrlList = primarySeedConfig.include || seedsConfig.include; return html` - ${this.renderSetting(msg("Primary Seed URL"), primarySeedUrl)} + ${this.renderSetting(msg("Primary Seed URL"), primarySeedUrl, true)} ${this.renderSetting( msg("Crawl Scope"), this.scopeTypeLabels[ @@ -221,7 +229,8 @@ export class ConfigDetails extends LiteElement { )} ` - : msg("None") + : msg("None"), + true )} ${this.renderSetting( msg("Include Any Linked Page (“one hop out”)"), @@ -235,7 +244,8 @@ export class ConfigDetails extends LiteElement { ${additionalUrlList.map((url) => html`
  • ${url}
  • `)} ` - : msg("None") + : msg("None"), + true )} ${this.renderSetting( msg("Max Pages"), @@ -259,7 +269,7 @@ export class ConfigDetails extends LiteElement { `; } - private renderSetting(label: string, value: any) { + private renderSetting(label: string, value: any, breakAll?: boolean) { let content = value; if (!this.crawlConfig) { @@ -272,7 +282,7 @@ export class ConfigDetails extends LiteElement { >`; } return html` - + ${content} `; diff --git a/frontend/src/pages/org/workflow-editor.ts b/frontend/src/pages/org/workflow-editor.ts index 9df3f504..e93376d0 100644 --- a/frontend/src/pages/org/workflow-editor.ts +++ b/frontend/src/pages/org/workflow-editor.ts @@ -98,6 +98,7 @@ type FormState = { jobName: WorkflowParams["name"]; browserProfile: Profile | null; tags: Tags; + description: WorkflowParams["description"]; }; const getDefaultProgressState = (hasConfigId = false): ProgressState => { @@ -163,6 +164,7 @@ const getDefaultFormState = (): FormState => ({ jobName: "", browserProfile: null, tags: [], + description: null, }); const defaultProgressState = getDefaultProgressState(); const orderedTabNames = STEPS.filter( @@ -233,6 +235,7 @@ export class CrawlConfigEditor extends LiteElement { }); private validateNameMax = maxLengthValidator(50); + private validateDescriptionMax = maxLengthValidator(350); private get formHasError() { return ( @@ -469,6 +472,7 @@ export class CrawlConfigEditor extends LiteElement { runNow: false, tags: this.initialWorkflow.tags, jobName: this.initialWorkflow.name || "", + description: this.initialWorkflow.description, browserProfile: this.initialWorkflow.profileid ? ({ id: this.initialWorkflow.profileid } as Profile) : null, @@ -639,19 +643,21 @@ export class CrawlConfigEditor extends LiteElement { private renderFooter({ isFirst = false, isLast = false }) { return html`
    - ${isFirst - ? html` + ${ + isFirst + ? html` ${this.configId ? msg("Cancel") : msg("Start Over")} ` - : html` + : html` ${msg("Previous Step")} - `} + ` + } ${when( this.configId, () => html` @@ -686,12 +692,14 @@ export class CrawlConfigEditor extends LiteElement { ?disabled=${this.isSubmitting || this.formHasError} ?loading=${this.isSubmitting} > - ${this.formState.scheduleType === "now" || - this.formState.runNow - ? msg("Save & Run Crawl") - : this.formState.scheduleType === "none" - ? msg("Save Workflow") - : msg("Save & Schedule Crawl")} + ${ + this.formState.scheduleType === "now" || + this.formState.runNow + ? msg("Save & Run Crawl") + : this.formState.scheduleType === "none" + ? msg("Save Workflow") + : msg("Save & Schedule Crawl") + } ` : html`
    @@ -1050,9 +1058,11 @@ https://example.net`} 0}> ${msg("Exclusions")} - ${exclusions.length - ? html`${exclusions.length}` - : ""}${exclusions.length}` + : "" + }
    ${this.renderFormCol(html` @@ -1089,9 +1099,11 @@ https://example.net`} ${msg("Additional URLs")} - ${additionalUrlList.length - ? html`${additionalUrlList.length}` - : ""} + ${ + additionalUrlList.length + ? html`${additionalUrlList.length}` + : "" + }
    ${this.renderFormCol(html` @@ -1172,9 +1184,11 @@ https://archiveweb.page/images/${"logo.svg"}`} > ${msg("pages")}
    - ${minPages === 1 - ? msg(str`Minimum ${minPages} page`) - : msg(str`Minimum ${minPages} pages`)} + ${ + minPages === 1 + ? msg(str`Minimum ${minPages} page`) + : msg(str`Minimum ${minPages} pages`) + }
    @@ -1415,9 +1429,11 @@ https://archiveweb.page/images/${"logo.svg"}`} ${msg( html`Schedule: ${utcSchedule - ? humanizeSchedule(utcSchedule) - : msg("Invalid date")}${ + utcSchedule + ? humanizeSchedule(utcSchedule) + : msg("Invalid date") + }.` )}

    @@ -1425,9 +1441,11 @@ https://archiveweb.page/images/${"logo.svg"}`} ${msg( html`Next scheduled run: ${utcSchedule - ? humanizeNextDate(utcSchedule) - : msg("Invalid date")}${ + utcSchedule + ? humanizeNextDate(utcSchedule) + : msg("Invalid date") + }.` )}

    @@ -1451,7 +1469,6 @@ https://archiveweb.page/images/${"logo.svg"}`} }; private renderJobMetadata() { - const { helpText, validate } = this.validateNameMax; return html` ${this.renderFormCol(html` `)} ${this.renderHelpTextCol( - msg(`Customize this Workflow and crawl name. Crawls are named after - the starting URL(s) by default.`) + msg(`Customize this Workflow's name. Workflows are named after + the first Crawl URL by default.`) )} + ${this.renderFormCol(html` + + `)} + ${this.renderHelpTextCol(msg(`Provide details about this Workflow.`))} ${this.renderFormCol( html` html`
  • - ${loc.some((v: string) => v === "seeds") && - typeof loc[loc.length - 1] === "number" - ? msg(str`Seed URL ${loc[loc.length - 1] + 1}: `) - : `${loc[loc.length - 1]}: `} + ${ + loc.some((v: string) => v === "seeds") && + typeof loc[loc.length - 1] === "number" + ? msg(str`Seed URL ${loc[loc.length - 1] + 1}: `) + : `${loc[loc.length - 1]}: ` + } ${detailMsg}
  • `; @@ -1900,6 +1929,7 @@ https://archiveweb.page/images/${"logo.svg"}`} const config: NewCrawlConfigParams = { jobType: this.jobType || "custom", name: this.formState.jobName || "", + description: this.formState.description, scale: this.formState.scale, profileid: this.formState.browserProfile?.id || "", runNow: this.formState.runNow || this.formState.scheduleType === "now", diff --git a/frontend/src/pages/org/workflows-new.ts b/frontend/src/pages/org/workflows-new.ts index 1be151f9..4fd46d42 100644 --- a/frontend/src/pages/org/workflows-new.ts +++ b/frontend/src/pages/org/workflows-new.ts @@ -13,6 +13,7 @@ import urlListSvg from "../../assets/images/new-crawl-config_URL-List.svg"; const defaultValue = { name: "", + description: null, profileid: null, schedule: "", config: { diff --git a/frontend/src/types/crawler.ts b/frontend/src/types/crawler.ts index ae44b745..a4e319c7 100644 --- a/frontend/src/types/crawler.ts +++ b/frontend/src/types/crawler.ts @@ -39,6 +39,7 @@ export type WorkflowParams = { config: SeedConfig; tags: string[]; crawlTimeout: number | null; + description: string | null; }; export type CrawlConfig = WorkflowParams & {