[AAE-10772] Move content services directives from core to content-services package (#7942)

* [AAE-10772] move CheckAllowableOperationDirective to content services

* [AAE-10772] move LibraryFavoriteDirective to content services

* [AAE-10772] move LibraryMembershipDirective to content services

* [AAE-10772] move NodeDeleteDirective to content services

* [AAE-10772] move NodeFavoriteDirective to content services

* [AAE-10772] update imports on LibraryMembershipDirective

* [AAE-10772] move NodeRestoreDirective to content services

* [AAE-10772] move UserInfoModule to content services

* Revert "[AAE-10772] move UserInfoModule to content services"

This reverts commit ede1d5db3923859586d88646ca7826abd3d30cf1.

* [AAE-10772] Remove barrel imports and move library membership interfaces into LibraryMembershipDirective because are only used in that directive

* [AAE-10772] Remove barrel imports from spec files

* [AAE-10772] Move directive md files from core to content-services

* [AAE-10772] Fix files path into the docs files

* [AAE-10772] Export library membership interfaces because are imported by the ACA ToggleJoinLibraryButtonComponent

Co-authored-by: Diogo Bastos <diogo.bastos@hyland.com>
This commit is contained in:
Amedeo Lepore
2022-11-18 09:49:17 +01:00
committed by GitHub
parent f9c71bc953
commit 933b59c54e
32 changed files with 243 additions and 108 deletions

View File

@@ -16,12 +16,11 @@
*/
import { ChangeDetectorRef, Component, ElementRef, SimpleChange } from '@angular/core';
import { ContentService } from '../services/content.service';
import { CheckAllowableOperationDirective, NodeAllowableOperationSubject } from './check-allowable-operation.directive';
import { setupTestBed } from '../testing/setup-test-bed';
import { ContentService, CoreTestingModule, setupTestBed } from '@alfresco/adf-core';
import { CheckAllowableOperationDirective } from './check-allowable-operation.directive';
import { TestBed } from '@angular/core/testing';
import { CoreTestingModule } from '../testing/core.testing.module';
import { TranslateModule } from '@ngx-translate/core';
import { NodeAllowableOperationSubject } from '../interfaces/node-allowable-operation-subject.interface';
@Component({
selector: 'adf-text-subject',

View File

@@ -19,12 +19,8 @@
import { ChangeDetectorRef, Directive, ElementRef, Host, Inject, Input, OnChanges, Optional, Renderer2, SimpleChanges } from '@angular/core';
import { NodeEntry } from '@alfresco/js-api';
import { ContentService } from '../services/content.service';
import { EXTENDIBLE_COMPONENT } from '../interface/injection.tokens';
export interface NodeAllowableOperationSubject {
disabled: boolean;
}
import { ContentService, EXTENDIBLE_COMPONENT } from '@alfresco/adf-core';
import { NodeAllowableOperationSubject } from '../interfaces/node-allowable-operation-subject.interface';
@Directive({
selector: '[adf-check-allowable-operation]'

View File

@@ -23,6 +23,12 @@ import { TranslateModule } from '@ngx-translate/core';
import { NodeLockDirective } from './node-lock.directive';
import { NodeCounterComponent, NodeCounterDirective } from './node-counter.directive';
import { AutoFocusDirective } from './auto-focus.directive';
import { CheckAllowableOperationDirective } from './check-allowable-operation.directive';
import { LibraryFavoriteDirective } from './library-favorite.directive';
import { LibraryMembershipDirective } from './library-membership.directive';
import { NodeDeleteDirective } from './node-delete.directive';
import { NodeFavoriteDirective } from './node-favorite.directive';
import { NodeRestoreDirective } from './node-restore.directive';
@NgModule({
imports: [
@@ -34,12 +40,24 @@ import { AutoFocusDirective } from './auto-focus.directive';
NodeLockDirective,
NodeCounterDirective,
NodeCounterComponent,
AutoFocusDirective
AutoFocusDirective,
CheckAllowableOperationDirective,
LibraryFavoriteDirective,
LibraryMembershipDirective,
NodeDeleteDirective,
NodeFavoriteDirective,
NodeRestoreDirective
],
exports: [
NodeLockDirective,
NodeCounterDirective,
AutoFocusDirective
AutoFocusDirective,
CheckAllowableOperationDirective,
LibraryFavoriteDirective,
LibraryMembershipDirective,
NodeDeleteDirective,
NodeFavoriteDirective,
NodeRestoreDirective
]
})
export class ContentDirectiveModule {

View File

@@ -16,12 +16,11 @@
*/
import { Component, ViewChild } from '@angular/core';
import { LibraryEntity, LibraryFavoriteDirective } from './library-favorite.directive';
import { LibraryFavoriteDirective } from './library-favorite.directive';
import { TestBed, ComponentFixture } from '@angular/core/testing';
import { TranslateModule } from '@ngx-translate/core';
import { AlfrescoApiService } from '../services/alfresco-api.service';
import { CoreModule } from '../core.module';
import { AlfrescoApiServiceMock } from '../mock';
import { AlfrescoApiServiceMock, CoreModule, AlfrescoApiService } from '@alfresco/adf-core';
import { LibraryEntity } from '../interfaces/library-entity.interface';
@Component({
selector: 'app-test-component',

View File

@@ -16,14 +16,9 @@
*/
import { Directive, HostListener, Input, OnChanges, Output, EventEmitter } from '@angular/core';
import { SiteBody, FavoriteBody, FavoriteEntry, Site, FavoritesApi } from '@alfresco/js-api';
import { AlfrescoApiService } from '../services/alfresco-api.service';
export interface LibraryEntity {
entry: Site;
isLibrary: boolean;
isFavorite: boolean;
}
import { SiteBody, FavoriteBody, FavoriteEntry, FavoritesApi } from '@alfresco/js-api';
import { AlfrescoApiService } from '@alfresco/adf-core';
import { LibraryEntity } from '../interfaces/library-entity.interface';
@Directive({
selector: '[adf-favorite-library]',

View File

@@ -16,14 +16,12 @@
*/
import { fakeAsync, TestBed, tick } from '@angular/core/testing';
import { AlfrescoApiService, SitesService } from '../services';
import { LibraryMembershipDirective } from './library-membership.directive';
import { NO_ERRORS_SCHEMA, SimpleChange } from '@angular/core';
import { of, throwError, Subject } from 'rxjs';
import { TranslateModule } from '@ngx-translate/core';
import { DirectiveModule } from './directive.module';
import { CoreModule } from '../core.module';
import { CoreTestingModule } from '../testing/core.testing.module';
import { AlfrescoApiService, CoreModule, CoreTestingModule, SitesService } from '@alfresco/adf-core';
import { ContentDirectiveModule } from './content-directive.module';
describe('LibraryMembershipDirective', () => {
let alfrescoApiService: AlfrescoApiService;
@@ -41,7 +39,7 @@ describe('LibraryMembershipDirective', () => {
TestBed.configureTestingModule({
imports: [
TranslateModule.forRoot(),
DirectiveModule,
ContentDirectiveModule,
CoreModule.forRoot(),
CoreTestingModule
],

View File

@@ -24,20 +24,9 @@ import {
SitesApi
} from '@alfresco/js-api';
import { BehaviorSubject, from, Observable } from 'rxjs';
import { AlfrescoApiService } from '../services/alfresco-api.service';
import { SitesService } from '../services/sites.service';
import { VersionCompatibilityService } from '../services/version-compatibility.service';
export interface LibraryMembershipToggleEvent {
updatedEntry?: any;
shouldReload: boolean;
i18nKey: string;
}
export interface LibraryMembershipErrorEvent {
error: any;
i18nKey: string;
}
import { VersionCompatibilityService, SitesService, AlfrescoApiService } from '@alfresco/adf-core';
import { LibraryMembershipToggleEvent } from '../interfaces/library-membership-toggle-event.interface';
import { LibraryMembershipErrorEvent} from '../interfaces/library-membership-error-event.interface';
@Directive({
selector: '[adf-library-membership]',

View File

@@ -19,8 +19,9 @@ import { Component, DebugElement, ViewChild } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NodeDeleteDirective } from './node-delete.directive';
import { setupTestBed } from '../testing/setup-test-bed';
import { CoreTestingModule } from '../testing/core.testing.module';
import { setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
import { TranslateModule } from '@ngx-translate/core';
import { ContentDirectiveModule } from './content-directive.module';
@Component({
template: `
@@ -89,7 +90,9 @@ describe('NodeDeleteDirective', () => {
setupTestBed({
imports: [
CoreTestingModule
TranslateModule.forRoot(),
CoreTestingModule,
ContentDirectiveModule
],
declarations: [
TestComponent,

View File

@@ -20,8 +20,7 @@
import { Directive, ElementRef, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
import { NodeEntry, Node, DeletedNodeEntity, DeletedNode, TrashcanApi, NodesApi } from '@alfresco/js-api';
import { Observable, forkJoin, from, of } from 'rxjs';
import { AlfrescoApiService } from '../services/alfresco-api.service';
import { TranslationService } from '../services/translation.service';
import { AlfrescoApiService, TranslationService } from '@alfresco/adf-core';
import { map, catchError, retry } from 'rxjs/operators';
interface ProcessedNodeData {

View File

@@ -18,10 +18,8 @@
import { SimpleChange } from '@angular/core';
import { fakeAsync, TestBed, tick } from '@angular/core/testing';
import { NodeFavoriteDirective } from './node-favorite.directive';
import { setupTestBed } from '../testing/setup-test-bed';
import { CoreTestingModule } from '../testing/core.testing.module';
import { TranslateModule } from '@ngx-translate/core';
import { AlfrescoApiService } from '../services/alfresco-api.service';
import { AlfrescoApiService, CoreTestingModule, setupTestBed } from '@alfresco/adf-core';
describe('NodeFavoriteDirective', () => {

View File

@@ -20,8 +20,8 @@
import { Directive, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
import { FavoriteBody, NodeEntry, SharedLinkEntry, Node, SharedLink, FavoritesApi } from '@alfresco/js-api';
import { Observable, from, forkJoin, of } from 'rxjs';
import { AlfrescoApiService } from '../services/alfresco-api.service';
import { catchError, map } from 'rxjs/operators';
import { AlfrescoApiService } from '@alfresco/adf-core';
@Directive({
selector: '[adf-node-favorite]',

View File

@@ -19,10 +19,9 @@ import { Component, DebugElement } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NodeRestoreDirective } from './node-restore.directive';
import { setupTestBed } from '../testing/setup-test-bed';
import { TranslationService } from '../services/translation.service';
import { CoreTestingModule } from '../testing/core.testing.module';
import { TranslateModule } from '@ngx-translate/core';
import { TranslationService, setupTestBed, CoreTestingModule } from '@alfresco/adf-core';
import { ContentDirectiveModule } from './content-directive.module';
@Component({
template: `
@@ -48,7 +47,8 @@ describe('NodeRestoreDirective', () => {
setupTestBed({
imports: [
TranslateModule.forRoot(),
CoreTestingModule
CoreTestingModule,
ContentDirectiveModule
],
declarations: [
TestComponent

View File

@@ -18,17 +18,12 @@
/* eslint-disable @angular-eslint/component-selector, @angular-eslint/no-input-rename */
import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';
import { TrashcanApi, DeletedNodeEntry, DeletedNodesPaging, PathInfoEntity } from '@alfresco/js-api';
import {
TrashcanApi, DeletedNodeEntry, DeletedNodesPaging } from '@alfresco/js-api';
import { Observable, forkJoin, from, of } from 'rxjs';
import { AlfrescoApiService } from '../services/alfresco-api.service';
import { TranslationService } from '../services/translation.service';
import { tap, mergeMap, map, catchError } from 'rxjs/operators';
export class RestoreMessageModel {
message: string;
path: PathInfoEntity;
action: string;
}
import { AlfrescoApiService, TranslationService } from '@alfresco/adf-core';
import { RestoreMessageModel } from '../interfaces/restore-message-model.interface';
@Directive({
selector: '[adf-restore]'

View File

@@ -19,3 +19,9 @@ export * from './content-directive.module';
export * from './node-lock.directive';
export * from './node-counter.directive';
export * from './auto-focus.directive';
export * from './check-allowable-operation.directive';
export * from './library-favorite.directive';
export * from './library-membership.directive';
export * from './node-delete.directive';
export * from './node-favorite.directive';
export * from './node-restore.directive';

View File

@@ -0,0 +1,18 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* 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.
*/
export * from './public-api';

View File

@@ -0,0 +1,24 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* 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 { Site } from '@alfresco/js-api';
export interface LibraryEntity {
entry: Site;
isLibrary: boolean;
isFavorite: boolean;
}

View File

@@ -0,0 +1,21 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* 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.
*/
export interface LibraryMembershipErrorEvent {
error: any;
i18nKey: string;
}

View File

@@ -0,0 +1,22 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* 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.
*/
export interface LibraryMembershipToggleEvent {
updatedEntry?: any;
shouldReload: boolean;
i18nKey: string;
}

View File

@@ -0,0 +1,20 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* 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.
*/
export interface NodeAllowableOperationSubject {
disabled: boolean;
}

View File

@@ -0,0 +1,23 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* 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.
*/
export * from './node-allowable-operation-subject.interface';
export * from './library-entity.interface';
export * from './restore-message-model.interface';
export * from './library-membership-error-event.interface';
export * from './library-membership-toggle-event.interface';

View File

@@ -0,0 +1,24 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* 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 { PathInfoEntity } from '@alfresco/js-api';
export class RestoreMessageModel {
message: string;
path: PathInfoEntity;
action: string;
}

View File

@@ -17,7 +17,7 @@
import {
ContentService, EXTENDIBLE_COMPONENT, FileUtils,
LogService, NodeAllowableOperationSubject, TranslationService, UploadService, AllowableOperationsEnum
LogService, TranslationService, UploadService, AllowableOperationsEnum
} from '@alfresco/adf-core';
import {
Component, EventEmitter, forwardRef, Input,
@@ -27,6 +27,7 @@ import { Node } from '@alfresco/js-api';
import { Subject } from 'rxjs';
import { PermissionModel } from '../../document-list/models/permissions.model';
import { UploadBase } from './base-upload/upload-base';
import { NodeAllowableOperationSubject } from '../../interfaces/node-allowable-operation-subject.interface';
@Component({
selector: 'adf-upload-button',

View File

@@ -16,10 +16,11 @@
*/
import {
EXTENDIBLE_COMPONENT, FileInfo, FileModel, FileUtils, NodeAllowableOperationSubject,
EXTENDIBLE_COMPONENT, FileInfo, FileModel, FileUtils,
NotificationService, TranslationService, UploadService, ContentService, AllowableOperationsEnum
} from '@alfresco/adf-core';
import { Component, forwardRef, ViewEncapsulation, NgZone } from '@angular/core';
import { NodeAllowableOperationSubject } from '../../interfaces/node-allowable-operation-subject.interface';
import { UploadBase } from './base-upload/upload-base';
@Component({

View File

@@ -36,5 +36,6 @@ export * from './lib/group/index';
export * from './lib/aspect-list/index';
export * from './lib/content-type/index';
export * from './lib/new-version-uploader';
export * from './lib/interfaces/index';
export * from './lib/content.module';

View File

@@ -0,0 +1,9 @@
6.0.0-beta.1
- CheckAllowableOperationDirective: Moved from ADF Core to ADF content services
- LibraryFavoriteDirective: Moved from ADF Core to ADF content services
- LibraryMembershipDirective: Moved from ADF Core to ADF content services
- NodeDeleteDirective: Moved from ADF Core to ADF content services
- NodeFavoriteDirective: Moved from ADF Core to ADF content services
- NodeRestoreDirective: Moved from ADF Core to ADF content services

View File

@@ -21,10 +21,6 @@ import { MaterialModule } from '../material.module';
import { HighlightDirective } from './highlight.directive';
import { LogoutDirective } from './logout.directive';
import { NodeDeleteDirective } from './node-delete.directive';
import { NodeFavoriteDirective } from './node-favorite.directive';
import { CheckAllowableOperationDirective } from './check-allowable-operation.directive';
import { NodeRestoreDirective } from './node-restore.directive';
import { UploadDirective } from './upload.directive';
import { NodeDownloadDirective } from './node-download.directive';
import { VersionCompatibilityDirective } from './version-compatibility.directive';
@@ -32,8 +28,6 @@ import { TooltipCardDirective } from './tooltip-card/tooltip-card.directive';
import { OverlayModule } from '@angular/cdk/overlay';
import { TooltipCardComponent } from './tooltip-card/tooltip-card.component';
import { InfiniteSelectScrollDirective } from './infinite-select-scroll.directive';
import { LibraryFavoriteDirective } from './library-favorite.directive';
import { LibraryMembershipDirective } from './library-membership.directive';
@NgModule({
imports: [
@@ -44,33 +38,21 @@ import { LibraryMembershipDirective } from './library-membership.directive';
declarations: [
HighlightDirective,
LogoutDirective,
NodeDeleteDirective,
NodeFavoriteDirective,
CheckAllowableOperationDirective,
NodeRestoreDirective,
NodeDownloadDirective,
UploadDirective,
VersionCompatibilityDirective,
TooltipCardDirective,
TooltipCardComponent,
InfiniteSelectScrollDirective,
LibraryFavoriteDirective,
LibraryMembershipDirective
InfiniteSelectScrollDirective
],
exports: [
HighlightDirective,
LogoutDirective,
NodeDeleteDirective,
NodeFavoriteDirective,
CheckAllowableOperationDirective,
NodeRestoreDirective,
NodeDownloadDirective,
UploadDirective,
VersionCompatibilityDirective,
TooltipCardDirective,
InfiniteSelectScrollDirective,
LibraryFavoriteDirective,
LibraryMembershipDirective
InfiniteSelectScrollDirective
]
})
export class DirectiveModule {}

View File

@@ -17,16 +17,10 @@
export * from './highlight.directive';
export * from './logout.directive';
export * from './node-delete.directive';
export * from './node-favorite.directive';
export * from './check-allowable-operation.directive';
export * from './node-restore.directive';
export * from './node-download.directive';
export * from './upload.directive';
export * from './version-compatibility.directive';
export * from './tooltip-card/tooltip-card.directive';
export * from './infinite-select-scroll.directive';
export * from './library-favorite.directive';
export * from './library-membership.directive';
export * from './directive.module';