mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
[MIGRATION] - Build fix and lint skipped rule
This commit is contained in:
@@ -9,3 +9,5 @@ scripts
|
||||
/angular.json
|
||||
docs/**/*.md
|
||||
lib/js-api/docs/**/*.md
|
||||
webpack.config.js
|
||||
.storybook
|
||||
|
@@ -44,6 +44,7 @@ module.exports = {
|
||||
rules: {
|
||||
// Uncomment this to enable prettier checks as part of the ESLint
|
||||
// 'prettier/prettier': 'error',
|
||||
|
||||
'ban/ban': [
|
||||
'error',
|
||||
{ name: 'eval', message: 'Calls to eval is not allowed.' },
|
||||
@@ -74,6 +75,7 @@ module.exports = {
|
||||
'@angular-eslint/no-input-prefix': 'error',
|
||||
'@typescript-eslint/consistent-type-definitions': 'error',
|
||||
'@typescript-eslint/dot-notation': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': [
|
||||
'off',
|
||||
{
|
||||
|
@@ -2,4 +2,4 @@ export const parameters = {
|
||||
docs: { inlineStories: true },
|
||||
controls: { expanded: true }
|
||||
};
|
||||
export const tags = ['autodocs'];
|
||||
export const tags = ['autodocs', 'autodocs', 'autodocs'];
|
||||
|
@@ -173,26 +173,26 @@
|
||||
"serve": {
|
||||
"executor": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "demoshell:build",
|
||||
"host": "0.0.0.0",
|
||||
"port": 3000,
|
||||
"proxyConfig": "demo-shell/proxy.conf.js",
|
||||
"disableHostCheck": true
|
||||
"disableHostCheck": true,
|
||||
"buildTarget": "demoshell:build"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "demoshell:build:production"
|
||||
"buildTarget": "demoshell:build:production"
|
||||
},
|
||||
"canary": {
|
||||
"browserTarget": "demoshell:build:canary"
|
||||
"buildTarget": "demoshell:build:canary"
|
||||
},
|
||||
"e2e": {
|
||||
"browserTarget": "demoshell:build:e2e"
|
||||
"buildTarget": "demoshell:build:e2e"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/eslint:lint",
|
||||
"options": {
|
||||
"lintFilePatterns": ["demo-shell/**/*.ts", "demo-shell/**/*.html"]
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { NgChartsModule } from 'ng2-charts';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AppConfigService, DebugAppConfigService, CoreModule, AuthModule, provideTranslations } from '@alfresco/adf-core';
|
||||
@@ -34,12 +34,13 @@ import { RouterModule } from '@angular/router';
|
||||
import { CoreAutomationService } from '../testing/automation.service';
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent],
|
||||
bootstrap: [AppComponent],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,
|
||||
RouterModule.forRoot(appRoutes, { useHash: true }),
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
HttpClientModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
ContentModule.forRoot(),
|
||||
@@ -49,13 +50,12 @@ import { CoreAutomationService } from '../testing/automation.service';
|
||||
NgChartsModule,
|
||||
MonacoEditorModule.forRoot()
|
||||
],
|
||||
declarations: [AppComponent],
|
||||
providers: [
|
||||
{ provide: AppConfigService, useClass: DebugAppConfigService }, // not use this service in production
|
||||
provideTranslations('app', 'resources'),
|
||||
provideTranslations('adf-insights', 'assets/adf-insights')
|
||||
],
|
||||
bootstrap: [AppComponent]
|
||||
provideTranslations('adf-insights', 'assets/adf-insights'),
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
]
|
||||
})
|
||||
export class AppModule {
|
||||
constructor(automationService: CoreAutomationService) {
|
||||
|
@@ -64,7 +64,7 @@
|
||||
<br>
|
||||
<div *ngIf="selectedContextAction">
|
||||
<span>Process Instance ID: {{ selectedContextAction.id }}</span><br>
|
||||
<span>Action Type}: {{ selectedContextAction.actionType }}</span>
|
||||
<span>Action Type: {{ selectedContextAction.actionType }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -4,10 +4,10 @@
|
||||
@include mat.all-component-typographies;
|
||||
@include mat.core;
|
||||
|
||||
$primary: mat.define-palette($alfresco-accent-orange);
|
||||
$accent: mat.define-palette($alfresco-accent-purple);
|
||||
$warn: mat.define-palette($alfresco-warn);
|
||||
$theme: mat.define-light-theme(
|
||||
$primary: mat.m2-define-palette($alfresco-accent-orange);
|
||||
$accent: mat.m2-define-palette($alfresco-accent-purple);
|
||||
$warn: mat.m2-define-palette($alfresco-warn);
|
||||
$theme: mat.m2-define-light-theme(
|
||||
(
|
||||
color: (
|
||||
primary: $primary,
|
||||
|
@@ -3,14 +3,14 @@
|
||||
@include mat.all-component-typographies($alfresco-typography);
|
||||
@include mat.core;
|
||||
|
||||
$primary: mat.define-palette($alfresco-accent-orange);
|
||||
$accent: mat.define-palette($alfresco-accent-purple);
|
||||
$warn: mat.define-palette($alfresco-warn);
|
||||
$theme: mat.define-light-theme(
|
||||
$primary: mat.m2-define-palette($alfresco-accent-orange);
|
||||
$accent: mat.m2-define-palette($alfresco-accent-purple);
|
||||
$warn: mat.m2-define-palette($alfresco-warn);
|
||||
$theme: mat.m2-define-light-theme(
|
||||
(
|
||||
color: (
|
||||
primary: $primary,
|
||||
accent: $accent,
|
||||
accent: $accent
|
||||
)
|
||||
)
|
||||
);
|
||||
|
@@ -50,7 +50,7 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/eslint:lint:eslint",
|
||||
"options": {
|
||||
"lintFilePatterns": ["lib/cli/**/*.ts", "lib/cli/**/*.html"]
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
export const parameters = {
|
||||
docs: { inlineStories: true },
|
||||
controls: { expanded: true }
|
||||
docs: { inlineStories: true },
|
||||
controls: { expanded: true }
|
||||
};
|
||||
export const tags = ["autodocs"];
|
||||
export const tags = ['autodocs', 'autodocs'];
|
||||
|
@@ -33,7 +33,7 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/eslint:lint:eslint",
|
||||
"options": {
|
||||
"lintFilePatterns": ["lib/content-services/**/*.ts", "lib/content-services/**/*.html"]
|
||||
}
|
||||
|
@@ -27,7 +27,8 @@ import { AspectEntry, Node } from '@alfresco/js-api';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { AspectListComponent } from './aspect-list.component';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
const aspectListMock: AspectEntry[] = [
|
||||
{
|
||||
@@ -114,7 +115,7 @@ describe('AspectListDialogComponent', () => {
|
||||
excludedAspects: []
|
||||
};
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, ContentTestingModule, MatDialogModule],
|
||||
imports: [ContentTestingModule, MatDialogModule],
|
||||
providers: [
|
||||
{ provide: MAT_DIALOG_DATA, useValue: data },
|
||||
{
|
||||
@@ -124,7 +125,9 @@ describe('AspectListDialogComponent', () => {
|
||||
backdropClick: () => of(null),
|
||||
close: jasmine.createSpy('close')
|
||||
}
|
||||
}
|
||||
},
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
}).compileComponents();
|
||||
fixture = TestBed.createComponent(AspectListDialogComponent);
|
||||
|
@@ -19,7 +19,8 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { AspectListService } from './aspect-list.service';
|
||||
import { AspectPaging, AspectsApi, AspectEntry } from '@alfresco/js-api';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
const stdAspect1: AspectEntry = { entry: { id: 'std:standardAspectOne', description: 'Standard Aspect One', title: 'StandardAspectOne' } };
|
||||
const stdAspect2: AspectEntry = { entry: { id: 'std:standardAspectTwo', description: 'Standard Aspect Two', title: 'StandardAspectTwo' } };
|
||||
@@ -38,7 +39,8 @@ describe('AspectListService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule]
|
||||
imports: [],
|
||||
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
|
||||
aspectListService = TestBed.inject(AspectListService);
|
||||
|
@@ -20,7 +20,8 @@ import { ContentService } from './content.service';
|
||||
import { AppConfigService, AuthenticationService, RedirectAuthService, StorageService } from '@alfresco/adf-core';
|
||||
import { Node, PermissionsInfo } from '@alfresco/js-api';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('ContentService', () => {
|
||||
let contentService: ContentService;
|
||||
@@ -29,8 +30,14 @@ describe('ContentService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [ContentService, AuthenticationService, { provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }]
|
||||
imports: [],
|
||||
providers: [
|
||||
ContentService,
|
||||
AuthenticationService,
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
authService = TestBed.inject(AuthenticationService);
|
||||
contentService = TestBed.inject(ContentService);
|
||||
|
@@ -20,8 +20,9 @@ import { AlfrescoApiService, AlfrescoApiServiceMock, RedirectAuthService } from
|
||||
import { PeopleContentQueryRequestModel, PeopleContentService } from './people-content.service';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { PersonPaging } from '@alfresco/js-api';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
export const fakeEcmUser2 = {
|
||||
id: 'another-fake-id',
|
||||
@@ -68,11 +69,13 @@ describe('PeopleContentService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
imports: [],
|
||||
providers: [
|
||||
PeopleContentService,
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -23,7 +23,8 @@ import { RepositoryInfo } from '@alfresco/js-api';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { DiscoveryApiService } from '../../common/services/discovery-api.service';
|
||||
import { FileModel, FileUploadStatus } from '../../common/models/file.model';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -36,7 +37,7 @@ describe('UploadService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppConfigModule, HttpClientTestingModule],
|
||||
imports: [AppConfigModule],
|
||||
providers: [
|
||||
UploadService,
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
@@ -46,7 +47,9 @@ describe('UploadService', () => {
|
||||
useValue: {
|
||||
ecmProductInfo$: mockProductInfo
|
||||
}
|
||||
}
|
||||
},
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
|
@@ -22,25 +22,24 @@ import { AspectOrientedConfigService } from './aspect-oriented-config.service';
|
||||
import { LayoutOrientedConfigService } from './layout-oriented-config.service';
|
||||
import { ContentMetadataConfigFactory } from './content-metadata-config.factory';
|
||||
import { ContentMetadataConfig } from '../../interfaces/content-metadata.interfaces';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('ContentMetadataConfigFactory', () => {
|
||||
|
||||
let factory: ContentMetadataConfigFactory;
|
||||
let appConfig: AppConfigService;
|
||||
let config: ContentMetadataConfig;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
HttpClientModule
|
||||
],
|
||||
imports: [],
|
||||
providers: [
|
||||
{
|
||||
provide: LogService, useValue: {
|
||||
provide: LogService,
|
||||
useValue: {
|
||||
error: () => {}
|
||||
}
|
||||
}
|
||||
},
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
]
|
||||
});
|
||||
factory = TestBed.inject(ContentMetadataConfigFactory);
|
||||
@@ -48,7 +47,6 @@ describe('ContentMetadataConfigFactory', () => {
|
||||
});
|
||||
|
||||
describe('get', () => {
|
||||
|
||||
let logService: LogService;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -57,7 +55,6 @@ describe('ContentMetadataConfigFactory', () => {
|
||||
});
|
||||
|
||||
describe('get', () => {
|
||||
|
||||
it('should get back to default preset if no preset is provided as parameter', () => {
|
||||
config = factory.get();
|
||||
|
||||
@@ -85,7 +82,6 @@ describe('ContentMetadataConfigFactory', () => {
|
||||
});
|
||||
|
||||
describe('set', () => {
|
||||
|
||||
const setConfig = (presetName: string, presetConfig: any) => {
|
||||
appConfig.config['content-metadata'] = {
|
||||
presets: {
|
||||
@@ -118,5 +114,5 @@ describe('ContentMetadataConfigFactory', () => {
|
||||
expect(config).toEqual(jasmine.any(LayoutOrientedConfigService));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -22,7 +22,8 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { NodeAllowableOperationSubject } from '../interfaces/node-allowable-operation-subject.interface';
|
||||
import { RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-text-subject',
|
||||
@@ -37,8 +38,12 @@ describe('CheckAllowableOperationDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }]
|
||||
imports: [],
|
||||
providers: [
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
changeDetectorMock = { detectChanges: () => {} } as ChangeDetectorRef;
|
||||
});
|
||||
|
@@ -19,7 +19,8 @@ import { Component, ViewChild } from '@angular/core';
|
||||
import { LibraryFavoriteDirective } from './library-favorite.directive';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { LibraryEntity } from '../interfaces/library-entity.interface';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
@@ -41,7 +42,8 @@ describe('LibraryFavoriteDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, TestComponent, LibraryFavoriteDirective]
|
||||
imports: [TestComponent, LibraryFavoriteDirective],
|
||||
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -21,7 +21,8 @@ import { SimpleChange } from '@angular/core';
|
||||
import { of, throwError, Subject } from 'rxjs';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-core';
|
||||
import { SitesService } from '../common/services/sites.service';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('LibraryMembershipDirective', () => {
|
||||
let alfrescoApiService: AlfrescoApiService;
|
||||
@@ -37,8 +38,13 @@ describe('LibraryMembershipDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [SitesService, { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
|
||||
imports: [],
|
||||
providers: [
|
||||
SitesService,
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
|
||||
testSiteEntry = {
|
||||
|
@@ -21,8 +21,9 @@ import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { Component, DebugElement, ViewChild } from '@angular/core';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-core';
|
||||
import { NodeDownloadDirective } from './node-download.directive';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { ContentApi } from '@alfresco/js-api';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
@@ -56,8 +57,12 @@ describe('NodeDownloadDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, MatDialogModule, TestComponent],
|
||||
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
|
||||
imports: [MatDialogModule, TestComponent],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -19,7 +19,8 @@ import { SimpleChange } from '@angular/core';
|
||||
import { fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { NodeFavoriteDirective } from './node-favorite.directive';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock, AppConfigService, AppConfigServiceMock } from '@alfresco/adf-core';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('NodeFavoriteDirective', () => {
|
||||
let directive: NodeFavoriteDirective;
|
||||
@@ -27,10 +28,12 @@ describe('NodeFavoriteDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
imports: [],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock }
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
alfrescoApiService = TestBed.inject(AlfrescoApiService);
|
||||
|
@@ -20,8 +20,9 @@ import { LockService } from './lock.service';
|
||||
import { AuthenticationService, RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { addDays, subDays } from 'date-fns';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('LockService', () => {
|
||||
let service: LockService;
|
||||
@@ -33,8 +34,12 @@ describe('LockService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }]
|
||||
imports: [],
|
||||
providers: [
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(LockService);
|
||||
authenticationService = TestBed.inject(AuthenticationService);
|
||||
|
@@ -19,8 +19,9 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock, CommentModel, RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { fakeContentComment, fakeContentComments } from '../mocks/node-comments.mock';
|
||||
import { NodeCommentsService } from './node-comments.service';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -29,10 +30,12 @@ describe('NodeCommentsService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
imports: [],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(NodeCommentsService);
|
||||
|
@@ -19,15 +19,16 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { mockError, fakeSearch } from '../mocks/search.service.mock';
|
||||
import { SearchService } from './search.service';
|
||||
import { NodePaging } from '@alfresco/js-api';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('SearchService', () => {
|
||||
let service: SearchService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [SearchService]
|
||||
imports: [],
|
||||
providers: [SearchService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
service = TestBed.inject(SearchService);
|
||||
});
|
||||
|
@@ -23,8 +23,9 @@ import { VersionCompatibilityService } from './version-compatibility.service';
|
||||
import { VersionInfo } from '@alfresco/js-api';
|
||||
import { RedirectAuthService } from '@alfresco/adf-core';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { VersionCompatibilityDirective } from '@alfresco/adf-content-services';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
@@ -51,9 +52,13 @@ describe('VersionCompatibilityDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [VersionCompatibilityDirective, HttpClientTestingModule],
|
||||
declarations: [TestComponent],
|
||||
providers: [{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }]
|
||||
imports: [VersionCompatibilityDirective],
|
||||
providers: [
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
versionCompatibilityService = TestBed.inject(VersionCompatibilityService);
|
||||
|
@@ -15,6 +15,7 @@
|
||||
"@typescript-eslint/consistent-type-assertions": "warn",
|
||||
"@typescript-eslint/prefer-for-of": "off",
|
||||
"@typescript-eslint/member-ordering": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"no-underscore-dangle": [
|
||||
"error",
|
||||
{
|
||||
|
@@ -3,4 +3,4 @@ const rootPreview = require('../../../.storybook/preview');
|
||||
export const parameters = {
|
||||
...rootPreview.preview
|
||||
};
|
||||
export const tags = ['autodocs'];
|
||||
export const tags = ['autodocs', 'autodocs'];
|
||||
|
@@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
import { Emitters, RequestOptions, ResultListDataRepresentationTaskRepresentation, SecurityOptions } from '@alfresco/js-api';
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
|
||||
import { HttpParams, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AdfHttpClient } from './adf-http-client.service';
|
||||
import { AlfrescoApiResponseError } from './alfresco-api/alfresco-api.response-error';
|
||||
@@ -58,8 +58,8 @@ describe('AdfHttpClient', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [AdfHttpClient]
|
||||
imports: [],
|
||||
providers: [AdfHttpClient, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
angularHttpClient = TestBed.inject(AdfHttpClient);
|
||||
controller = TestBed.inject(HttpTestingController);
|
||||
|
@@ -17,15 +17,7 @@
|
||||
|
||||
import { SHOULD_ADD_AUTH_TOKEN } from '@alfresco/adf-core/auth';
|
||||
import { Emitters as JsApiEmitters, HttpClient as JsApiHttpClient } from '@alfresco/js-api';
|
||||
import {
|
||||
HttpClient,
|
||||
HttpContext,
|
||||
HttpErrorResponse,
|
||||
HttpEvent,
|
||||
HttpHeaders,
|
||||
HttpParams,
|
||||
HttpResponse
|
||||
} from '@angular/common/http';
|
||||
import { HttpClient, HttpContext, HttpErrorResponse, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, of, Subject, throwError } from 'rxjs';
|
||||
import { catchError, map, takeUntil } from 'rxjs/operators';
|
||||
@@ -52,8 +44,7 @@ export interface Emitters {
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
|
||||
|
||||
export class AdfHttpClient implements ee.Emitter, JsApiHttpClient {
|
||||
on: ee.EmitterMethod;
|
||||
off: ee.EmitterMethod;
|
||||
once: ee.EmitterMethod;
|
||||
@@ -107,47 +98,43 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
|
||||
const params = getQueryParamsWithCustomEncoder(options.queryParams, new AlfrescoApiParamEncoder());
|
||||
const responseType = AdfHttpClient.getResponseType(options);
|
||||
const context = new HttpContext().set(SHOULD_ADD_AUTH_TOKEN, true);
|
||||
const security: SecurityOptions = {...this.defaultSecurityOptions, ...sc};
|
||||
const security: SecurityOptions = { ...this.defaultSecurityOptions, ...sc };
|
||||
const headers = this.getHeaders(options);
|
||||
if (!emitters) {
|
||||
emitters = this.getEventEmitters();
|
||||
}
|
||||
|
||||
const request = this.httpClient.request(
|
||||
options.httpMethod,
|
||||
url,
|
||||
{
|
||||
context,
|
||||
...(body && {body}),
|
||||
...(responseType && {responseType}),
|
||||
...security,
|
||||
...(params && {params}),
|
||||
headers,
|
||||
observe: 'events',
|
||||
reportProgress: true
|
||||
}
|
||||
);
|
||||
const request = this.httpClient.request(options.httpMethod, url, {
|
||||
context,
|
||||
...(body && { body }),
|
||||
...(responseType && { responseType }),
|
||||
...security,
|
||||
...(params && { params }),
|
||||
headers,
|
||||
observe: 'events',
|
||||
reportProgress: true
|
||||
});
|
||||
|
||||
return this.requestWithLegacyEventEmitters<T>(request, emitters, options.returnType);
|
||||
}
|
||||
|
||||
post<T = any>(url: string, options?: RequestOptions, sc?: SecurityOptions, emitters?: JsApiEmitters): Promise<T> {
|
||||
return this.request<T>(url, {...options, httpMethod: 'POST'}, sc, emitters);
|
||||
return this.request<T>(url, { ...options, httpMethod: 'POST' }, sc, emitters);
|
||||
}
|
||||
|
||||
put<T = any>(url: string, options?: RequestOptions, sc?: SecurityOptions, emitters?: JsApiEmitters): Promise<T> {
|
||||
return this.request<T>(url, {...options, httpMethod: 'PUT'}, sc, emitters);
|
||||
return this.request<T>(url, { ...options, httpMethod: 'PUT' }, sc, emitters);
|
||||
}
|
||||
|
||||
get<T = any>(url: string, options?: RequestOptions, sc?: SecurityOptions, emitters?: JsApiEmitters): Promise<T> {
|
||||
return this.request<T>(url, {...options, httpMethod: 'GET'}, sc, emitters);
|
||||
return this.request<T>(url, { ...options, httpMethod: 'GET' }, sc, emitters);
|
||||
}
|
||||
|
||||
delete<T = void>(url: string, options?: RequestOptions, sc?: SecurityOptions, emitters?: JsApiEmitters): Promise<T> {
|
||||
return this.request<T>(url, {...options, httpMethod: 'DELETE'}, sc, emitters);
|
||||
return this.request<T>(url, { ...options, httpMethod: 'DELETE' }, sc, emitters);
|
||||
}
|
||||
|
||||
private addPromiseListeners<T = any>(promise: Promise<T>, eventEmitter: any) {
|
||||
private addPromiseListeners<T = any>(promise: Promise<T>, eventEmitter: any) {
|
||||
const eventPromise = Object.assign(promise, {
|
||||
on() {
|
||||
// eslint-disable-next-line prefer-spread, prefer-rest-params
|
||||
@@ -189,58 +176,59 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
|
||||
}
|
||||
|
||||
private requestWithLegacyEventEmitters<T = any>(request$: Observable<HttpEvent<T>>, emitters: JsApiEmitters, returnType: any): Promise<T> {
|
||||
|
||||
const abort$ = new Subject<void>();
|
||||
const {eventEmitter, apiClientEmitter} = emitters;
|
||||
const { eventEmitter, apiClientEmitter } = emitters;
|
||||
|
||||
const promise = request$.pipe(
|
||||
map((res) => {
|
||||
if (isHttpUploadProgressEvent(res)) {
|
||||
const percent = Math.round((res.loaded / res.total) * 100);
|
||||
eventEmitter.emit('progress', {loaded: res.loaded, total: res.total, percent});
|
||||
}
|
||||
const promise = request$
|
||||
.pipe(
|
||||
map((res) => {
|
||||
if (isHttpUploadProgressEvent(res)) {
|
||||
const percent = Math.round((res.loaded / res.total) * 100);
|
||||
eventEmitter.emit('progress', { loaded: res.loaded, total: res.total, percent });
|
||||
}
|
||||
|
||||
if (isHttpResponseEvent(res)) {
|
||||
eventEmitter.emit('success', res.body);
|
||||
return AdfHttpClient.deserialize(res, returnType);
|
||||
}
|
||||
}),
|
||||
catchError((err: HttpErrorResponse): Observable<AlfrescoApiResponseError> => {
|
||||
if (isHttpResponseEvent(res)) {
|
||||
eventEmitter.emit('success', res.body);
|
||||
return AdfHttpClient.deserialize(res, returnType);
|
||||
}
|
||||
}),
|
||||
catchError((err: HttpErrorResponse): Observable<AlfrescoApiResponseError> => {
|
||||
// since we can't always determinate ahead of time if the response is going to be xml or plain text response
|
||||
// we need to handle false positive cases here.
|
||||
|
||||
// since we can't always determinate ahead of time if the response is going to be xml or plain text response
|
||||
// we need to handle false positive cases here.
|
||||
if (err.status === 200) {
|
||||
eventEmitter.emit('success', err.error.text);
|
||||
return of(err.error.text);
|
||||
}
|
||||
|
||||
if (err.status === 200) {
|
||||
eventEmitter.emit('success', err.error.text);
|
||||
return of(err.error.text);
|
||||
}
|
||||
eventEmitter.emit('error', err);
|
||||
apiClientEmitter.emit('error', { ...err, response: { req: err } });
|
||||
|
||||
eventEmitter.emit('error', err);
|
||||
apiClientEmitter.emit('error', { ...err, response: { req: err } });
|
||||
if (err.status === 401) {
|
||||
eventEmitter.emit('unauthorized');
|
||||
apiClientEmitter.emit('unauthorized');
|
||||
}
|
||||
|
||||
if (err.status === 401) {
|
||||
eventEmitter.emit('unauthorized');
|
||||
apiClientEmitter.emit('unauthorized');
|
||||
}
|
||||
// for backwards compatibility we need to convert it to error class as the HttpErrorResponse only implements Error interface, not extending it,
|
||||
// and we need to be able to correctly pass instanceof Error conditions used inside repository
|
||||
// we also need to pass error as Stringify string as we are detecting statusCodes using JSON.parse(error.message) in some places
|
||||
const msg = typeof err.error === 'string' ? err.error : JSON.stringify(err.error);
|
||||
|
||||
// for backwards compatibility we need to convert it to error class as the HttpErrorResponse only implements Error interface, not extending it,
|
||||
// and we need to be able to correctly pass instanceof Error conditions used inside repository
|
||||
// we also need to pass error as Stringify string as we are detecting statusCodes using JSON.parse(error.message) in some places
|
||||
const msg = typeof err.error === 'string' ? err.error : JSON.stringify(err.error);
|
||||
// for backwards compatibility to handle cases in code where we try read response.error.response.body;
|
||||
|
||||
// for backwards compatibility to handle cases in code where we try read response.error.response.body;
|
||||
const error = {
|
||||
...err,
|
||||
body: err.error
|
||||
};
|
||||
|
||||
const error = {
|
||||
...err, body: err.error
|
||||
};
|
||||
const alfrescoApiError = new AlfrescoApiResponseError(msg, err.status, error);
|
||||
return throwError(alfrescoApiError);
|
||||
}),
|
||||
takeUntil(abort$)
|
||||
)
|
||||
.toPromise();
|
||||
|
||||
const alfrescoApiError = new AlfrescoApiResponseError(msg, err.status, error);
|
||||
return throwError(alfrescoApiError);
|
||||
}),
|
||||
takeUntil(abort$)
|
||||
).toPromise();
|
||||
|
||||
(promise as any).abort = function() {
|
||||
(promise as any).abort = function () {
|
||||
eventEmitter.emit('abort');
|
||||
abort$.next();
|
||||
abort$.complete();
|
||||
@@ -261,7 +249,7 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
|
||||
}
|
||||
|
||||
if (isFormUrlEncoded) {
|
||||
return new HttpParams({fromObject: removeNilValues(options.formParams)});
|
||||
return new HttpParams({ fromObject: removeNilValues(options.formParams) });
|
||||
}
|
||||
|
||||
return body;
|
||||
@@ -273,8 +261,8 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
|
||||
|
||||
const optionsHeaders = {
|
||||
...options.headerParams,
|
||||
...(accept && {Accept: accept}),
|
||||
...((contentType) && {'Content-Type': contentType})
|
||||
...(accept && { Accept: accept }),
|
||||
...(contentType && { 'Content-Type': contentType })
|
||||
};
|
||||
|
||||
if (!this.disableCsrf) {
|
||||
@@ -319,7 +307,6 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
|
||||
return Boolean(contentType?.match(/^application\/json(;.*)?$/i));
|
||||
}
|
||||
|
||||
|
||||
private setCsrfToken(optionsHeaders: any) {
|
||||
const token = this.createCSRFToken();
|
||||
optionsHeaders['X-CSRF-TOKEN'] = token;
|
||||
@@ -337,7 +324,6 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
|
||||
}
|
||||
|
||||
private static getResponseType(options: RequestOptions): 'blob' | 'json' | 'text' {
|
||||
|
||||
const isBlobType = options.returnType?.toString().toLowerCase() === 'blob' || options.responseType?.toString().toLowerCase() === 'blob';
|
||||
|
||||
if (isBlobType) {
|
||||
@@ -359,7 +345,6 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
|
||||
* @returns deserialized object
|
||||
*/
|
||||
private static deserialize<T>(response: HttpResponse<T>, returnType?: Constructor<unknown> | 'blob'): any {
|
||||
|
||||
if (response === null) {
|
||||
return null;
|
||||
}
|
||||
@@ -390,9 +375,7 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient {
|
||||
return new returnType(body);
|
||||
}
|
||||
|
||||
|
||||
private static deserializeBlobResponse(response: HttpResponse<Blob>) {
|
||||
return new Blob([response.body], {type: response.headers.get('Content-Type')});
|
||||
return new Blob([response.body], { type: response.headers.get('Content-Type') });
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -36,42 +36,37 @@ export const SHOULD_ADD_AUTH_TOKEN = new HttpContextToken<boolean>(() => false);
|
||||
|
||||
@Injectable()
|
||||
export class AuthenticationInterceptor implements HttpInterceptor {
|
||||
constructor(private authService: Authentication) {}
|
||||
|
||||
constructor( private authService: Authentication) { }
|
||||
intercept(
|
||||
req: HttpRequest<any>,
|
||||
next: HttpHandler
|
||||
): Observable<HttpSentEvent | HttpHeaderResponse | HttpProgressEvent | HttpResponse<any> | HttpUserEvent<any>> {
|
||||
if (req.context.get(SHOULD_ADD_AUTH_TOKEN)) {
|
||||
return this.authService.addTokenToHeader(req.url, req.headers).pipe(
|
||||
mergeMap((headersWithBearer) => {
|
||||
const headerWithContentType = this.appendJsonContentType(headersWithBearer);
|
||||
const kcReq = req.clone({ headers: headerWithContentType });
|
||||
return next.handle(kcReq).pipe(catchError((error) => observableThrowError(error)));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
intercept(req: HttpRequest<any>, next: HttpHandler):
|
||||
Observable<HttpSentEvent | HttpHeaderResponse | HttpProgressEvent | HttpResponse<any> | HttpUserEvent<any>> {
|
||||
|
||||
if (req.context.get(SHOULD_ADD_AUTH_TOKEN)) {
|
||||
return this.authService.addTokenToHeader(req.url, req.headers).pipe(
|
||||
mergeMap((headersWithBearer) => {
|
||||
const headerWithContentType = this.appendJsonContentType(headersWithBearer);
|
||||
const kcReq = req.clone({ headers: headerWithContentType});
|
||||
return next.handle(kcReq)
|
||||
.pipe(
|
||||
catchError((error) => observableThrowError(error))
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
return next.handle(req).pipe(catchError((error) => observableThrowError(error)));
|
||||
return next.handle(req).pipe(catchError((error) => observableThrowError(error)));
|
||||
}
|
||||
|
||||
private appendJsonContentType(headers: HttpHeaders): HttpHeaders {
|
||||
// prevent adding any content type, to properly handle formData with boundary browser generated value,
|
||||
// as adding any Content-Type its going to break the upload functionality
|
||||
|
||||
// prevent adding any content type, to properly handle formData with boundary browser generated value,
|
||||
// as adding any Content-Type its going to break the upload functionality
|
||||
if (headers.get('Content-Type') === 'multipart/form-data') {
|
||||
return headers.delete('Content-Type');
|
||||
}
|
||||
|
||||
if (headers.get('Content-Type') === 'multipart/form-data') {
|
||||
return headers.delete('Content-Type');
|
||||
}
|
||||
if (!headers.get('Content-Type')) {
|
||||
return headers.set('Content-Type', 'application/json;charset=UTF-8');
|
||||
}
|
||||
|
||||
if (!headers.get('Content-Type')) {
|
||||
return headers.set('Content-Type', 'application/json;charset=UTF-8');
|
||||
}
|
||||
|
||||
return headers;
|
||||
return headers;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,15 +2,15 @@
|
||||
@use '@angular/material' as mat;
|
||||
|
||||
@mixin adf-breadcrumb-theme($theme) {
|
||||
$config: mat.get-color-config($theme);
|
||||
$config: mat.m2-get-color-config($theme);
|
||||
$foreground-palette: map.get($config, foreground);
|
||||
$primary-palette: map.get($config, primary);
|
||||
$text-color: mat.get-color-from-palette($foreground-palette, text);
|
||||
$primary: mat.get-color-from-palette($primary-palette, text);
|
||||
$text-color: mat.m2-get-color-from-palette($foreground-palette, text);
|
||||
$primary: mat.m2-get-color-from-palette($primary-palette, text);
|
||||
|
||||
adf-breadcrumb {
|
||||
.adf-breadcrumb__show-all-button-icon--rotate {
|
||||
color: mat.get-color-from-palette($primary-palette, 500);
|
||||
color: mat.m2-get-color-from-palette($primary-palette, 500);
|
||||
}
|
||||
|
||||
.adf-breadcrumb__item-wrapper {
|
||||
|
@@ -1,31 +1,27 @@
|
||||
@use '@angular/material' as mat;
|
||||
@import './default-colors.scss';
|
||||
@import './custom-palette-creator.scss';
|
||||
@import './default-colors';
|
||||
@import './custom-palette-creator';
|
||||
|
||||
@function get-mat-palettes($primary-color, $accent-color) {
|
||||
$mat-primary-palette: null;
|
||||
|
||||
@if ($primary-color) {
|
||||
$custom-theme-primary-palette: create-color-palette($primary-color, 'primary');
|
||||
$mat-primary-palette: mat.define-palette($custom-theme-primary-palette, 500);
|
||||
$mat-primary-palette: mat.m2-define-palette($custom-theme-primary-palette, 500);
|
||||
} @else {
|
||||
$mat-primary-palette: mat.define-palette($default-primary, A100);
|
||||
$mat-primary-palette: mat.m2-define-palette($default-primary, A100);
|
||||
}
|
||||
|
||||
$mat-accent-palette: null;
|
||||
|
||||
@if ($accent-color) {
|
||||
$custom-theme-accent-palette: create-color-palette($accent-color, 'accent');
|
||||
$mat-accent-palette: mat.define-palette($custom-theme-accent-palette, 500);
|
||||
$mat-accent-palette: mat.m2-define-palette($custom-theme-accent-palette, 500);
|
||||
} @else {
|
||||
$mat-accent-palette: mat.define-palette($default-accent);
|
||||
$mat-accent-palette: mat.m2-define-palette($default-accent);
|
||||
}
|
||||
|
||||
$mat-warn-palette: mat.define-palette($default-warn, A100);
|
||||
$mat-warn-palette: mat.m2-define-palette($default-warn, A100);
|
||||
|
||||
@return (
|
||||
primary: $mat-primary-palette,
|
||||
accent: $mat-accent-palette,
|
||||
warning: $mat-warn-palette,
|
||||
);
|
||||
@return (primary: $mat-primary-palette, accent: $mat-accent-palette, warning: $mat-warn-palette);
|
||||
}
|
||||
|
@@ -21,6 +21,6 @@
|
||||
|
||||
@use '@angular/material' as mat;
|
||||
|
||||
$default-primary: mat.$indigo-palette;
|
||||
$default-accent: mat.$pink-palette;
|
||||
$default-warn: mat.$red-palette;
|
||||
$default-primary: mat.$m2-indigo-palette;
|
||||
$default-accent: mat.$m2-pink-palette;
|
||||
$default-warn: mat.$m2-red-palette;
|
||||
|
@@ -3,37 +3,37 @@
|
||||
@import '../variables/font-family';
|
||||
|
||||
@function get-mat-typography($base-font-size, $font-family) {
|
||||
$custom-typography: mat.define-typography-config(
|
||||
$custom-typography: mat.m2-define-typography-config(
|
||||
$font-family: 'Muli, Roboto, "Helvetica Neue", sans-serif',
|
||||
$headline-1: mat.define-typography-level(112px, 112px, 300),
|
||||
$headline-2: mat.define-typography-level(56px, 56px, 400),
|
||||
$headline-3: mat.define-typography-level(45px, 48px, 400),
|
||||
$headline-4: mat.define-typography-level(34px, 40px, 400),
|
||||
$headline-5: mat.define-typography-level(24px, 32px, 400),
|
||||
$headline-6: mat.define-typography-level(20px, 32px, 500),
|
||||
$subtitle-1: mat.define-typography-level(16px, 28px, 400),
|
||||
$body-1: mat.define-typography-level(15px, 24px, 400),
|
||||
$subtitle-2: mat.define-typography-level(14px, 24px, 500),
|
||||
$body-2: mat.define-typography-level(14px, 20px, 400),
|
||||
$caption: mat.define-typography-level(12px, 20px, 400),
|
||||
$button: mat.define-typography-level(14px, 14px, 500),
|
||||
$headline-1: mat.m2-define-typography-level(112px, 112px, 300),
|
||||
$headline-2: mat.m2-define-typography-level(56px, 56px, 400),
|
||||
$headline-3: mat.m2-define-typography-level(45px, 48px, 400),
|
||||
$headline-4: mat.m2-define-typography-level(34px, 40px, 400),
|
||||
$headline-5: mat.m2-define-typography-level(24px, 32px, 400),
|
||||
$headline-6: mat.m2-define-typography-level(20px, 32px, 500),
|
||||
$subtitle-1: mat.m2-define-typography-level(16px, 28px, 400),
|
||||
$body-1: mat.m2-define-typography-level(15px, 24px, 400),
|
||||
$subtitle-2: mat.m2-define-typography-level(14px, 24px, 500),
|
||||
$body-2: mat.m2-define-typography-level(14px, 20px, 400),
|
||||
$caption: mat.m2-define-typography-level(12px, 20px, 400),
|
||||
$button: mat.m2-define-typography-level(14px, 14px, 500),
|
||||
// Line-height must be unit-less fraction of the font-size.
|
||||
);
|
||||
|
||||
@if $base-font-size {
|
||||
$custom-typography: mat.define-typography-config(
|
||||
$headline-1: mat.define-typography-level(8rem, 8rem, 300),
|
||||
$headline-2: mat.define-typography-level(4rem, 4rem, 400),
|
||||
$headline-3: mat.define-typography-level(3.21rem, 3.21rem, 400),
|
||||
$headline-4: mat.define-typography-level(2.42rem, 2.85rem, 400),
|
||||
$headline-5: mat.define-typography-level(1.71rem, 2.28rem, 400),
|
||||
$headline-6: mat.define-typography-level(1.42rem, 2.28rem, 500),
|
||||
$subtitle-1: mat.define-typography-level(1.14rem, 2rem, 400),
|
||||
$body-1: mat.define-typography-level(1.07rem, 1.71rem, 400),
|
||||
$subtitle-2: mat.define-typography-level(1rem, 1.71rem, 500),
|
||||
$body-2: mat.define-typography-level(1rem, 1.42rem, 400),
|
||||
$caption: mat.define-typography-level(0.86rem, 1.42rem, 400),
|
||||
$button: mat.define-typography-level(1rem, 1rem, 500),
|
||||
$custom-typography: mat.m2-define-typography-config(
|
||||
$headline-1: mat.m2-define-typography-level(8rem, 8rem, 300),
|
||||
$headline-2: mat.m2-define-typography-level(4rem, 4rem, 400),
|
||||
$headline-3: mat.m2-define-typography-level(3.21rem, 3.21rem, 400),
|
||||
$headline-4: mat.m2-define-typography-level(2.42rem, 2.85rem, 400),
|
||||
$headline-5: mat.m2-define-typography-level(1.71rem, 2.28rem, 400),
|
||||
$headline-6: mat.m2-define-typography-level(1.42rem, 2.28rem, 500),
|
||||
$subtitle-1: mat.m2-define-typography-level(1.14rem, 2rem, 400),
|
||||
$body-1: mat.m2-define-typography-level(1.07rem, 1.71rem, 400),
|
||||
$subtitle-2: mat.m2-define-typography-level(1rem, 1.71rem, 500),
|
||||
$body-2: mat.m2-define-typography-level(1rem, 1.42rem, 400),
|
||||
$caption: mat.m2-define-typography-level(0.86rem, 1.42rem, 400),
|
||||
$button: mat.m2-define-typography-level(1rem, 1rem, 500),
|
||||
$font-family: $default-font-family
|
||||
);
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/eslint:lint:eslint",
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"lib/core/**/*.ts",
|
||||
|
@@ -24,7 +24,7 @@ import { of, Subject } from 'rxjs';
|
||||
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ShellAppService, SHELL_APP_SERVICE } from '../../services/shell-app.service';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@@ -58,10 +58,10 @@ describe('AppLayoutComponent', () => {
|
||||
};
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
imports: [
|
||||
CommonModule,
|
||||
NoopAnimationsModule,
|
||||
HttpClientModule,
|
||||
...LAYOUT_DIRECTIVES,
|
||||
ExtensionsModule,
|
||||
RouterModule.forChild([]),
|
||||
@@ -76,9 +76,9 @@ describe('AppLayoutComponent', () => {
|
||||
{
|
||||
provide: SHELL_APP_SERVICE,
|
||||
useValue: shellService
|
||||
}
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
},
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(ShellLayoutComponent);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||
import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService } from './app-config.service';
|
||||
import { ExtensionConfig, ExtensionService } from '@alfresco/adf-extensions';
|
||||
@@ -49,8 +49,8 @@ describe('AppConfigService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientModule],
|
||||
providers: [{ provide: ExtensionService, useClass: TestExtensionService }]
|
||||
imports: [],
|
||||
providers: [{ provide: ExtensionService, useClass: TestExtensionService }, provideHttpClient(withInterceptorsFromDi())]
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -18,8 +18,15 @@
|
||||
import { throwError as observableThrowError, Observable } from 'rxjs';
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
HttpHandler, HttpInterceptor, HttpRequest,
|
||||
HttpSentEvent, HttpHeaderResponse, HttpProgressEvent, HttpResponse, HttpUserEvent, HttpHeaders
|
||||
HttpHandler,
|
||||
HttpInterceptor,
|
||||
HttpRequest,
|
||||
HttpSentEvent,
|
||||
HttpHeaderResponse,
|
||||
HttpProgressEvent,
|
||||
HttpResponse,
|
||||
HttpUserEvent,
|
||||
HttpHeaders
|
||||
} from '@angular/common/http';
|
||||
import { catchError, mergeMap } from 'rxjs/operators';
|
||||
import { AuthenticationService } from '../services/authentication.service';
|
||||
@@ -30,61 +37,52 @@ export class AuthBearerInterceptor implements HttpInterceptor {
|
||||
|
||||
private excludedUrlsRegex: RegExp[];
|
||||
|
||||
constructor(private authenticationService: AuthenticationService) { }
|
||||
constructor(private authenticationService: AuthenticationService) {}
|
||||
|
||||
private loadExcludedUrlsRegex() {
|
||||
const excludedUrls = this.bearerExcludedUrls;
|
||||
this.excludedUrlsRegex = excludedUrls.map((urlPattern) => new RegExp(`^https?://[^/]+/${urlPattern}`, 'i')) || [];
|
||||
}
|
||||
|
||||
intercept(req: HttpRequest<any>, next: HttpHandler):
|
||||
Observable<HttpSentEvent | HttpHeaderResponse | HttpProgressEvent | HttpResponse<any> | HttpUserEvent<any>> {
|
||||
|
||||
|
||||
if (!this.excludedUrlsRegex) {
|
||||
this.loadExcludedUrlsRegex();
|
||||
private loadExcludedUrlsRegex() {
|
||||
const excludedUrls = this.bearerExcludedUrls;
|
||||
this.excludedUrlsRegex = excludedUrls.map((urlPattern) => new RegExp(`^https?://[^/]+/${urlPattern}`, 'i')) || [];
|
||||
}
|
||||
|
||||
const requestUrl = req.url;
|
||||
const shallPass: boolean = this.excludedUrlsRegex.some((regex) => regex.test(requestUrl));
|
||||
if (shallPass) {
|
||||
return next.handle(req)
|
||||
.pipe(
|
||||
catchError((error) => observableThrowError(error))
|
||||
intercept(
|
||||
req: HttpRequest<any>,
|
||||
next: HttpHandler
|
||||
): Observable<HttpSentEvent | HttpHeaderResponse | HttpProgressEvent | HttpResponse<any> | HttpUserEvent<any>> {
|
||||
if (!this.excludedUrlsRegex) {
|
||||
this.loadExcludedUrlsRegex();
|
||||
}
|
||||
|
||||
const requestUrl = req.url;
|
||||
const shallPass: boolean = this.excludedUrlsRegex.some((regex) => regex.test(requestUrl));
|
||||
if (shallPass) {
|
||||
return next.handle(req).pipe(catchError((error) => observableThrowError(error)));
|
||||
}
|
||||
|
||||
return this.authenticationService.addTokenToHeader(requestUrl, req.headers).pipe(
|
||||
mergeMap((headersWithBearer) => {
|
||||
const headerWithContentType = this.appendJsonContentType(headersWithBearer, req.body);
|
||||
const kcReq = req.clone({ headers: headerWithContentType });
|
||||
return next.handle(kcReq).pipe(catchError((error) => observableThrowError(error)));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
return this.authenticationService.addTokenToHeader(requestUrl, req.headers)
|
||||
.pipe(
|
||||
mergeMap((headersWithBearer) => {
|
||||
const headerWithContentType = this.appendJsonContentType(headersWithBearer, req.body);
|
||||
const kcReq = req.clone({ headers: headerWithContentType});
|
||||
return next.handle(kcReq)
|
||||
.pipe(
|
||||
catchError((error) => observableThrowError(error))
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
private appendJsonContentType(headers: HttpHeaders, reqBody: any): HttpHeaders {
|
||||
// prevent adding any content type, to properly handle formData with boundary browser generated value,
|
||||
// as adding any Content-Type its going to break the upload functionality
|
||||
|
||||
private appendJsonContentType(headers: HttpHeaders, reqBody: any): HttpHeaders {
|
||||
if (headers.get('Content-Type') === 'multipart/form-data' && !(reqBody instanceof FormData)) {
|
||||
return headers.delete('Content-Type');
|
||||
}
|
||||
|
||||
// prevent adding any content type, to properly handle formData with boundary browser generated value,
|
||||
// as adding any Content-Type its going to break the upload functionality
|
||||
if (!headers.get('Content-Type') && !(reqBody instanceof FormData)) {
|
||||
return headers.set('Content-Type', 'application/json;charset=UTF-8');
|
||||
}
|
||||
|
||||
if (headers.get('Content-Type') === 'multipart/form-data' && !(reqBody instanceof FormData)) {
|
||||
return headers.delete('Content-Type');
|
||||
return headers;
|
||||
}
|
||||
|
||||
if (!headers.get('Content-Type') && !(reqBody instanceof FormData)) {
|
||||
return headers.set('Content-Type', 'application/json;charset=UTF-8');
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
|
||||
protected get bearerExcludedUrls(): readonly string[] {
|
||||
return this._bearerExcludedUrls;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -15,13 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { EMPTY } from 'rxjs';
|
||||
import { AppConfigService } from '../../app-config/app-config.service';
|
||||
import { AUTH_MODULE_CONFIG } from './auth-config';
|
||||
import { AuthConfigService } from './auth-config.service';
|
||||
import { OauthConfigModel } from '../models/oauth-config.model';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('AuthConfigService', () => {
|
||||
let service: AuthConfigService;
|
||||
@@ -95,8 +96,12 @@ describe('AuthConfigService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [{ provide: AUTH_MODULE_CONFIG, useValue: { useHash: true } }]
|
||||
imports: [],
|
||||
providers: [
|
||||
{ provide: AUTH_MODULE_CONFIG, useValue: { useHash: true } },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(AuthConfigService);
|
||||
spyOn<any>(service, 'getLocationOrigin').and.returnValue('http://localhost:3000');
|
||||
|
@@ -15,27 +15,37 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { HttpClientModule, HttpErrorResponse, HttpResponse } from '@angular/common/http';
|
||||
import { HttpErrorResponse, HttpResponse, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { IdentityRoleResponseModel, IdentityRoleService } from './identity-role.service';
|
||||
|
||||
export const mockIdentityRole1 = {
|
||||
id: 'mock-id-1', name: 'Mock_Role_1', description: 'Mock desc1', clientRole: true, composite: false
|
||||
id: 'mock-id-1',
|
||||
name: 'Mock_Role_1',
|
||||
description: 'Mock desc1',
|
||||
clientRole: true,
|
||||
composite: false
|
||||
};
|
||||
|
||||
export const mockIdentityRole2 = {
|
||||
id: 'mock-id-2', name: 'Mock_Role_2', description: 'Mock desc2', clientRole: false, composite: true
|
||||
id: 'mock-id-2',
|
||||
name: 'Mock_Role_2',
|
||||
description: 'Mock desc2',
|
||||
clientRole: false,
|
||||
composite: true
|
||||
};
|
||||
|
||||
export const mockIdentityRole3 = {
|
||||
id: 'mock-id-3', name: 'Mock_Role_3', description: 'Mock desc3', clientRole: false, composite: false
|
||||
id: 'mock-id-3',
|
||||
name: 'Mock_Role_3',
|
||||
description: 'Mock desc3',
|
||||
clientRole: false,
|
||||
composite: false
|
||||
};
|
||||
|
||||
export const mockIdentityRoles = {
|
||||
entries: [
|
||||
mockIdentityRole1, mockIdentityRole2, mockIdentityRole3
|
||||
],
|
||||
entries: [mockIdentityRole1, mockIdentityRole2, mockIdentityRole3],
|
||||
pagination: {
|
||||
skipCount: 1,
|
||||
maxItems: 5,
|
||||
@@ -50,9 +60,8 @@ describe('IdentityRoleService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
HttpClientModule
|
||||
]
|
||||
imports: [],
|
||||
providers: [provideHttpClient(withInterceptorsFromDi())]
|
||||
});
|
||||
service = TestBed.inject(IdentityRoleService);
|
||||
});
|
||||
@@ -75,31 +84,29 @@ describe('IdentityRoleService', () => {
|
||||
statusText: 'Created'
|
||||
});
|
||||
spyOn(service, 'addRole').and.returnValue(of(response));
|
||||
service.addRole(mockIdentityRole1).subscribe(
|
||||
(res: any) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.status).toEqual(201);
|
||||
expect(res.statusText).toEqual('Created');
|
||||
done();
|
||||
}
|
||||
);
|
||||
service.addRole(mockIdentityRole1).subscribe((res: any) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.status).toEqual(201);
|
||||
expect(res.statusText).toEqual('Created');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('Should not add role if error occurred', () => {
|
||||
const errorResponse = new HttpErrorResponse({
|
||||
error: 'test 404 error',
|
||||
status: 404, statusText: 'Not Found'
|
||||
status: 404,
|
||||
statusText: 'Not Found'
|
||||
});
|
||||
spyOn(service, 'addRole').and.returnValue(throwError(errorResponse));
|
||||
service.addRole(mockIdentityRole1)
|
||||
.subscribe(
|
||||
() => fail('expected an error'),
|
||||
(error) => {
|
||||
expect(error.status).toEqual(404);
|
||||
expect(error.statusText).toEqual('Not Found');
|
||||
expect(error.error).toEqual('test 404 error');
|
||||
}
|
||||
);
|
||||
service.addRole(mockIdentityRole1).subscribe(
|
||||
() => fail('expected an error'),
|
||||
(error) => {
|
||||
expect(error.status).toEqual(404);
|
||||
expect(error.statusText).toEqual('Not Found');
|
||||
expect(error.error).toEqual('test 404 error');
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('should be able to delete role', (done) => {
|
||||
@@ -109,30 +116,28 @@ describe('IdentityRoleService', () => {
|
||||
statusText: 'No Content'
|
||||
});
|
||||
spyOn(service, 'deleteRole').and.returnValue(of(response));
|
||||
service.deleteRole(mockIdentityRole1).subscribe(
|
||||
(res: any) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.status).toEqual(204);
|
||||
expect(res.statusText).toEqual('No Content');
|
||||
done();
|
||||
}
|
||||
);
|
||||
service.deleteRole(mockIdentityRole1).subscribe((res: any) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.status).toEqual(204);
|
||||
expect(res.statusText).toEqual('No Content');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('Should not delete role if error occurred', () => {
|
||||
const errorResponse = new HttpErrorResponse({
|
||||
error: 'test 404 error',
|
||||
status: 404, statusText: 'Not Found'
|
||||
status: 404,
|
||||
statusText: 'Not Found'
|
||||
});
|
||||
spyOn(service, 'deleteRole').and.returnValue(throwError(errorResponse));
|
||||
service.deleteRole(mockIdentityRole1)
|
||||
.subscribe(
|
||||
() => fail('expected an error'),
|
||||
(error) => {
|
||||
expect(error.status).toEqual(404);
|
||||
expect(error.statusText).toEqual('Not Found');
|
||||
expect(error.error).toEqual('test 404 error');
|
||||
}
|
||||
);
|
||||
service.deleteRole(mockIdentityRole1).subscribe(
|
||||
() => fail('expected an error'),
|
||||
(error) => {
|
||||
expect(error.status).toEqual(404);
|
||||
expect(error.statusText).toEqual('Not Found');
|
||||
expect(error.error).toEqual('test 404 error');
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@@ -19,7 +19,8 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { UserAccessService } from './user-access.service';
|
||||
import { JwtHelperService } from './jwt-helper.service';
|
||||
import { AppConfigService } from '../../app-config';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('UserAccessService', () => {
|
||||
let userAccessService: UserAccessService;
|
||||
@@ -28,8 +29,8 @@ describe('UserAccessService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [UserAccessService]
|
||||
imports: [],
|
||||
providers: [UserAccessService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
userAccessService = TestBed.inject(UserAccessService);
|
||||
jwtHelperService = TestBed.inject(JwtHelperService);
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { Component } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { AppConfigService } from '../../app-config/app-config.service';
|
||||
@@ -61,9 +61,9 @@ describe('LogService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientModule],
|
||||
declarations: [ProvidesLogComponent],
|
||||
providers: [LogService, AppConfigService]
|
||||
imports: [],
|
||||
providers: [LogService, AppConfigService, provideHttpClient(withInterceptorsFromDi())]
|
||||
});
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
providesLogComponent = TestBed.createComponent(ProvidesLogComponent);
|
||||
@@ -166,11 +166,9 @@ describe('LogService', () => {
|
||||
it('message Observable', fakeAsync(() => {
|
||||
appConfigService.config['logLevel'] = 'trace';
|
||||
|
||||
providesLogComponent.componentInstance.logService.onMessage.subscribe(
|
||||
(message) => {
|
||||
expect(message).toEqual({ text: 'Test message', type: 'LOG' });
|
||||
}
|
||||
);
|
||||
providesLogComponent.componentInstance.logService.onMessage.subscribe((message) => {
|
||||
expect(message).toEqual({ text: 'Test message', type: 'LOG' });
|
||||
});
|
||||
|
||||
providesLogComponent.componentInstance.log();
|
||||
}));
|
||||
|
@@ -44,7 +44,7 @@ import { DirectionalityConfigService } from './common/services/directionality-co
|
||||
import { SEARCH_TEXT_INPUT_DIRECTIVES } from './search-text/search-text-input.module';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
import { AuthenticationInterceptor, Authentication } from '@alfresco/adf-core/auth';
|
||||
import { HttpClientModule, HttpClientXsrfModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi, withXsrfConfiguration } from '@angular/common/http';
|
||||
import { AuthenticationService } from './auth/services/authentication.service';
|
||||
import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
|
||||
import { loadAppConfig } from './app-config/app-config.loader';
|
||||
@@ -61,43 +61,6 @@ import { UnsavedChangesDialogComponent } from './dialogs';
|
||||
import { MaterialModule } from './material.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
TranslateModule,
|
||||
...ABOUT_DIRECTIVES,
|
||||
...VIEWER_DIRECTIVES,
|
||||
...LAYOUT_DIRECTIVES,
|
||||
...CORE_PIPES,
|
||||
IdentityUserInfoComponent,
|
||||
...CORE_DIRECTIVES,
|
||||
AppConfigPipe,
|
||||
...PAGINATION_DIRECTIVES,
|
||||
...TOOLBAR_DIRECTIVES,
|
||||
...CONTEXT_MENU_DIRECTIVES,
|
||||
...CARD_VIEW_DIRECTIVES,
|
||||
FormBaseModule,
|
||||
CommentsComponent,
|
||||
CommentListComponent,
|
||||
...CLIPBOARD_DIRECTIVES,
|
||||
...LOGIN_DIRECTIVES,
|
||||
...LANGUAGE_MENU_DIRECTIVES,
|
||||
...INFO_DRAWER_DIRECTIVES,
|
||||
...DATATABLE_DIRECTIVES,
|
||||
...TEMPLATE_DIRECTIVES,
|
||||
IconComponent,
|
||||
SortingPickerComponent,
|
||||
...NOTIFICATION_HISTORY_DIRECTIVES,
|
||||
...SEARCH_TEXT_INPUT_DIRECTIVES,
|
||||
BlankPageComponent,
|
||||
UnsavedChangesDialogComponent,
|
||||
DynamicChipListComponent,
|
||||
HttpClientModule,
|
||||
HttpClientXsrfModule.withOptions({
|
||||
cookieName: 'CSRF-TOKEN',
|
||||
headerName: 'X-CSRF-TOKEN'
|
||||
}),
|
||||
MaterialModule
|
||||
],
|
||||
providers: [...CORE_PIPES],
|
||||
exports: [
|
||||
...ABOUT_DIRECTIVES,
|
||||
...VIEWER_DIRECTIVES,
|
||||
@@ -128,6 +91,47 @@ import { MaterialModule } from './material.module';
|
||||
UnsavedChangesDialogComponent,
|
||||
DynamicChipListComponent,
|
||||
MaterialModule
|
||||
],
|
||||
imports: [
|
||||
TranslateModule,
|
||||
...ABOUT_DIRECTIVES,
|
||||
...VIEWER_DIRECTIVES,
|
||||
...LAYOUT_DIRECTIVES,
|
||||
...CORE_PIPES,
|
||||
IdentityUserInfoComponent,
|
||||
...CORE_DIRECTIVES,
|
||||
AppConfigPipe,
|
||||
...PAGINATION_DIRECTIVES,
|
||||
...TOOLBAR_DIRECTIVES,
|
||||
...CONTEXT_MENU_DIRECTIVES,
|
||||
...CARD_VIEW_DIRECTIVES,
|
||||
FormBaseModule,
|
||||
CommentsComponent,
|
||||
CommentListComponent,
|
||||
...CLIPBOARD_DIRECTIVES,
|
||||
...LOGIN_DIRECTIVES,
|
||||
...LANGUAGE_MENU_DIRECTIVES,
|
||||
...INFO_DRAWER_DIRECTIVES,
|
||||
...DATATABLE_DIRECTIVES,
|
||||
...TEMPLATE_DIRECTIVES,
|
||||
IconComponent,
|
||||
SortingPickerComponent,
|
||||
...NOTIFICATION_HISTORY_DIRECTIVES,
|
||||
...SEARCH_TEXT_INPUT_DIRECTIVES,
|
||||
BlankPageComponent,
|
||||
UnsavedChangesDialogComponent,
|
||||
DynamicChipListComponent,
|
||||
MaterialModule
|
||||
],
|
||||
providers: [
|
||||
...CORE_PIPES,
|
||||
provideHttpClient(
|
||||
withInterceptorsFromDi(),
|
||||
withXsrfConfiguration({
|
||||
cookieName: 'CSRF-TOKEN',
|
||||
headerName: 'X-CSRF-TOKEN'
|
||||
})
|
||||
)
|
||||
]
|
||||
})
|
||||
export class CoreModule {
|
||||
|
@@ -28,7 +28,12 @@ import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatDatetimepickerModule, MatNativeDatetimeModule } from '@mat-datetimepicker/core';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
<<<<<<< HEAD
|
||||
import { NoopTranslateModule } from '@alfresco/adf-core';
|
||||
=======
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
>>>>>>> dda0cdf98 ([MIGRATION] - Build fix and lint skipped rule)
|
||||
|
||||
describe('DateTimeWidgetComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -40,14 +45,19 @@ describe('DateTimeWidgetComponent', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
<<<<<<< HEAD
|
||||
NoopTranslateModule,
|
||||
=======
|
||||
TranslateModule.forRoot(),
|
||||
>>>>>>> dda0cdf98 ([MIGRATION] - Build fix and lint skipped rule)
|
||||
NoopAnimationsModule,
|
||||
MatDialogModule,
|
||||
MatNativeDatetimeModule,
|
||||
MatDatepickerModule,
|
||||
MatDatetimepickerModule,
|
||||
DateTimeWidgetComponent
|
||||
]
|
||||
],
|
||||
providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
fixture = TestBed.createComponent(DateTimeWidgetComponent);
|
||||
|
||||
|
@@ -11,59 +11,59 @@
|
||||
$background: map-get($theme, background);
|
||||
|
||||
$defaults: (
|
||||
--adf-card-view-background: mat.get-color-from-palette($background, card),
|
||||
--adf-card-view-background: mat.m2-get-color-from-palette($background, card),
|
||||
--adf-card-view-border: $adf-ref-card-border,
|
||||
--adf-card-view-border-color: mat.get-color-from-palette($foreground, divider),
|
||||
--adf-card-view-border-color: mat.m2-get-color-from-palette($foreground, divider),
|
||||
--adf-card-view-border-radius: $adf-ref-card-border-radius-slim,
|
||||
--adf-card-view-array-item-background: mat.get-color-from-palette($background, card),
|
||||
--adf-card-view-array-item-background: mat.m2-get-color-from-palette($background, card),
|
||||
--adf-card-view-array-item-border: $adf-ref-card-border,
|
||||
--adf-card-view-array-item-border-color: mat.get-color-from-palette($foreground, divider),
|
||||
--adf-card-view-array-item-border-color: mat.m2-get-color-from-palette($foreground, divider),
|
||||
--adf-card-view-array-item-border-radius: $adf-ref-card-border-radius-slim,
|
||||
--adf-edit-task-and-service-filter-header-title-color: mat.get-color-from-palette($foreground, text),
|
||||
--adf-edit-task-and-service-filter-header-description-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-edit-task-and-service-filter-content-text-label-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-edit-task-and-service-filter-content-select-label-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-edit-task-and-service-filter-header-title-color: mat.m2-get-color-from-palette($foreground, text),
|
||||
--adf-edit-task-and-service-filter-header-description-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-edit-task-and-service-filter-content-text-label-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-edit-task-and-service-filter-content-select-label-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-edit-task-and-service-filter-header-height: $adf-ref-height-48,
|
||||
--adf-about-panel-header-height: $adf-ref-height-48,
|
||||
--adf-about-panel-header-title-color: mat.get-color-from-palette($foreground, text),
|
||||
--adf-about-panel-header-title-color: mat.m2-get-color-from-palette($foreground, text),
|
||||
--adf-edit-process-filter-header-height: $adf-ref-height-48,
|
||||
--adf-edit-process-filter-header-title-color: mat.get-color-from-palette($foreground, text),
|
||||
--adf-edit-process-filter-header-description-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-edit-process-filter-content-text-label-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-edit-process-filter-content-select-label-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-about-server-settings-background: mat.get-color-from-palette($background, card),
|
||||
--adf-about-server-settings-color: mat.get-color-from-palette($foreground, text),
|
||||
--adf-edit-process-filter-header-title-color: mat.m2-get-color-from-palette($foreground, text),
|
||||
--adf-edit-process-filter-header-description-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-edit-process-filter-content-text-label-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-edit-process-filter-content-select-label-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-about-server-settings-background: mat.m2-get-color-from-palette($background, card),
|
||||
--adf-about-server-settings-color: mat.m2-get-color-from-palette($foreground, text),
|
||||
--adf-about-server-settings-border-radius: $adf-ref-card-border-radius-normal,
|
||||
--adf-about-server-settings-padding: $adf-ref-card-padding,
|
||||
--adf-package-list-table-background: mat.get-color-from-palette($background, card),
|
||||
--adf-package-list-table-background: mat.m2-get-color-from-palette($background, card),
|
||||
--adf-package-list-table-header-min-height: $adf-ref-table-header-min-height,
|
||||
--adf-package-list-table-header-cell-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-package-list-table-header-cell-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-package-list-table-row-min-height: $adf-ref-table-row-min-height,
|
||||
--adf-package-list-table-row-cell-color: mat.get-color-from-palette($foreground, text),
|
||||
--adf-package-list-table-row-cell-color: mat.m2-get-color-from-palette($foreground, text),
|
||||
--adf-identity-user-info-background: var(--adf-theme-primary-300),
|
||||
--adf-identity-user-info-height: $adf-ref-height,
|
||||
--adf-identity-user-info-width: $adf-ref-width,
|
||||
--adf-identity-user-info-line-height: $adf-ref-line-height,
|
||||
--adf-identity-user-info-font-size: var(--theme-adf-picture-1-font-size),
|
||||
--adf-user-info-container-margin-right: $adf-ref-margin-right,
|
||||
--adf-info-drawer-tab-default-color: mat.get-color-from-palette($accent),
|
||||
--adf-info-drawer-tab-default-background: mat.get-color-from-palette($background, card),
|
||||
--adf-info-drawer-tab-default-color: mat.m2-get-color-from-palette($accent),
|
||||
--adf-info-drawer-tab-default-background: mat.m2-get-color-from-palette($background, card),
|
||||
--adf-info-drawer-tab-default-bottom-line: $adf-ref-tab-bottom-line-default,
|
||||
--adf-info-drawer-tab-hover-color: mat.get-color-from-palette($accent),
|
||||
--adf-info-drawer-tab-hover-background: mat.get-color-from-palette($background, card),
|
||||
--adf-info-drawer-tab-hover-color: mat.m2-get-color-from-palette($accent),
|
||||
--adf-info-drawer-tab-hover-background: mat.m2-get-color-from-palette($background, card),
|
||||
--adf-info-drawer-tab-hover-bottom-line: $adf-ref-tab-bottom-line-default,
|
||||
--adf-info-drawer-tab-active-unfocused-color: mat.get-color-from-palette($primary),
|
||||
--adf-info-drawer-tab-active-unfocused-background: mat.get-color-from-palette($background, card),
|
||||
--adf-info-drawer-tab-active-unfocused-color: mat.m2-get-color-from-palette($primary),
|
||||
--adf-info-drawer-tab-active-unfocused-background: mat.m2-get-color-from-palette($background, card),
|
||||
--adf-info-drawer-tab-active-unfocused-bottom-line: $adf-ref-tab-bottom-line-default,
|
||||
--adf-info-drawer-tab-active-focused-color: mat.get-color-from-palette($foreground, text),
|
||||
--adf-info-drawer-tab-active-focused-background: mat.get-color-from-palette($primary),
|
||||
--adf-info-drawer-tab-active-focused-color: mat.m2-get-color-from-palette($foreground, text),
|
||||
--adf-info-drawer-tab-active-focused-background: mat.m2-get-color-from-palette($primary),
|
||||
--adf-info-drawer-tab-active-focused-bottom-line: $adf-ref-tab-bottom-line-active,
|
||||
|
||||
--adf-people-cloud-input-label-default-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-people-cloud-input-label-focus-color: mat.get-color-from-palette($primary),
|
||||
--adf-people-cloud-autosuggest-result-active-color: mat.get-color-from-palette($foreground, text),
|
||||
--adf-people-cloud-autosuggest-result-disabled-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-people-cloud-input-caption-error-color: mat.get-color-from-palette($warn),
|
||||
--adf-people-cloud-input-label-default-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-people-cloud-input-label-focus-color: mat.m2-get-color-from-palette($primary),
|
||||
--adf-people-cloud-autosuggest-result-active-color: mat.m2-get-color-from-palette($foreground, text),
|
||||
--adf-people-cloud-autosuggest-result-disabled-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-people-cloud-input-caption-error-color: mat.m2-get-color-from-palette($warn),
|
||||
--adf-metadata-property-panel-border-color: $adf-ref-metadata-property-panel-border-color,
|
||||
--adf-metadata-buttons-background-color: $adf-ref-metadata-buttons-background-color,
|
||||
--adf-metadata-action-button-clear-color: $adf-ref-metadata-action-button-clear-color,
|
||||
@@ -71,16 +71,16 @@
|
||||
--adf-metadata-property-panel-label-color: $adf-ref-metadata-property-panel-label-color,
|
||||
--adf-metadata-property-panel-title-color: $adf-ref-metadata-property-panel-title-color,
|
||||
|
||||
--adf-group-cloud-input-label-default-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-group-cloud-input-label-focus-color: mat.get-color-from-palette($primary),
|
||||
--adf-group-cloud-autosuggest-result-active-color: mat.get-color-from-palette($foreground, text),
|
||||
--adf-group-cloud-autosuggest-result-disabled-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-group-cloud-input-caption-error-color: mat.get-color-from-palette($warn),
|
||||
--adf-task-assignment-filter-option-default-color: mat.get-color-from-palette($foreground, text),
|
||||
--adf-task-assignment-filter-option-selected-color: mat.get-color-from-palette($primary),
|
||||
--adf-task-assignment-filter-label-default-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-task-assignment-filter-label-focus-color: mat.get-color-from-palette($primary),
|
||||
--adf-process-header-cloud-card-background: mat.get-color-from-palette($background, card),
|
||||
--adf-group-cloud-input-label-default-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-group-cloud-input-label-focus-color: mat.m2-get-color-from-palette($primary),
|
||||
--adf-group-cloud-autosuggest-result-active-color: mat.m2-get-color-from-palette($foreground, text),
|
||||
--adf-group-cloud-autosuggest-result-disabled-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-group-cloud-input-caption-error-color: mat.m2-get-color-from-palette($warn),
|
||||
--adf-task-assignment-filter-option-default-color: mat.m2-get-color-from-palette($foreground, text),
|
||||
--adf-task-assignment-filter-option-selected-color: mat.m2-get-color-from-palette($primary),
|
||||
--adf-task-assignment-filter-label-default-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-task-assignment-filter-label-focus-color: mat.m2-get-color-from-palette($primary),
|
||||
--adf-process-header-cloud-card-background: mat.m2-get-color-from-palette($background, card),
|
||||
--adf-header-icon-button-default-color: $adf-ref-header-icon-color,
|
||||
--adf-header-icon-button-default-border-radius: $adf-ref-header-icon-border-radius,
|
||||
--adf-header-icon-button-hover-color: $adf-ref-header-icon-color,
|
||||
@@ -89,7 +89,7 @@
|
||||
--adf-danger-button-background: $adf-danger-button-background,
|
||||
--adf-secondary-button-background: $adf-secondary-button-background,
|
||||
|
||||
--adf-display-external-property-widget-preview-selection-color: mat.get-color-from-palette($foreground, secondary-text)
|
||||
--adf-display-external-property-widget-preview-selection-color: mat.m2-get-color-from-palette($foreground, secondary-text)
|
||||
);
|
||||
|
||||
// propagates SCSS variables into the CSS variables scope
|
||||
|
@@ -28,77 +28,69 @@
|
||||
// map SCSS variables to expose as CSS variables
|
||||
$defaults: (
|
||||
// theme colors
|
||||
--theme-primary-color: mat.get-color-from-palette($primary),
|
||||
--theme-primary-color-default-contrast: mat.get-color-from-palette($primary, default-contrast),
|
||||
--theme-header-text-color: mat.get-color-from-palette($primary, default-contrast),
|
||||
--adf-theme-primary-50:mat.get-color-from-palette($primary, 50),
|
||||
--adf-theme-primary-100:mat.get-color-from-palette($primary, 100),
|
||||
--adf-theme-primary-300:mat.get-color-from-palette($primary, 300),
|
||||
--adf-theme-primary-900:mat.get-color-from-palette($primary, 900),
|
||||
|
||||
--theme-warn-color: mat.get-color-from-palette($warn),
|
||||
--theme-warn-color-a700: mat.get-color-from-palette($warn, A700),
|
||||
--theme-warn-color-default-contrast: mat.get-color-from-palette($warn, default-contrast),
|
||||
|
||||
--theme-accent-color: mat.get-color-from-palette($accent),
|
||||
--theme-accent-color-a200: mat.get-color-from-palette($accent, A200),
|
||||
--theme-accent-color-default-contrast: mat.get-color-from-palette($accent, default-contrast),
|
||||
--theme-accent-500:mat.get-color-from-palette($accent, 500),
|
||||
|
||||
--adf-theme-foreground-base-color: mat.get-color-from-palette($foreground, base),
|
||||
--adf-theme-foreground-base-color-065: mat.get-color-from-palette($foreground, base, 0.65),
|
||||
--adf-theme-foreground-base-color-045: mat.get-color-from-palette($foreground, base, 0.45),
|
||||
--adf-theme-foreground-disabled-text-color: mat.get-color-from-palette($foreground, disabled-text),
|
||||
--adf-theme-foreground-divider-color: mat.get-color-from-palette($foreground, divider),
|
||||
--adf-theme-foreground-icon-color: mat.get-color-from-palette($foreground, icon),
|
||||
--adf-theme-foreground-icon-color-054: mat.get-color-from-palette($foreground, icon, 0.54),
|
||||
--adf-theme-foreground-secondary-text-color: mat.get-color-from-palette($foreground, secondary-text),
|
||||
--adf-theme-foreground-text-color: mat.get-color-from-palette($foreground, text),
|
||||
--adf-theme-foreground-text-color-087: mat.get-color-from-palette($foreground, text, 0.87),
|
||||
--adf-theme-foreground-text-color-075: mat.get-color-from-palette($foreground, text, 0.75),
|
||||
--adf-theme-foreground-text-color-064: mat.get-color-from-palette($foreground, text, 0.64),
|
||||
--adf-theme-foreground-text-color-054: mat.get-color-from-palette($foreground, text, 0.54),
|
||||
--adf-theme-foreground-text-color-040: mat.get-color-from-palette($foreground, text, 0.4),
|
||||
--adf-theme-foreground-text-color-027: mat.get-color-from-palette($foreground, text, 0.27),
|
||||
--adf-theme-foreground-text-color-025: mat.get-color-from-palette($foreground, text, 0.25),
|
||||
--adf-theme-foreground-text-color-014: mat.get-color-from-palette($foreground, text, 0.14),
|
||||
--adf-theme-foreground-text-color-007: mat.get-color-from-palette($foreground, text, 0.07),
|
||||
|
||||
--adf-theme-background-card-color: mat.get-color-from-palette($background, card),
|
||||
--adf-theme-background-card-color-087: mat.get-color-from-palette($background, card, 0.87),
|
||||
--theme-background-color: mat.get-color-from-palette($background, background),
|
||||
--adf-theme-background-dialog-color: mat.get-color-from-palette($background, dialog),
|
||||
--adf-theme-background-hover-color: mat.get-color-from-palette($background, hover),
|
||||
--adf-theme-background-selected-button-color: mat.get-color-from-palette($background, selected-button),
|
||||
--adf-theme-background-status-bar-color: mat.get-color-from-palette($background, status-bar),
|
||||
--adf-theme-background-unselected-chip-color: mat.get-color-from-palette($background, unselected-chip),
|
||||
|
||||
--theme-primary-color: mat.m2-get-color-from-palette($primary),
|
||||
--theme-primary-color-default-contrast: mat.m2-get-color-from-palette($primary, default-contrast),
|
||||
--theme-header-text-color: mat.m2-get-color-from-palette($primary, default-contrast),
|
||||
--adf-theme-primary-50: mat.m2-get-color-from-palette($primary, 50),
|
||||
--adf-theme-primary-100: mat.m2-get-color-from-palette($primary, 100),
|
||||
--adf-theme-primary-300: mat.m2-get-color-from-palette($primary, 300),
|
||||
--adf-theme-primary-900: mat.m2-get-color-from-palette($primary, 900),
|
||||
--theme-warn-color: mat.m2-get-color-from-palette($warn),
|
||||
--theme-warn-color-a700: mat.m2-get-color-from-palette($warn, A700),
|
||||
--theme-warn-color-default-contrast: mat.m2-get-color-from-palette($warn, default-contrast),
|
||||
--theme-accent-color: mat.m2-get-color-from-palette($accent),
|
||||
--theme-accent-color-a200: mat.m2-get-color-from-palette($accent, A200),
|
||||
--theme-accent-color-default-contrast: mat.m2-get-color-from-palette($accent, default-contrast),
|
||||
--theme-accent-500: mat.m2-get-color-from-palette($accent, 500),
|
||||
--adf-theme-foreground-base-color: mat.m2-get-color-from-palette($foreground, base),
|
||||
--adf-theme-foreground-base-color-065: mat.m2-get-color-from-palette($foreground, base, 0.65),
|
||||
--adf-theme-foreground-base-color-045: mat.m2-get-color-from-palette($foreground, base, 0.45),
|
||||
--adf-theme-foreground-disabled-text-color: mat.m2-get-color-from-palette($foreground, disabled-text),
|
||||
--adf-theme-foreground-divider-color: mat.m2-get-color-from-palette($foreground, divider),
|
||||
--adf-theme-foreground-icon-color: mat.m2-get-color-from-palette($foreground, icon),
|
||||
--adf-theme-foreground-icon-color-054: mat.m2-get-color-from-palette($foreground, icon, 0.54),
|
||||
--adf-theme-foreground-secondary-text-color: mat.m2-get-color-from-palette($foreground, secondary-text),
|
||||
--adf-theme-foreground-text-color: mat.m2-get-color-from-palette($foreground, text),
|
||||
--adf-theme-foreground-text-color-087: mat.m2-get-color-from-palette($foreground, text, 0.87),
|
||||
--adf-theme-foreground-text-color-075: mat.m2-get-color-from-palette($foreground, text, 0.75),
|
||||
--adf-theme-foreground-text-color-064: mat.m2-get-color-from-palette($foreground, text, 0.64),
|
||||
--adf-theme-foreground-text-color-054: mat.m2-get-color-from-palette($foreground, text, 0.54),
|
||||
--adf-theme-foreground-text-color-040: mat.m2-get-color-from-palette($foreground, text, 0.4),
|
||||
--adf-theme-foreground-text-color-027: mat.m2-get-color-from-palette($foreground, text, 0.27),
|
||||
--adf-theme-foreground-text-color-025: mat.m2-get-color-from-palette($foreground, text, 0.25),
|
||||
--adf-theme-foreground-text-color-014: mat.m2-get-color-from-palette($foreground, text, 0.14),
|
||||
--adf-theme-foreground-text-color-007: mat.m2-get-color-from-palette($foreground, text, 0.07),
|
||||
--adf-theme-background-card-color: mat.m2-get-color-from-palette($background, card),
|
||||
--adf-theme-background-card-color-087: mat.m2-get-color-from-palette($background, card, 0.87),
|
||||
--theme-background-color: mat.m2-get-color-from-palette($background, background),
|
||||
--adf-theme-background-dialog-color: mat.m2-get-color-from-palette($background, dialog),
|
||||
--adf-theme-background-hover-color: mat.m2-get-color-from-palette($background, hover),
|
||||
--adf-theme-background-selected-button-color: mat.m2-get-color-from-palette($background, selected-button),
|
||||
--adf-theme-background-status-bar-color: mat.m2-get-color-from-palette($background, status-bar),
|
||||
--adf-theme-background-unselected-chip-color: mat.m2-get-color-from-palette($background, unselected-chip),
|
||||
// typography
|
||||
--theme-font-family: mat.font-family($typography),
|
||||
--theme-body-1-font-size: mat.font-size($typography, body-2),
|
||||
--theme-body-2-font-size: mat.font-size($typography, subtitle-2),
|
||||
--theme-body-1-line-height: mat.line-height($typography, body-2),
|
||||
--theme-display-1-font-size: mat.font-size($typography, headline-4),
|
||||
--theme-display-3-font-size: mat.font-size($typography, headline-2),
|
||||
--theme-display-4-font-size: mat.font-size($typography, headline-1),
|
||||
--theme-caption-font-size: mat.font-size($typography, caption),
|
||||
--theme-title-font-size: mat.font-size($typography, headline-6),
|
||||
--theme-subheading-1-font-size: mat.font-size($typography, body-1),
|
||||
--theme-subheading-2-font-size: mat.font-size($typography, subtitle-1),
|
||||
--theme-button-font-size: mat.font-size($typography, button),
|
||||
--theme-headline-font-size: mat.font-size($typography, headline-5),
|
||||
--theme-headline-line-height: mat.line-height($typography, headline-5),
|
||||
|
||||
--theme-font-family: mat.m2-font-family($typography),
|
||||
--theme-body-1-font-size: mat.m2-font-size($typography, body-2),
|
||||
--theme-body-2-font-size: mat.m2-font-size($typography, subtitle-2),
|
||||
--theme-body-1-line-height: mat.m2-line-height($typography, body-2),
|
||||
--theme-display-1-font-size: mat.m2-font-size($typography, headline-4),
|
||||
--theme-display-3-font-size: mat.m2-font-size($typography, headline-2),
|
||||
--theme-display-4-font-size: mat.m2-font-size($typography, headline-1),
|
||||
--theme-caption-font-size: mat.m2-font-size($typography, caption),
|
||||
--theme-title-font-size: mat.m2-font-size($typography, headline-6),
|
||||
--theme-subheading-1-font-size: mat.m2-font-size($typography, body-1),
|
||||
--theme-subheading-2-font-size: mat.m2-font-size($typography, subtitle-1),
|
||||
--theme-button-font-size: mat.m2-font-size($typography, button),
|
||||
--theme-headline-font-size: mat.m2-font-size($typography, headline-5),
|
||||
--theme-headline-line-height: mat.m2-line-height($typography, headline-5),
|
||||
--theme-adf-icon-1-font-size: map-get($custom-css-variables, 'theme-adf-icon-1-font-size'),
|
||||
--theme-adf-picture-1-font-size: map-get($custom-css-variables, 'theme-adf-picture-1-font-size'),
|
||||
--theme-adf-task-footer-font-size: map-get($custom-css-variables, 'theme-adf-task-footer-font-size'),
|
||||
--theme-adf-task-title-font-size: map-get($custom-css-variables, 'theme-adf-task-title-font-size'),
|
||||
|
||||
// specific colors
|
||||
--adf-theme-mat-grey-color-a200: mat.get-color-from-palette(mat.$grey-palette, A200),
|
||||
--adf-theme-mat-grey-color-a400: mat.get-color-from-palette(mat.$grey-palette, A400),
|
||||
--adf-theme-mat-grey-color-50: mat.get-color-from-palette(mat.$grey-palette, 50),
|
||||
|
||||
--adf-theme-mat-grey-color-a200: mat.m2-get-color-from-palette(mat.$m2-grey-palette, A200),
|
||||
--adf-theme-mat-grey-color-a400: mat.m2-get-color-from-palette(mat.$m2-grey-palette, A400),
|
||||
--adf-theme-mat-grey-color-50: mat.m2-get-color-from-palette(mat.$m2-grey-palette, 50),
|
||||
// spacing
|
||||
--adf-theme-spacing: map-get($custom-css-variables, 'theme-adf-spacing')
|
||||
);
|
||||
|
@@ -1,18 +1,18 @@
|
||||
@use '@angular/material' as mat;
|
||||
|
||||
$alfresco-typography: mat.define-typography-config(
|
||||
$alfresco-typography: mat.m2-define-typography-config(
|
||||
$font-family: 'Muli, Roboto, "Helvetica Neue", sans-serif',
|
||||
$headline-1: mat.define-typography-level(112px, 112px, 300),
|
||||
$headline-2: mat.define-typography-level(56px, 56px, 400),
|
||||
$headline-3: mat.define-typography-level(45px, 48px, 400),
|
||||
$headline-4: mat.define-typography-level(34px, 40px, 400),
|
||||
$headline-5: mat.define-typography-level(24px, 32px, 400),
|
||||
$headline-6: mat.define-typography-level(20px, 32px, 500),
|
||||
$subtitle-1: mat.define-typography-level(16px, 28px, 400),
|
||||
$body-1: mat.define-typography-level(15px, 24px, 400),
|
||||
$subtitle-2: mat.define-typography-level(14px, 24px, 500),
|
||||
$body-2: mat.define-typography-level(14px, 20px, 400),
|
||||
$caption: mat.define-typography-level(12px, 20px, 400),
|
||||
$button: mat.define-typography-level(14px, 14px, 500),
|
||||
$headline-1: mat.m2-define-typography-level(112px, 112px, 300),
|
||||
$headline-2: mat.m2-define-typography-level(56px, 56px, 400),
|
||||
$headline-3: mat.m2-define-typography-level(45px, 48px, 400),
|
||||
$headline-4: mat.m2-define-typography-level(34px, 40px, 400),
|
||||
$headline-5: mat.m2-define-typography-level(24px, 32px, 400),
|
||||
$headline-6: mat.m2-define-typography-level(20px, 32px, 500),
|
||||
$subtitle-1: mat.m2-define-typography-level(16px, 28px, 400),
|
||||
$body-1: mat.m2-define-typography-level(15px, 24px, 400),
|
||||
$subtitle-2: mat.m2-define-typography-level(14px, 24px, 500),
|
||||
$body-2: mat.m2-define-typography-level(14px, 20px, 400),
|
||||
$caption: mat.m2-define-typography-level(12px, 20px, 400),
|
||||
$button: mat.m2-define-typography-level(14px, 14px, 500),
|
||||
// Line-height must be unit-less fraction of the font-size.
|
||||
);
|
||||
|
@@ -4,14 +4,14 @@
|
||||
@include mat.all-component-typographies;
|
||||
@include mat.core;
|
||||
|
||||
$primary: mat.define-palette($alfresco-ecm-blue);
|
||||
$accent: mat.define-palette($alfresco-accent-orange);
|
||||
$warn: mat.define-palette($alfresco-warn);
|
||||
$theme: mat.define-light-theme(
|
||||
$primary: mat.m2-define-palette($alfresco-ecm-blue);
|
||||
$accent: mat.m2-define-palette($alfresco-accent-orange);
|
||||
$warn: mat.m2-define-palette($alfresco-warn);
|
||||
$theme: mat.m2-define-light-theme(
|
||||
(
|
||||
color: (
|
||||
primary: $primary,
|
||||
accent: $accent,
|
||||
accent: $accent
|
||||
),
|
||||
typography: $alfresco-typography
|
||||
)
|
||||
|
@@ -4,14 +4,14 @@
|
||||
@include mat.all-component-typographies;
|
||||
@include mat.core;
|
||||
|
||||
$primary: mat.define-palette(mat.$pink-palette, 700, 500, 900);
|
||||
$accent: mat.define-palette($alfresco-accent-purple);
|
||||
$warn: mat.define-palette($alfresco-warn);
|
||||
$theme: mat.define-light-theme(
|
||||
$primary: mat.m2-define-palette(mat.$m2-pink-palette, 700, 500, 900);
|
||||
$accent: mat.m2-define-palette($alfresco-accent-purple);
|
||||
$warn: mat.m2-define-palette($alfresco-warn);
|
||||
$theme: mat.m2-define-light-theme(
|
||||
(
|
||||
color: (
|
||||
primary: $primary,
|
||||
accent: $accent,
|
||||
accent: $accent
|
||||
),
|
||||
typography: $alfresco-typography
|
||||
)
|
||||
|
@@ -4,14 +4,14 @@
|
||||
@include mat.all-component-typographies;
|
||||
@include mat.core;
|
||||
|
||||
$primary: mat.define-palette($alfresco-ecm-cyan);
|
||||
$accent: mat.define-palette($alfresco-accent-orange);
|
||||
$warn: mat.define-palette($alfresco-warn);
|
||||
$theme: mat.define-light-theme(
|
||||
$primary: mat.m2-define-palette($alfresco-ecm-cyan);
|
||||
$accent: mat.m2-define-palette($alfresco-accent-orange);
|
||||
$warn: mat.m2-define-palette($alfresco-warn);
|
||||
$theme: mat.m2-define-light-theme(
|
||||
(
|
||||
color: (
|
||||
primary: $primary,
|
||||
accent: $accent,
|
||||
accent: $accent
|
||||
),
|
||||
typography: $alfresco-typography
|
||||
)
|
||||
|
@@ -4,14 +4,14 @@
|
||||
@include mat.all-component-typographies;
|
||||
@include mat.core;
|
||||
|
||||
$primary: mat.define-palette($alfresco-ecm-cyan);
|
||||
$accent: mat.define-palette($alfresco-accent-purple);
|
||||
$warn: mat.define-palette($alfresco-warn);
|
||||
$theme: mat.define-light-theme(
|
||||
$primary: mat.m2-define-palette($alfresco-ecm-cyan);
|
||||
$accent: mat.m2-define-palette($alfresco-accent-purple);
|
||||
$warn: mat.m2-define-palette($alfresco-warn);
|
||||
$theme: mat.m2-define-light-theme(
|
||||
(
|
||||
color: (
|
||||
primary: $primary,
|
||||
accent: $accent,
|
||||
accent: $accent
|
||||
),
|
||||
typography: $alfresco-typography
|
||||
)
|
||||
|
@@ -4,14 +4,14 @@
|
||||
@include mat.all-component-typographies;
|
||||
@include mat.core;
|
||||
|
||||
$primary: mat.define-palette($alfresco-bpm-green);
|
||||
$accent: mat.define-palette($alfresco-accent-orange);
|
||||
$warn: mat.define-palette($alfresco-warn);
|
||||
$theme: mat.define-light-theme(
|
||||
$primary: mat.m2-define-palette($alfresco-bpm-green);
|
||||
$accent: mat.m2-define-palette($alfresco-accent-orange);
|
||||
$warn: mat.m2-define-palette($alfresco-warn);
|
||||
$theme: mat.m2-define-light-theme(
|
||||
(
|
||||
color: (
|
||||
primary: $primary,
|
||||
accent: $accent,
|
||||
accent: $accent
|
||||
),
|
||||
typography: $alfresco-typography
|
||||
)
|
||||
|
@@ -4,14 +4,14 @@
|
||||
@include mat.all-component-typographies;
|
||||
@include mat.core;
|
||||
|
||||
$primary: mat.define-palette($alfresco-bpm-green);
|
||||
$accent: mat.define-palette($alfresco-accent-purple);
|
||||
$warn: mat.define-palette($alfresco-warn);
|
||||
$theme: mat.define-light-theme(
|
||||
$primary: mat.m2-define-palette($alfresco-bpm-green);
|
||||
$accent: mat.m2-define-palette($alfresco-accent-purple);
|
||||
$warn: mat.m2-define-palette($alfresco-warn);
|
||||
$theme: mat.m2-define-light-theme(
|
||||
(
|
||||
color: (
|
||||
primary: $primary,
|
||||
accent: $accent,
|
||||
accent: $accent
|
||||
),
|
||||
typography: $alfresco-typography
|
||||
)
|
||||
|
@@ -5,14 +5,14 @@
|
||||
@include mat.all-component-typographies;
|
||||
@include mat.core;
|
||||
|
||||
$primary: mat.define-palette(mat.$indigo-palette);
|
||||
$accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
|
||||
$warn: mat.define-palette($alfresco-warn);
|
||||
$theme: mat.define-light-theme(
|
||||
$primary: mat.m2-define-palette(mat.$m2-indigo-palette);
|
||||
$accent: mat.m2-define-palette(mat.$m2-pink-palette, A200, A100, A400);
|
||||
$warn: mat.m2-define-palette($alfresco-warn);
|
||||
$theme: mat.m2-define-light-theme(
|
||||
(
|
||||
color: (
|
||||
primary: $primary,
|
||||
accent: $accent,
|
||||
accent: $accent
|
||||
),
|
||||
typography: $alfresco-typography
|
||||
)
|
||||
|
@@ -5,14 +5,14 @@
|
||||
@include mat.all-component-typographies;
|
||||
@include mat.core;
|
||||
|
||||
$primary: mat.define-palette(mat.$pink-palette, 700, 500, 900);
|
||||
$accent: mat.define-palette(mat.$blue-grey-palette, A200, A100, A400);
|
||||
$warn: mat.define-palette($alfresco-warn);
|
||||
$theme: mat.define-dark-theme(
|
||||
$primary: mat.m2-define-palette(mat.$m2-pink-palette, 700, 500, 900);
|
||||
$accent: mat.m2-define-palette(mat.$m2-blue-grey-palette, A200, A100, A400);
|
||||
$warn: mat.m2-define-palette($alfresco-warn);
|
||||
$theme: mat.m2-define-dark-theme(
|
||||
(
|
||||
color: (
|
||||
primary: $primary,
|
||||
accent: $accent,
|
||||
accent: $accent
|
||||
),
|
||||
typography: $alfresco-typography
|
||||
)
|
||||
|
@@ -5,14 +5,14 @@
|
||||
@include mat.all-component-typographies;
|
||||
@include mat.core;
|
||||
|
||||
$primary: mat.define-palette(mat.$purple-palette, 700, 500, 800);
|
||||
$accent: mat.define-palette(mat.$green-palette, A200, A100, A400);
|
||||
$warn: mat.define-palette($alfresco-warn);
|
||||
$theme: mat.define-dark-theme(
|
||||
$primary: mat.m2-define-palette(mat.$m2-purple-palette, 700, 500, 800);
|
||||
$accent: mat.m2-define-palette(mat.$m2-green-palette, A200, A100, A400);
|
||||
$warn: mat.m2-define-palette($alfresco-warn);
|
||||
$theme: mat.m2-define-dark-theme(
|
||||
(
|
||||
color: (
|
||||
primary: $primary,
|
||||
accent: $accent,
|
||||
accent: $accent
|
||||
),
|
||||
typography: $alfresco-typography
|
||||
)
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { Injector } from '@angular/core';
|
||||
import { getTestBed, TestBed } from '@angular/core/testing';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
@@ -36,7 +36,6 @@ describe('TranslationService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
HttpClientModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
@@ -47,7 +46,8 @@ describe('TranslationService', () => {
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
provideTranslations('@alfresco/adf-core', 'assets/ng2-alfresco-core')
|
||||
provideTranslations('@alfresco/adf-core', 'assets/ng2-alfresco-core'),
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
]
|
||||
});
|
||||
|
||||
@@ -70,7 +70,7 @@ describe('TranslationService', () => {
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
responseText: JSON.stringify({TEST: 'This is a test', TEST2: 'This is another test'})
|
||||
responseText: JSON.stringify({ TEST: 'This is a test', TEST2: 'This is another test' })
|
||||
});
|
||||
});
|
||||
|
||||
@@ -82,7 +82,7 @@ describe('TranslationService', () => {
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
responseText: JSON.stringify({TEST: 'This is a test', TEST2: 'This is another test'})
|
||||
responseText: JSON.stringify({ TEST: 'This is a test', TEST2: 'This is another test' })
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -16,9 +16,10 @@
|
||||
*/
|
||||
|
||||
import { AppExtensionService } from '@alfresco/adf-extensions';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { ViewUtilService } from './view-util.service';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('ViewUtilService', () => {
|
||||
let viewUtilService: ViewUtilService;
|
||||
@@ -27,8 +28,8 @@ describe('ViewUtilService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [AppExtensionService]
|
||||
imports: [],
|
||||
providers: [AppExtensionService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
|
||||
viewUtilService = TestBed.inject(ViewUtilService);
|
||||
|
@@ -13,6 +13,7 @@
|
||||
"main": "lib/eslint-angular/index.ts",
|
||||
"generatePackageJson": true,
|
||||
"tsConfig": "lib/eslint-angular/tsconfig.lib.prod.json",
|
||||
"webpackConfig": "lib/eslint-angular/webpack.config.js",
|
||||
"stylePreprocessorOptions": {
|
||||
"includePaths": ["lib", "lib/core/src/lib"]
|
||||
},
|
||||
@@ -31,7 +32,7 @@
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/eslint:lint:eslint",
|
||||
"options": {
|
||||
"lintFilePatterns": ["lib/eslint-angular/**/*.ts"]
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ const messages = {
|
||||
|
||||
type MessageIds = keyof typeof messages;
|
||||
|
||||
const filetypeErrors: {regexp: RegExp; messageId: MessageIds}[] = [
|
||||
const filetypeErrors: { regexp: RegExp; messageId: MessageIds }[] = [
|
||||
{
|
||||
regexp: /.*\.spec\.ts/,
|
||||
messageId: 'useAngularMaterialTestingHarness'
|
||||
@@ -53,7 +53,7 @@ export default createESLintRule<unknown[], MessageIds>({
|
||||
type: 'suggestion',
|
||||
docs: {
|
||||
description: 'Disallows using Angular Material internal selectors',
|
||||
recommended: 'error'
|
||||
recommended: 'recommended'
|
||||
},
|
||||
hasSuggestions: true,
|
||||
schema: [],
|
||||
@@ -63,9 +63,9 @@ export default createESLintRule<unknown[], MessageIds>({
|
||||
create(context) {
|
||||
return {
|
||||
[ASTSelectors.join(',')](node: TSESTree.Literal | TSESTree.TemplateLiteral) {
|
||||
const message = filetypeErrors.find((fileTypeError) =>
|
||||
context.getFilename().match(fileTypeError.regexp)
|
||||
) || { messageId: 'noAngularMaterialSelectors' };
|
||||
const message = filetypeErrors.find((fileTypeError) => context.getFilename().match(fileTypeError.regexp)) || {
|
||||
messageId: 'noAngularMaterialSelectors'
|
||||
};
|
||||
|
||||
context.report({
|
||||
node,
|
||||
|
@@ -21,7 +21,7 @@ import { createESLintRule } from '../../utils/create-eslint-rule/create-eslint-r
|
||||
|
||||
export const RULE_NAME = 'use-none-component-view-encapsulation';
|
||||
|
||||
type MessageIds = 'useNoneComponentViewEncapsulation'| 'suggestAddViewEncapsulationNone';
|
||||
type MessageIds = 'useNoneComponentViewEncapsulation' | 'suggestAddViewEncapsulationNone';
|
||||
type DecoratorForClass = TSESTree.Decorator & {
|
||||
parent: TSESTree.ClassDeclaration;
|
||||
};
|
||||
@@ -54,7 +54,7 @@ export default createESLintRule<unknown[], MessageIds>({
|
||||
type: 'suggestion',
|
||||
docs: {
|
||||
description: `Disallows using other encapsulation than \`${viewEncapsulationNone}\``,
|
||||
recommended: false
|
||||
recommended: 'recommended'
|
||||
},
|
||||
hasSuggestions: true,
|
||||
schema: [],
|
||||
@@ -65,18 +65,13 @@ export default createESLintRule<unknown[], MessageIds>({
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
const encapsulationProperty = Selectors.metadataProperty(
|
||||
metadataPropertyName
|
||||
);
|
||||
const encapsulationProperty = Selectors.metadataProperty(metadataPropertyName);
|
||||
const withoutEncapsulationProperty =
|
||||
`${Selectors.COMPONENT_CLASS_DECORATOR}:matches([expression.arguments.length=0], [expression.arguments.0.type='ObjectExpression']:not(:has(${encapsulationProperty})))` as const;
|
||||
const nonNoneViewEncapsulationNoneProperty =
|
||||
`${Selectors.COMPONENT_CLASS_DECORATOR} > CallExpression > ObjectExpression > ` +
|
||||
`${encapsulationProperty}:matches([value.type='Identifier'][value.name='undefined'], [value.object.name='ViewEncapsulation'][value.property.name!='None'])`;
|
||||
const selectors = [
|
||||
withoutEncapsulationProperty,
|
||||
nonNoneViewEncapsulationNoneProperty
|
||||
].join(',');
|
||||
const selectors = [withoutEncapsulationProperty, nonNoneViewEncapsulationNoneProperty].join(',');
|
||||
return {
|
||||
[selectors](node: DecoratorForClass | PropertyInClassDecorator) {
|
||||
context.report({
|
||||
@@ -107,11 +102,7 @@ export default createESLintRule<unknown[], MessageIds>({
|
||||
moduleName: '@angular/core',
|
||||
node: node.parent
|
||||
}),
|
||||
RuleFixes.getDecoratorPropertyAddFix(
|
||||
node,
|
||||
fixer,
|
||||
`${metadataPropertyName}: ${viewEncapsulationNone}`
|
||||
)
|
||||
RuleFixes.getDecoratorPropertyAddFix(node, fixer, `${metadataPropertyName}: ${viewEncapsulationNone}`)
|
||||
].filter(isNotNullOrUndefined);
|
||||
}
|
||||
}
|
||||
|
20
lib/eslint-angular/webpack.config.js
Normal file
20
lib/eslint-angular/webpack.config.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin');
|
||||
const { join } = require('path');
|
||||
|
||||
module.exports = {
|
||||
output: {
|
||||
path: join(__dirname, '../../dist/libs/eslint-angular')
|
||||
},
|
||||
devServer: {
|
||||
port: 4200
|
||||
},
|
||||
plugins: [
|
||||
new NxAppWebpackPlugin({
|
||||
main: './index.ts',
|
||||
tsConfig: './tsconfig.lib.json',
|
||||
index: './index.ts',
|
||||
outputHashing: process.env['NODE_ENV'] === 'production' ? 'all' : 'none',
|
||||
optimization: process.env['NODE_ENV'] === 'production'
|
||||
})
|
||||
]
|
||||
};
|
@@ -32,7 +32,7 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/eslint:lint:eslint",
|
||||
"options": {
|
||||
"lintFilePatterns": ["lib/extensions/**/*.ts", "lib/extensions/**/*.html"]
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { DynamicExtensionComponent } from './dynamic.component';
|
||||
import { ComponentRegisterService } from '../../services/component-register.service';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
selector: 'test-component',
|
||||
@@ -48,8 +48,8 @@ describe('DynamicExtensionComponent', () => {
|
||||
componentRegister.setComponents({ 'test-component': TestComponent });
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientModule, DynamicExtensionComponent, TestComponent],
|
||||
providers: [{ provide: ComponentRegisterService, useValue: componentRegister }]
|
||||
imports: [DynamicExtensionComponent, TestComponent],
|
||||
providers: [{ provide: ComponentRegisterService, useValue: componentRegister }, provideHttpClient(withInterceptorsFromDi())]
|
||||
});
|
||||
|
||||
TestBed.compileComponents();
|
||||
|
@@ -16,9 +16,10 @@
|
||||
*/
|
||||
|
||||
import { TestBed, fakeAsync, flushMicrotasks, tick } from '@angular/core/testing';
|
||||
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
|
||||
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { ExtensionConfig } from '../config/extension.config';
|
||||
import { ExtensionLoaderService } from './extension-loader.service';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('ExtensionLoaderService', () => {
|
||||
let extensionLoaderService: ExtensionLoaderService;
|
||||
@@ -35,10 +36,8 @@ describe('ExtensionLoaderService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [
|
||||
ExtensionLoaderService
|
||||
]
|
||||
imports: [],
|
||||
providers: [ExtensionLoaderService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
extensionLoaderService = TestBed.inject(ExtensionLoaderService);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
@@ -85,10 +84,12 @@ describe('ExtensionLoaderService', () => {
|
||||
it('should load only extensions defined by $references', fakeAsync(() => {
|
||||
appExtensionsConfig.$references = ['test.extension.1.json'];
|
||||
|
||||
extensionLoaderService.load('assets/app.extensions.json', 'assets/plugins', ['test.extension.2.json, test.extension.3.json']).then((config: ExtensionConfig) => {
|
||||
const pluginsReference = config.$references.map((entry: ExtensionConfig) => entry.$name);
|
||||
expect(pluginsReference).toEqual(['test.extension.1']);
|
||||
});
|
||||
extensionLoaderService
|
||||
.load('assets/app.extensions.json', 'assets/plugins', ['test.extension.2.json, test.extension.3.json'])
|
||||
.then((config: ExtensionConfig) => {
|
||||
const pluginsReference = config.$references.map((entry: ExtensionConfig) => entry.$name);
|
||||
expect(pluginsReference).toEqual(['test.extension.1']);
|
||||
});
|
||||
|
||||
httpMock.expectOne('assets/app.extensions.json').flush(appExtensionsConfig);
|
||||
tick();
|
||||
@@ -98,20 +99,20 @@ describe('ExtensionLoaderService', () => {
|
||||
flushMicrotasks();
|
||||
}));
|
||||
|
||||
it('should load extensions from passed extension value',fakeAsync(() => {
|
||||
it('should load extensions from passed extension value', fakeAsync(() => {
|
||||
appExtensionsConfig.$references = ['test.extension.1.json'];
|
||||
|
||||
extensionLoaderService.load(
|
||||
'assets/app.extensions.json',
|
||||
'assets/plugins',
|
||||
undefined,
|
||||
[{
|
||||
$id: 'extension-value-id',
|
||||
$license: 'license',
|
||||
$name: 'name',
|
||||
$version:'version',
|
||||
$vendor: 'vendor'
|
||||
}]).then((config: ExtensionConfig) => {
|
||||
extensionLoaderService
|
||||
.load('assets/app.extensions.json', 'assets/plugins', undefined, [
|
||||
{
|
||||
$id: 'extension-value-id',
|
||||
$license: 'license',
|
||||
$name: 'name',
|
||||
$version: 'version',
|
||||
$vendor: 'vendor'
|
||||
}
|
||||
])
|
||||
.then((config: ExtensionConfig) => {
|
||||
const hasExtensionValue = config.$references.some((entry: ExtensionConfig) => entry.$id === 'extension-value-id');
|
||||
expect(hasExtensionValue).toBe(true);
|
||||
});
|
||||
@@ -122,17 +123,17 @@ describe('ExtensionLoaderService', () => {
|
||||
}));
|
||||
|
||||
it('should load extensions if only extension value was passed', fakeAsync(() => {
|
||||
extensionLoaderService.load(
|
||||
'assets/app.extensions.json',
|
||||
'assets/plugins',
|
||||
undefined,
|
||||
[{
|
||||
$id: 'extension-value-id',
|
||||
$license: 'license',
|
||||
$name: 'name',
|
||||
$version:'version',
|
||||
$vendor: 'vendor'
|
||||
}]).then((config: ExtensionConfig) => {
|
||||
extensionLoaderService
|
||||
.load('assets/app.extensions.json', 'assets/plugins', undefined, [
|
||||
{
|
||||
$id: 'extension-value-id',
|
||||
$license: 'license',
|
||||
$name: 'name',
|
||||
$version: 'version',
|
||||
$vendor: 'vendor'
|
||||
}
|
||||
])
|
||||
.then((config: ExtensionConfig) => {
|
||||
const hasExtensionValue = config.$references.some((entry: ExtensionConfig) => entry.$id === 'extension-value-id');
|
||||
expect(hasExtensionValue).toBe(true);
|
||||
});
|
||||
@@ -144,23 +145,24 @@ describe('ExtensionLoaderService', () => {
|
||||
it('should load extensions with multiple extension values', fakeAsync(() => {
|
||||
appExtensionsConfig.$references = ['test.extension.1.json'];
|
||||
|
||||
extensionLoaderService.load(
|
||||
'assets/app.extensions.json',
|
||||
'assets/plugins',
|
||||
undefined,
|
||||
[{
|
||||
$id: 'extension-value-id-1',
|
||||
$license: 'license',
|
||||
$name: 'name',
|
||||
$version:'version',
|
||||
$vendor: 'vendor'
|
||||
},{
|
||||
$id: 'extension-value-id-2',
|
||||
$license: 'license',
|
||||
$name: 'name',
|
||||
$version:'version',
|
||||
$vendor: 'vendor'
|
||||
}]).then((config: ExtensionConfig) => {
|
||||
extensionLoaderService
|
||||
.load('assets/app.extensions.json', 'assets/plugins', undefined, [
|
||||
{
|
||||
$id: 'extension-value-id-1',
|
||||
$license: 'license',
|
||||
$name: 'name',
|
||||
$version: 'version',
|
||||
$vendor: 'vendor'
|
||||
},
|
||||
{
|
||||
$id: 'extension-value-id-2',
|
||||
$license: 'license',
|
||||
$name: 'name',
|
||||
$version: 'version',
|
||||
$vendor: 'vendor'
|
||||
}
|
||||
])
|
||||
.then((config: ExtensionConfig) => {
|
||||
const hasFirstExtensionValue = config.$references.some((entry: ExtensionConfig) => entry.$id === 'extension-value-id-1');
|
||||
expect(hasFirstExtensionValue).toBe(true);
|
||||
const hasSecondExtensionValue = config.$references.some((entry: ExtensionConfig) => entry.$id === 'extension-value-id-2');
|
||||
|
@@ -33,7 +33,7 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/eslint:lint:eslint",
|
||||
"options": {
|
||||
"lintFilePatterns": ["lib/insights/**/*.ts", "lib/insights/**/*.html"]
|
||||
}
|
||||
|
@@ -76,7 +76,7 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/eslint:lint:eslint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["lib/js-api/**/*.ts"]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
export const parameters = {
|
||||
docs: { inlineStories: true },
|
||||
controls: { expanded: true }
|
||||
docs: { inlineStories: true },
|
||||
controls: { expanded: true }
|
||||
};
|
||||
export const tags = ['autodocs'];
|
||||
export const tags = ['autodocs', 'autodocs'];
|
||||
|
@@ -33,7 +33,7 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/eslint:lint:eslint",
|
||||
"options": {
|
||||
"lintFilePatterns": ["lib/process-services-cloud/**/*.ts", "lib/process-services-cloud/**/*.html"]
|
||||
}
|
||||
|
@@ -26,7 +26,8 @@ import {
|
||||
} from '../mock/identity-group.service.mock';
|
||||
import { mockFoodGroups } from '../mock/group-cloud.mock';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('IdentityGroupService', () => {
|
||||
let service: IdentityGroupService;
|
||||
@@ -35,8 +36,8 @@ describe('IdentityGroupService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule],
|
||||
providers: [IdentityGroupService]
|
||||
imports: [TranslateModule.forRoot()],
|
||||
providers: [IdentityGroupService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
service = TestBed.inject(IdentityGroupService);
|
||||
adfHttpClient = TestBed.inject(AdfHttpClient);
|
||||
|
@@ -21,7 +21,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ProcessFiltersCloudComponent } from './components/process-filters-cloud.component';
|
||||
import { MaterialModule } from '../../material.module';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { EditProcessFilterCloudComponent } from './components/edit-process-filter-cloud.component';
|
||||
import { ProcessFilterDialogCloudComponent } from './components/process-filter-dialog-cloud.component';
|
||||
import { AppListCloudModule } from './../../app/app-list-cloud.module';
|
||||
@@ -29,18 +29,9 @@ import { ProcessCommonModule } from '../../common/process-common.module';
|
||||
import { PeopleCloudModule } from '../../people/people-cloud.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
HttpClientModule,
|
||||
CommonModule,
|
||||
MaterialModule,
|
||||
AppListCloudModule,
|
||||
CoreModule,
|
||||
ProcessCommonModule,
|
||||
PeopleCloudModule
|
||||
],
|
||||
declarations: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent],
|
||||
exports: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent]
|
||||
exports: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent],
|
||||
imports: [FormsModule, ReactiveFormsModule, CommonModule, MaterialModule, AppListCloudModule, CoreModule, ProcessCommonModule, PeopleCloudModule],
|
||||
providers: [provideHttpClient(withInterceptorsFromDi())]
|
||||
})
|
||||
export class ProcessFiltersCloudModule { }
|
||||
export class ProcessFiltersCloudModule {}
|
||||
|
@@ -30,12 +30,13 @@ import {
|
||||
} from '../mock/task-filters-cloud.mock';
|
||||
import { UserPreferenceCloudService } from '../../../services/user-preference-cloud.service';
|
||||
import { PreferenceCloudServiceInterface } from '../../../services/preference-cloud.interface';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { NotificationCloudService } from '../../../services/notification-cloud.service';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
||||
import { IdentityUserService } from '../../../people/services/identity-user.service';
|
||||
import { ApolloModule } from 'apollo-angular';
|
||||
import { StorageService } from '@alfresco/adf-core';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('TaskFilterCloudService', () => {
|
||||
let service: TaskFilterCloudService;
|
||||
@@ -46,17 +47,20 @@ describe('TaskFilterCloudService', () => {
|
||||
let createPreferenceSpy: jasmine.Spy;
|
||||
let getCurrentUserInfoSpy: jasmine.Spy;
|
||||
|
||||
const identityUserMock = { username: 'fakeusername', firstName: 'fake-identity-first-name', lastName: 'fake-identity-last-name', email: 'fakeIdentity@email.com' };
|
||||
const identityUserMock = {
|
||||
username: 'fakeusername',
|
||||
firstName: 'fake-identity-first-name',
|
||||
lastName: 'fake-identity-last-name',
|
||||
email: 'fakeIdentity@email.com'
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
HttpClientTestingModule,
|
||||
ProcessServiceCloudTestingModule,
|
||||
ApolloModule
|
||||
],
|
||||
imports: [ProcessServiceCloudTestingModule, ApolloModule],
|
||||
providers: [
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: UserPreferenceCloudService }
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: UserPreferenceCloudService },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(TaskFilterCloudService);
|
||||
@@ -245,13 +249,20 @@ describe('Inject [LocalPreferenceCloudService] into the TaskFilterCloudService',
|
||||
let getPreferencesSpy: jasmine.Spy;
|
||||
let storageService: StorageService;
|
||||
|
||||
const identityUserMock = { username: 'fakeusername', firstName: 'fake-identity-first-name', lastName: 'fake-identity-last-name', email: 'fakeIdentity@email.com' };
|
||||
const identityUserMock = {
|
||||
username: 'fakeusername',
|
||||
firstName: 'fake-identity-first-name',
|
||||
lastName: 'fake-identity-last-name',
|
||||
email: 'fakeIdentity@email.com'
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, ProcessServiceCloudTestingModule, ApolloModule],
|
||||
imports: [ProcessServiceCloudTestingModule, ApolloModule],
|
||||
providers: [
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(TaskFilterCloudService);
|
||||
|
@@ -21,7 +21,7 @@ import { CommonModule } from '@angular/common';
|
||||
import { TaskFiltersCloudComponent } from './components/task-filters-cloud.component';
|
||||
import { MaterialModule } from '../../material.module';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { AppListCloudModule } from './../../app/app-list-cloud.module';
|
||||
import { ProcessCommonModule } from '../../common/process-common.module';
|
||||
import { PeopleCloudModule } from '../../people/people-cloud.module';
|
||||
@@ -34,10 +34,18 @@ import { GroupCloudModule } from '../../group/group-cloud.module';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
TaskFiltersCloudComponent,
|
||||
ServiceTaskFiltersCloudComponent,
|
||||
EditTaskFilterCloudComponent,
|
||||
EditServiceTaskFilterCloudComponent,
|
||||
TaskFilterDialogCloudComponent,
|
||||
TaskAssignmentFilterCloudComponent
|
||||
],
|
||||
exports: [TaskFiltersCloudComponent, ServiceTaskFiltersCloudComponent, EditTaskFilterCloudComponent, EditServiceTaskFilterCloudComponent],
|
||||
imports: [
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
HttpClientModule,
|
||||
CommonModule,
|
||||
MaterialModule,
|
||||
AppListCloudModule,
|
||||
@@ -47,14 +55,6 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
PeopleCloudModule,
|
||||
MatProgressSpinnerModule
|
||||
],
|
||||
declarations: [
|
||||
TaskFiltersCloudComponent,
|
||||
ServiceTaskFiltersCloudComponent,
|
||||
EditTaskFilterCloudComponent,
|
||||
EditServiceTaskFilterCloudComponent,
|
||||
TaskFilterDialogCloudComponent,
|
||||
TaskAssignmentFilterCloudComponent
|
||||
],
|
||||
exports: [TaskFiltersCloudComponent, ServiceTaskFiltersCloudComponent, EditTaskFilterCloudComponent, EditServiceTaskFilterCloudComponent]
|
||||
providers: [provideHttpClient(withInterceptorsFromDi())]
|
||||
})
|
||||
export class TaskFiltersCloudModule {}
|
||||
|
@@ -33,7 +33,7 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/eslint:lint:eslint",
|
||||
"options": {
|
||||
"lintFilePatterns": ["lib/process-services/**/*.ts", "lib/process-services/**/*.html"]
|
||||
}
|
||||
|
@@ -2,4 +2,4 @@ export const parameters = {
|
||||
docs: { inlineStories: true },
|
||||
controls: { expanded: true }
|
||||
};
|
||||
export const tags = ["autodocs"];
|
||||
export const tags = ['autodocs', 'autodocs'];
|
||||
|
@@ -11,8 +11,8 @@
|
||||
"projectRoot": "lib/testing",
|
||||
"outputPath": "dist/libs/testing",
|
||||
"main": "lib/testing/index.ts",
|
||||
"generatePackageJson": true,
|
||||
"tsConfig": "lib/testing/tsconfig.lib.prod.json",
|
||||
"webpackConfig": "lib/testing/webpack.config.js",
|
||||
"stylePreprocessorOptions": {
|
||||
"includePaths": ["lib", "lib/core/src/lib"]
|
||||
},
|
||||
@@ -24,14 +24,14 @@
|
||||
"projectRoot": "lib/testing",
|
||||
"outputPath": "dist/libs/testing",
|
||||
"main": "lib/testing/index.ts",
|
||||
"generatePackageJson": true,
|
||||
"tsConfig": "lib/testing/tsconfig.lib.prod.json"
|
||||
"tsConfig": "lib/testing/tsconfig.lib.prod.json",
|
||||
"webpackConfig": "lib/testing/webpack.config.js"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/eslint:lint:eslint",
|
||||
"options": {
|
||||
"lintFilePatterns": ["lib/testing/**/*.ts", "lib/testing/**/*.html"]
|
||||
}
|
||||
|
20
lib/testing/webpack.config.js
Normal file
20
lib/testing/webpack.config.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin');
|
||||
const { join } = require('path');
|
||||
|
||||
module.exports = {
|
||||
output: {
|
||||
path: join(__dirname, '../../dist/libs/testing')
|
||||
},
|
||||
devServer: {
|
||||
port: 4200
|
||||
},
|
||||
plugins: [
|
||||
new NxAppWebpackPlugin({
|
||||
main: './src/index.ts',
|
||||
tsConfig: './tsconfig.lib.json',
|
||||
index: './src/index.ts',
|
||||
outputHashing: process.env['NODE_ENV'] === 'production' ? 'all' : 'none',
|
||||
optimization: process.env['NODE_ENV'] === 'production'
|
||||
})
|
||||
]
|
||||
};
|
412
migrations.json
412
migrations.json
@@ -2,311 +2,307 @@
|
||||
"migrations": [
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.0",
|
||||
"description": "Remove @nrwl/cli.",
|
||||
"implementation": "./src/migrations/update-16-0-0/remove-nrwl-cli",
|
||||
"version": "17.0.0-beta.1",
|
||||
"description": "Updates the default cache directory to .nx/cache",
|
||||
"implementation": "./src/migrations/update-17-0-0/move-cache-directory",
|
||||
"package": "nx",
|
||||
"name": "16.0.0-remove-nrwl-cli"
|
||||
"name": "17.0.0-move-cache-directory"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.9",
|
||||
"description": "Replace `dependsOn.projects` and `inputs` definitions with new configuration format.",
|
||||
"implementation": "./src/migrations/update-16-0-0/update-depends-on-to-tokens",
|
||||
"version": "17.0.0-beta.3",
|
||||
"description": "Use minimal config for tasksRunnerOptions",
|
||||
"implementation": "./src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options",
|
||||
"package": "nx",
|
||||
"name": "16.0.0-tokens-for-depends-on"
|
||||
"name": "17.0.0-use-minimal-config-for-tasks-runner-options"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.0",
|
||||
"description": "Replace @nrwl/nx-cloud with nx-cloud",
|
||||
"implementation": "./src/migrations/update-16-0-0/update-nx-cloud-runner",
|
||||
"version": "17.0.0-rc.1",
|
||||
"description": "Migration for v17.0.0-rc.1",
|
||||
"implementation": "./src/migrations/update-17-0-0/rm-default-collection-npm-scope",
|
||||
"package": "nx",
|
||||
"name": "16.0.0-update-nx-cloud-runner"
|
||||
"name": "rm-default-collection-npm-scope"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.2.0-beta.0",
|
||||
"description": "Remove outputPath from run commands",
|
||||
"implementation": "./src/migrations/update-16-2-0/remove-run-commands-output-path",
|
||||
"version": "17.3.0-beta.6",
|
||||
"description": "Updates the nx wrapper.",
|
||||
"implementation": "./src/migrations/update-17-3-0/update-nxw",
|
||||
"package": "nx",
|
||||
"name": "16.2.0-remove-output-path-from-run-commands"
|
||||
"name": "17.3.0-update-nx-wrapper"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.6.0-beta.6",
|
||||
"description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed",
|
||||
"implementation": "./src/migrations/update-15-0-0/prefix-outputs",
|
||||
"version": "18.0.0-beta.2",
|
||||
"description": "Updates nx.json to disabled adding plugins when generating projects in an existing Nx workspace",
|
||||
"implementation": "./src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces",
|
||||
"x-repair-skip": true,
|
||||
"package": "nx",
|
||||
"name": "16.6.0-prefix-outputs"
|
||||
"name": "18.0.0-disable-adding-plugins-for-existing-workspaces"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.8.0-beta.3",
|
||||
"description": "Escape $ in env variables",
|
||||
"implementation": "./src/migrations/update-16-8-0/escape-dollar-sign-env-variables",
|
||||
"version": "18.1.0-beta.3",
|
||||
"description": "Moves affected.defaultBase to defaultBase in `nx.json`",
|
||||
"implementation": "./src/migrations/update-17-2-0/move-default-base",
|
||||
"package": "nx",
|
||||
"name": "16.8.0-escape-dollar-sign-env"
|
||||
"name": "move-default-base-to-nx-json-root"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.1",
|
||||
"description": "Replace @nx/workspace with @nx/workspace",
|
||||
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
|
||||
"package": "@nx/workspace",
|
||||
"name": "update-16-0-0-add-nx-packages"
|
||||
},
|
||||
{
|
||||
"version": "16.0.0-beta.4",
|
||||
"description": "Generates a plugin called 'workspace-plugin' containing your workspace generators.",
|
||||
"cli": "nx",
|
||||
"implementation": "./src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin",
|
||||
"package": "@nx/workspace",
|
||||
"name": "16-0-0-move-workspace-generators-into-local-plugin"
|
||||
},
|
||||
{
|
||||
"version": "16.0.0-beta.9",
|
||||
"description": "Fix .babelrc presets if it contains an invalid entry for @nx/web/babel.",
|
||||
"cli": "nx",
|
||||
"implementation": "./src/migrations/update-16-0-0/fix-invalid-babelrc",
|
||||
"package": "@nx/workspace",
|
||||
"name": "16-0-0-fix-invalid-babelrc"
|
||||
"version": "19.2.0-beta.2",
|
||||
"description": "Updates the default workspace data directory to .nx/workspace-data",
|
||||
"implementation": "./src/migrations/update-19-2-0/move-workspace-data-directory",
|
||||
"package": "nx",
|
||||
"name": "19-2-0-move-graph-cache-directory"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.1",
|
||||
"description": "Replace @nx/js with @nx/js",
|
||||
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
|
||||
"version": "19.2.2-beta.0",
|
||||
"description": "Updates the nx wrapper.",
|
||||
"implementation": "./src/migrations/update-17-3-0/update-nxw",
|
||||
"package": "nx",
|
||||
"name": "19-2-2-update-nx-wrapper"
|
||||
},
|
||||
{
|
||||
"version": "19.2.4-beta.0",
|
||||
"description": "Set project name in nx.json explicitly",
|
||||
"implementation": "./src/migrations/update-19-2-4/set-project-name",
|
||||
"x-repair-skip": true,
|
||||
"package": "nx",
|
||||
"name": "19-2-4-set-project-name"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "19.6.0-beta.0",
|
||||
"description": "Update workspace to use Storybook v8",
|
||||
"implementation": "./src/migrations/update-19-6-0/update-sb-8",
|
||||
"package": "@nx/storybook",
|
||||
"name": "update-19-6-0-add-nx-packages"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "17.0.2",
|
||||
"description": "Remove deprecated build options",
|
||||
"implementation": "./src/migrations/update-17-0-0/remove-deprecated-build-options",
|
||||
"package": "@nx/js",
|
||||
"name": "update-16-0-0-add-nx-packages"
|
||||
"name": "update-17-0-0-remove-deprecated-build-options"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.6.0-beta.0",
|
||||
"description": "Explicitly set 'updateBuildableProjectDepsInPackageJson' to 'true' in targets that rely on that value as the default.",
|
||||
"factory": "./src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps",
|
||||
"package": "@nx/js",
|
||||
"name": "explicitly-set-projects-to-update-buildable-deps"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.8.2-beta.0",
|
||||
"description": "Remove invalid options (strict, noInterop) for ES6 type modules.",
|
||||
"factory": "./src/migrations/update-16-8-2/update-swcrc",
|
||||
"package": "@nx/js",
|
||||
"name": "16-8-2-update-swcrc"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.1",
|
||||
"description": "Replace @nx/storybook with @nx/storybook",
|
||||
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
|
||||
"package": "@nx/storybook",
|
||||
"name": "update-16-0-0-add-nx-packages"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.1",
|
||||
"description": "Update workspace to use Storybook v7",
|
||||
"implementation": "./src/migrations/update-16-0-0/update-sb-7",
|
||||
"package": "@nx/storybook",
|
||||
"name": "update-16-0-0-migrate-7"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.1.0-beta.0",
|
||||
"description": "Ignore @nx/react/plugins/storybook in Storybook eslint rules.",
|
||||
"factory": "./src/migrations/update-16-1-0/eslint-ignore-react-plugin",
|
||||
"package": "@nx/storybook",
|
||||
"name": "update-16-1-0"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.5.0-beta.0",
|
||||
"description": "Move .storybook/tsconfig.json to tsconfig.storybook.json for non-Angular projects.",
|
||||
"factory": "./src/migrations/update-16-5-0/move-storybook-tsconfig",
|
||||
"package": "@nx/storybook",
|
||||
"name": "update-16-5-0"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.1",
|
||||
"description": "Replace @nx/eslint-plugin with @nx/eslint-plugin",
|
||||
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
|
||||
"version": "17.2.6-beta.1",
|
||||
"description": "Rename workspace rules from @nx/workspace/name to @nx/workspace-name",
|
||||
"implementation": "./src/migrations/update-17-2-6-rename-workspace-rules/rename-workspace-rules",
|
||||
"package": "@nx/eslint-plugin",
|
||||
"name": "update-16-0-0-add-nx-packages"
|
||||
"name": "update-17-2-6-rename-workspace-rules"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.1",
|
||||
"description": "Replace @nx/node with @nx/node",
|
||||
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
|
||||
"package": "@nx/node",
|
||||
"name": "update-16-0-0-add-nx-packages"
|
||||
"version": "19.1.0-beta.6",
|
||||
"description": "Migrate no-extra-semi rules into user config, out of nx extendable configs",
|
||||
"implementation": "./src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi",
|
||||
"package": "@nx/eslint-plugin",
|
||||
"name": "update-19-1-0-rename-no-extra-semi"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.5",
|
||||
"description": "Replace @nx/node:webpack with @nx/node:webpack",
|
||||
"implementation": "./src/migrations/update-16-0-0/update-webpack-executor",
|
||||
"package": "@nx/node",
|
||||
"name": "update-16-0-0-update-executor"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.3.1-beta.0",
|
||||
"description": "Replace @nx/node:webpack and @nx/node:webpack with @nx/webpack:webpack for all project targets",
|
||||
"implementation": "./src/migrations/update-16-3-1/update-webpack-executor",
|
||||
"package": "@nx/node",
|
||||
"name": "update-16-3-1-update-executor"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.4.0-beta.8",
|
||||
"description": "Replace @nx/node:node with @nx/js:node for all project targets",
|
||||
"implementation": "./src/migrations/update-16-4-0/replace-node-executor",
|
||||
"package": "@nx/node",
|
||||
"name": "update-16-4-0-replace-node-executor"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.1",
|
||||
"description": "Replace the deprecated library generator 'simpleModuleName' option from generator defaults with 'simpleName'",
|
||||
"factory": "./src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option",
|
||||
"version": "17.1.0-beta.5",
|
||||
"requires": { "@angular/core": ">=17.0.0" },
|
||||
"description": "Update the @angular/cli package version to ~17.0.0.",
|
||||
"factory": "./src/migrations/update-17-1-0/update-angular-cli",
|
||||
"package": "@nx/angular",
|
||||
"name": "remove-library-generator-simple-module-name-option"
|
||||
"name": "update-angular-cli-version-17-0-0"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.1",
|
||||
"description": "Replace @nx/angular with @nx/angular",
|
||||
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
|
||||
"version": "17.1.0-beta.5",
|
||||
"requires": { "@angular/core": ">=17.0.0" },
|
||||
"description": "Rename 'browserTarget' to 'buildTarget'.",
|
||||
"factory": "./src/migrations/update-17-1-0/browser-target-to-build-target",
|
||||
"package": "@nx/angular",
|
||||
"name": "update-16-0-0-add-nx-packages"
|
||||
"name": "rename-browser-target-to-build-target"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.6",
|
||||
"description": "Remove protractor as default e2eTestRunner from nxJson and project configurations",
|
||||
"implementation": "./src/migrations/update-16-0-0/remove-protractor-defaults",
|
||||
"version": "17.1.0-beta.5",
|
||||
"requires": { "@angular/core": ">=17.0.0" },
|
||||
"description": "Replace usages of '@nguniversal/builders' with '@angular-devkit/build-angular'.",
|
||||
"factory": "./src/migrations/update-17-1-0/replace-nguniversal-builders",
|
||||
"package": "@nx/angular",
|
||||
"name": "remove-protractor-defaults-from-generators"
|
||||
"name": "replace-nguniversal-builders"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.0.0-beta.6",
|
||||
"description": "Remove karma as default unitTestRunner from nxJson and project configurations",
|
||||
"implementation": "./src/migrations/update-16-0-0/remove-karma-defaults",
|
||||
"version": "17.1.0-beta.5",
|
||||
"requires": { "@angular/core": ">=17.0.0" },
|
||||
"description": "Replace usages of '@nguniversal/' packages with '@angular/ssr'.",
|
||||
"factory": "./src/migrations/update-17-1-0/replace-nguniversal-engines",
|
||||
"package": "@nx/angular",
|
||||
"name": "remove-karma-defaults-from-generators"
|
||||
"name": "replace-nguniversal-engines"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.1.0-beta.1",
|
||||
"requires": { "@angular/core": ">=15.0.0" },
|
||||
"description": "Remove exported `@angular/platform-server` `renderModule` method. The `renderModule` method is now exported by the Angular CLI.",
|
||||
"factory": "./src/migrations/update-16-1-0/remove-render-module-platform-server-exports",
|
||||
"version": "17.1.0-beta.5",
|
||||
"requires": { "@angular/core": ">=17.0.0" },
|
||||
"description": "Replace the deep imports from 'zone.js/dist/zone' and 'zone.js/dist/zone-testing' with 'zone.js' and 'zone.js/testing'.",
|
||||
"factory": "./src/migrations/update-17-1-0/update-zone-js-deep-import",
|
||||
"package": "@nx/angular",
|
||||
"name": "remove-render-module-platform-server-exports"
|
||||
"name": "update-zone-js-deep-import"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.1.0-beta.1",
|
||||
"requires": { "@angular/core": ">=16.0.0-rc.4" },
|
||||
"description": "Remove 'ngcc' invocation if exists from the 'postinstall' script in package.json.",
|
||||
"factory": "./src/migrations/update-16-1-0/remove-ngcc-invocation",
|
||||
"version": "17.2.0-beta.2",
|
||||
"description": "Rename '@nx/angular:webpack-dev-server' executor to '@nx/angular:dev-server'",
|
||||
"factory": "./src/migrations/update-17-2-0/rename-webpack-dev-server",
|
||||
"package": "@nx/angular",
|
||||
"name": "remove-ngcc-invocation"
|
||||
"name": "rename-webpack-dev-server-executor"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.1.0-beta.1",
|
||||
"requires": { "@angular/core": ">=16.0.0-rc.4" },
|
||||
"description": "Extract the app config for standalone apps",
|
||||
"factory": "./src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap",
|
||||
"version": "17.3.0-beta.10",
|
||||
"requires": { "@angular/core": ">=17.1.0" },
|
||||
"description": "Update the @angular/cli package version to ~17.1.0.",
|
||||
"factory": "./src/migrations/update-17-3-0/update-angular-cli",
|
||||
"package": "@nx/angular",
|
||||
"name": "extract-app-config-for-standalone"
|
||||
"name": "update-angular-cli-version-17-1-0"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.1.0-beta.1",
|
||||
"requires": { "@angular/core": ">=16.0.0-rc.4" },
|
||||
"description": "Update server executors' configuration to disable 'buildOptimizer' for non optimized builds.",
|
||||
"factory": "./src/migrations/update-16-1-0/update-server-executor-config",
|
||||
"version": "17.3.0-beta.10",
|
||||
"requires": { "@angular/core": ">=17.1.0" },
|
||||
"description": "Add 'browser-sync' as dev dependency when '@angular-devkit/build-angular:ssr-dev-server' or '@nx/angular:module-federation-dev-ssr' is used.",
|
||||
"factory": "./src/migrations/update-17-3-0/add-browser-sync-dependency",
|
||||
"package": "@nx/angular",
|
||||
"name": "update-server-executor-config"
|
||||
"name": "add-browser-sync-dependency"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.1.0-beta.1",
|
||||
"requires": { "@angular/core": ">=16.0.0" },
|
||||
"description": "Update the @angular/cli package version to ~16.0.0.",
|
||||
"factory": "./src/migrations/update-16-1-0/update-angular-cli",
|
||||
"version": "17.3.0-beta.10",
|
||||
"requires": { "@angular/core": ">=17.1.0" },
|
||||
"description": "Add 'autoprefixer' as dev dependency when '@nx/angular:ng-packagr-lite' or '@nx/angular:package` is used.",
|
||||
"factory": "./src/migrations/update-17-3-0/add-autoprefixer-dependency",
|
||||
"package": "@nx/angular",
|
||||
"name": "update-angular-cli-version-16-0-0"
|
||||
"name": "add-autoprefixer-dependency"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.4.0-beta.6",
|
||||
"requires": { "@angular-eslint/eslint-plugin-template": ">=16.0.0" },
|
||||
"description": "Remove the 'accessibility-' prefix from '@angular-eslint/eslint-plugin-template' rules.",
|
||||
"factory": "./src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules",
|
||||
"version": "18.0.0-beta.0",
|
||||
"description": "Add NX_MF_DEV_SERVER_STATIC_REMOTES to inputs for task hashing when '@nx/angular:webpack-browser' is used for Module Federation.",
|
||||
"factory": "./src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults",
|
||||
"package": "@nx/angular",
|
||||
"name": "rename-angular-eslint-accesibility-rules"
|
||||
"name": "add-module-federation-env-var-to-target-defaults"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.4.0-beta.11",
|
||||
"requires": { "@angular/core": ">=16.1.0" },
|
||||
"description": "Update the @angular/cli package version to ~16.1.0.",
|
||||
"factory": "./src/migrations/update-16-4-0/update-angular-cli",
|
||||
"version": "18.1.0-beta.1",
|
||||
"requires": { "@angular/core": ">=17.2.0" },
|
||||
"description": "Update the @angular/cli package version to ~17.2.0.",
|
||||
"factory": "./src/migrations/update-18-1-0/update-angular-cli",
|
||||
"package": "@nx/angular",
|
||||
"name": "update-angular-cli-version-16-1-0"
|
||||
"name": "update-angular-cli-version-17-2-0"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.6.0-beta.0",
|
||||
"description": "Explicitly set 'updateBuildableProjectDepsInPackageJson' to 'true' in targets that rely on that value as the default.",
|
||||
"factory": "./src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps",
|
||||
"version": "18.1.1-beta.0",
|
||||
"description": "Ensure targetDefaults inputs for task hashing when '@nx/angular:webpack-browser' is used are correct for Module Federation.",
|
||||
"factory": "./src/migrations/update-18-1-1/fix-target-defaults-inputs",
|
||||
"package": "@nx/angular",
|
||||
"name": "explicitly-set-projects-to-update-buildable-deps"
|
||||
"name": "fix-target-defaults-for-webpack-browser"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "16.7.0-beta.6",
|
||||
"requires": { "@angular/core": ">=16.2.0" },
|
||||
"description": "Update the @angular/cli package version to ~16.2.0.",
|
||||
"factory": "./src/migrations/update-16-7-0/update-angular-cli",
|
||||
"version": "18.2.0-beta.0",
|
||||
"requires": { "@angular/core": ">=17.3.0" },
|
||||
"description": "Update the @angular/cli package version to ~17.3.0.",
|
||||
"factory": "./src/migrations/update-18-2-0/update-angular-cli",
|
||||
"package": "@nx/angular",
|
||||
"name": "update-angular-cli-version-16-2-0"
|
||||
"name": "update-angular-cli-version-17-3-0"
|
||||
},
|
||||
{
|
||||
"version": "16.0.0",
|
||||
"description": "As of Angular v16, the `moduleId` property of `@Component` is deprecated as it no longer has any effect.",
|
||||
"factory": "./migrations/remove-module-id/bundle",
|
||||
"cli": "nx",
|
||||
"version": "19.1.0-beta.2",
|
||||
"requires": { "@angular/core": ">=18.0.0" },
|
||||
"description": "Update the @angular/cli package version to ~18.0.0.",
|
||||
"factory": "./src/migrations/update-19-1-0/update-angular-cli",
|
||||
"package": "@nx/angular",
|
||||
"name": "update-angular-cli-version-18-0-0"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "19.2.1-beta.0",
|
||||
"requires": { "@angular-eslint/eslint-plugin": ">=18.0.0" },
|
||||
"description": "Installs the '@typescript-eslint/utils' package when having installed '@angular-eslint/eslint-plugin' or '@angular-eslint/eslint-plugin-template' with version >=18.0.0.",
|
||||
"factory": "./src/migrations/update-19-2-1/add-typescript-eslint-utils",
|
||||
"package": "@nx/angular",
|
||||
"name": "add-typescript-eslint-utils"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "19.5.0-beta.1",
|
||||
"requires": { "@angular/core": ">=18.1.0" },
|
||||
"description": "Update the @angular/cli package version to ~18.1.0.",
|
||||
"factory": "./src/migrations/update-19-5-0/update-angular-cli",
|
||||
"package": "@nx/angular",
|
||||
"name": "update-angular-cli-version-18-1-0"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "19.6.0-beta.4",
|
||||
"description": "Ensure Module Federation DTS is turned off by default.",
|
||||
"factory": "./src/migrations/update-19-6-0/turn-off-dts-by-default",
|
||||
"package": "@nx/angular",
|
||||
"name": "update-19-6-0"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "19.6.0-beta.7",
|
||||
"requires": { "@angular/core": ">=18.2.0" },
|
||||
"description": "Update the @angular/cli package version to ~18.2.0.",
|
||||
"factory": "./src/migrations/update-19-6-0/update-angular-cli",
|
||||
"package": "@nx/angular",
|
||||
"name": "update-angular-cli-version-18-2-0"
|
||||
},
|
||||
{
|
||||
"cli": "nx",
|
||||
"version": "19.6.1-beta.0",
|
||||
"description": "Ensure Target Defaults are set correctly for Module Federation.",
|
||||
"factory": "./src/migrations/update-19-6-1/ensure-depends-on-for-mf",
|
||||
"package": "@nx/angular",
|
||||
"name": "update-19-6-1-ensure-module-federation-target-defaults"
|
||||
},
|
||||
{
|
||||
"version": "18.0.0",
|
||||
"description": "Updates two-way bindings that have an invalid expression to use the longform expression instead.",
|
||||
"factory": "./migrations/invalid-two-way-bindings/bundle",
|
||||
"package": "@angular/core",
|
||||
"name": "migration-v16-remove-module-id"
|
||||
"name": "invalid-two-way-bindings"
|
||||
},
|
||||
{
|
||||
"version": "16.0.0",
|
||||
"description": "In Angular version 15.2, the guard and resolver interfaces (CanActivate, Resolve, etc) were deprecated. This migration removes imports and 'implements' clauses that contain them.",
|
||||
"factory": "./migrations/guard-and-resolve-interfaces/bundle",
|
||||
"version": "18.0.0",
|
||||
"description": "Replace deprecated HTTP related modules with provider functions",
|
||||
"factory": "./migrations/http-providers/bundle",
|
||||
"package": "@angular/core",
|
||||
"name": "migration-v16-guard-and-resolve-interfaces"
|
||||
"name": "migration-http-providers"
|
||||
},
|
||||
{
|
||||
"version": "16.0.0-0",
|
||||
"description": "Updates the Angular Material to v16",
|
||||
"factory": "./ng-update/index_bundled#updateToV16",
|
||||
"version": "18.1.0",
|
||||
"description": "Updates calls to afterRender with an explicit phase to the new API",
|
||||
"factory": "./migrations/after-render-phase/bundle",
|
||||
"package": "@angular/core",
|
||||
"name": "migration-after-render-phase"
|
||||
},
|
||||
{
|
||||
"version": "18.0.0-0",
|
||||
"description": "Updates Angular Material to v18",
|
||||
"factory": "./ng-update/index_bundled#updateToV18",
|
||||
"package": "@angular/material",
|
||||
"name": "migration-v16"
|
||||
"name": "migration-v18"
|
||||
},
|
||||
{
|
||||
"version": "16.0.0-0",
|
||||
"description": "Updates the Angular CDK to v16",
|
||||
"factory": "./ng-update/index#updateToV16",
|
||||
"version": "18.0.0-0",
|
||||
"description": "Updates the Angular CDK to v18",
|
||||
"factory": "./ng-update/index#updateToV18",
|
||||
"package": "@angular/cdk",
|
||||
"name": "migration-v16"
|
||||
"name": "migration-v18"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
24
nx.json
24
nx.json
@@ -1,25 +1,28 @@
|
||||
{
|
||||
"npmScope": "adf",
|
||||
"defaultProject": "demoshell",
|
||||
"affected": {
|
||||
"defaultBase": "develop"
|
||||
},
|
||||
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
||||
"targetDefaults": {
|
||||
"build": {
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": ["production", "^production"]
|
||||
"inputs": ["production", "^production"],
|
||||
"cache": true
|
||||
},
|
||||
"build-storybook": {
|
||||
"inputs": ["default", "^production", "{projectRoot}/.storybook/**/*", "{projectRoot}/tsconfig.storybook.json"]
|
||||
},
|
||||
"lint": {
|
||||
"cache": true
|
||||
},
|
||||
"test": {
|
||||
"cache": true
|
||||
},
|
||||
"stylelint": {
|
||||
"cache": true
|
||||
}
|
||||
},
|
||||
"tasksRunnerOptions": {
|
||||
"default": {
|
||||
"runner": "nx/tasks-runners/default",
|
||||
"options": {
|
||||
"cacheableOperations": ["build", "lint", "test", "stylelint"],
|
||||
"cacheDirectory": "nxcache",
|
||||
"runtimeCacheInputs": ["node -v"]
|
||||
}
|
||||
}
|
||||
@@ -41,5 +44,8 @@
|
||||
"!{projectRoot}/karma.conf.js",
|
||||
"!{projectRoot}/tsconfig.storybook.json"
|
||||
]
|
||||
}
|
||||
},
|
||||
"cacheDirectory": "nxcache",
|
||||
"useInferencePlugins": false,
|
||||
"defaultBase": "develop"
|
||||
}
|
||||
|
15349
package-lock.json
generated
15349
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
98
package.json
98
package.json
@@ -51,26 +51,27 @@
|
||||
"process services-cloud"
|
||||
],
|
||||
"dependencies": {
|
||||
"@angular/animations": "16.2.9",
|
||||
"@angular/cdk": "16.2.9",
|
||||
"@angular/common": "16.2.9",
|
||||
"@angular/compiler": "16.2.9",
|
||||
"@angular/core": "16.2.9",
|
||||
"@angular/forms": "16.2.9",
|
||||
"@angular/material": "16.2.9",
|
||||
"@angular/material-date-fns-adapter": "16.2.9",
|
||||
"@angular/platform-browser": "16.2.9",
|
||||
"@angular/platform-browser-dynamic": "16.2.9",
|
||||
"@angular/router": "16.2.9",
|
||||
"@angular/animations": "18.2.2",
|
||||
"@angular/cdk": "18.2.2",
|
||||
"@angular/common": "18.2.2",
|
||||
"@angular/compiler": "18.2.2",
|
||||
"@angular/core": "18.2.2",
|
||||
"@angular/forms": "18.2.2",
|
||||
"@angular/material": "18.2.2",
|
||||
"@angular/material-date-fns-adapter": "18.2.2",
|
||||
"@angular/platform-browser": "18.2.2",
|
||||
"@angular/platform-browser-dynamic": "18.2.2",
|
||||
"@angular/router": "18.2.2",
|
||||
"@apollo/client": "^3.10.2",
|
||||
"@cspell/eslint-plugin": "^7.3.6",
|
||||
"@mat-datetimepicker/core": "12.0.1",
|
||||
"@mat-datetimepicker/core": "14.0.0",
|
||||
"@ngx-translate/core": "^14.0.0",
|
||||
"@storybook/core-server": "^8.2.7",
|
||||
"@storybook/theming": "^8.2.7",
|
||||
"@storybook/addon-interactions": "^8.2.9",
|
||||
"@storybook/core-server": "^8.2.9",
|
||||
"@storybook/theming": "^8.2.9",
|
||||
"angular-oauth2-oidc": "^13.0.1",
|
||||
"angular-oauth2-oidc-jwks": "^17.0.2",
|
||||
"apollo-angular": "^5.0.2",
|
||||
"apollo-angular": "7.1.2",
|
||||
"chart.js": "^4.3.0",
|
||||
"cropperjs": "1.6.2",
|
||||
"date-fns": "^2.30.0",
|
||||
@@ -78,29 +79,29 @@
|
||||
"event-emitter": "^0.3.5",
|
||||
"material-icons": "^1.13.12",
|
||||
"minimatch-browser": "1.0.0",
|
||||
"monaco-editor": "0.41.0",
|
||||
"monaco-editor": "0.50.0",
|
||||
"ng2-charts": "^4.1.1",
|
||||
"ngx-monaco-editor-v2": "16.0.1",
|
||||
"ngx-monaco-editor-v2": "18.1.0",
|
||||
"pdfjs-dist": "3.3.122",
|
||||
"raphael": "2.3.0",
|
||||
"rxjs": "7.8.1",
|
||||
"subscriptions-transport-ws": "^0.11.0",
|
||||
"superagent": "^9.0.1",
|
||||
"tslib": "^2.6.2",
|
||||
"zone.js": "0.13.3"
|
||||
"zone.js": "0.14.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alfresco/eslint-plugin-eslint-angular": "file:lib/eslint-angular",
|
||||
"@angular-devkit/architect": "0.1602.9",
|
||||
"@angular-devkit/build-angular": "16.2.9",
|
||||
"@angular-devkit/core": "16.2.9",
|
||||
"@angular-devkit/schematics": "16.2.9",
|
||||
"@angular-eslint/eslint-plugin": "16.0.3",
|
||||
"@angular-eslint/eslint-plugin-template": "16.0.3",
|
||||
"@angular-eslint/template-parser": "16.0.3",
|
||||
"@angular/cli": "~16.2.0",
|
||||
"@angular/compiler-cli": "16.2.9",
|
||||
"@chromatic-com/storybook": "^1.6.1",
|
||||
"@angular-devkit/architect": "0.1802.1",
|
||||
"@angular-devkit/build-angular": "18.2.1",
|
||||
"@angular-devkit/core": "18.2.1",
|
||||
"@angular-devkit/schematics": "18.2.1",
|
||||
"@angular-eslint/eslint-plugin": "18.3.0",
|
||||
"@angular-eslint/eslint-plugin-template": "18.3.0",
|
||||
"@angular-eslint/template-parser": "18.3.0",
|
||||
"@angular/cli": "~18.2.0",
|
||||
"@angular/compiler-cli": "18.2.2",
|
||||
"@chromatic-com/storybook": "^1.8.0",
|
||||
"@editorjs/code": "2.9.0",
|
||||
"@editorjs/editorjs": "^2.29.0",
|
||||
"@editorjs/header": "2.8.1",
|
||||
@@ -108,17 +109,20 @@
|
||||
"@editorjs/list": "1.9.0",
|
||||
"@editorjs/marker": "1.4.0",
|
||||
"@editorjs/underline": "1.1.0",
|
||||
"@nx/js": "16.10.0",
|
||||
"@nx/storybook": "^19.5.6",
|
||||
"@nx/workspace": "16.10.0",
|
||||
"@nx/angular": "19.6.4",
|
||||
"@nx/eslint-plugin": "19.6.4",
|
||||
"@nx/js": "19.6.4",
|
||||
"@nx/node": "19.6.4",
|
||||
"@nx/storybook": "19.6.4",
|
||||
"@nx/workspace": "19.6.4",
|
||||
"@paperist/types-remark": "0.1.3",
|
||||
"@playwright/test": "^1.35.1",
|
||||
"@quanzo/change-font-size": "1.0.0",
|
||||
"@schematics/angular": "16.2.9",
|
||||
"@storybook/addon-essentials": "^8.2.7",
|
||||
"@storybook/angular": "^8.2.7",
|
||||
"@storybook/core-server": "^8.2.7",
|
||||
"@storybook/manager-api": "^8.2.7",
|
||||
"@schematics/angular": "18.2.1",
|
||||
"@storybook/addon-essentials": "^8.2.9",
|
||||
"@storybook/angular": "^8.2.9",
|
||||
"@storybook/core-server": "^8.2.9",
|
||||
"@storybook/manager-api": "^8.2.9",
|
||||
"@types/ejs": "^3.1.5",
|
||||
"@types/event-emitter": "^0.3.3",
|
||||
"@types/jasmine": "4.0.3",
|
||||
@@ -126,14 +130,15 @@
|
||||
"@types/jsdom": "^21.1.5",
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"@types/mocha": "^10.0.6",
|
||||
"@types/node": "^20.10.0",
|
||||
"@types/node": "^18.16.9",
|
||||
"@types/pdfjs-dist": "^2.10.378",
|
||||
"@types/selenium-webdriver": "^4.1.17",
|
||||
"@types/shelljs": "^0.8.15",
|
||||
"@types/superagent": "^4.1.22",
|
||||
"@typescript-eslint/eslint-plugin": "5.59.8",
|
||||
"@typescript-eslint/parser": "5.62.0",
|
||||
"@typescript-eslint/eslint-plugin": "7.18.0",
|
||||
"@typescript-eslint/parser": "7.10.0",
|
||||
"@typescript-eslint/typescript-estree": "7.1.1",
|
||||
"@typescript-eslint/utils": "^7.16.0",
|
||||
"ajv": "^8.12.0",
|
||||
"commander": "12.0.0",
|
||||
"css-loader": "^6.10.0",
|
||||
@@ -143,7 +148,7 @@
|
||||
"editorjs-text-color-plugin": "1.13.1",
|
||||
"ejs": "^3.1.10",
|
||||
"eslint": "^8.47.0",
|
||||
"eslint-config-prettier": "^8.10.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-plugin-ban": "^1.6.0",
|
||||
"eslint-plugin-import": "2.29.1",
|
||||
"eslint-plugin-jsdoc": "40.1.0",
|
||||
@@ -175,10 +180,10 @@
|
||||
"mini-css-extract-plugin": "^2.7.6",
|
||||
"mocha": "^10.2.0",
|
||||
"moment": "^2.29.4",
|
||||
"ng-packagr": "16.2.3",
|
||||
"ng-packagr": "18.2.1",
|
||||
"nock": "^13.3.8",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"nx": "16.10.0",
|
||||
"nx": "19.6.4",
|
||||
"postcss": "^8.4.31",
|
||||
"postcss-sass": "^0.5.0",
|
||||
"prettier": "2.8.8",
|
||||
@@ -191,18 +196,15 @@
|
||||
"selenium-webdriver": "^4.14.0",
|
||||
"shelljs": "^0.8.5",
|
||||
"spdx-license-list": "^6.9.0",
|
||||
"storybook": "^8.2.7",
|
||||
"storybook": "^8.2.9",
|
||||
"stylelint": "^16.3.1",
|
||||
"stylelint-config-standard-scss": "^13.1.0",
|
||||
"ts-node": "^10.9.2",
|
||||
"tsconfig-paths": "^4.1.1",
|
||||
"typescript": "5.1.6",
|
||||
"typescript": "5.5.4",
|
||||
"webdriver-manager": "12.1.9",
|
||||
"webpack": "^5.90.3",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"@nx/eslint-plugin": "16.10.0",
|
||||
"@nx/node": "16.10.0",
|
||||
"@nx/angular": "16.10.0"
|
||||
"webpack-cli": "^5.1.4"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"bundlesize": [
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Storybook 7 Migration Summary
|
||||
# Storybook 8 Migration Summary
|
||||
|
||||
## Upgrade Storybook packages
|
||||
|
||||
@@ -8,26 +8,19 @@ The following command was ran to upgrade the Storybook packages:
|
||||
npx storybook@latest upgrade
|
||||
```
|
||||
|
||||
## Your `.storybook/main.js|ts` files were prepared for Storybook's automigration scripts
|
||||
|
||||
Some adjustments were made to your `.storybook/main.js|ts` files so that
|
||||
the Storybook automigration scripts could run successfully. The changes that were made are as follows:
|
||||
|
||||
- Remove the `as StorybookConfig` typecast from the main.ts files, if any,
|
||||
since it is not needed any more.
|
||||
- Remove the `path.resolve` calls from the Next.js Storybook configuration, if any, since it breaks the Storybook automigration scripts.
|
||||
|
||||
## The Storybook automigration scripts were ran
|
||||
|
||||
The following commands ran successfully and your Storybook configuration was successfully migrated to the latest version 7:
|
||||
|
||||
- `npx storybook@latest automigrate --config-dir lib/content-services/.storybook --renderer @storybook/angular`
|
||||
- `npx storybook@latest automigrate --config-dir .storybook`
|
||||
|
||||
- `npx storybook@latest automigrate --config-dir lib/core/.storybook --renderer @storybook/angular`
|
||||
- `npx storybook@latest automigrate --config-dir lib/content-services/.storybook`
|
||||
|
||||
- `npx storybook@latest automigrate --config-dir lib/process-services-cloud/.storybook --renderer @storybook/angular`
|
||||
- `npx storybook@latest automigrate --config-dir lib/core/.storybook`
|
||||
|
||||
- `npx storybook@latest automigrate --config-dir lib/stories/.storybook --renderer @storybook/angular`
|
||||
- `npx storybook@latest automigrate --config-dir lib/process-services-cloud/.storybook`
|
||||
|
||||
- `npx storybook@latest automigrate --config-dir lib/stories/.storybook`
|
||||
|
||||
Please make sure to check the results yourself and make sure that everything is working as expected.
|
||||
|
||||
@@ -35,19 +28,6 @@ Also, we may have missed something. Please make sure to check the logs of the St
|
||||
the `❌ Failed trying to evaluate` message or `❌ The migration failed to update` message. This will indicate if a command was
|
||||
unsuccessful, and will help you run the migration again, manually.
|
||||
|
||||
## Final adjustments
|
||||
|
||||
After the Storybook automigration scripts have run, some additional adjustments were made to your
|
||||
workspace, to make sure that everything is working as expected. These adjustments are as follows:
|
||||
|
||||
- The `vite-tsconfig-paths` plugin was removed from the Storybook configuration files since it's no longer needed.
|
||||
- The `viteConfigPath` option was added to the Storybook builder, where needed.
|
||||
- The import package for the `StorybookConfig` type was changed to be framework specific.
|
||||
- The `uiFramework` option was removed from your project's Storybook targets.
|
||||
- The `lit` package was added to your workspace, if you are using the
|
||||
Web Components `@storybook/web-components` package. Please note that the `lit-html` package is
|
||||
no longer needed by Storybook v7. So, if you are not using it anywhere else, you can safely remove it.
|
||||
|
||||
## Next steps
|
||||
|
||||
You can make sure everything is working as expected by trying
|
||||
@@ -61,8 +41,6 @@ npx nx build-storybook project-name
|
||||
npx nx storybook project-name
|
||||
```
|
||||
|
||||
Please read the [Storybook 7.0.0 release article](https://storybook.js.org/blog/storybook-7-0/) and the
|
||||
official [Storybook 7.0.0 migration guide](https://storybook.js.org/docs/react/migration-guide)
|
||||
Please read the [Storybook 8.0.0 release article](https://storybook.js.org/blog/storybook-8/) and the
|
||||
official [Storybook 8.0.0 migration guide](https://storybook.js.org/docs/react/migration-guide)
|
||||
for more information.
|
||||
|
||||
You can also read the docs for the [@nx/storybook:migrate-7 generator](https://nx.dev/nx-api/storybook/generators/migrate-7) and our [Storybook 7 setup guide](https://nx.dev/nx-api/storybook/documents/storybook-7-setup).
|
||||
|
Reference in New Issue
Block a user