mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +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 { 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