mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
NG-16 - migration step 1
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": ["plugin:@nrwl/nx/angular"],
|
||||
"extends": ["plugin:@nx/angular"],
|
||||
"parserOptions": {
|
||||
"project": ["lib/core/tsconfig.lib.json", "lib/core/tsconfig.spec.json"],
|
||||
"createDefaultProgram": true
|
||||
@@ -15,7 +15,12 @@
|
||||
"@typescript-eslint/consistent-type-assertions": "warn",
|
||||
"@typescript-eslint/prefer-for-of": "off",
|
||||
"@typescript-eslint/member-ordering": "off",
|
||||
"no-underscore-dangle": ["error", { "allowAfterThis": true }],
|
||||
"no-underscore-dangle": [
|
||||
"error",
|
||||
{
|
||||
"allowAfterThis": true
|
||||
}
|
||||
],
|
||||
"no-shadow": "warn",
|
||||
"quote-props": "warn",
|
||||
"object-shorthand": "warn",
|
||||
@@ -24,7 +29,6 @@
|
||||
"arrow-body-style": "warn",
|
||||
"@angular-eslint/no-output-native": "off",
|
||||
"space-before-function-paren": "warn",
|
||||
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
@@ -77,11 +81,10 @@
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nrwl/nx/angular-template"],
|
||||
"extends": ["plugin:@nx/angular-template"],
|
||||
"rules": {
|
||||
"@angular-eslint/template/no-autofocus": "error",
|
||||
"@angular-eslint/template/no-positive-tabindex": "error",
|
||||
|
||||
"@angular-eslint/template/no-negated-async": "off"
|
||||
}
|
||||
}
|
||||
|
@@ -4,14 +4,19 @@ module.exports = {
|
||||
...rootMain,
|
||||
core: { ...rootMain.core, builder: 'webpack5' },
|
||||
stories: [...rootMain.stories, '../**/*.stories.@(js|jsx|ts|tsx)'],
|
||||
|
||||
framework: {
|
||||
name: "@storybook/angular",
|
||||
options: (()=>console.log('loaded config!'))()
|
||||
},
|
||||
|
||||
staticDirs: [
|
||||
...rootMain.staticDirs,
|
||||
{ from: __dirname + '/../src/lib/i18n', to: 'assets/adf-core/i18n' },
|
||||
{ from: __dirname + '/../src/lib/assets/images', to: 'assets/images' }
|
||||
],
|
||||
addons: ['@storybook/addon-essentials', ...rootMain.addons]
|
||||
|
||||
addons: ['@storybook/addon-essentials', ...rootMain.addons],
|
||||
|
||||
docs: {}
|
||||
};
|
||||
|
@@ -3,3 +3,4 @@ const rootPreview = require('../../../.storybook/preview');
|
||||
export const parameters = {
|
||||
...rootPreview.preview
|
||||
};
|
||||
export const tags = ['autodocs'];
|
||||
|
@@ -17,13 +17,13 @@
|
||||
|
||||
import { Inject, Injectable, inject } from '@angular/core';
|
||||
import { FeaturesServiceToken, IFeaturesService } from '../interfaces/features.interface';
|
||||
import { CanMatch, Route } from '@angular/router';
|
||||
import { Route } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
export const isFeatureOff = (flag: string) => () => inject(FeaturesServiceToken).isOff$(flag);
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class IsFeatureOff implements CanMatch {
|
||||
export class IsFeatureOff {
|
||||
constructor(@Inject(FeaturesServiceToken) private featuresServiceToken: IFeaturesService) {}
|
||||
|
||||
canMatch(route: Route): Observable<boolean> {
|
||||
|
@@ -17,13 +17,13 @@
|
||||
|
||||
import { Inject, Injectable, inject } from '@angular/core';
|
||||
import { FeaturesServiceToken, IFeaturesService } from '../interfaces/features.interface';
|
||||
import { CanMatch, Route } from '@angular/router';
|
||||
import { Route } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
export const isFeatureOn = (flag: string) => () => inject(FeaturesServiceToken).isOn$(flag);
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class IsFeatureOn implements CanMatch {
|
||||
export class IsFeatureOn {
|
||||
constructor(@Inject(FeaturesServiceToken) private featuresServiceToken: IFeaturesService) {}
|
||||
|
||||
canMatch(route: Route): Observable<boolean> {
|
||||
|
@@ -17,12 +17,12 @@
|
||||
|
||||
import { Inject, Injectable, Optional, inject } from '@angular/core';
|
||||
import { FlagsOverrideToken } from '../interfaces/features.interface';
|
||||
import { CanMatch } from '@angular/router';
|
||||
|
||||
|
||||
export const isFlagsOverrideOn = () => () => inject(FlagsOverrideToken) ?? false;
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class IsFlagsOverrideOn implements CanMatch {
|
||||
export class IsFlagsOverrideOn {
|
||||
constructor(@Optional() @Inject(FlagsOverrideToken) private devToolsToken: boolean) {}
|
||||
|
||||
canMatch(): boolean {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { InjectionToken } from '@angular/core';
|
||||
import { CanActivate, CanActivateChild } from '@angular/router';
|
||||
import { CanActivateFn, CanActivateChildFn } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
export interface ShellPreferencesService {
|
||||
@@ -33,6 +33,10 @@ export interface ShellAppService {
|
||||
|
||||
export const SHELL_APP_SERVICE = new InjectionToken<ShellAppService>('SHELL_APP_SERVICE');
|
||||
|
||||
export const SHELL_AUTH_TOKEN = new InjectionToken<CanActivate & CanActivateChild>('SHELL_AUTH_TOKEN');
|
||||
export const SHELL_AUTH_TOKEN = new InjectionToken<{
|
||||
canActivate: CanActivateFn;
|
||||
} & {
|
||||
canActivateChild: CanActivateChildFn;
|
||||
}>('SHELL_AUTH_TOKEN');
|
||||
export const SHELL_NAVBAR_MIN_WIDTH = new InjectionToken<number>('SHELL_NAVBAR_MIN_WIDTH');
|
||||
export const SHELL_NAVBAR_MAX_WIDTH = new InjectionToken<number>('SHELL_NAVBAR_MAX_WIDTH');
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, CanActivateChild, UrlTree } from '@angular/router';
|
||||
import { Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router';
|
||||
import { AuthenticationService } from '../services/authentication.service';
|
||||
import { AppConfigService, AppConfigValues } from '../../app-config/app-config.service';
|
||||
import { OauthConfigModel } from '../models/oauth-config.model';
|
||||
@@ -25,7 +25,7 @@ import { Observable } from 'rxjs';
|
||||
import { BasicAlfrescoAuthService } from '../basic-auth/basic-alfresco-auth.service';
|
||||
import { OidcAuthenticationService } from '../oidc/oidc-authentication.service';
|
||||
|
||||
export abstract class AuthGuardBase implements CanActivate, CanActivateChild {
|
||||
export abstract class AuthGuardBase {
|
||||
protected get withCredentials(): boolean {
|
||||
return this.appConfigService.get<boolean>('auth.withCredentials', false);
|
||||
}
|
||||
|
@@ -16,14 +16,14 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router';
|
||||
import { ActivatedRouteSnapshot, Router } from '@angular/router';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { UserAccessService } from '../services/user-access.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthGuardSsoRoleService implements CanActivate {
|
||||
export class AuthGuardSsoRoleService {
|
||||
constructor(private userAccessService: UserAccessService,
|
||||
private router: Router,
|
||||
private dialog: MatDialog) {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CanActivate, Router, UrlTree } from '@angular/router';
|
||||
import { Router, UrlTree } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { AuthService } from './auth.service';
|
||||
|
||||
@@ -25,7 +25,7 @@ const ROUTE_DEFAULT = '/';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class OidcAuthGuard implements CanActivate {
|
||||
export class OidcAuthGuard {
|
||||
constructor(private auth: AuthService, private _router: Router) { }
|
||||
|
||||
canActivate(
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CanDeactivate } from '@angular/router';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { UnsavedChangesDialogComponent } from './unsaved-changes-dialog.component';
|
||||
@@ -28,7 +28,7 @@ import { tap } from 'rxjs/operators';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UnsavedChangesGuard implements CanDeactivate<any> {
|
||||
export class UnsavedChangesGuard {
|
||||
unsaved = false;
|
||||
|
||||
constructor(private dialog: MatDialog) {}
|
||||
|
Reference in New Issue
Block a user