mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-4695] Fix saving screenshots for E2Es, add nx eslint plugin (#3148)
* [ACA-4695] Fix saving screenshots for E2Es, add nx eslint plugin * [ACA-4695] Improve eslint rules
This commit is contained in:
@@ -103,6 +103,7 @@ export class SearchLibrariesResultsComponent extends PageComponent implements On
|
||||
|
||||
if (this.route) {
|
||||
this.route.params.forEach((params: Params) => {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
this.searchedWord = params.hasOwnProperty(this.queryParamName) ? params[this.queryParamName] : null;
|
||||
const query = this.formatSearchQuery(this.searchedWord);
|
||||
|
||||
|
@@ -85,6 +85,7 @@ export class SearchResultsComponent extends PageComponent implements OnInit {
|
||||
combineLatest([this.route.params, this.queryBuilder.configUpdated])
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(([params, searchConfig]) => {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
this.searchedWord = params.hasOwnProperty(this.queryParamName) ? params[this.queryParamName] : null;
|
||||
const query = this.formatSearchQuery(this.searchedWord, searchConfig['aca:fields']);
|
||||
if (query) {
|
||||
@@ -128,6 +129,7 @@ export class SearchResultsComponent extends PageComponent implements OnInit {
|
||||
|
||||
if (this.route) {
|
||||
this.route.params.forEach((params: Params) => {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
this.searchedWord = params.hasOwnProperty(this.queryParamName) ? params[this.queryParamName] : null;
|
||||
if (this.searchedWord) {
|
||||
this.queryBuilder.update();
|
||||
|
@@ -29,7 +29,6 @@ import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||
import { ContentServiceExtensionService } from '../services/content-service-extension.service';
|
||||
|
||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
||||
export function setupExtensions(service: AppExtensionService): () => void {
|
||||
return () => service.load();
|
||||
}
|
||||
|
@@ -128,6 +128,7 @@ export class RuleCompositeConditionUiComponent implements ControlValueAccessor,
|
||||
}
|
||||
|
||||
isFormControlSimpleCondition(control: FormControl): boolean {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
return control.value.hasOwnProperty('field');
|
||||
}
|
||||
|
||||
|
@@ -95,7 +95,7 @@ export const isContentServiceEnabled = (): boolean => localStorage && localStora
|
||||
* JSON ref: `app.isSearchSupported`
|
||||
*/
|
||||
export const isSearchSupported = (context: RuleContext): boolean =>
|
||||
[navigation.isNotSearchResults(context) /*, !hasSelection(context)*/].every(Boolean);
|
||||
[navigation.isNotSearchResults(context) /* , !hasSelection(context)*/].every(Boolean);
|
||||
|
||||
/**
|
||||
* Checks if upload action is supported for the given context
|
||||
@@ -617,6 +617,7 @@ export function canOpenWithOffice(context: RuleContext): boolean {
|
||||
|
||||
// workaround for Shared files
|
||||
if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/shared')) {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if (file.entry.hasOwnProperty('allowableOperationsOnTarget')) {
|
||||
return context.permissions.check(file, ['update'], {
|
||||
target: 'allowableOperationsOnTarget'
|
||||
|
@@ -136,8 +136,8 @@ export const isNotRecentFiles = (context: RuleContext): boolean => !isRecentFile
|
||||
* JSON ref: `app.navigation.isSearchResults`
|
||||
*/
|
||||
export function isSearchResults(
|
||||
context: RuleContext /*,
|
||||
...args: RuleParameter[]*/
|
||||
context: RuleContext
|
||||
// ...args: RuleParameter[]
|
||||
): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url && url.startsWith('/search');
|
||||
|
@@ -154,9 +154,8 @@ export class ContentApiService {
|
||||
};
|
||||
const queryOptions = Object.assign(defaults, options || {});
|
||||
|
||||
// @ts-ignore
|
||||
return from(
|
||||
new Promise((resolve, reject) => {
|
||||
new Promise<Node>((resolve, reject) => {
|
||||
this.nodesApi.getNode(nodeId, queryOptions).then(
|
||||
(nodeEntry: NodeEntry) => {
|
||||
resolve(nodeEntry.entry);
|
||||
|
@@ -64,7 +64,7 @@ describe('AosEffects', () => {
|
||||
const action = new AosAction(payload);
|
||||
aosActions$ = of(action);
|
||||
|
||||
effects.openOffice$.subscribe();
|
||||
effects.openOffice$.subscribe(() => {});
|
||||
|
||||
expect(onActionEditOnlineAosSpy).toHaveBeenCalledWith(payload);
|
||||
});
|
||||
|
Reference in New Issue
Block a user