Stopped crawls should not show stop/cancel buttons (#2101)

- crawler isActive() should only look at running states, not 'stopping',
since stopping may not be reset to false after crawl is stopped
(probably should reset, but also a record that the crawl ended as being
stopped). crawl is guaranteed to remain in one of the active states
while stopping on the backend
- fixes #2100
This commit is contained in:
Ilya Kreymer 2024-10-02 23:28:04 -07:00 committed by GitHub
parent 87cc38b737
commit 00efb3615b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 8 deletions

View File

@ -140,8 +140,8 @@ export class ArchivedItemDetail extends BtrixElement {
private timerId?: number;
private get isActive(): boolean | null {
if (!this.item || this.item.type !== "crawl") return null;
private get isActive(): boolean {
if (!this.item || this.item.type !== "crawl") return false;
return isActive(this.item);
}

View File

@ -29,12 +29,8 @@ export const DEPTH_SUPPORTED_SCOPES = [
"any",
];
export function isActive({ state, stopping }: Partial<Crawl | QARun>) {
return (
(state &&
(activeCrawlStates as readonly string[]).includes(state as string)) ||
stopping === true
);
export function isActive({ state }: Partial<Crawl | QARun>) {
return (activeCrawlStates as readonly (typeof state)[]).includes(state);
}
export function isSuccessfullyFinished({ state }: { state: string }) {