feat(core): share in workspace link (#7897)
ShareDocsService -> ShareDocsListService ShareService -> ShareInfoService (*new) ShareReaderService `/share/:workspaceId/:docId` -> redirect to -> `/workspace/:workspaceId/:docId` workspace loading process 1. find workspace in workspace list 2. (if not found) revalidate workspace list 3. (if still not found) try load share page 4. (if share page found) => share page 5. (if share page not found) => 404 6. (if workspace found) => workspace page
This commit is contained in:
@@ -12,6 +12,6 @@ import { DocsSearchService } from './services/docs-search';
|
||||
export function configureDocsSearchModule(framework: Framework) {
|
||||
framework
|
||||
.scope(WorkspaceScope)
|
||||
.service(DocsSearchService)
|
||||
.service(DocsSearchService, [WorkspaceService])
|
||||
.entity(DocsIndexer, [WorkspaceService]);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { WorkspaceService } from '@toeverything/infra';
|
||||
import {
|
||||
fromPromise,
|
||||
OnEvent,
|
||||
@@ -12,7 +13,15 @@ import { DocsIndexer } from '../entities/docs-indexer';
|
||||
export class DocsSearchService extends Service {
|
||||
readonly indexer = this.framework.createEntity(DocsIndexer);
|
||||
|
||||
constructor(private readonly workspaceService: WorkspaceService) {
|
||||
super();
|
||||
}
|
||||
|
||||
handleWorkspaceEngineBeforeStart() {
|
||||
// skip if in shared mode
|
||||
if (this.workspaceService.workspace.openOptions.isSharedMode) {
|
||||
return;
|
||||
}
|
||||
this.indexer.setupListener();
|
||||
this.indexer.startCrawling();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user