diff --git a/frontend/src/components/ui/config-details.ts b/frontend/src/components/ui/config-details.ts index 33987c90..42794a76 100644 --- a/frontend/src/components/ui/config-details.ts +++ b/frontend/src/components/ui/config-details.ts @@ -39,9 +39,9 @@ export class ConfigDetails extends LiteElement { @property({ type: Boolean }) anchorLinks = false; - // Hide tag field, e.g. if embedded in crawl detail view + // Hide metadata section, e.g. if embedded in crawl detail view @property({ type: Boolean }) - hideTags = false; + hideMetadata = false; @state() private orgDefaults?: { @@ -215,7 +215,7 @@ export class ConfigDetails extends LiteElement { > ${crawlConfig?.profileName} `, - () => msg("Default Profile") + () => crawlConfig?.profileName || msg("Default Profile") ) )} ${this.renderSetting( @@ -262,45 +262,51 @@ export class ConfigDetails extends LiteElement { )} -
- -

${msg("Crawl Metadata")}

-
- - ${this.renderSetting(msg("Name"), crawlConfig?.name)} - ${this.renderSetting( - msg("Description"), - html` -

${crawlConfig?.description}

- ` - )} - ${this.hideTags - ? "" - : this.renderSetting( - msg("Tags"), - crawlConfig?.tags?.length - ? crawlConfig.tags.map( - (tag) => - html`${tag}` - ) - : undefined - )} - ${this.renderSetting( - msg("Collections"), - this.collections.length - ? this.collections.map( - (coll) => - html` - ${coll.name} - - (${msg(str`${coll.crawlCount} items`)}) - - ` - ) - : undefined - )} -
-
+ ${this.hideMetadata + ? nothing + : html` +
+ +

${msg("Metadata")}

+
+ + ${this.renderSetting(msg("Name"), crawlConfig?.name)} + ${this.renderSetting( + msg("Description"), + crawlConfig?.description + ? html` +

+ ${crawlConfig?.description} +

+ ` + : undefined + )} + ${this.renderSetting( + msg("Tags"), + crawlConfig?.tags?.length + ? crawlConfig.tags.map( + (tag) => + html`${tag}` + ) + : [] + )} + ${this.renderSetting( + msg("Collections"), + this.collections.length + ? this.collections.map( + (coll) => + html` + ${coll.name} + + (${msg(str`${coll.crawlCount} items`)}) + + ` + ) + : undefined + )} +
+
+ `} `; } @@ -436,6 +442,8 @@ export class ConfigDetails extends LiteElement { content = html` `; } else if (typeof value === "boolean") { content = value ? msg("Yes") : msg("No"); + } else if (Array.isArray(value) && !value.length) { + content = html`${msg("None")}`; } else if (typeof value !== "number" && !value) { content = html`${msg("Not specified")}; @@ -119,6 +122,9 @@ export class CrawlDetail extends LiteElement { this.fetchCrawlLogs(); this.fetchSeeds(); } + if (changedProperties.has("workflowId") && this.workflowId) { + this.fetchWorkflow(); + } } connectedCallback(): void { @@ -330,7 +336,7 @@ export class CrawlDetail extends LiteElement { `; }; return html` -