Prettier upgrade and e2e type checks (#1522)

* upgrade prettier

* noImplicitAny rule

* fix type

* update tsconfig

* upgrade to 150 print width
This commit is contained in:
Denys Vuika
2020-07-14 10:03:23 +01:00
committed by GitHub
parent 32793ea7b0
commit ddc6f36ab4
339 changed files with 5170 additions and 8763 deletions

View File

@@ -25,8 +25,7 @@
import { Action } from '@ngrx/store';
export const SET_INFO_DRAWER_METADATA_ASPECT =
'SET_INFO_DRAWER_METADATA_ASPECT';
export const SET_INFO_DRAWER_METADATA_ASPECT = 'SET_INFO_DRAWER_METADATA_ASPECT';
export class SetInfoDrawerMetadataAspectAction implements Action {
readonly type = SET_INFO_DRAWER_METADATA_ASPECT;

View File

@@ -35,10 +35,7 @@ export enum SearchActionTypes {
export class SearchByTermAction implements Action {
readonly type = SearchActionTypes.SearchByTerm;
constructor(
public payload: string,
public searchOptions?: SearchOptionModel[]
) {}
constructor(public payload: string, public searchOptions?: SearchOptionModel[]) {}
}
export class ToggleSearchFilterAction implements Action {

View File

@@ -27,10 +27,7 @@ import { Effect, Actions, ofType } from '@ngrx/effects';
import { Injectable } from '@angular/core';
import { map } from 'rxjs/operators';
import { MatDialog } from '@angular/material/dialog';
import {
CloseModalDialogsAction,
AppActionTypes
} from '../actions/app.actions';
import { CloseModalDialogsAction, AppActionTypes } from '../actions/app.actions';
@Injectable()
export class DialogEffects {

View File

@@ -30,27 +30,17 @@ import { MinimalNodeEntryEntity, PathInfoEntity } from '@alfresco/js-api';
import { map } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { AppStore } from '../states/app.state';
import {
NavigateUrlAction,
RouterActionTypes,
NavigateRouteAction,
NavigateToFolder,
NavigateToParentFolder
} from '../actions/router.actions';
import { NavigateUrlAction, RouterActionTypes, NavigateRouteAction, NavigateToFolder, NavigateToParentFolder } from '../actions/router.actions';
import { SnackbarErrorAction } from '../actions/snackbar.actions';
@Injectable()
export class RouterEffects {
constructor(
private store: Store<AppStore>,
private actions$: Actions,
private router: Router
) {}
constructor(private store: Store<AppStore>, private actions$: Actions, private router: Router) {}
@Effect({ dispatch: false })
navigateUrl$ = this.actions$.pipe(
ofType<NavigateUrlAction>(RouterActionTypes.NavigateUrl),
map(action => {
map((action) => {
if (action.payload) {
this.router.navigateByUrl(action.payload);
}
@@ -60,7 +50,7 @@ export class RouterEffects {
@Effect({ dispatch: false })
navigateRoute$ = this.actions$.pipe(
ofType<NavigateRouteAction>(RouterActionTypes.NavigateRoute),
map(action => {
map((action) => {
this.router.navigate(action.payload);
})
);
@@ -68,7 +58,7 @@ export class RouterEffects {
@Effect({ dispatch: false })
navigateToFolder$ = this.actions$.pipe(
ofType<NavigateToFolder>(RouterActionTypes.NavigateFolder),
map(action => {
map((action) => {
if (action.payload && action.payload.entry) {
this.navigateToFolder(action.payload.entry);
}
@@ -78,7 +68,7 @@ export class RouterEffects {
@Effect({ dispatch: false })
navigateToParentFolder$ = this.actions$.pipe(
ofType<NavigateToParentFolder>(RouterActionTypes.NavigateParentFolder),
map(action => {
map((action) => {
if (action.payload && action.payload.entry) {
this.navigateToParentFolder(action.payload.entry);
}
@@ -131,18 +121,12 @@ export class RouterEffects {
this.router.navigate(link);
}, 10);
} else {
this.store.dispatch(
new SnackbarErrorAction('APP.MESSAGES.ERRORS.CANNOT_NAVIGATE_LOCATION')
);
this.store.dispatch(new SnackbarErrorAction('APP.MESSAGES.ERRORS.CANNOT_NAVIGATE_LOCATION'));
}
}
private isLibraryContent(path: PathInfoEntity): boolean {
if (
path &&
path.elements.length >= 2 &&
path.elements[1].name === 'Sites'
) {
if (path && path.elements.length >= 2 && path.elements[1].name === 'Sites') {
return true;
}

View File

@@ -30,13 +30,7 @@ import { Actions, Effect, ofType } from '@ngrx/effects';
import { Store } from '@ngrx/store';
import { map } from 'rxjs/operators';
import { AppStore } from '../states/app.state';
import {
SnackbarInfoAction,
SnackbarActionTypes,
SnackbarWarningAction,
SnackbarErrorAction,
SnackbarAction
} from '../actions/snackbar.actions';
import { SnackbarInfoAction, SnackbarActionTypes, SnackbarWarningAction, SnackbarErrorAction, SnackbarAction } from '../actions/snackbar.actions';
@Injectable()
export class SnackbarEffects {

View File

@@ -28,80 +28,29 @@ import { createSelector } from '@ngrx/store';
export const selectApp = (state: AppStore) => state.app;
export const getHeaderColor = createSelector(
selectApp,
state => state.headerColor
);
export const getHeaderColor = createSelector(selectApp, (state) => state.headerColor);
export const getAppName = createSelector(selectApp, (state) => state.appName);
export const getLogoPath = createSelector(selectApp, (state) => state.logoPath);
export const getHeaderImagePath = createSelector(selectApp, (state) => state.headerImagePath);
export const getLanguagePickerState = createSelector(selectApp, (state) => state.languagePicker);
export const getUserProfile = createSelector(selectApp, (state) => state.user);
export const getCurrentFolder = createSelector(selectApp, (state) => state.navigation.currentFolder);
export const getAppSelection = createSelector(selectApp, (state) => state.selection);
export const getSharedUrl = createSelector(selectApp, (state) => state.sharedUrl);
export const getNavigationState = createSelector(selectApp, (state) => state.navigation);
export const isInfoDrawerOpened = createSelector(selectApp, (state) => state.infoDrawerOpened);
export const showFacetFilter = createSelector(selectApp, (state) => state.showFacetFilter);
export const getDocumentDisplayMode = createSelector(selectApp, (state) => state.documentDisplayMode);
export const getRepositoryStatus = createSelector(selectApp, (state) => state.repository);
export const isQuickShareEnabled = createSelector(getRepositoryStatus, (info) => info.status.isQuickShareEnabled);
export const isAdmin = createSelector(selectApp, (state) => state.user.isAdmin);
export const getAppName = createSelector(selectApp, state => state.appName);
export const getLogoPath = createSelector(selectApp, state => state.logoPath);
export const getHeaderImagePath = createSelector(
selectApp,
state => state.headerImagePath
);
export const getLanguagePickerState = createSelector(
selectApp,
state => state.languagePicker
);
export const getUserProfile = createSelector(selectApp, state => state.user);
export const getCurrentFolder = createSelector(
selectApp,
state => state.navigation.currentFolder
);
export const getAppSelection = createSelector(
selectApp,
state => state.selection
);
export const getSharedUrl = createSelector(selectApp, state => state.sharedUrl);
export const getNavigationState = createSelector(
selectApp,
state => state.navigation
);
export const isInfoDrawerOpened = createSelector(
selectApp,
state => state.infoDrawerOpened
);
export const showFacetFilter = createSelector(
selectApp,
state => state.showFacetFilter
);
export const getDocumentDisplayMode = createSelector(
selectApp,
state => state.documentDisplayMode
);
export const getRepositoryStatus = createSelector(
selectApp,
state => state.repository
);
export const isQuickShareEnabled = createSelector(
getRepositoryStatus,
info => info.status.isQuickShareEnabled
);
export const isAdmin = createSelector(selectApp, state => state.user.isAdmin);
export const getSideNavState = createSelector(
getAppSelection,
getNavigationState,
(selection, navigation) => {
return {
selection,
navigation
};
}
);
export const getSideNavState = createSelector(getAppSelection, getNavigationState, (selection, navigation) => {
return {
selection,
navigation
};
});
export const getRuleContext = createSelector(
getAppSelection,
@@ -118,7 +67,4 @@ export const getRuleContext = createSelector(
}
);
export const infoDrawerMetadataAspect = createSelector(
selectApp,
state => state.infoDrawerMetadataAspect
);
export const infoDrawerMetadataAspect = createSelector(selectApp, (state) => state.infoDrawerMetadataAspect);

View File

@@ -23,11 +23,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import {
SelectionState,
ProfileState,
NavigationState
} from '@alfresco/adf-extensions';
import { SelectionState, ProfileState, NavigationState } from '@alfresco/adf-extensions';
import { RepositoryInfo } from '@alfresco/js-api';
export interface AppState {

View File

@@ -30,8 +30,6 @@ import { DialogEffects } from './effects/dialog.effects';
import { RouterEffects } from './effects/router.effects';
@NgModule({
imports: [
EffectsModule.forFeature([SnackbarEffects, DialogEffects, RouterEffects])
]
imports: [EffectsModule.forFeature([SnackbarEffects, DialogEffects, RouterEffects])]
})
export class SharedStoreModule {}