@alfresco/aca-content 7.3.0-20948466018 → 7.3.0-20950287046

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -595,7 +595,8 @@
595
595
  "LIBRARIES": "Libraries",
596
596
  "MIN_LENGTH": "Search input must have at least 2 alphanumeric characters.",
597
597
  "REQUIRED": "Search input is required.",
598
- "WHITESPACE": "Search input cannot be only whitespace."
598
+ "WHITESPACE": "Search input cannot be only whitespace.",
599
+ "OPERATORS": "Search input cannot begin with, end with or contain only operators."
599
600
  },
600
601
  "SORT": {
601
602
  "SORTING_OPTION": "Sort by",
@@ -6,7 +6,7 @@ import { DIALOG_COMPONENT_DATA, TimeAgoPipe, LocalizedDatePipe, IconComponent, N
6
6
  import * as i1$1 from '@alfresco/adf-content-services';
7
7
  import { DocumentListService, ContentVersionService, DownloadZipDialogComponent, NodeAction, ContentNodeDialogService, ContentNodeSelectorComponent, ContentService, NodesApiService, NodeAspectService, NewVersionUploaderService, NewVersionUploaderDataAction, ShareDialogComponent, FolderDialogComponent, LibraryDialogComponent, RenditionService, SearchQueryBuilderService, UploadService, FileModel, AlfrescoApiService, SearchAiService, NameColumnComponent, NodeNameTooltipPipe, NodeCommentsComponent, ContentMetadataComponent, VersionManagerComponent, LibraryFavoriteDirective, NodeFavoriteDirective, LibraryMembershipDirective, BreadcrumbComponent, UploadDragAreaComponent, DocumentListComponent, forbidOnlySpaces, AutoFocusDirective, AlfrescoViewerComponent, SearchFormComponent, ResetSearchDirective, SearchFilterChipsComponent, PermissionListComponent, AlfrescoViewerModule, UploadModule, TagNodeListComponent, ContentModule, TrashcanNameColumnComponent, LibraryStatusColumnComponent, LibraryRoleColumnComponent, LibraryNameColumnComponent } from '@alfresco/adf-content-services';
8
8
  import * as i2 from '@alfresco/aca-shared';
9
- import { ContentApiService, NodePermissionService, AppHookService, AppSettingsService, AppExtensionService, isLocked, LockedByComponent, UserProfileService, PageComponent, GenericErrorComponent, ContextActionsDirective, InfoDrawerComponent, PaginationDirective, PageLayoutComponent, ToolbarComponent, noWhitespaceValidator, AppSharedRuleGuard, PluginEnabledGuard, ExtensionsDataLoaderGuard, ToolbarMenuItemComponent, DocumentBasePageService, provideContentAppExtensions } from '@alfresco/aca-shared';
9
+ import { ContentApiService, NodePermissionService, AppHookService, AppSettingsService, AppExtensionService, isLocked, LockedByComponent, UserProfileService, PageComponent, GenericErrorComponent, ContextActionsDirective, InfoDrawerComponent, PaginationDirective, PageLayoutComponent, ToolbarComponent, noWhitespaceValidator, noLeadingTrailingOperatorsValidator, AppSharedRuleGuard, PluginEnabledGuard, ExtensionsDataLoaderGuard, ToolbarMenuItemComponent, DocumentBasePageService, provideContentAppExtensions } from '@alfresco/aca-shared';
10
10
  import * as rules from '@alfresco/aca-shared/rules';
11
11
  import * as i1 from '@ngrx/store';
12
12
  import { Store, createSelector, provideStore } from '@ngrx/store';
@@ -2813,7 +2813,7 @@ function formatSearchTerm(userInput, fields = ['cm:name']) {
2813
2813
  if (userInput.includes(':') || userInput.includes('"')) {
2814
2814
  return userInput;
2815
2815
  }
2816
- const words = userInput.split(' ');
2816
+ const words = userInput.split(/\s+/);
2817
2817
  if (words.length > 1) {
2818
2818
  const separator = words.some(isOperator) ? ' ' : ' AND ';
2819
2819
  return words.map((term) => (isOperator(term) ? term : formatSearchTermByFields(term, fields))).join(separator);
@@ -6973,7 +6973,7 @@ class SearchInputControlComponent {
6973
6973
  /** Emitted when the input control has a validation error. */
6974
6974
  validationError = new EventEmitter();
6975
6975
  searchInput;
6976
- searchFieldFormControl = new FormControl('', [Validators.required, noWhitespaceValidator()]);
6976
+ searchFieldFormControl = new FormControl('', [Validators.required, noWhitespaceValidator(), noLeadingTrailingOperatorsValidator()]);
6977
6977
  get searchTerm() {
6978
6978
  return this.searchFieldFormControl.value.replace('text:', 'TEXT:');
6979
6979
  }
@@ -7033,6 +7033,9 @@ class SearchInputControlComponent {
7033
7033
  if (errors?.whitespace) {
7034
7034
  this.validationError.emit('SEARCH.INPUT.WHITESPACE');
7035
7035
  }
7036
+ else if (errors?.operators) {
7037
+ this.validationError.emit('SEARCH.INPUT.OPERATORS');
7038
+ }
7036
7039
  else if (errors?.required) {
7037
7040
  this.validationError.emit('SEARCH.INPUT.REQUIRED');
7038
7041
  }