mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
ACS-8586: Remove internal dependency on PipeModule (#10086)
This commit is contained in:
@@ -26,14 +26,13 @@ import { NodeAspectService } from '../../../aspect-list/services/node-aspect.ser
|
||||
import { ContentMetadataService } from '../../services/content-metadata.service';
|
||||
import { AllowableOperationsEnum } from '../../../common/models/allowable-operations.enum';
|
||||
import { of } from 'rxjs';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock, AuthModule, PipeModule, TranslationMock, TranslationService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock, AuthModule, TranslationMock, TranslationService } from '@alfresco/adf-core';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { versionCompatibilityFactory } from '../../../version-compatibility/version-compatibility-factory';
|
||||
import { VersionCompatibilityService } from '../../../version-compatibility';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { CategoryService } from '../../../category';
|
||||
import { TagService } from '../../../tag';
|
||||
import { PropertyDescriptorsService } from '../../public-api';
|
||||
@@ -59,9 +58,7 @@ describe('ContentMetadataCardComponent', () => {
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
HttpClientModule,
|
||||
MatDialogModule,
|
||||
PipeModule,
|
||||
MatSnackBarModule,
|
||||
MatTooltipModule,
|
||||
ContentMetadataCardComponent
|
||||
],
|
||||
providers: [
|
||||
|
@@ -27,7 +27,6 @@ import {
|
||||
CardViewBaseItemModel,
|
||||
CardViewComponent,
|
||||
NotificationService,
|
||||
PipeModule,
|
||||
TranslationMock,
|
||||
TranslationService,
|
||||
UpdateNotification
|
||||
@@ -51,8 +50,6 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatChipHarness } from '@angular/material/chips/testing';
|
||||
|
||||
@@ -193,9 +190,6 @@ describe('ContentMetadataComponent', () => {
|
||||
HttpClientModule,
|
||||
MatDialogModule,
|
||||
MatSnackBarModule,
|
||||
MatProgressBarModule,
|
||||
MatTooltipModule,
|
||||
PipeModule,
|
||||
ContentMetadataComponent
|
||||
],
|
||||
providers: [
|
||||
|
@@ -15,16 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { CardViewDateItemModel, CardViewTextItemModel, FileSizePipe } from '@alfresco/adf-core';
|
||||
import { CardViewDateItemModel, CardViewTextItemModel, FileSizePipe, TranslationService } from '@alfresco/adf-core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class BasicPropertiesService {
|
||||
|
||||
constructor(private fileSizePipe: FileSizePipe) {
|
||||
}
|
||||
private translationService = inject(TranslationService);
|
||||
|
||||
getProperties(node: Node) {
|
||||
const sizeInBytes = node.content ? node.content.sizeInBytes : '';
|
||||
@@ -63,7 +62,7 @@ export class BasicPropertiesService {
|
||||
label: 'CORE.METADATA.BASIC.SIZE',
|
||||
value: sizeInBytes,
|
||||
key: 'content.sizeInBytes',
|
||||
pipes: [{ pipe: this.fileSizePipe }],
|
||||
pipes: [{ pipe: new FileSizePipe(this.translationService) }],
|
||||
editable: false
|
||||
}),
|
||||
new CardViewTextItemModel({
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import {
|
||||
CardViewItemProperties,
|
||||
CardViewItem,
|
||||
@@ -30,7 +30,8 @@ import {
|
||||
MultiValuePipe,
|
||||
AppConfigService,
|
||||
DecimalNumberPipe,
|
||||
LogService
|
||||
LogService,
|
||||
UserPreferencesService
|
||||
} from '@alfresco/adf-core';
|
||||
import { Property, CardViewGroup, OrganisedPropertyGroup } from '../interfaces/content-metadata.interfaces';
|
||||
import { of } from 'rxjs';
|
||||
@@ -52,14 +53,13 @@ export const RECOGNISED_ECM_TYPES = [D_TEXT, D_MLTEXT, D_DATE, D_DATETIME, D_INT
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PropertyGroupTranslatorService {
|
||||
private userPreferenceService = inject(UserPreferencesService);
|
||||
private appConfig = inject(AppConfigService);
|
||||
private logService = inject(LogService);
|
||||
|
||||
valueSeparator: string;
|
||||
|
||||
constructor(
|
||||
private multiValuePipe: MultiValuePipe,
|
||||
private decimalNumberPipe: DecimalNumberPipe,
|
||||
private appConfig: AppConfigService,
|
||||
private logService: LogService
|
||||
) {
|
||||
constructor() {
|
||||
this.valueSeparator = this.appConfig.get<string>('content-metadata.multi-value-pipe-separator');
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ export class PropertyGroupTranslatorService {
|
||||
cardViewItemProperty = new CardViewIntItemModel(
|
||||
Object.assign(propertyDefinition, {
|
||||
multivalued: isMultiValued,
|
||||
pipes: [{ pipe: this.multiValuePipe, params: [this.valueSeparator] }]
|
||||
pipes: [{ pipe: new MultiValuePipe(), params: [this.valueSeparator] }]
|
||||
})
|
||||
);
|
||||
break;
|
||||
@@ -146,7 +146,7 @@ export class PropertyGroupTranslatorService {
|
||||
cardViewItemProperty = new CardViewLongItemModel(
|
||||
Object.assign(propertyDefinition, {
|
||||
multivalued: isMultiValued,
|
||||
pipes: [{ pipe: this.multiValuePipe, params: [this.valueSeparator] }]
|
||||
pipes: [{ pipe: new MultiValuePipe(), params: [this.valueSeparator] }]
|
||||
})
|
||||
);
|
||||
break;
|
||||
@@ -156,7 +156,10 @@ export class PropertyGroupTranslatorService {
|
||||
cardViewItemProperty = new CardViewFloatItemModel(
|
||||
Object.assign(propertyDefinition, {
|
||||
multivalued: isMultiValued,
|
||||
pipes: [{ pipe: this.decimalNumberPipe }, { pipe: this.multiValuePipe, params: [this.valueSeparator] }]
|
||||
pipes: [
|
||||
{ pipe: new DecimalNumberPipe(this.userPreferenceService, this.appConfig) },
|
||||
{ pipe: new MultiValuePipe(), params: [this.valueSeparator] }
|
||||
]
|
||||
})
|
||||
);
|
||||
break;
|
||||
@@ -165,7 +168,7 @@ export class PropertyGroupTranslatorService {
|
||||
cardViewItemProperty = new CardViewDateItemModel(
|
||||
Object.assign(propertyDefinition, {
|
||||
multivalued: isMultiValued,
|
||||
pipes: [{ pipe: this.multiValuePipe, params: [this.valueSeparator] }]
|
||||
pipes: [{ pipe: new MultiValuePipe(), params: [this.valueSeparator] }]
|
||||
})
|
||||
);
|
||||
break;
|
||||
@@ -174,7 +177,7 @@ export class PropertyGroupTranslatorService {
|
||||
cardViewItemProperty = new CardViewDatetimeItemModel(
|
||||
Object.assign(propertyDefinition, {
|
||||
multivalued: isMultiValued,
|
||||
pipes: [{ pipe: this.multiValuePipe, params: [this.valueSeparator] }]
|
||||
pipes: [{ pipe: new MultiValuePipe(), params: [this.valueSeparator] }]
|
||||
})
|
||||
);
|
||||
break;
|
||||
@@ -189,7 +192,7 @@ export class PropertyGroupTranslatorService {
|
||||
Object.assign(propertyDefinition, {
|
||||
multivalued: isMultiValued,
|
||||
multiline: isMultiValued,
|
||||
pipes: [{ pipe: this.multiValuePipe, params: [this.valueSeparator] }]
|
||||
pipes: [{ pipe: new MultiValuePipe(), params: [this.valueSeparator] }]
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DownloadZipDialogComponent } from './download-zip.dialog';
|
||||
import { PipeModule } from '@alfresco/adf-core';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
@@ -26,14 +25,7 @@ import { CommonModule } from '@angular/common';
|
||||
|
||||
@NgModule({
|
||||
declarations: [DownloadZipDialogComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
PipeModule,
|
||||
MatDialogModule,
|
||||
MatProgressBarModule,
|
||||
MatButtonModule,
|
||||
TranslateModule
|
||||
],
|
||||
imports: [CommonModule, MatDialogModule, MatProgressBarModule, MatButtonModule, TranslateModule],
|
||||
exports: [DownloadZipDialogComponent]
|
||||
})
|
||||
export class DownloadZipDialogModule {}
|
||||
|
Reference in New Issue
Block a user