diff --git a/lib/content-services/src/lib/content.module.ts b/lib/content-services/src/lib/content.module.ts index 2b7e7580b93..4e9540f8120 100644 --- a/lib/content-services/src/lib/content.module.ts +++ b/lib/content-services/src/lib/content.module.ts @@ -42,19 +42,18 @@ import { AspectListModule } from './aspect-list/aspect-list.module'; import { VersionCompatibilityModule } from './version-compatibility/version-compatibility.module'; import { versionCompatibilityFactory } from './version-compatibility/version-compatibility-factory'; import { VersionCompatibilityService } from './version-compatibility/version-compatibility.service'; -import { ContentPipeModule } from './pipes/content-pipe.module'; +import { CONTENT_PIPES } from './pipes/content-pipe.module'; import { NodeCommentsModule } from './node-comments/node-comments.module'; import { TreeModule } from './tree/tree.module'; import { AlfrescoViewerModule } from './viewer/alfresco-viewer.module'; import { ContentUserInfoModule } from './content-user-info/content-user-info.module'; -import { SecurityControlsServiceModule } from './security/services/security-controls-service.module'; import { CategoriesModule } from './category/category.module'; import { contentAuthLoaderFactory } from './auth-loader/content-auth-loader-factory'; import { ContentAuthLoaderService } from './auth-loader/content-auth-loader.service'; @NgModule({ imports: [ - ContentPipeModule, + ...CONTENT_PIPES, CoreModule, TagModule, CommonModule, @@ -83,12 +82,11 @@ import { ContentAuthLoaderService } from './auth-loader/content-auth-loader.serv TreeModule, SearchTextModule, AlfrescoViewerModule, - SecurityControlsServiceModule, CategoriesModule ], providers: [provideTranslations('adf-content-services', 'assets/adf-content-services')], exports: [ - ContentPipeModule, + ...CONTENT_PIPES, TagModule, DocumentListModule, ContentUserInfoModule, @@ -112,7 +110,6 @@ import { ContentAuthLoaderService } from './auth-loader/content-auth-loader.serv TreeModule, SearchTextModule, AlfrescoViewerModule, - SecurityControlsServiceModule, CategoriesModule ] }) diff --git a/lib/content-services/src/lib/document-list/document-list.module.ts b/lib/content-services/src/lib/document-list/document-list.module.ts index a89661968bb..2ba7ab36d27 100644 --- a/lib/content-services/src/lib/document-list/document-list.module.ts +++ b/lib/content-services/src/lib/document-list/document-list.module.ts @@ -21,7 +21,6 @@ import { CoreModule, EditJsonDialogModule } from '@alfresco/adf-core'; import { MaterialModule } from '../material.module'; import { UploadModule } from '../upload/upload.module'; -import { ContentPipeModule } from '../pipes/content-pipe.module'; import { SearchModule } from './../search/search.module'; import { ContentActionListComponent } from './components/content-action/content-action-list.component'; @@ -36,17 +35,18 @@ import { NameColumnComponent } from './components/name-column/name-column.compon import { FilterHeaderComponent } from './components/filter-header/filter-header.component'; import { FileAutoDownloadComponent } from './components/file-auto-download/file-auto-download.component'; import { ContentDirectiveModule } from '../directives/content-directive.module'; +import { NodeNameTooltipPipe } from '../pipes'; @NgModule({ imports: [ CoreModule, CommonModule, - ContentPipeModule, MaterialModule, UploadModule, EditJsonDialogModule, SearchModule, - ContentDirectiveModule + ContentDirectiveModule, + NodeNameTooltipPipe ], declarations: [ DocumentListComponent, @@ -72,5 +72,4 @@ import { ContentDirectiveModule } from '../directives/content-directive.module'; FilterHeaderComponent ] }) -export class DocumentListModule { -} +export class DocumentListModule {} diff --git a/lib/content-services/src/lib/pipes/content-pipe.module.ts b/lib/content-services/src/lib/pipes/content-pipe.module.ts index e1e90e248af..2154b4e3b83 100644 --- a/lib/content-services/src/lib/pipes/content-pipe.module.ts +++ b/lib/content-services/src/lib/pipes/content-pipe.module.ts @@ -15,33 +15,19 @@ * limitations under the License. */ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { NodeNameTooltipPipe } from './node-name-tooltip.pipe'; -import { TranslateModule } from '@ngx-translate/core'; import { IsIncludedPipe } from './is-included.pipe'; import { TabLabelsPipe } from './tab-labels.pipe'; +export const CONTENT_PIPES = [NodeNameTooltipPipe, IsIncludedPipe, TabLabelsPipe] as const; + +/** + * @deprecated Use the individual pipe modules instead. + */ @NgModule({ - imports: [ - CommonModule, - TranslateModule - ], - declarations: [ - NodeNameTooltipPipe, - IsIncludedPipe, - TabLabelsPipe - ], - providers: [ - NodeNameTooltipPipe, - IsIncludedPipe, - TabLabelsPipe - ], - exports: [ - NodeNameTooltipPipe, - IsIncludedPipe, - TabLabelsPipe - ] + imports: [...CONTENT_PIPES], + providers: [...CONTENT_PIPES], + exports: [...CONTENT_PIPES] }) -export class ContentPipeModule { -} +export class ContentPipeModule {} diff --git a/lib/content-services/src/lib/pipes/is-included.pipe.ts b/lib/content-services/src/lib/pipes/is-included.pipe.ts index ca5ded4d194..cd25b433744 100644 --- a/lib/content-services/src/lib/pipes/is-included.pipe.ts +++ b/lib/content-services/src/lib/pipes/is-included.pipe.ts @@ -18,7 +18,8 @@ import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ - name: 'adfIsIncluded' + name: 'adfIsIncluded', + standalone: true }) export class IsIncludedPipe implements PipeTransform { transform(value: T, array: T[], compare?: (value1: T, value2: T) => boolean): boolean { diff --git a/lib/content-services/src/lib/pipes/node-name-tooltip.pipe.ts b/lib/content-services/src/lib/pipes/node-name-tooltip.pipe.ts index 88d2632b6d9..d634cc8183b 100644 --- a/lib/content-services/src/lib/pipes/node-name-tooltip.pipe.ts +++ b/lib/content-services/src/lib/pipes/node-name-tooltip.pipe.ts @@ -19,7 +19,8 @@ import { Pipe, PipeTransform } from '@angular/core'; import { NodeEntry } from '@alfresco/js-api'; @Pipe({ - name: 'adfNodeNameTooltip' + name: 'adfNodeNameTooltip', + standalone: true }) export class NodeNameTooltipPipe implements PipeTransform { transform(node: NodeEntry): string { diff --git a/lib/content-services/src/lib/pipes/tab-labels.pipe.ts b/lib/content-services/src/lib/pipes/tab-labels.pipe.ts index 5578ab1b7ca..7b84eb98c27 100644 --- a/lib/content-services/src/lib/pipes/tab-labels.pipe.ts +++ b/lib/content-services/src/lib/pipes/tab-labels.pipe.ts @@ -19,12 +19,11 @@ import { Pipe, PipeTransform } from '@angular/core'; import { SearchWidgetSettings } from '../search/models/search-widget-settings.interface'; @Pipe({ - name: 'tabLabels' + name: 'tabLabels', + standalone: true }) export class TabLabelsPipe implements PipeTransform { - - transform(field: string, settings?: SearchWidgetSettings): string { - return settings?.displayedLabelsByField?.[field] ? settings.displayedLabelsByField[field] : field; - } - + transform(field: string, settings?: SearchWidgetSettings): string { + return settings?.displayedLabelsByField?.[field] ? settings.displayedLabelsByField[field] : field; + } } diff --git a/lib/content-services/src/lib/search/search.module.ts b/lib/content-services/src/lib/search/search.module.ts index 0e30858b2a4..351e18c96db 100644 --- a/lib/content-services/src/lib/search/search.module.ts +++ b/lib/content-services/src/lib/search/search.module.ts @@ -19,7 +19,6 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MaterialModule } from '../material.module'; -import { ContentPipeModule } from '../pipes/content-pipe.module'; import { CoreModule, SearchTextModule } from '@alfresco/adf-core'; @@ -57,9 +56,20 @@ import { SearchFilterTabDirective } from './components/search-filter-tabbed/sear import { SearchFacetChipTabbedComponent } from './components/search-filter-chips/search-facet-chip-tabbed/search-facet-chip-tabbed.component'; import { SearchFacetTabbedContentComponent } from './components/search-filter-chips/search-facet-chip-tabbed/search-facet-tabbed-content.component'; import { SearchInputComponent } from './components/search-input'; +import { IsIncludedPipe, TabLabelsPipe } from '../pipes'; @NgModule({ - imports: [CommonModule, ContentPipeModule, FormsModule, ReactiveFormsModule, MaterialModule, CoreModule, SearchTextModule, SearchInputComponent], + imports: [ + CommonModule, + FormsModule, + ReactiveFormsModule, + MaterialModule, + CoreModule, + SearchTextModule, + SearchInputComponent, + IsIncludedPipe, + TabLabelsPipe + ], declarations: [ SearchComponent, SearchControlComponent, diff --git a/lib/content-services/src/lib/security/public-api.ts b/lib/content-services/src/lib/security/public-api.ts index 9e726f81980..abf28ed87ce 100644 --- a/lib/content-services/src/lib/security/public-api.ts +++ b/lib/content-services/src/lib/security/public-api.ts @@ -16,4 +16,3 @@ */ export * from './services/security-controls-groups-marks-security.service'; -export * from './services/security-controls-service.module'; diff --git a/lib/content-services/src/lib/security/services/mock/security-marks.mock.ts b/lib/content-services/src/lib/security/services/mock/security-marks.mock.ts index 4532829b53c..3072bbe51ad 100644 --- a/lib/content-services/src/lib/security/services/mock/security-marks.mock.ts +++ b/lib/content-services/src/lib/security/services/mock/security-marks.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { SecurityMarkPaging, SecurityMarkEntry, SecurityMarkBody } from '@alfresco/js-api'; +import { SecurityMarkPaging, SecurityMarkBody } from '@alfresco/js-api'; export const fakeMarksApiResponse: SecurityMarkPaging = { list: { @@ -38,14 +38,8 @@ export const fakeMarksApiResponse: SecurityMarkPaging = { } }; -export const fakeCreateMarksApiResponse: SecurityMarkEntry = { - entry: { - groupId: 'e7b83b84-bb48-46fc-8e64-4b6be910906c', - name: 'securityMark1', - id: 'ffBOeOJJ' +export const createNewSecurityMarkMock: SecurityMarkBody[] = [ + { + name: 'securityMark1' } -}; - -export const createNewSecurityMarkMock: SecurityMarkBody[] = [{ - name: 'securityMark1' -}]; +]; diff --git a/lib/content-services/src/lib/security/services/models/security-controls-group-info-response.interface.ts b/lib/content-services/src/lib/security/services/models/security-controls-group-info-response.interface.ts deleted file mode 100644 index 45196e4e883..00000000000 --- a/lib/content-services/src/lib/security/services/models/security-controls-group-info-response.interface.ts +++ /dev/null @@ -1,26 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { SecurityMark } from '@alfresco/js-api'; - -export interface SecurityControlsGroupInfoResponse { - id: string; - groupName: string; - groupType: string; - inUse: boolean; - marks: SecurityMark[]; -} diff --git a/lib/content-services/src/lib/security/services/models/security-controls-group-list-response.interface.ts b/lib/content-services/src/lib/security/services/models/security-controls-group-list-response.interface.ts deleted file mode 100644 index 15db6728c04..00000000000 --- a/lib/content-services/src/lib/security/services/models/security-controls-group-list-response.interface.ts +++ /dev/null @@ -1,25 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { PaginationModel } from '@alfresco/adf-core'; -import { Observable } from 'rxjs'; -import { SecurityControlsGroupInfoResponse } from './security-controls-group-info-response.interface'; - -export interface SecurityControlsGroupListResponse { - pagination: PaginationModel; - entries: Observable; -} diff --git a/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.spec.ts b/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.spec.ts index 9d88ed8c92a..1f704a22141 100644 --- a/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.spec.ts +++ b/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.spec.ts @@ -25,8 +25,9 @@ import { SecurityGroupBody, SecurityMarkBody, SecurityMarkEntry } from '@alfresc describe('SecurityControlsService', () => { let service: SecurityControlsService; - let securityGroupId; - let securityMarkId; + let securityGroupId: string; + let securityMarkId: string; + const securityGroupBody: SecurityGroupBody = { groupName: 'TestGroup', groupType: 'HIERARCHICAL' diff --git a/lib/content-services/src/lib/security/services/security-controls-service.module.ts b/lib/content-services/src/lib/security/services/security-controls-service.module.ts deleted file mode 100644 index 7159471dd40..00000000000 --- a/lib/content-services/src/lib/security/services/security-controls-service.module.ts +++ /dev/null @@ -1,24 +0,0 @@ -/*! - * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -@NgModule({ - imports: [CommonModule] -}) -export class SecurityControlsServiceModule {} diff --git a/lib/content-services/src/lib/upload/pipes/file-upload-error.pipe.ts b/lib/content-services/src/lib/upload/pipes/file-upload-error.pipe.ts index d5bb2a1a708..e42a6c66b42 100644 --- a/lib/content-services/src/lib/upload/pipes/file-upload-error.pipe.ts +++ b/lib/content-services/src/lib/upload/pipes/file-upload-error.pipe.ts @@ -20,12 +20,11 @@ import { TranslationService } from '@alfresco/adf-core'; @Pipe({ name: 'adfFileUploadError', - pure: true + pure: true, + standalone: true }) export class FileUploadErrorPipe implements PipeTransform { - - constructor(private translation: TranslationService) { - } + constructor(private translation: TranslationService) {} transform(errorCode: number): string { return this.translation.instant(`FILE_UPLOAD.ERRORS.${errorCode || 'GENERIC'}`); diff --git a/lib/content-services/src/lib/upload/upload.module.ts b/lib/content-services/src/lib/upload/upload.module.ts index a0895b58e74..c0a244026d5 100644 --- a/lib/content-services/src/lib/upload/upload.module.ts +++ b/lib/content-services/src/lib/upload/upload.module.ts @@ -25,18 +25,13 @@ import { UploadButtonComponent } from './components/upload-button.component'; import { UploadVersionButtonComponent } from './components/upload-version-button.component'; import { UploadDragAreaComponent } from './components/upload-drag-area.component'; import { FileUploadErrorPipe } from './pipes/file-upload-error.pipe'; -import { CoreModule } from '@alfresco/adf-core'; +import { CoreModule, FileSizePipe } from '@alfresco/adf-core'; import { FileDraggableDirective } from './directives/file-draggable.directive'; import { ToggleIconDirective } from './directives/toggle-icon.directive'; import { A11yModule } from '@angular/cdk/a11y'; @NgModule({ - imports: [ - CoreModule, - CommonModule, - MaterialModule, - A11yModule - ], + imports: [CoreModule, CommonModule, MaterialModule, A11yModule, FileUploadErrorPipe, FileSizePipe], declarations: [ FileDraggableDirective, UploadDragAreaComponent, @@ -45,7 +40,6 @@ import { A11yModule } from '@angular/cdk/a11y'; FileUploadingDialogComponent, FileUploadingListComponent, FileUploadingListRowComponent, - FileUploadErrorPipe, ToggleIconDirective ], exports: [ diff --git a/lib/content-services/src/lib/version-manager/version-manager.module.ts b/lib/content-services/src/lib/version-manager/version-manager.module.ts index ded68d244ae..55ae6346b58 100644 --- a/lib/content-services/src/lib/version-manager/version-manager.module.ts +++ b/lib/content-services/src/lib/version-manager/version-manager.module.ts @@ -25,32 +25,13 @@ import { VersionManagerComponent } from './version-manager.component'; import { VersionListComponent } from './version-list.component'; import { UploadModule } from '../upload/upload.module'; import { VersionCompatibilityModule } from '../version-compatibility/version-compatibility.module'; -import { CoreModule } from '@alfresco/adf-core'; +import { CoreModule, FileTypePipe } from '@alfresco/adf-core'; import { VersionComparisonComponent } from './version-comparison.component'; import { ScrollingModule } from '@angular/cdk/scrolling'; @NgModule({ - imports: [ - CommonModule, - MaterialModule, - CoreModule, - UploadModule, - VersionCompatibilityModule, - FormsModule, - ScrollingModule - ], - exports: [ - VersionUploadComponent, - VersionManagerComponent, - VersionListComponent, - FormsModule, - VersionComparisonComponent - ], - declarations: [ - VersionUploadComponent, - VersionManagerComponent, - VersionListComponent, - VersionComparisonComponent - ] + imports: [CommonModule, MaterialModule, CoreModule, UploadModule, VersionCompatibilityModule, FormsModule, ScrollingModule, FileTypePipe], + exports: [VersionUploadComponent, VersionManagerComponent, VersionListComponent, FormsModule, VersionComparisonComponent], + declarations: [VersionUploadComponent, VersionManagerComponent, VersionListComponent, VersionComparisonComponent] }) export class VersionManagerModule {} diff --git a/lib/content-services/src/lib/version-manager/version-upload.component.html b/lib/content-services/src/lib/version-manager/version-upload.component.html index bffba2fd88f..83fe6649fa6 100644 --- a/lib/content-services/src/lib/version-manager/version-upload.component.html +++ b/lib/content-services/src/lib/version-manager/version-upload.component.html @@ -1,6 +1,6 @@
- + {{ 'ADF_VERSION_LIST.ACTIONS.UPLOAD.MINOR' | translate: { version: minorVersion } }}