Skip to content

Commit

Permalink
Improved solutio for token with no need to set it explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoAlbano committed Oct 15, 2024
1 parent 24b4006 commit 57eb75d
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 53 deletions.
5 changes: 2 additions & 3 deletions app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
import { AuthGuard, AuthModule, CoreModule, JWT_STORAGE_SERVICE, StorageService, TRANSLATION_PROVIDER } from '@alfresco/adf-core';
import { AuthGuard, AuthModule, CoreModule, TRANSLATION_PROVIDER } from '@alfresco/adf-core';
import { AppService } from '@alfresco/aca-shared';

import { AppExtensionsModule } from './extensions.module';
Expand Down Expand Up @@ -111,8 +111,7 @@ registerLocaleData(localeSv);
name: 'app',
source: 'assets'
}
},
{ provide: JWT_STORAGE_SERVICE, useClass: StorageService }
}
],
declarations: [AppComponent],
bootstrap: [AppComponent]
Expand Down
60 changes: 30 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
},
"private": true,
"dependencies": {
"@alfresco/adf-content-services": "7.0.0-alpha.4-11336342104",
"@alfresco/adf-core": "7.0.0-alpha.4-11336342104",
"@alfresco/adf-extensions": "7.0.0-alpha.4-11336342104",
"@alfresco/eslint-plugin-eslint-angular": "7.0.0-alpha.4-11336342104",
"@alfresco/js-api": ">=8.0.0-alpha.4-11336342104",
"@alfresco/adf-content-services": "7.0.0-alpha.4-11348846149",
"@alfresco/adf-core": "7.0.0-alpha.4-11348846149",
"@alfresco/adf-extensions": "7.0.0-alpha.4-11348846149",
"@alfresco/eslint-plugin-eslint-angular": "7.0.0-alpha.4-11348846149",
"@alfresco/js-api": ">=8.0.0-alpha.4-11348846149",
"@angular/animations": "16.2.9",
"@angular/cdk": "16.2.9",
"@angular/common": "16.2.9",
Expand Down Expand Up @@ -62,7 +62,7 @@
"zone.js": "0.13.3"
},
"devDependencies": {
"@alfresco/adf-cli": "7.0.0-alpha.4-11336342104",
"@alfresco/adf-cli": "7.0.0-alpha.4-11348846149",
"@angular-devkit/build-angular": "16.2.9",
"@angular-devkit/core": "16.2.9",
"@angular-devkit/schematics": "16.2.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Overlay } from '@angular/cdk/overlay';
import { Injector } from '@angular/core';
import { Store } from '@ngrx/store';
import { of } from 'rxjs';
import { AuthModule, CoreModule, JWT_STORAGE_SERVICE, StorageService, UserPreferencesService } from '@alfresco/adf-core';
import { AuthModule, CoreModule, UserPreferencesService } from '@alfresco/adf-core';
import { ContextMenuService } from './context-menu.service';
import { TranslateModule } from '@ngx-translate/core';
import { ContextMenuComponent } from './context-menu.component';
Expand All @@ -52,12 +52,7 @@ describe('ContextMenuService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [TranslateModule.forRoot(), CoreModule.forRoot(), ContextMenuComponent, AuthModule.forRoot()],
providers: [
Overlay,
{ provide: Store, useValue: { select: () => of() } },
UserPreferencesService,
{ provide: JWT_STORAGE_SERVICE, useClass: StorageService }
]
providers: [Overlay, { provide: Store, useValue: { select: () => of() } }, UserPreferencesService]
});

injector = TestBed.inject(Injector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DatatableCellBadgesComponent } from './datatable-cell-badges.component';
import { AppExtensionService } from '@alfresco/aca-shared';
import { TranslateModule } from '@ngx-translate/core';
import { AuthModule, JWT_STORAGE_SERVICE, StorageService } from '@alfresco/adf-core';
import { AuthModule } from '@alfresco/adf-core';
import { Actions } from '@ngrx/effects';
import { NodeEntry } from '@alfresco/js-api';
import { of } from 'rxjs';
Expand Down Expand Up @@ -76,7 +76,7 @@ describe('DatatableCellBadgesComponent', () => {
}
)
],
providers: [Actions, { provide: JWT_STORAGE_SERVICE, useClass: StorageService }]
providers: [Actions]
});

fixture = TestBed.createComponent(DatatableCellBadgesComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpClientModule } from '@angular/common/http';
import { TranslateModule } from '@ngx-translate/core';
import { By } from '@angular/platform-browser';
import { AuthModule, JWT_STORAGE_SERVICE, StorageService } from '@alfresco/adf-core';
import { AuthModule } from '@alfresco/adf-core';
import { Component, Input } from '@angular/core';
import { NodeEntry } from '@alfresco/js-api';

Expand Down Expand Up @@ -70,7 +70,7 @@ describe('CustomNameColumnComponent', () => {
}
)
],
providers: [Actions, { provide: JWT_STORAGE_SERVICE, useClass: StorageService }]
providers: [Actions]
});

fixture = TestBed.createComponent(CustomNameColumnComponent);
Expand Down
5 changes: 2 additions & 3 deletions projects/aca-shared/src/lib/testing/lib-testing-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import { Injectable, NgModule } from '@angular/core';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { JWT_STORAGE_SERVICE, StorageService, TranslateLoaderService, TranslationMock, TranslationService } from '@alfresco/adf-core';
import { TranslateLoaderService, TranslationMock, TranslationService } from '@alfresco/adf-core';
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
import { HttpClientModule } from '@angular/common/http';
import { RouterTestingModule } from '@angular/router/testing';
Expand Down Expand Up @@ -122,8 +122,7 @@ export class DocumentBasePageServiceMock extends DocumentBasePageService {
exports: [TranslateModule],
providers: [
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: TranslationService, useClass: TranslationMock },
{ provide: JWT_STORAGE_SERVICE, useClass: StorageService }
{ provide: TranslationService, useClass: TranslationMock }
]
})
export class LibTestingModule {}

0 comments on commit 57eb75d

Please sign in to comment.