Skip to content

Commit d5a23cb

Browse files
committed
show modified by crawl
1 parent 4ea0233 commit d5a23cb

File tree

3 files changed

+64
-26
lines changed

3 files changed

+64
-26
lines changed

frontend/src/features/browser-profiles/profile-metadata-dialog.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,16 @@ export class ProfileMetadataDialog extends BtrixElement {
174174
@sl-input=${this.validateDescriptionMax.validate}
175175
></sl-textarea>
176176
177-
<btrix-tag-input
178-
name="tags"
179-
.initialTags=${[]}
180-
.tagOptions=${[]}
181-
@tag-input=${console.log}
182-
@tags-change=${console.log}
183-
></btrix-tag-input>
177+
${
178+
// <btrix-tag-input
179+
// name="tags"
180+
// .initialTags=${[]}
181+
// .tagOptions=${[]}
182+
// @tag-input=${console.log}
183+
// @tags-change=${console.log}
184+
// ></btrix-tag-input>
185+
undefined
186+
}
184187
</form>
185188
<div slot="footer" class="flex justify-between">
186189
<sl-button form="crawlDetailsForm" type="reset" size="small"

frontend/src/pages/org/browser-profiles/profile.ts

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ import { emptyMessage } from "@/layouts/emptyMessage";
3737
import { labelWithIcon } from "@/layouts/labelWithIcon";
3838
import { page } from "@/layouts/page";
3939
import { panel, panelBody } from "@/layouts/panel";
40-
import { OrgTab } from "@/routes";
41-
import { stringFor } from "@/strings/ui";
40+
import { OrgTab, WorkflowTab } from "@/routes";
41+
import { noData, stringFor } from "@/strings/ui";
4242
import type { APIPaginatedList, APIPaginationQuery } from "@/types/api";
4343
import type { Profile, Workflow } from "@/types/crawler";
4444
import type { CrawlState } from "@/types/crawlState";
@@ -434,9 +434,12 @@ export class BrowserProfilesProfilePage extends BtrixElement {
434434
: none,
435435
)}
436436
</btrix-desc-list-item>
437-
<btrix-desc-list-item label=${msg("Tags")}>
438-
${this.renderDetail(() => html`${none}`)}
439-
</btrix-desc-list-item>
437+
${
438+
// <btrix-desc-list-item label=${msg("Tags")}>
439+
// ${this.renderDetail(() => html`${none}`)}
440+
// </btrix-desc-list-item>
441+
undefined
442+
}
440443
</btrix-desc-list>
441444
<sl-divider class="my-5"></sl-divider>
442445
<btrix-desc-list>
@@ -459,16 +462,29 @@ export class BrowserProfilesProfilePage extends BtrixElement {
459462
),
460463
)}
461464
</btrix-desc-list-item>
462-
<btrix-desc-list-item label=${msg("Modification Reason")}>
463-
${this.renderDetail((profile) => {
464-
const userName = profile.modifiedByName || profile.createdByName;
465-
if (userName) {
466-
return `${msg("Updated by")} ${userName}`;
467-
}
468-
469-
return stringFor.notApplicable;
470-
})}
471-
</btrix-desc-list-item>
465+
${when(this.profile, (profile) =>
466+
profile.modified
467+
? html`<btrix-desc-list-item label=${msg("Modified By")}>
468+
${this.renderDetail((profile) => {
469+
if (
470+
profile.modifiedCrawlDate &&
471+
(!profile.modified ||
472+
profile.modifiedCrawlDate >= profile.modified)
473+
) {
474+
return msg("Automatic update from crawl");
475+
}
476+
477+
if (profile.modifiedByName) {
478+
return profile.modifiedByName;
479+
}
480+
481+
return noData;
482+
})}
483+
</btrix-desc-list-item>`
484+
: html`<btrix-desc-list-item label=${msg("Created By")}>
485+
${profile.createdByName || noData}
486+
</btrix-desc-list-item>`,
487+
)}
472488
<btrix-desc-list-item label=${msg("Backup Status")}>
473489
${this.renderDetail((profile) => {
474490
const isBackedUp =
@@ -505,8 +521,22 @@ export class BrowserProfilesProfilePage extends BtrixElement {
505521
? `${this.localize.number(this.workflowsTask.value.total)} ${pluralOf("workflows", this.workflowsTask.value.total)}`
506522
: html`<sl-skeleton></sl-skeleton>`}
507523
</btrix-desc-list-item>
508-
<btrix-desc-list-item label=${msg("Modified By Use")}>
509-
${msg("No")}
524+
<btrix-desc-list-item
525+
label=${msg("Last Modified by Crawl")}
526+
>
527+
${profile.modifiedCrawlId && profile.modifiedCrawlDate
528+
? html`
529+
${this.localize.relativeDate(
530+
profile.modifiedCrawlDate,
531+
)}
532+
533+
<btrix-link
534+
href="${this.navigate
535+
.orgBasePath}/${OrgTab.Workflows}/${profile.modifiedCrawlCid}/${WorkflowTab.Crawls}/${profile.modifiedCrawlId}"
536+
>${msg("View Crawl")}</btrix-link
537+
>
538+
`
539+
: msg("No")}
510540
</btrix-desc-list-item>
511541
</btrix-desc-list>
512542
</div>

frontend/src/types/crawler.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,14 @@ export type Profile = {
127127
name: string;
128128
description: string;
129129
created: string;
130-
createdByName: string | null;
130+
createdBy: string | null; // User ID
131+
createdByName: string | null; // User Name
131132
modified: string | null;
132-
modifiedByName: string | null;
133+
modifiedBy: string | null; // User ID
134+
modifiedByName: string | null; // User Name
135+
modifiedCrawlDate: string | null;
136+
modifiedCrawlId: string | null;
137+
modifiedCrawlCid: string | null;
133138
origins: string[];
134139
profileId: string;
135140
baseProfileName: string;

0 commit comments

Comments
 (0)