mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Angular 19 migration (#10795)
This commit is contained in:
committed by
GitHub
parent
c7f28d54d6
commit
951b22e098
@@ -32,7 +32,6 @@
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/no-host-metadata-property": "off",
|
||||
"@angular-eslint/no-input-prefix": "error",
|
||||
"@typescript-eslint/consistent-type-definitions": "error",
|
||||
"@typescript-eslint/dot-notation": "off",
|
||||
@@ -63,7 +62,8 @@
|
||||
"rxjs/no-subject-unsubscribe": "error",
|
||||
"rxjs/no-subject-value": "error",
|
||||
"rxjs/no-unsafe-takeuntil": "error",
|
||||
"unicorn/filename-case": "error"
|
||||
"unicorn/filename-case": "error",
|
||||
"@angular-eslint/prefer-standalone": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@@ -32,7 +32,6 @@ import { ExtensionService } from '../../services/extension.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-dynamic-column',
|
||||
standalone: true,
|
||||
template: `<ng-container #content />`,
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
|
@@ -22,12 +22,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { DynamicExtensionComponent } from './dynamic.component';
|
||||
import { ComponentRegisterService } from '../../services/component-register.service';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { MatMenuItem } from '@angular/material/menu';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
@Component({
|
||||
selector: 'test-component',
|
||||
standalone: true,
|
||||
template: '<div data-automation-id="found-me">Hey I am the mighty test component!</div>'
|
||||
})
|
||||
export class TestComponent implements OnChanges {
|
||||
@@ -52,7 +50,6 @@ describe('DynamicExtensionComponent', () => {
|
||||
imports: [HttpClientModule, DynamicExtensionComponent, TestComponent],
|
||||
providers: [{ provide: ComponentRegisterService, useValue: componentRegister }]
|
||||
});
|
||||
|
||||
TestBed.compileComponents();
|
||||
});
|
||||
|
||||
@@ -94,9 +91,10 @@ describe('DynamicExtensionComponent', () => {
|
||||
});
|
||||
|
||||
it('should assign menuItem from dynamically generated component in ngAfterViewInit', () => {
|
||||
getInnerElement().componentInstance.menuItem = new MatMenuItem(null, null, null, null, null);
|
||||
const testData = 'matMenuTestData';
|
||||
getInnerElement().componentInstance.menuItem = testData;
|
||||
component.ngAfterViewInit();
|
||||
expect(component.menuItem).toBeInstanceOf(MatMenuItem);
|
||||
expect(component.menuItem).toEqual(testData);
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -23,7 +23,6 @@ import { MatMenuItem } from '@angular/material/menu';
|
||||
// cSpell:words lifecycle
|
||||
@Component({
|
||||
selector: 'adf-dynamic-component',
|
||||
standalone: true,
|
||||
template: `<div #content></div>`
|
||||
})
|
||||
export class DynamicExtensionComponent implements OnChanges, OnDestroy, AfterViewInit {
|
||||
|
@@ -21,7 +21,6 @@ import { ExtensionService } from '../../services/extension.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-dynamic-tab',
|
||||
standalone: true,
|
||||
template: `<div #content></div>`
|
||||
})
|
||||
export class DynamicTabComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
@@ -34,7 +34,6 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-preview-extension',
|
||||
standalone: true,
|
||||
template: `<div #content></div>`
|
||||
})
|
||||
export class PreviewExtensionComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
@@ -19,7 +19,7 @@ import { DynamicExtensionComponent } from './components/dynamic-component/dynami
|
||||
import { DynamicTabComponent } from './components/dynamic-tab/dynamic-tab.component';
|
||||
import { DynamicColumnComponent } from './components/dynamic-column/dynamic-column.component';
|
||||
import { PreviewExtensionComponent } from './components/viewer/preview-extension.component';
|
||||
import { NgModule, ModuleWithProviders, APP_INITIALIZER } from '@angular/core';
|
||||
import { NgModule, ModuleWithProviders, inject, provideAppInitializer } from '@angular/core';
|
||||
import { AppExtensionService } from './services/app-extension.service';
|
||||
import { setupExtensions } from './services/startup-extension-factory';
|
||||
|
||||
@@ -35,12 +35,10 @@ export class ExtensionsModule {
|
||||
return {
|
||||
ngModule: ExtensionsModule,
|
||||
providers: [
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: setupExtensions,
|
||||
deps: [AppExtensionService],
|
||||
multi: true
|
||||
}
|
||||
provideAppInitializer(() => {
|
||||
const initializerFn = setupExtensions(inject(AppExtensionService));
|
||||
return initializerFn();
|
||||
})
|
||||
]
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user