Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ng17 migration #10295

Open
wants to merge 40 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8dede61
Migrate to NG17
VitoAlbano Oct 10, 2024
b1e805f
[ci:force] - fixed deps
VitoAlbano Oct 10, 2024
6122026
[ci:force] - fixed build for testing 1
VitoAlbano Oct 10, 2024
e60f01b
Fixed build for all the packages
VitoAlbano Oct 11, 2024
bf8d5e0
[ci:force] - fixing lint
VitoAlbano Oct 12, 2024
ccec60c
[ci:force] - Fixed lint
VitoAlbano Oct 13, 2024
358367c
AAE-26163 Fix infinite loop when authentication error event occured (…
alep85 Oct 21, 2024
22d571b
Cherry picked commit from oidc and run fix lint
VitoAlbano Nov 4, 2024
389c3b1
[MIGRATION] - fixed build and lint
VitoAlbano Nov 14, 2024
70c4434
[MIGRATION] - Added injectionContext to avoid error NG0203 for unit t…
VitoAlbano Nov 14, 2024
172a097
[MIGRATION] - Moving mocha to jest
VitoAlbano Nov 14, 2024
d42319d
[MIGRATION] - Fixing failing migrated tests
VitoAlbano Nov 14, 2024
3c41c0f
[MIGRATION] - Migrating to Jest - working but some tests fails
VitoAlbano Nov 15, 2024
0a50e7e
Trying to fix js-api unit tests
ehsan-2019 Nov 28, 2024
d956db5
Removing testing lib to sync with develop
ehsan-2019 Nov 28, 2024
0d60b4f
Fixed two excluded unit tests
ehsan-2019 Nov 28, 2024
d410f87
Removed unused project parts
VitoAlbano Nov 28, 2024
e421dd5
Removed unused project parts
VitoAlbano Nov 28, 2024
d724605
Reduced tserrors on building storybook
VitoAlbano Nov 28, 2024
05b2323
Fixed sonarqube errors
VitoAlbano Nov 28, 2024
c7e43f3
Removing temporarily eslint rule from publishing
VitoAlbano Nov 28, 2024
066b7a3
[MIGRATION] - Fixed lint
VitoAlbano Dec 4, 2024
3fd3fba
[MIGRATION] - Fixed type
VitoAlbano Dec 6, 2024
b9dca36
[MIGRATION] - Rebased
VitoAlbano Dec 6, 2024
e501a36
[MIGRATION] - Readded removed action
VitoAlbano Dec 6, 2024
c4c3457
[MIGRATION] - Checking deps
VitoAlbano Dec 6, 2024
6488e47
[MIGRATION] - updated lock
VitoAlbano Dec 6, 2024
b611297
[ACS-9052] manage versions close button is too low (#10466)
AleksanderSklorz Dec 6, 2024
5df06e4
[MIGRATION] - fixed storybook builds
VitoAlbano Dec 6, 2024
addaa2c
[MIGRATION] - Checking if now eslint is releasable
VitoAlbano Dec 6, 2024
c9f0491
[MIGRATION] - Changing the building executor for eslint-rules
VitoAlbano Dec 6, 2024
8276fe0
Readded rule for peer deps
VitoAlbano Dec 10, 2024
bbb7eba
Fixed wrong rule
VitoAlbano Dec 10, 2024
38d66df
[ACS-9075] Fixed incorrect buttons labels color (#10489)
AleksanderSklorz Dec 12, 2024
e8ffabe
Update package.json
dominikiwanekhyland Dec 18, 2024
25d331a
Fix ACA pipeline
dominikiwanekhyland Dec 19, 2024
84c6bd4
[ACS-9084] Fixed incorrect color for notification bell icon (#10513)
swapnil-verma-gl Dec 31, 2024
692b8de
Change dialog label padding
dominikiwanekhyland Jan 7, 2025
444327a
[AAE-26767] - Fixed lint
VitoAlbano Jan 14, 2025
2b90756
[AAE-26767] - Fixed lint
VitoAlbano Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ scripts
docs/**/*.md
lib/js-api/docs/**/*.md
.storybook
webpack.config.js
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ jobs:
- uses: ./.github/actions/setup
- uses: ./.github/actions/download-node-modules-and-artifacts
- run: NX_REJECT_UNKNOWN_LOCAL_CACHE=0 npx nx affected:build $NX_CALCULATION_FLAGS --prod
- run: NX_REJECT_UNKNOWN_LOCAL_CACHE=0 npx nx affected --target=build-storybook $NX_CALCULATION_FLAGS --configuration=ci --parallel=1
- run: NX_REJECT_UNKNOWN_LOCAL_CACHE=0 npx nx affected --target=build-storybook $NX_CALCULATION_FLAGS --configuration=ci
- uses: ./.github/actions/upload-node-modules-and-artifacts

PR-forbidden-labels:
Expand Down
4 changes: 4 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// eslint-disable
const nxPreset = require('@nx/jest/preset').default;

module.exports = {...nxPreset };
2 changes: 1 addition & 1 deletion lib/cli/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["lib/cli/**/*.ts", "lib/cli/**/*.html"]
}
Expand Down
12 changes: 3 additions & 9 deletions lib/content-services/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["lib/content-services/**/*.ts", "lib/content-services/**/*.html"]
}
Expand All @@ -45,10 +45,7 @@
"browserTarget": "content-services:storybook",
"configDir": "lib/content-services/.storybook",
"compodoc": false,
"styles": [
"node_modules/cropperjs/dist/cropper.min.css",
"node_modules/pdfjs-dist/web/pdf_viewer.css"
],
"styles": ["node_modules/cropperjs/dist/cropper.min.css", "node_modules/pdfjs-dist/web/pdf_viewer.css"],
"stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"]
}
Expand All @@ -66,10 +63,7 @@
"configDir": "lib/content-services/.storybook",
"outputDir": "dist/storybook/content-services",
"compodoc": false,
"styles": [
"node_modules/cropperjs/dist/cropper.min.css",
"node_modules/pdfjs-dist/web/pdf_viewer.css"
],
"styles": ["node_modules/cropperjs/dist/cropper.min.css", "node_modules/pdfjs-dist/web/pdf_viewer.css"],
"stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,17 @@ import { AlfrescoApiService } from '../services/alfresco-api.service';

@Injectable()
export class AlfrescoApiNoAuthService extends AlfrescoApiService {
constructor(
storage: StorageService,
appConfig: AppConfigService,
private readonly adfHttpClient: AdfHttpClient
) {
constructor(storage: StorageService, appConfig: AppConfigService, private readonly adfHttpClient: AdfHttpClient) {
super(appConfig, storage);
}

override createInstance(config: AlfrescoApiConfig) {
return new AlfrescoApi({
...config,
oauthInit: false
}, this.adfHttpClient);
return new AlfrescoApi(
{
...config,
oauthInit: false
},
this.adfHttpClient
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { AlfrescoApiConfig } from '@alfresco/js-api';
import { Injectable } from '@angular/core';
import { AppConfigService, AppConfigValues, StorageService } from '@alfresco/adf-core';
import { AlfrescoApiService } from '../services/alfresco-api.service';
import { AlfrescoApiService } from '../services/alfresco-api.service';

/**
* Create a factory to resolve an api service instance
Expand All @@ -34,10 +34,11 @@ export function createAlfrescoApiInstance(angularAlfrescoApiService: AlfrescoApi
providedIn: 'root'
})
export class AlfrescoApiLoaderService {
constructor(private readonly appConfig: AppConfigService,
private readonly apiService: AlfrescoApiService,
private storageService: StorageService) {
}
constructor(
private readonly appConfig: AppConfigService,
private readonly apiService: AlfrescoApiService,
private storageService: StorageService
) {}

async init(): Promise<any> {
await this.appConfig.load();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import { Injectable } from '@angular/core';
import { AlfrescoApiService } from '../../services/alfresco-api.service';
import { AlfrescoApiService } from '../../services/alfresco-api.service';
import { AppConfigService } from '@alfresco/adf-core';
import { from, Observable, of, zip } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import { TagService } from '../../tag/services/tag.service';
providedIn: 'root'
})
export class NodeAspectService {

constructor(private nodesApiService: NodesApiService,
private dialogAspectListService: DialogAspectListService,
private cardViewContentUpdateService: CardViewContentUpdateService,
private tagService: TagService) {
}
constructor(
private nodesApiService: NodesApiService,
private dialogAspectListService: DialogAspectListService,
private cardViewContentUpdateService: CardViewContentUpdateService,
private tagService: TagService
) {}

updateNodeAspects(nodeId: string, selectorAutoFocusedOnClose?: string) {
this.dialogAspectListService.openAspectListDialog(nodeId, selectorAutoFocusedOnClose).subscribe((aspectList) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ describe('ContentAuthLoaderService', () => {
basicAlfrescoAuthService = TestBed.inject(BasicAlfrescoAuthService);
});


it('should require Alf ticket on login if OAuth and provider is ALL or ECM', fakeAsync(() => {
spyOn(authService, 'isOauth').and.returnValue(true);
spyOn(authService, 'isALLProvider').and.returnValue(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,15 @@ import { take } from 'rxjs/operators';

@Injectable()
export class ContentAuthLoaderService {

constructor(
private readonly basicAlfrescoAuthService: BasicAlfrescoAuthService,
private readonly authService: AuthenticationService
) {
}
constructor(private readonly basicAlfrescoAuthService: BasicAlfrescoAuthService, private readonly authService: AuthenticationService) {}

init(): void {
this.authService.onLogin
.pipe(take(1))
.subscribe({
next: async () => {
if (this.authService.isOauth() && (this.authService.isALLProvider() || this.authService.isECMProvider())) {
await this.basicAlfrescoAuthService.requireAlfTicket();
}
this.authService.onLogin.pipe(take(1)).subscribe({
next: async () => {
if (this.authService.isOauth() && (this.authService.isALLProvider() || this.authService.isECMProvider())) {
await this.basicAlfrescoAuthService.requireAlfTicket();
}
});
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ describe('Breadcrumb', () => {
});
let documentListComponent: DocumentListComponent;

const getBreadcrumbActionText = (): string =>
fixture.debugElement.nativeElement.querySelector('.adf-breadcrumb-item-current').textContent.trim();
const getBreadcrumbActionText = (): string => fixture.debugElement.nativeElement.querySelector('.adf-breadcrumb-item-current').textContent.trim();

beforeEach(() => {
TestBed.configureTestingModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
import { Injectable } from '@angular/core';
import {
CategoryEntry,
CategoryPaging, Pagination, PathInfo, ResultNode,
CategoryPaging,
Pagination,
PathInfo,
ResultNode,
ResultSetPaging,
ResultSetPagingList,
ResultSetRowEntry
Expand All @@ -27,7 +30,6 @@ import { Observable, of } from 'rxjs';

@Injectable({ providedIn: 'root' })
export class CategoryServiceMock {

public getSubcategories(parentNodeId: string, skipCount?: number, maxItems?: number): Observable<CategoryPaging> {
return parentNodeId ? of(this.getChildrenLevelResponse(skipCount, maxItems)) : of(this.getRootLevelResponse(skipCount, maxItems));
}
Expand Down Expand Up @@ -66,12 +68,12 @@ export class CategoryServiceMock {
}

private getRootLevelResponse(skipCount?: number, maxItems?: number): CategoryPaging {
const rootCategoryEntry: CategoryEntry = {entry: {id: 'testId', name: 'testNode', parentId: '-root-', hasChildren: true}};
return {list: {pagination: {skipCount, maxItems, hasMoreItems: false}, entries: [rootCategoryEntry]}};
const rootCategoryEntry: CategoryEntry = { entry: { id: 'testId', name: 'testNode', parentId: '-root-', hasChildren: true } };
return { list: { pagination: { skipCount, maxItems, hasMoreItems: false }, entries: [rootCategoryEntry] } };
}

private getChildrenLevelResponse(skipCount?: number, maxItems?: number): CategoryPaging {
const childCategoryEntry: CategoryEntry = {entry: {id: 'childId', name: 'childNode', parentId: 'testId', hasChildren: false}};
return {list: {pagination: {skipCount, maxItems, hasMoreItems: true}, entries: [childCategoryEntry]}};
const childCategoryEntry: CategoryEntry = { entry: { id: 'childId', name: 'childNode', parentId: 'testId', hasChildren: false } };
return { list: { pagination: { skipCount, maxItems, hasMoreItems: true }, entries: [childCategoryEntry] } };
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,59 +24,65 @@ import { from, Observable } from 'rxjs';
import { map, mergeMap, toArray } from 'rxjs/operators';

@Injectable({ providedIn: 'root' })
export class CategoryTreeDatasourceService extends TreeService<CategoryNode> {

export class CategoryTreeDatasourceService extends TreeService<CategoryNode> {
constructor(private categoryService: CategoryService) {
super();
}

public getSubNodes(parentNodeId: string, skipCount?: number, maxItems?: number, name?: string): Observable<TreeResponse<CategoryNode>> {
return !name ? this.categoryService.getSubcategories(parentNodeId, skipCount, maxItems).pipe(map((response: CategoryPaging) => {
const parentNode: CategoryNode = this.getParentNode(parentNodeId);
const nodesList: CategoryNode[] = response.list.entries.map((entry: CategoryEntry) => ({
id: entry.entry.id,
nodeName: entry.entry.name,
parentId: entry.entry.parentId,
hasChildren: entry.entry.hasChildren,
level: parentNode ? parentNode.level + 1 : 0,
isLoading: false,
nodeType: TreeNodeType.RegularNode
}));
if (response.list.pagination.hasMoreItems && parentNode) {
const loadMoreNode: CategoryNode = {
id: 'loadMore',
nodeName: '',
parentId: parentNode.id,
hasChildren: false,
level: parentNode.level + 1,
isLoading: false,
nodeType: TreeNodeType.LoadMoreNode
};
nodesList.push(loadMoreNode);
}
const treeResponse: TreeResponse<CategoryNode> = {entries: nodesList, pagination: response.list.pagination};
return treeResponse;
})) : this.categoryService.searchCategories(name, skipCount, maxItems).pipe(mergeMap((pagingResult) => {
const nextAfterGeneralPathPartIndex = 3;
const pathSeparator = '/';
return from(pagingResult.list.entries).pipe(mergeMap((category) => {
const path = category.entry.path.name.split(pathSeparator).slice(nextAfterGeneralPathPartIndex)
.join(pathSeparator);
return !name
? this.categoryService.getSubcategories(parentNodeId, skipCount, maxItems).pipe(
map((response: CategoryPaging) => {
const parentNode: CategoryNode = this.getParentNode(parentNodeId);
const nodesList: CategoryNode[] = response.list.entries.map((entry: CategoryEntry) => ({
id: entry.entry.id,
nodeName: entry.entry.name,
parentId: entry.entry.parentId,
hasChildren: entry.entry.hasChildren,
level: parentNode ? parentNode.level + 1 : 0,
isLoading: false,
nodeType: TreeNodeType.RegularNode
}));
if (response.list.pagination.hasMoreItems && parentNode) {
const loadMoreNode: CategoryNode = {
id: 'loadMore',
nodeName: '',
parentId: parentNode.id,
hasChildren: false,
level: parentNode.level + 1,
isLoading: false,
nodeType: TreeNodeType.LoadMoreNode
};
nodesList.push(loadMoreNode);
}
const treeResponse: TreeResponse<CategoryNode> = { entries: nodesList, pagination: response.list.pagination };
return treeResponse;
})
)
: this.categoryService.searchCategories(name, skipCount, maxItems).pipe(
mergeMap((pagingResult) => {
const nextAfterGeneralPathPartIndex = 3;
const pathSeparator = '/';
return from(pagingResult.list.entries).pipe(
mergeMap((category) => {
const path = category.entry.path.name.split(pathSeparator).slice(nextAfterGeneralPathPartIndex).join(pathSeparator);

return this.categoryService.getCategory(category.entry.id).pipe(
map((res) => ({
id: category.entry.id,
nodeName: path ? `${path}/${category.entry.name}` : category.entry.name,
parentId: category.entry.parentId,
level: 0,
nodeType: TreeNodeType.RegularNode,
hasChildren: res.entry.hasChildren,
isLoading: false
}))
);
}),
toArray(),
map(res => ({entries: res, pagination: pagingResult.list.pagination})));
}));
return this.categoryService.getCategory(category.entry.id).pipe(
map((res) => ({
id: category.entry.id,
nodeName: path ? `${path}/${category.entry.name}` : category.entry.name,
parentId: category.entry.parentId,
level: 0,
nodeType: TreeNodeType.RegularNode,
hasChildren: res.entry.hasChildren,
isLoading: false
}))
);
}),
toArray(),
map((res) => ({ entries: res, pagination: pagingResult.list.pagination }))
);
})
);
}
}
12 changes: 2 additions & 10 deletions lib/content-services/src/lib/common/events/file.event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,27 @@
import { FileModel, FileUploadStatus } from '../models/file.model';

export class FileUploadEvent {

constructor(
public readonly file: FileModel,
public readonly status: FileUploadStatus = FileUploadStatus.Pending,
public readonly error: any = null) {
}

public readonly error: any = null
) {}
}

export class FileUploadCompleteEvent extends FileUploadEvent {

constructor(file: FileModel, public totalComplete: number = 0, public data?: any, public totalAborted: number = 0) {
super(file, FileUploadStatus.Complete);
}

}

export class FileUploadDeleteEvent extends FileUploadEvent {

constructor(file: FileModel, public totalComplete: number = 0) {
super(file, FileUploadStatus.Deleted);
}

}

export class FileUploadErrorEvent extends FileUploadEvent {

constructor(file: FileModel, public error: any, public totalError: number = 0) {
super(file, FileUploadStatus.Error);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
import { FileModel } from './file.model';

describe('FileModel', () => {

describe('extension', () => {

it('should return the extension if file has it', () => {
const file = new FileModel({ name: 'tyrion-lannister.doc' } as File);

Expand All @@ -33,7 +31,7 @@ describe('FileModel', () => {
expect(file.extension).toBe('');
});

it('should return the empty string if file is starting with . and doesn\'t have extension', () => {
it("should return the empty string if file is starting with . and doesn't have extension", () => {
const file = new FileModel({ name: '.white-walkers' } as File);

expect(file.extension).toBe('');
Expand Down
Loading
Loading