diff --git a/nuxeo-admin-console-web/angular-app/src/app/app-routing.module.ts b/nuxeo-admin-console-web/angular-app/src/app/app-routing.module.ts index ddd91ae5..c0e6e4c3 100644 --- a/nuxeo-admin-console-web/angular-app/src/app/app-routing.module.ts +++ b/nuxeo-admin-console-web/angular-app/src/app/app-routing.module.ts @@ -54,6 +54,13 @@ export const appRoutes: Route[] = [ "./features/sub-features/generic-multi-feature-layout/generic-multi-feature-layout.module" ).then((m) => m.GenericMultiFeatureLayoutModule), }, + { + path: "fulltext-reindex", + loadChildren: () => + import( + "./features/sub-features/generic-multi-feature-layout/generic-multi-feature-layout.module" + ).then((m) => m.GenericMultiFeatureLayoutModule), + }, { path: "**", redirectTo: "" }, ]; diff --git a/nuxeo-admin-console-web/angular-app/src/app/features/fulltext-reindex/fulltext-reindex.constants.ts b/nuxeo-admin-console-web/angular-app/src/app/features/fulltext-reindex/fulltext-reindex.constants.ts new file mode 100644 index 00000000..d7098a4d --- /dev/null +++ b/nuxeo-admin-console-web/angular-app/src/app/features/fulltext-reindex/fulltext-reindex.constants.ts @@ -0,0 +1,19 @@ +export const FULLTEXT_REINDEX_LABELS = { + FOLDER_REINDEX_TITLE: "Reindex the fulltext of a document and all of its children", + DOCUMENT_REINDEX_TITLE: "Reindex the fulltext of a single document", + NXQL_QUERY_REINDEX_TITLE: "Reindex the fulltext of the documents returned by a NXQL query", + REINDEX_BUTTON_LABEL: "Reindex", + DOCUMENT_QUERY: + "ecm:path='{query}' AND ecm:mixinType = 'Downloadable' AND ecm:isProxy = 0 AND ecm:mixinType != 'HiddenInNavigation' AND ecm:isVersion = 0 AND ecm:isTrashed = 0", + FOLDER_QUERY: + "(ecm:uuid='{query}' OR ecm:ancestorId='{query}') AND ecm:mixinType = 'Downloadable' AND ecm:isProxy = 0 AND ecm:mixinType != 'HiddenInNavigation' AND ecm:isVersion = 0 AND ecm:isTrashed = 0", + NXQL_QUERY: + "(ecm:uuid='{query}' OR ecm:ancestorId='{query}') AND ecm:mixinType = 'Downloadable' AND ecm:isProxy = 0 AND ecm:mixinType != 'HiddenInNavigation' AND ecm:isVersion = 0 AND ecm:isTrashed = 0", + NXQL_QUERY_DEFAULT_VALUE: + "SELECT * FROM Document WHERE ecm:mixinType != 'HiddenInNavigation' AND ecm:isProxy = 0 AND ecm:isVersion = 0 AND ecm:isTrashed = 0 AND ecm:mixinType = 'Downloadable' AND dc:title = 'A document to reindex'", + FORCE: "force", + FORCE_TITLE: "Empty fulltext index of binaries for excluded documents", + TRUE: "True", + FALSE: "False", + FORCE_HELPER_TEXT: "Use this option if you changed your fulltext configuration to exclude additional documents. This will remove the content of the files they hold from the fulltext index." +} diff --git a/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.html b/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.html index 4b9f1e60..feb4527b 100644 --- a/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.html +++ b/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.html @@ -1,33 +1,50 @@
\ No newline at end of file diff --git a/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.scss b/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.scss index c1ec92d0..8521aa43 100644 --- a/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.scss +++ b/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.scss @@ -40,9 +40,30 @@ left: 0; bottom: 0; } + &.fulltext-reindex { + left: 0; + bottom: 0; + } } .conversion-helper-text { font-size: 14px; margin-top: -15px; + color: #666666; + } + .force-checkbox-container { + display: flex; + align-items: center; + margin: 0 0 10px; + } + + .force-conversion-helper-text { + max-width: 600px; + white-space: normal; + word-wrap: break-word; + font-size: 13px; + margin-top: -15px; + color: #666666; } + + } diff --git a/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.spec.ts b/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.spec.ts index c5007086..775b718e 100644 --- a/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.spec.ts +++ b/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.spec.ts @@ -30,6 +30,7 @@ import { ErrorModalComponent } from "../error-modal/error-modal.component"; import { featureMap, FEATURES } from "../../generic-multi-feature-layout.mapping"; import { PICTURE_RENDITIONS_LABELS } from "../../../../pictures/pictures-renditions.constants"; import { THUMBNAIL_GENERATION_LABELS } from "../../../../thumbnail-generation/thumbnail-generation.constants"; +import { FULLTEXT_REINDEX_LABELS } from "../../../../fulltext-reindex/fulltext-reindex.constants"; describe("DocumentTabComponent", () => { let component: DocumentTabComponent; @@ -303,8 +304,14 @@ describe("DocumentTabComponent", () => { const result = featureMap()[FEATURES.THUMBNAIL_GENERATION](GENERIC_LABELS.DOCUMENT); expect(result.labels.pageTitle).toBe(THUMBNAIL_GENERATION_LABELS.DOCUMENT_THUMBNAIL_GENERATION_TITLE); expect(result.labels.submitBtnLabel).toBe(THUMBNAIL_GENERATION_LABELS.THUMBNAIL_GENERATION_BUTTON_LABEL); - expect(result.data.bodyParam.query).toBe(THUMBNAIL_GENERATION_LABELS.DOCUMENT_QUERY); }); }); + describe('FEATURES.FULLTEXT_REINDEX', () => { + it('should return correct labels and data for DOCUMENT tabType', () => { + const result = featureMap()[FEATURES.FULLTEXT_REINDEX](GENERIC_LABELS.DOCUMENT); + expect(result.labels.pageTitle).toBe(FULLTEXT_REINDEX_LABELS.DOCUMENT_REINDEX_TITLE); + expect(result.labels.submitBtnLabel).toBe(FULLTEXT_REINDEX_LABELS.REINDEX_BUTTON_LABEL); + }); + }); }); \ No newline at end of file diff --git a/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.ts b/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.ts index 2b8fdc1e..3faca0b5 100644 --- a/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.ts +++ b/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/document-tab/document-tab.component.ts @@ -1,4 +1,5 @@ import { VIDEO_RENDITIONS_LABELS } from "./../../../../video-renditions-generation/video-renditions-generation.constants"; +import { FULLTEXT_REINDEX_LABELS } from "src/app/features/fulltext-reindex/fulltext-reindex.constants"; import { REST_END_POINTS } from "./../../../../../shared/constants/rest-end-ponts.constants"; import { GenericMultiFeatureUtilitiesService } from "./../../services/generic-multi-feature-utilities.service"; import { NuxeoJSClientService } from "./../../../../../shared/services/nuxeo-js-client.service"; @@ -73,6 +74,7 @@ export class DocumentTabComponent implements OnInit, OnDestroy { activeFeature: FeaturesKey = {} as FeaturesKey; requestQuery = ""; VIDEO_RENDITIONS_LABELS = VIDEO_RENDITIONS_LABELS; + FULLTEXT_REINDEX_LABELS = FULLTEXT_REINDEX_LABELS; FEATURES = FEATURES; constructor( public dialogService: MatDialog, @@ -83,6 +85,7 @@ export class DocumentTabComponent implements OnInit, OnDestroy { ) { this.inputForm = this.fb.group({ inputIdentifier: ["", Validators.required], + force: [false], }); this.nuxeo = this.nuxeoJSClientService.getNuxeoInstance(); this.documentActionLaunched$ = this.store.pipe( @@ -117,6 +120,12 @@ export class DocumentTabComponent implements OnInit, OnDestroy { new FormControl("true") ); } + if (this.isFeatureFullTextReindex()) { + this.inputForm.addControl( + FULLTEXT_REINDEX_LABELS.FORCE, + new FormControl("false") + ); + } } this.documentActionLaunchedSubscription = @@ -209,6 +218,10 @@ export class DocumentTabComponent implements OnInit, OnDestroy { if (this.isFeatureVideoRenditions()) { this.inputForm?.get("conversionNames")?.reset(); } + if (this.isFeatureFullTextReindex()) { + this.inputForm?.get("force")?.reset(); + } + document.getElementById("inputIdentifier")?.focus(); } @@ -319,6 +332,13 @@ export class DocumentTabComponent implements OnInit, OnDestroy { ); } + isFeatureFullTextReindex(): boolean { + return ( + this.activeFeature === + (FEATURES.FULLTEXT_REINDEX as FeaturesKey) + ); + } + ngOnDestroy(): void { this.store.dispatch(FeatureActions.resetDocumentActionState()); this.documentActionLaunchedSubscription?.unsubscribe(); @@ -329,4 +349,4 @@ export class DocumentTabComponent implements OnInit, OnDestroy { this.launchedDialogOpenedSubscription?.unsubscribe(); this.errorDialogOpenedSubscription?.unsubscribe(); } -} +} \ No newline at end of file diff --git a/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/folder-tab/folder-tab.component.html b/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/folder-tab/folder-tab.component.html index a932150a..3404603c 100644 --- a/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/folder-tab/folder-tab.component.html +++ b/nuxeo-admin-console-web/angular-app/src/app/features/sub-features/generic-multi-feature-layout/components/folder-tab/folder-tab.component.html @@ -1,5 +1,5 @@