Cherry picked commit from oidc and run fix lint

This commit is contained in:
VitoAlbano
2024-11-04 14:47:02 +00:00
committed by Vito Albano
parent e162ebbfef
commit 4d1108e77e
36 changed files with 150 additions and 111 deletions

View File

@@ -22,7 +22,7 @@ import { Component, TemplateRef, ViewChild } from '@angular/core';
selector: 'adf-breadcrumb-item',
template: `
<ng-template #breadcrumbItemTemplate>
<ng-content></ng-content>
<ng-content />
</ng-template>
`
})

View File

@@ -16,7 +16,18 @@
*/
import { fakeAsync, TestBed, tick } from '@angular/core/testing';
import { OAuthService, OAuthEvent, OAuthStorage, AUTH_CONFIG, TokenResponse, AuthConfig, OAuthLogger, OAuthErrorEvent, OAuthSuccessEvent, OAuthInfoEvent } from 'angular-oauth2-oidc';
import {
OAuthService,
OAuthEvent,
OAuthStorage,
AUTH_CONFIG,
TokenResponse,
AuthConfig,
OAuthLogger,
OAuthErrorEvent,
OAuthSuccessEvent,
OAuthInfoEvent
} from 'angular-oauth2-oidc';
import { of, Subject, timeout } from 'rxjs';
import { RedirectAuthService } from './redirect-auth.service';
import { AUTH_MODULE_CONFIG } from './auth-config';
@@ -43,7 +54,9 @@ describe('RedirectAuthService', () => {
retryLoginServiceSpy = jasmine.createSpyObj('RetryLoginService', ['tryToLoginTimes']);
timeSyncServiceSpy = jasmine.createSpyObj('TimeSyncService', ['checkTimeSync']);
oauthLoggerSpy = jasmine.createSpyObj('OAuthLogger', ['error', 'info', 'warn']);
oauthServiceSpy = jasmine.createSpyObj('OAuthService', [
oauthServiceSpy = jasmine.createSpyObj(
'OAuthService',
[
'clearHashAfterLogin',
'configure',
'logOut',
@@ -54,7 +67,9 @@ describe('RedirectAuthService', () => {
'refreshToken',
'getIdentityClaims',
'getAccessToken'
], { clockSkewInSec: 120, events: oauthEvents$, tokenValidationHandler: {} });
],
{ clockSkewInSec: 120, events: oauthEvents$, tokenValidationHandler: {} }
);
authConfigSpy = jasmine.createSpyObj('AuthConfig', ['sessionChecksEnabled']);
TestBed.configureTestingModule({
@@ -202,8 +217,14 @@ describe('RedirectAuthService', () => {
});
it('should logout user if token has expired due to local machine clock being out of sync', () => {
const mockTimeSync: TimeSync = { outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' };
const expectedError = new Error(`Token has expired due to local machine clock ${mockTimeSync.localDateTimeISO} being out of sync with server time ${mockTimeSync.serverDateTimeISO}`);
const mockTimeSync: TimeSync = {
outOfSync: true,
localDateTimeISO: '2024-10-10T22:00:18.621Z',
serverDateTimeISO: '2024-10-10T22:10:53.000Z'
};
const expectedError = new Error(
`Token has expired due to local machine clock ${mockTimeSync.localDateTimeISO} being out of sync with server time ${mockTimeSync.serverDateTimeISO}`
);
timeSyncServiceSpy.checkTimeSync.and.returnValue(of(mockTimeSync));
@@ -375,7 +396,7 @@ describe('RedirectAuthService', () => {
expect(oauthServiceSpy.logOut).not.toHaveBeenCalled();
expect(oauthLoggerSpy.error).not.toHaveBeenCalled();
expect(await firstEventOccurPromise).toEqual(expectedFakeErrorEvent);;
expect(await firstEventOccurPromise).toEqual(expectedFakeErrorEvent);
try {
tick(1000);
@@ -387,7 +408,6 @@ describe('RedirectAuthService', () => {
}));
it('should logout user if the second time the refresh token failed', fakeAsync(async () => {
const expectedErrorCausedBySecondTokenRefreshError = new OAuthErrorEvent('token_refresh_error', { reason: 'second token refresh error' }, {});
oauthEvents$.next(new OAuthErrorEvent('token_refresh_error', { reason: 'error' }, {}));
@@ -398,8 +418,12 @@ describe('RedirectAuthService', () => {
}));
it('should logout user if token_refresh_error is emitted because of clock out of sync', () => {
const expectedErrorMessage = new Error('OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z');
timeSyncServiceSpy.checkTimeSync.and.returnValue(of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync));
const expectedErrorMessage = new Error(
'OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z'
);
timeSyncServiceSpy.checkTimeSync.and.returnValue(
of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync)
);
oauthEvents$.next(new OAuthErrorEvent('token_refresh_error', { reason: 'error' }, {}));
@@ -408,8 +432,12 @@ describe('RedirectAuthService', () => {
});
it('should logout user if discovery_document_load_error is emitted because of clock out of sync', () => {
const expectedErrorMessage = new Error('OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z');
timeSyncServiceSpy.checkTimeSync.and.returnValue(of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync));
const expectedErrorMessage = new Error(
'OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z'
);
timeSyncServiceSpy.checkTimeSync.and.returnValue(
of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync)
);
oauthEvents$.next(new OAuthErrorEvent('discovery_document_load_error', { reason: 'error' }, {}));
@@ -418,8 +446,12 @@ describe('RedirectAuthService', () => {
});
it('should logout user if code_error is emitted because of clock out of sync', () => {
const expectedErrorMessage = new Error('OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z');
timeSyncServiceSpy.checkTimeSync.and.returnValue(of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync));
const expectedErrorMessage = new Error(
'OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z'
);
timeSyncServiceSpy.checkTimeSync.and.returnValue(
of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync)
);
oauthEvents$.next(new OAuthErrorEvent('code_error', { reason: 'error' }, {}));
@@ -428,8 +460,12 @@ describe('RedirectAuthService', () => {
});
it('should logout user if discovery_document_validation_error is emitted because of clock out of sync', () => {
const expectedErrorMessage = new Error('OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z');
timeSyncServiceSpy.checkTimeSync.and.returnValue(of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync));
const expectedErrorMessage = new Error(
'OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z'
);
timeSyncServiceSpy.checkTimeSync.and.returnValue(
of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync)
);
oauthEvents$.next(new OAuthErrorEvent('discovery_document_validation_error', { reason: 'error' }, {}));
@@ -438,8 +474,12 @@ describe('RedirectAuthService', () => {
});
it('should logout user if jwks_load_error is emitted because of clock out of sync', () => {
const expectedErrorMessage = new Error('OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z');
timeSyncServiceSpy.checkTimeSync.and.returnValue(of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync));
const expectedErrorMessage = new Error(
'OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z'
);
timeSyncServiceSpy.checkTimeSync.and.returnValue(
of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync)
);
oauthEvents$.next(new OAuthErrorEvent('jwks_load_error', { reason: 'error' }, {}));
@@ -448,8 +488,12 @@ describe('RedirectAuthService', () => {
});
it('should logout user if silent_refresh_error is emitted because of clock out of sync', () => {
const expectedErrorMessage = new Error('OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z');
timeSyncServiceSpy.checkTimeSync.and.returnValue(of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync));
const expectedErrorMessage = new Error(
'OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z'
);
timeSyncServiceSpy.checkTimeSync.and.returnValue(
of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync)
);
oauthEvents$.next(new OAuthErrorEvent('silent_refresh_error', { reason: 'error' }, {}));
@@ -458,8 +502,12 @@ describe('RedirectAuthService', () => {
});
it('should logout user if user_profile_load_error is emitted because of clock out of sync', () => {
const expectedErrorMessage = new Error('OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z');
timeSyncServiceSpy.checkTimeSync.and.returnValue(of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync));
const expectedErrorMessage = new Error(
'OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z'
);
timeSyncServiceSpy.checkTimeSync.and.returnValue(
of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync)
);
oauthEvents$.next(new OAuthErrorEvent('user_profile_load_error', { reason: 'error' }, {}));
@@ -468,8 +516,12 @@ describe('RedirectAuthService', () => {
});
it('should logout user if token_error is emitted because of clock out of sync', () => {
const expectedErrorMessage = new Error('OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z');
timeSyncServiceSpy.checkTimeSync.and.returnValue(of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync));
const expectedErrorMessage = new Error(
'OAuth error occurred due to local machine clock 2024-10-10T22:00:18.621Z being out of sync with server time 2024-10-10T22:10:53.000Z'
);
timeSyncServiceSpy.checkTimeSync.and.returnValue(
of({ outOfSync: true, localDateTimeISO: '2024-10-10T22:00:18.621Z', serverDateTimeISO: '2024-10-10T22:10:53.000Z' } as TimeSync)
);
oauthEvents$.next(new OAuthErrorEvent('token_error', { reason: 'error' }, {}));
@@ -479,7 +531,7 @@ describe('RedirectAuthService', () => {
it('should onLogout$ be emitted when logout event occur', () => {
let expectedLogoutIsEmitted = false;
service.onLogout$.subscribe(() => expectedLogoutIsEmitted = true);
service.onLogout$.subscribe(() => (expectedLogoutIsEmitted = true));
oauthEvents$.next(new OAuthInfoEvent('logout'));

View File

@@ -26,7 +26,6 @@ export class RetryLoginService {
/**
* Attempts to log in a specified number of times if the initial login attempt fails.
*
* @param loginOptions - The options to be used for the login attempt.
* @param maxLoginAttempts - The maximum number of login attempts. Defaults to 3.
* @returns A promise that resolves to `true` if the login is successful, or rejects with an error if all attempts fail.

View File

@@ -32,13 +32,9 @@ export interface TimeSync {
providedIn: 'root'
})
export class TimeSyncService {
private readonly _http: HttpClient;
constructor(
private _injector: Injector,
private _appConfigService: AppConfigService
) {
constructor(private _injector: Injector, private _appConfigService: AppConfigService) {
this._http = this._injector.get(HttpClient);
}
@@ -59,7 +55,7 @@ export class TimeSyncService {
serverTimeInMs = serverTimeResponse;
}
const adjustedServerTimeInMs = serverTimeInMs + (roundTripTimeInMs / 2);
const adjustedServerTimeInMs = serverTimeInMs + roundTripTimeInMs / 2;
const localCurrentTimeInMs = Date.now();
const timeOffsetInMs = Math.abs(localCurrentTimeInMs - adjustedServerTimeInMs);
const maxAllowedClockSkewInMs = maxAllowedClockSkewInSec * 1000;
@@ -71,20 +67,17 @@ export class TimeSyncService {
serverDateTimeISO: new Date(adjustedServerTimeInMs).toISOString()
};
}),
catchError(error => throwError(() => new Error(error)))
catchError((error) => throwError(() => new Error(error)))
);
}
/**
* Checks if the local time is out of sync with the server time.
*
* @param maxAllowedClockSkewInSec - The maximum allowed clock skew in seconds.
* @returns An Observable that emits a boolean indicating whether the local time is out of sync.
*/
isLocalTimeOutOfSync(maxAllowedClockSkewInSec: number): Observable<boolean> {
return this.checkTimeSync(maxAllowedClockSkewInSec).pipe(
map(sync => sync.outOfSync)
);
return this.checkTimeSync(maxAllowedClockSkewInSec).pipe(map((sync) => sync.outOfSync));
}
private getServerTime(): Observable<number> {

View File

@@ -123,5 +123,5 @@
</ng-container>
<ng-template #buttonContent>
<ng-content></ng-content>
<ng-content />
</ng-template>

View File

@@ -23,7 +23,7 @@ import { DEFAULT_SEPARATOR } from '../card-view-textitem/card-view-textitem.comp
@Component({
selector: 'adf-card-view-item-dispatcher',
standalone: true,
template: '<ng-template #content></ng-template>'
template: '<ng-template #content />'
})
export class CardViewItemDispatcherComponent implements OnChanges {
@Input()

View File

@@ -22,7 +22,7 @@ import { DataRow } from '../../data/data-row.model';
@Component({
selector: 'adf-datatable-row',
standalone: true,
template: `<ng-content></ng-content>`,
template: `<ng-content />`,
encapsulation: ViewEncapsulation.None,
host: {
class: 'adf-datatable-row',

View File

@@ -37,7 +37,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
@Component({
selector: 'adf-custom-column-template-component',
standalone: true,
template: ` <ng-template #tmplRef></ng-template> `
template: ` <ng-template #tmplRef /> `
})
class CustomColumnTemplateComponent {
@ViewChild('tmplRef', { static: true }) templateRef: TemplateRef<any>;

View File

@@ -1,6 +1,6 @@
<div class="adf-empty-list_template">
<ng-content select="[adf-empty-list-header]"></ng-content>
<ng-content select="[adf-empty-list-body]"></ng-content>
<ng-content select="[adf-empty-list-footer]"></ng-content>
<ng-content></ng-content>
<ng-content select="[adf-empty-list-header]" />
<ng-content select="[adf-empty-list-body]" />
<ng-content select="[adf-empty-list-footer]" />
<ng-content />
</div>

View File

@@ -4,14 +4,14 @@
<div *ngIf="hasTabs()" class="alfresco-tabs-widget">
<mat-tab-group>
<mat-tab *ngFor="let tab of visibleTabs()" [label]="tab.title | translate ">
<ng-template *ngTemplateOutlet="render; context: { fieldToRender: tab.fields }"></ng-template>
<ng-template *ngTemplateOutlet="render; context: { fieldToRender: tab.fields }" />
</mat-tab>
</mat-tab-group>
</div>
</div>
<div *ngIf="!formDefinition.hasTabs() && formDefinition.hasFields()">
<ng-template *ngTemplateOutlet="render; context: { fieldToRender: formDefinition.fields }"></ng-template>
<ng-template *ngTemplateOutlet="render; context: { fieldToRender: formDefinition.fields }" />
</div>
</div>

View File

@@ -7,11 +7,11 @@
data-automation-id="adf-inplace-input">
<mat-label data-automation-id="adf-inplace-input-label">
<ng-content select="[label]"></ng-content>
<ng-content select="[label]" />
</mat-label>
<mat-error data-automation-id="adf-inplace-input-error">
<ng-content select="[error]"></ng-content>
<ng-content select="[error]" />
</mat-error>
</mat-form-field>
</div>

View File

@@ -30,13 +30,13 @@
<ng-template #toolbarActions>
<div class="adf-toolbar-actions">
<ng-content select="[adf-toolbar-actions]"></ng-content>
<ng-content select="[adf-toolbar-actions]" />
</div>
</ng-template>
<ng-template #navbarTemplate>
<adf-navbar [items]="navbarItems">
<ng-content select="adf-navbar-item"></ng-content>
<ng-content select="adf-navbar-item" />
</adf-navbar>
</ng-template>

View File

@@ -1,4 +1,4 @@
<adf-navbar-item *ngFor="let item of items"
[routerLink]="item.routerLink"
[label]="item.label" />
<ng-content></ng-content>
<ng-content />

View File

@@ -1,12 +1,12 @@
<div *ngIf="showHeader" class="adf-info-drawer-layout-header">
<div class="adf-info-drawer-layout-header-title">
<ng-content select="[info-drawer-node-icon]"></ng-content>
<ng-content select="[info-drawer-title]"></ng-content>
<ng-content select="[info-drawer-node-icon]" />
<ng-content select="[info-drawer-title]" />
</div>
<div class="adf-info-drawer-layout-header-buttons">
<ng-content select="[info-drawer-buttons]"></ng-content>
<ng-content select="[info-drawer-buttons]" />
</div>
</div>
<div class="adf-info-drawer-layout-content">
<ng-content select="[info-drawer-content]"></ng-content>
<ng-content select="[info-drawer-content]" />
</div>

View File

@@ -2,8 +2,8 @@
<img *ngIf="icon" class="adf-info-drawer-icon" alt="{{ 'INFO_DRAWER.ICON' | translate }}" src="{{ icon }}" info-drawer-node-icon>
<div *ngIf="title" role="heading" aria-level="1" title="{{ title | translate }}" info-drawer-title>{{ title | translate }}</div>
<ng-content *ngIf="!title" info-drawer-title select="[info-drawer-title]"></ng-content>
<ng-content info-drawer-buttons select="[info-drawer-buttons]"></ng-content>
<ng-content *ngIf="!title" info-drawer-title select="[info-drawer-title]" />
<ng-content info-drawer-buttons select="[info-drawer-buttons]" />
<ng-container info-drawer-content *ngIf="showTabLayout(); then tabLayout else singleLayout" />
<ng-template #tabLayout>
@@ -28,6 +28,6 @@
</ng-template>
<ng-template #singleLayout>
<ng-content select="[info-drawer-content]"></ng-content>
<ng-content select="[info-drawer-content]" />
</ng-template>
</adf-info-drawer-layout>

View File

@@ -40,7 +40,7 @@ import { MatIconModule } from '@angular/material/icon';
@Component({
selector: 'adf-info-drawer-tab',
standalone: true,
template: '<ng-template><ng-content></ng-content></ng-template>',
template: '<ng-template><ng-content /></ng-template>',
encapsulation: ViewEncapsulation.None
})
export class InfoDrawerTabComponent {

View File

@@ -36,7 +36,7 @@
{{ title }}
</h1>
<ng-content></ng-content>
<ng-content />
<button
*ngIf="showSidenavToggle && position === 'end'"

View File

@@ -6,12 +6,12 @@
[@sidenavAnimation]="sidenavAnimationState"
[opened]="!isMobileScreenSize || !hideSidenav"
[mode]="isMobileScreenSize ? 'over' : 'side'">
<ng-content sidenav select="[app-layout-navigation]"></ng-content>
<ng-content sidenav select="[app-layout-navigation]" />
</mat-sidenav>
<div>
<div class="adf-container-full-width" [@contentAnimationLeft]="getContentAnimationState()">
<ng-content select="[app-layout-content]"></ng-content>
<ng-content select="[app-layout-content]" />
</div>
</div>
</mat-sidenav-container>

View File

@@ -1,16 +1,16 @@
<div class="adf-sidebar-action-menu">
<button *ngIf="isExpanded()" mat-raised-button class="adf-sidebar-action-menu-button" data-automation-id="create-button" [matMenuTriggerFor]="adfSidebarMenu">
<span *ngIf="title" class="adf-sidebar-action-menu-text">{{ title }}</span>
<ng-content select="[adf-sidebar-menu-title-icon], [sidebar-menu-title-icon]"></ng-content>
<ng-content select="[adf-sidebar-menu-title-icon], [sidebar-menu-title-icon]" />
</button>
<div *ngIf="!isExpanded()" class="adf-sidebar-action-menu-icon" [matMenuTriggerFor]="adfSidebarMenu">
<ng-content select="[adf-sidebar-menu-expand-icon], [sidebar-menu-expand-icon]"></ng-content>
<ng-content select="[adf-sidebar-menu-expand-icon], [sidebar-menu-expand-icon]" />
</div>
<mat-menu #adfSidebarMenu="matMenu" class="adf-sidebar-action-menu-panel" [overlapTrigger]="false" yPosition="below">
<div class="adf-sidebar-action-menu-options" [style.width.px]="width">
<ng-content select="[adf-sidebar-menu-options], [sidebar-menu-options]"></ng-content>
<ng-content select="[adf-sidebar-menu-options], [sidebar-menu-options]" />
</div>
</mat-menu>
</div>

View File

@@ -26,5 +26,5 @@
</ng-container>
</adf-layout-container>
<ng-template #emptyTemplate></ng-template>
<ng-template #emptyTemplate />
</div>

View File

@@ -6,10 +6,10 @@
[backgroundImageUrl]="''"
(success)="onLoginSuccess($event)">
<adf-login-header>
<ng-template></ng-template>
<ng-template />
</adf-login-header>
<adf-login-footer>
<ng-template></ng-template>
<ng-template />
</adf-login-footer>
</adf-login>
</div>

View File

@@ -16,8 +16,7 @@
*ngIf="headerTemplate"
ngFor
[ngForOf]="[data]"
[ngForTemplate]="headerTemplate">
</ng-template>
[ngForTemplate]="headerTemplate" />
<img
*ngIf="!headerTemplate"
id="adf-login-img-logo"
@@ -118,7 +117,7 @@
</div>
<!--CUSTOM CONTENT-->
<ng-content></ng-content>
<ng-content />
<br>
<button
@@ -193,8 +192,7 @@
*ngIf="footerTemplate"
ngFor
[ngForOf]="[data]"
[ngForTemplate]="footerTemplate">
</ng-template>
[ngForTemplate]="footerTemplate" />
<div class="adf-login-action" *ngIf="!footerTemplate && showLoginActions">
<div id="adf-login-action-left" class="adf-login-action-left">
<a href="{{needHelpLink}}">{{'LOGIN.ACTION.HELP' | translate }}</a>

View File

@@ -14,8 +14,7 @@
<ng-template *ngIf="headerTemplate"
ngFor
[ngForOf]="[data]"
[ngForTemplate]="headerTemplate">
</ng-template>
[ngForTemplate]="headerTemplate" />
<img *ngIf="!headerTemplate"
id="adf-login-img-logo"
class="adf-img-logo"
@@ -109,7 +108,7 @@
</div>
<!--CUSTOM CONTENT-->
<ng-content></ng-content>
<ng-content />
<br>
<button type="submit"
@@ -180,8 +179,7 @@
<ng-template *ngIf="footerTemplate"
ngFor
[ngForOf]="[data]"
[ngForTemplate]="footerTemplate">
</ng-template>
[ngForTemplate]="footerTemplate" />
<div class="adf-login-action" *ngIf="!footerTemplate && showLoginActions">
<div id="adf-login-action-left" class="adf-login-action-left">
<a href="{{ needHelpLink }}">{{ 'LOGIN.ACTION.HELP' | translate }}</a>

View File

@@ -5,7 +5,7 @@
class="adf-infinite-pagination-load-more"
(click)="onLoadMore()"
data-automation-id="adf-infinite-pagination-button">
<ng-content></ng-content>
<ng-content />
</button>
<mat-progress-bar *ngIf="isLoading"

View File

@@ -2,5 +2,5 @@
<adf-icon class="adf-empty-content__icon" [value]="icon" />
<div class="adf-empty-content__title">{{ title | translate }}</div>
<div class="adf-empty-content__subtitle">{{ subtitle | translate }}</div>
<ng-content></ng-content>
<ng-content />
</div>

View File

@@ -10,6 +10,6 @@
<p class="adf-error-content-description {{ screenSize.isSmallScreen ? 'mat-subtitle-1': 'mat-headline-5' }}">
{{ 'ERROR_CONTENT.' + errorCodeTranslated + '.DESCRIPTION' | translate }}
</p>
<ng-content select="[adf-error-content-actions]"></ng-content>
<ng-content select="[adf-error-content-actions]" />
</div>
</ng-container>

View File

@@ -20,7 +20,7 @@ import { Component } from '@angular/core';
@Component({
selector: 'adf-toolbar-title',
standalone: true,
template: '<ng-content></ng-content>',
template: '<ng-content />',
host: { class: 'adf-toolbar-title' }
})
export class ToolbarTitleComponent {}

View File

@@ -1,5 +1,5 @@
<mat-toolbar class="adf-toolbar-container adf-toolbar-container-row" [color]="color">
<span class="adf-toolbar-title" *ngIf="title">{{ title | translate }}</span>
<ng-content select="adf-toolbar-title"></ng-content>
<ng-content></ng-content>
<ng-content select="adf-toolbar-title" />
<ng-content />
</mat-toolbar>

View File

@@ -23,6 +23,6 @@ import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'adf-viewer-more-actions' },
template: `<ng-content></ng-content>`
template: `<ng-content />`
})
export class ViewerMoreActionsComponent {}

View File

@@ -23,6 +23,6 @@ import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'adf-viewer-open-with' },
template: `<ng-content></ng-content>`
template: `<ng-content />`
})
export class ViewerOpenWithComponent {}

View File

@@ -79,8 +79,7 @@
<ng-container *ngFor="let extensionTemplate of extensionTemplates">
<span *ngIf="extensionTemplate.isVisible" class="adf-viewer-render-custom-content">
<ng-template [ngTemplateOutlet]="extensionTemplate.template"
[ngTemplateOutletContext]="{ urlFile: urlFile, extension: extension }">
</ng-template>
[ngTemplateOutletContext]="{ urlFile: urlFile, extension: extension }" />
</span>
</ng-container>
</ng-container>
@@ -92,5 +91,5 @@
</div>
</div>
<ng-container *ngIf="viewerTemplateExtensions">
<ng-template [ngTemplateOutlet]="viewerTemplateExtensions" [ngTemplateOutletInjector]="injector"></ng-template>
<ng-template [ngTemplateOutlet]="viewerTemplateExtensions" [ngTemplateOutletInjector]="injector" />
</ng-container>

View File

@@ -23,7 +23,7 @@ import { ChangeDetectionStrategy, Component, HostListener, ViewEncapsulation } f
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'adf-viewer-sidebar' },
template: `<ng-content></ng-content>`
template: `<ng-content />`
})
export class ViewerSidebarComponent {
@HostListener('keydown', ['$event'])

View File

@@ -23,6 +23,6 @@ import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'adf-viewer-toolbar-actions' },
template: `<ng-content></ng-content>`
template: `<ng-content />`
})
export class ViewerToolbarActionsComponent {}

View File

@@ -23,6 +23,6 @@ import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'adf-viewer-toolbar-custom-actions' },
template: `<ng-content></ng-content>`
template: `<ng-content />`
})
export class ViewerToolbarCustomActionsComponent {}

View File

@@ -23,6 +23,6 @@ import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'adf-viewer-toolbar' },
template: `<ng-content></ng-content>`
template: `<ng-content />`
})
export class ViewerToolbarComponent {}

View File

@@ -6,7 +6,7 @@
<div class="adf-viewer-content"
[cdkTrapFocus]="overlayMode"
cdkTrapFocusAutoCapture>
<ng-content select="adf-viewer-toolbar"></ng-content>
<ng-content select="adf-viewer-toolbar" />
<ng-container *ngIf="showToolbar && !toolbar">
<adf-toolbar id="adf-viewer-toolbar" class="adf-viewer-toolbar">
<adf-toolbar-title>
@@ -58,7 +58,7 @@
</button>
</div>
<ng-content select="adf-viewer-toolbar-actions"></ng-content>
<ng-content select="adf-viewer-toolbar-actions" />
<ng-container *ngIf="mnuOpenWith"
data-automation-id='adf-toolbar-custom-btn'>
@@ -71,13 +71,13 @@
</button>
<mat-menu #mnuOpenWith="matMenu"
[overlapTrigger]="false">
<ng-content select="adf-viewer-open-with"></ng-content>
<ng-content select="adf-viewer-open-with" />
</mat-menu>
</ng-container>
<adf-toolbar-divider />
<ng-content select="adf-viewer-toolbar-custom-actions"></ng-content>
<ng-content select="adf-viewer-toolbar-custom-actions" />
<button id="adf-viewer-fullscreen"
*ngIf="allowFullScreen"
@@ -115,7 +115,7 @@
</button>
<mat-menu #mnuMoreActions="matMenu"
[overlapTrigger]="false">
<ng-content select="adf-viewer-more-actions"></ng-content>
<ng-content select="adf-viewer-more-actions" />
</mat-menu>
</ng-container>
@@ -144,7 +144,7 @@
<ng-container *ngTemplateOutlet="sidebarRightTemplate;context:sidebarRightTemplateContext" />
</ng-container>
<ng-content *ngIf="!sidebarRightTemplate"
select="adf-viewer-sidebar"></ng-content>
select="adf-viewer-sidebar" />
</div>
</ng-container>
@@ -155,7 +155,7 @@
<ng-container *ngTemplateOutlet="sidebarLeftTemplate;context:sidebarLeftTemplateContext" />
</ng-container>
<ng-content *ngIf="!sidebarLeftTemplate"
select="adf-viewer-sidebar"></ng-content>
select="adf-viewer-sidebar" />
</div>
</ng-container>