mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-7678] Convert content pipes to standalone (#9562)
* standalone pipes for content services * remove useless module [ci:force] * bug fixes [ci:force] * bug fixes and cleanup [ci:force] * cleanup unused/dead code [ci:force]
This commit is contained in:
@@ -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
|
||||
]
|
||||
})
|
||||
|
@@ -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 {}
|
||||
|
@@ -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 {}
|
||||
|
@@ -18,7 +18,8 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'adfIsIncluded'
|
||||
name: 'adfIsIncluded',
|
||||
standalone: true
|
||||
})
|
||||
export class IsIncludedPipe<T> implements PipeTransform {
|
||||
transform(value: T, array: T[], compare?: (value1: T, value2: T) => boolean): boolean {
|
||||
|
@@ -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 {
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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,
|
||||
|
@@ -16,4 +16,3 @@
|
||||
*/
|
||||
|
||||
export * from './services/security-controls-groups-marks-security.service';
|
||||
export * from './services/security-controls-service.module';
|
||||
|
@@ -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'
|
||||
}];
|
||||
];
|
||||
|
@@ -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[];
|
||||
}
|
@@ -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<SecurityControlsGroupInfoResponse[]>;
|
||||
}
|
@@ -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'
|
||||
|
@@ -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 {}
|
@@ -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'}`);
|
||||
|
@@ -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: [
|
||||
|
@@ -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 {}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<div class="adf-new-version-max-width">
|
||||
<mat-radio-group class="adf-new-version-radio-group" [(ngModel)]="semanticVersion" (change)="onVersionChange()">
|
||||
<mat-radio-button class="adf-new-version-radio-button" id="adf-new-version-minor"[value]="'minor'">
|
||||
<mat-radio-button class="adf-new-version-radio-button" id="adf-new-version-minor" [value]="'minor'">
|
||||
{{ 'ADF_VERSION_LIST.ACTIONS.UPLOAD.MINOR' | translate: { version: minorVersion } }}
|
||||
</mat-radio-button>
|
||||
<mat-radio-button class="adf-new-version-radio-button" id="adf-new-version-major" [value]="'major'">
|
||||
|
Reference in New Issue
Block a user