Skip to content

Commit

Permalink
[MIGRATION] - fixed build and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoAlbano committed Nov 14, 2024
1 parent 8573124 commit 24eb40a
Show file tree
Hide file tree
Showing 97 changed files with 119 additions and 453 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ describe('SavedSearchesService', () => {

/**
* Creates a stub with Promise returning a Blob
*
* @returns Promise with Blob
*/
function createBlob() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export class SavedSearchesService {

/**
* Gets a list of saved searches by user.
*
* @returns SavedSearch list containing user saved searches
*/
getSavedSearches(): Observable<SavedSearch[]> {
Expand All @@ -76,7 +75,6 @@ export class SavedSearchesService {
/**
* Saves a new search into state and updates state. If there are less than 5 searches,
* it will be pushed on first place, if more it will be pushed to 6th place.
*
* @param newSaveSearch object { name: string, description: string, encodedUrl: string }
* @returns NodeEntry
*/
Expand Down Expand Up @@ -113,7 +111,6 @@ export class SavedSearchesService {

/**
* Replace Save Search with new one and also updates the state.
*
* @param updatedSavedSearch - updated Save Search
* @returns NodeEntry
*/
Expand All @@ -140,7 +137,6 @@ export class SavedSearchesService {

/**
* Deletes Save Search and update state.
*
* @param deletedSavedSearch - Save Search to delete
* @returns NodeEntry
*/
Expand Down Expand Up @@ -171,7 +167,6 @@ export class SavedSearchesService {

/**
* Reorders saved search place
*
* @param previousIndex - previous index of saved search
* @param currentIndex - new index of saved search
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { TranslateModule } from '@ngx-translate/core';
<ng-container>
<mat-icon>{{ expanded ? 'expand_more' : 'chevron_right' }}</mat-icon>
<mat-panel-title *ngIf="title" class="adf-metadata-properties-title" [title]="title | translate">{{ title | translate }}</mat-panel-title>
<ng-content></ng-content>
<ng-content />
</ng-container>
`
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<img [alt]="'ADF-DATATABLE.EMPTY.DRAG-AND-DROP.TITLE' | translate" class="adf-empty-folder-image" [src]="emptyFolderImageUrl">
</div>
</adf-empty-list>
<ng-content select="adf-custom-empty-content-template, empty-folder-content"></ng-content>
<ng-content select="adf-custom-empty-content-template, empty-folder-content" />
</ng-template>
</adf-no-content-template>

Expand All @@ -58,7 +58,7 @@
<mat-icon>error</mat-icon>
<p class="adf-no-permission__template--text">{{ 'ADF-DOCUMENT-LIST.NO_PERMISSION' | translate }}</p>
</div>
<ng-content select="adf-custom-no-permission-template, no-permission-content"></ng-content>
<ng-content select="adf-custom-no-permission-template, no-permission-content" />
</ng-template>
</adf-no-permission-template>

Expand All @@ -72,7 +72,7 @@
[color]="'primary'"
[mode]="'indeterminate'" />
</div>
<ng-content select="adf-custom-loading-content-template"></ng-content>
<ng-content select="adf-custom-loading-content-template" />
</ng-template>
</adf-loading-content-template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="adf-empty-search-result">
<ng-content></ng-content>
<ng-content />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
*ngIf="data?.list?.entries.length === 0">
<ng-content
selector="adf-empty-search-result"
*ngIf="isNoSearchTemplatePresent() else defaultNoResult">
</ng-content>
*ngIf="isNoSearchTemplatePresent() else defaultNoResult" />
<ng-template #defaultNoResult>
<p matListItemLine class="adf-search-fixed-text">{{ 'SEARCH.RESULTS.NONE' | translate:{searchTerm:
searchTerm} }}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
</ng-container>
</ng-container>

<ng-content></ng-content>
<ng-content />
</mat-chip-listbox>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="adf-search-filter-menu-card">
<div class="adf-search-filter-title">
<ng-content select="filter-title"></ng-content>
<ng-content select="filter-title" />
<button mat-icon-button
class="adf-search-filter-title-action"
aria-hidden="false"
Expand All @@ -13,12 +13,12 @@
<mat-divider />

<div class="adf-search-filter-content">
<ng-content select="filter-content"></ng-content>
<ng-content select="filter-content" />
</div>

<mat-divider />

<div class="adf-search-filter-actions">
<ng-content select="filter-actions"></ng-content>
<ng-content select="filter-actions" />
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
[ngClass]="_classList" #panel>
<ng-template
[ngTemplateOutlet]="template"
[ngTemplateOutletContext]="{ $implicit: results }">
</ng-template>
[ngTemplateOutletContext]="{ $implicit: results }" />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ export abstract class BaseQueryBuilderService {

/**
* Adds a facet bucket to a field.
*
* @param field The target field
* @param bucket Bucket to add
*/
Expand All @@ -216,7 +215,6 @@ export abstract class BaseQueryBuilderService {

/**
* Gets the buckets currently added to a field
*
* @param field The target fields
* @returns Bucket array
*/
Expand All @@ -226,7 +224,6 @@ export abstract class BaseQueryBuilderService {

/**
* Removes an existing bucket from a field.
*
* @param field The target field
* @param bucket Bucket to remove
*/
Expand All @@ -239,7 +236,6 @@ export abstract class BaseQueryBuilderService {

/**
* Adds a filter query to the current query.
*
* @param query Query string to add
*/
addFilterQuery(query: string): void {
Expand All @@ -253,7 +249,6 @@ export abstract class BaseQueryBuilderService {

/**
* Removes an existing filter query.
*
* @param query The query to remove
*/
removeFilterQuery(query: string): void {
Expand All @@ -264,7 +259,6 @@ export abstract class BaseQueryBuilderService {

/**
* Gets a facet query by label.
*
* @param label Label of the query
* @returns Facet query data
*/
Expand All @@ -280,7 +274,6 @@ export abstract class BaseQueryBuilderService {

/**
* Gets a facet field by label.
*
* @param label Label of the facet field
* @returns Facet field data
*/
Expand All @@ -306,7 +299,6 @@ export abstract class BaseQueryBuilderService {

/**
* Builds the current query and triggers the `updated` event.
*
* @param queryBody query settings
*/
update(queryBody?: SearchRequest): void {
Expand All @@ -316,7 +308,6 @@ export abstract class BaseQueryBuilderService {

/**
* Builds and executes the current query.
*
* @param updateQueryParams whether query params should be updated with encoded query
* @param queryBody query settings
*/
Expand Down Expand Up @@ -356,7 +347,6 @@ export abstract class BaseQueryBuilderService {

/**
* Builds the current query.
*
* @returns The finished query
*/
buildQuery(): SearchRequest {
Expand Down Expand Up @@ -397,7 +387,6 @@ export abstract class BaseQueryBuilderService {

/**
* Gets the primary sorting definition.
*
* @returns The primary sorting definition
*/
getPrimarySorting(): SearchSortingDefinition {
Expand All @@ -409,7 +398,6 @@ export abstract class BaseQueryBuilderService {

/**
* Gets all pre-configured sorting options that users can choose from.
*
* @returns Pre-configured sorting options
*/
getSortingOptions(): SearchSortingDefinition[] {
Expand All @@ -418,7 +406,6 @@ export abstract class BaseQueryBuilderService {

/**
* Gets the query group.
*
* @param query Target query
* @returns Query group
*/
Expand All @@ -428,7 +415,6 @@ export abstract class BaseQueryBuilderService {

/**
* Checks if FacetQueries has been defined
*
* @returns True if defined, false otherwise
*/
get hasFacetQueries(): boolean {
Expand All @@ -437,7 +423,6 @@ export abstract class BaseQueryBuilderService {

/**
* Checks if FacetIntervals has been defined
*
* @returns True if defined, false otherwise
*/
get hasFacetIntervals(): boolean {
Expand Down Expand Up @@ -558,7 +543,6 @@ export abstract class BaseQueryBuilderService {

/**
* Encloses a label name with double quotes if it contains whitespace characters.
*
* @param configLabel Original label text
* @returns Label, possibly with quotes if it contains spaces
*/
Expand Down Expand Up @@ -591,7 +575,6 @@ export abstract class BaseQueryBuilderService {

/**
* Builds search query with provided user query, executes query, encodes latest filter config and navigates to search.
*
* @param query user query to search for
* @param searchUrl search url to navigate to
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@
<mat-menu #menu="matMenu">
<ng-template
[ngTemplateOutlet]="nodeActionsMenuTemplate"
[ngTemplateOutletContext]="{ node: node }">
</ng-template>
[ngTemplateOutletContext]="{ node: node }" />
</mat-menu>
</div>
</mat-tree-node>
Expand All @@ -109,8 +108,7 @@
</ng-container>

<ng-template #emptyContent>
<ng-template [ngTemplateOutlet]="emptyContentTemplate">
</ng-template>
<ng-template [ngTemplateOutlet]="emptyContentTemplate" />
</ng-template>

<ng-template #loadingSpinner>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
<ng-template
ngFor
[ngForOf]="files"
[ngForTemplate]="template">
</ng-template>
[ngForTemplate]="template" />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
(folderEntityDropped)="onFolderEntityDropped($event)"
(upload-files)="onUploadFiles($any($event))"
dropzone="" webkitdropzone="*" #droparea>
<ng-content></ng-content>
<ng-content />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@
(submitFile)="onSubmitFile($event)">

<adf-viewer-toolbar *ngIf="toolbar">
<ng-content select="adf-viewer-toolbar"></ng-content>
<ng-content select="adf-viewer-toolbar" />
</adf-viewer-toolbar>

<adf-viewer-toolbar-actions *ngIf="toolbarActions">
<ng-content select="adf-viewer-toolbar-actions"></ng-content>
<ng-content select="adf-viewer-toolbar-actions" />
</adf-viewer-toolbar-actions>

<adf-viewer-more-actions *ngIf="moreActions">
<ng-content select="adf-viewer-more-actions"></ng-content>
<ng-content select="adf-viewer-more-actions" />
</adf-viewer-more-actions>

<adf-viewer-open-with *ngIf="openWith">
<ng-content select="adf-viewer-open-with"></ng-content>
<ng-content select="adf-viewer-open-with" />
</adf-viewer-open-with>

<adf-viewer-sidebar *ngIf="sidebar">
<ng-content select="adf-viewer-sidebar"></ng-content>
<ng-content select="adf-viewer-sidebar" />
</adf-viewer-sidebar>

<adf-viewer-toolbar-custom-actions>
Expand Down
19 changes: 16 additions & 3 deletions lib/core/src/lib/auth/oidc/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
* limitations under the License.
*/

import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core';
import { APP_INITIALIZER, inject, ModuleWithProviders, NgModule, InjectionToken } from '@angular/core';
import { AUTH_CONFIG, OAuthModule, OAuthStorage } from 'angular-oauth2-oidc';
import { AuthenticationService } from '../services/authentication.service';
import { StorageService } from '../../common/services/storage.service';
import { AuthModuleConfig, AUTH_MODULE_CONFIG } from './auth-config';
import { authConfigFactory, AuthConfigService } from './auth-config.service';
import { AuthRoutingModule } from './auth-routing.module';
Expand All @@ -27,21 +26,35 @@ import { RedirectAuthService } from './redirect-auth.service';
import { AuthenticationConfirmationComponent } from './view/authentication-confirmation/authentication-confirmation.component';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { TokenInterceptor } from './token.interceptor';
import { StorageService } from '../../common/services/storage.service';

export const JWT_STORAGE_SERVICE = new InjectionToken<OAuthStorage>('JWT_STORAGE_SERVICE', {
providedIn: 'root',
factory: () => inject(StorageService)
});

/**
* Create a Login Factory function
*
* @param redirectService auth redirect service
* @returns a factory function
*/
export function loginFactory(redirectService: RedirectAuthService): () => Promise<boolean> {
return () => redirectService.init();
}

/**
* @returns current instance of OAuthStorage
*/
export function oauthStorageFactory(): OAuthStorage {
return inject(JWT_STORAGE_SERVICE);
}

@NgModule({
declarations: [AuthenticationConfirmationComponent],
imports: [AuthRoutingModule, OAuthModule.forRoot()],
providers: [
{ provide: OAuthStorage, useExisting: StorageService },
{ provide: OAuthStorage, useFactory: oauthStorageFactory },
{ provide: AuthenticationService },
{
provide: AUTH_CONFIG,
Expand Down
3 changes: 2 additions & 1 deletion lib/core/src/lib/testing/noop-auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/

import { APP_INITIALIZER, Injectable, NgModule } from '@angular/core';
import { AuthModule, JWT_STORAGE_SERVICE, RedirectAuthService } from '../auth';
import { AuthModule, JWT_STORAGE_SERVICE } from '../auth/oidc/auth.module';
import { RedirectAuthService } from '../auth/oidc/redirect-auth.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppConfigService, StoragePrefixFactory } from '../app-config';
Expand Down
Loading

0 comments on commit 24eb40a

Please sign in to comment.