diff --git a/.eslintrc.js b/.eslintrc.js index f3f19322e5..be73788fd7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,3 @@ -path = require('path'); module.exports = { root: true, ignorePatterns: [ @@ -11,20 +10,36 @@ module.exports = { '**/scripts', '**/docs' ], + plugins: ['@nrwl/nx'], overrides: [ { files: ['*.ts'], parserOptions: { - project: [path.join(__dirname, 'tsconfig.json'), path.join(__dirname, 'e2e/tsconfig.e2e.json')], + project: ['tsconfig.json', 'e2e/tsconfig.e2e.json'], createDefaultProgram: true }, extends: [ + 'plugin:@nrwl/nx/typescript', + 'plugin:@nrwl/nx/angular', + 'plugin:@cspell/recommended', 'plugin:@angular-eslint/ng-cli-compat', 'plugin:@angular-eslint/ng-cli-compat--formatting-add-on', 'plugin:@angular-eslint/template/process-inline-templates' ], - plugins: ['eslint-plugin-unicorn', 'eslint-plugin-rxjs', 'ban', 'license-header'], + plugins: [ + 'eslint-plugin-unicorn', + 'eslint-plugin-rxjs', + 'prettier', + 'ban', + 'license-header', + '@cspell', + 'eslint-plugin-import', + '@angular-eslint/eslint-plugin', + '@typescript-eslint' + ], rules: { + // Uncomment this to enable prettier checks as part of the ESLint + // 'prettier/prettier': 'error', 'ban/ban': [ 'error', { name: 'eval', message: 'Calls to eval is not allowed.' }, diff --git a/angular.json b/angular.json index e75de7b52e..47dca93ad4 100644 --- a/angular.json +++ b/angular.json @@ -210,16 +210,6 @@ "demo-shell/**/*.html" ] } - }, - "spellcheck": { - "executor": "nx:run-commands", - "options": { - "commands": [ - { - "command": "npx cspell 'demo-shell/**/*.ts'" - } - ] - } } } }, @@ -346,16 +336,6 @@ } } }, - "spellcheck": { - "executor": "nx:run-commands", - "options": { - "commands": [ - { - "command": "npx cspell 'lib/core/**/*.ts'" - } - ] - } - }, "stylelint": { "executor": "nx:run-commands", "options": { @@ -484,16 +464,6 @@ } } }, - "spellcheck": { - "executor": "nx:run-commands", - "options": { - "commands": [ - { - "command": "npx cspell 'lib/content-services/**/*.ts'" - } - ] - } - }, "stylelint": { "executor": "nx:run-commands", "options": { @@ -560,26 +530,6 @@ ] } }, - "spellcheck": { - "executor": "nx:run-commands", - "options": { - "commands": [ - { - "command": "npx cspell 'lib/process-services/**/*.ts'" - } - ] - }, - "stylelint": { - "executor": "nx:run-commands", - "options": { - "commands": [ - { - "command": "npx stylelint lib/process-services/**/*.scss --config stylelint-config.json" - } - ] - } - } - }, "stylelint": { "executor": "nx:run-commands", "options": { @@ -699,16 +649,6 @@ ] } }, - "spellcheck": { - "executor": "nx:run-commands", - "options": { - "commands": [ - { - "command": "npx cspell 'lib/process-services-cloud/**/*.ts'" - } - ] - } - }, "stylelint": { "executor": "nx:run-commands", "options": { @@ -775,16 +715,6 @@ ] } }, - "spellcheck": { - "executor": "nx:run-commands", - "options": { - "commands": [ - { - "command": "npx cspell 'lib/insights/**/*.ts'" - } - ] - } - }, "stylelint": { "executor": "nx:run-commands", "options": { @@ -848,17 +778,6 @@ "lib/extensions/**/*.ts", "lib/extensions/**/*.html" ] - }, - "dependsOn": ["spellcheck"] - }, - "spellcheck": { - "executor": "nx:run-commands", - "options": { - "commands": [ - { - "command": "npx cspell 'lib/extensions/**/*.ts'" - } - ] } }, "npm-publish": { diff --git a/cspell.json b/cspell.json index f86d5fc0dd..5488073961 100644 --- a/cspell.json +++ b/cspell.json @@ -139,7 +139,8 @@ "webscript", "Whitespaces", "xdescribe", - "xsrf" + "xsrf", + "Undeployed" ], "dictionaries": [ "html", diff --git a/demo-shell/src/app/components/cloud/cloud-filters-demo.component.ts b/demo-shell/src/app/components/cloud/cloud-filters-demo.component.ts index 9aa6e39aa0..388d43a4a0 100644 --- a/demo-shell/src/app/components/cloud/cloud-filters-demo.component.ts +++ b/demo-shell/src/app/components/cloud/cloud-filters-demo.component.ts @@ -53,7 +53,7 @@ export class CloudFiltersDemoComponent implements OnInit { this.currentProcessFilter$ = this.cloudLayoutService.processFilter$; let root = ''; - if (this.route.snapshot && this.route.snapshot.firstChild) { + if (this.route.snapshot?.firstChild) { root = this.route.snapshot.firstChild.url[0].path; if (root === 'tasks') { this.expandTaskFilter = true; diff --git a/demo-shell/src/app/components/cloud/cloud-layout.component.ts b/demo-shell/src/app/components/cloud/cloud-layout.component.ts index 998f8ab107..c8c85f8638 100644 --- a/demo-shell/src/app/components/cloud/cloud-layout.component.ts +++ b/demo-shell/src/app/components/cloud/cloud-layout.component.ts @@ -41,7 +41,7 @@ export class CloudLayoutComponent implements OnInit { this.appName = params.appName; }); - if (this.route.snapshot && this.route.snapshot.firstChild) { + if (this.route.snapshot?.firstChild) { root = this.route.snapshot.firstChild.url[0].path; } diff --git a/demo-shell/src/app/components/cloud/processes-cloud-demo.component.ts b/demo-shell/src/app/components/cloud/processes-cloud-demo.component.ts index 0163e6c04b..a4e2f7935c 100644 --- a/demo-shell/src/app/components/cloud/processes-cloud-demo.component.ts +++ b/demo-shell/src/app/components/cloud/processes-cloud-demo.component.ts @@ -185,7 +185,7 @@ export class ProcessesCloudDemoComponent implements OnInit, OnDestroy { } private loadFilter(model: ProcessFilterCloudModel) { - if (model && model.appName && model.id) { + if (model?.appName && model.id) { this.editedFilter = model; } } diff --git a/demo-shell/src/app/components/file-view/file-view.component.ts b/demo-shell/src/app/components/file-view/file-view.component.ts index b4e9c3e91f..4da84b4ca7 100644 --- a/demo-shell/src/app/components/file-view/file-view.component.ts +++ b/demo-shell/src/app/components/file-view/file-view.component.ts @@ -84,7 +84,7 @@ export class FileViewComponent implements OnInit { if (id) { this.nodeApiService.getNode(id).subscribe( (node) => { - if (node && node.isFile) { + if (node?.isFile) { this.isCommentEnabled = this.contentServices.hasPermissions(node, PermissionsEnum.NOT_CONSUMER) || this.contentServices.hasAllowableOperations(node, AllowableOperationsEnum.UPDATE); this.nodeId = id; diff --git a/demo-shell/src/app/components/files/files.component.ts b/demo-shell/src/app/components/files/files.component.ts index 4505fbeceb..ae1a2f2cc8 100644 --- a/demo-shell/src/app/components/files/files.component.ts +++ b/demo-shell/src/app/components/files/files.component.ts @@ -231,7 +231,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { showFile(event) { const entry = event.value.entry; - if (entry && entry.isFile) { + if (entry?.isFile) { this.preview.showResource(entry.id); } } @@ -296,7 +296,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { } ngOnChanges(changes: SimpleChanges) { - if (changes.nodeResult && changes.nodeResult.currentValue) { + if (changes.nodeResult?.currentValue) { this.nodeResult = changes.nodeResult.currentValue; this.pagination = this.nodeResult.list.pagination; } @@ -468,7 +468,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { if (selection && selection.length === 1) { const entry = selection[0].entry; - if (entry && entry.isFolder) { + if (entry?.isFolder) { return this.contentService.hasAllowableOperations(entry, 'update'); } } @@ -570,7 +570,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { } searchResultsHighlight(search: SearchEntry): string { - if (search && search.highlight) { + if (search?.highlight) { return search.highlight.map((currentHighlight) => currentHighlight.snippets).join(', '); } return ''; @@ -588,7 +588,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy { const objectFromMap = {}; activeFilters.forEach((filter: FilterSearch) => { let paramValue = null; - if (filter.value && filter.value.from && filter.value.to) { + if (filter.value?.from && filter.value.to) { paramValue = `${filter.value.from}||${filter.value.to}`; } else { paramValue = filter.value; diff --git a/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.ts b/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.ts index b4a7dd5872..779788e0dd 100644 --- a/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.ts +++ b/demo-shell/src/app/components/files/version-manager-dialog-adapter.component.ts @@ -41,9 +41,9 @@ export class VersionManagerDialogAdapterComponent { private containingDialog?: MatDialogRef ) { this.contentEntry = data.contentEntry; - this.newFileVersion = data.hasOwnProperty('newFileVersion') ? data.newFileVersion : this.newFileVersion; - this.showComments = data.hasOwnProperty('showComments') ? data.showComments : this.showComments; - this.allowDownload = data.hasOwnProperty('allowDownload') ? data.allowDownload : this.allowDownload; + this.newFileVersion = Object.prototype.hasOwnProperty.call(data, 'newFileVersion') ? data.newFileVersion : this.newFileVersion; + this.showComments = Object.prototype.hasOwnProperty.call(data, 'showComments') ? data.showComments : this.showComments; + this.allowDownload = Object.prototype.hasOwnProperty.call(data, 'allowDownload') ? data.allowDownload : this.allowDownload; } uploadError(event: FileUploadErrorEvent) { diff --git a/demo-shell/src/app/components/process-list-demo/process-list-demo.component.ts b/demo-shell/src/app/components/process-list-demo/process-list-demo.component.ts index 061d530efb..6ab9660c89 100644 --- a/demo-shell/src/app/components/process-list-demo/process-list-demo.component.ts +++ b/demo-shell/src/app/components/process-list-demo/process-list-demo.component.ts @@ -124,7 +124,7 @@ export class ProcessListDemoComponent implements OnInit, OnDestroy { } isFormValid() { - return this.processListForm && this.processListForm.dirty && this.processListForm.valid; + return this.processListForm?.dirty && this.processListForm.valid; } resetProcessForm() { diff --git a/demo-shell/src/app/components/process-service/process-attachments.component.ts b/demo-shell/src/app/components/process-service/process-attachments.component.ts index b52e4bfad9..eee364c607 100644 --- a/demo-shell/src/app/components/process-service/process-attachments.component.ts +++ b/demo-shell/src/app/components/process-service/process-attachments.component.ts @@ -93,7 +93,7 @@ export class ProcessAttachmentsComponent implements OnInit, OnChanges, OnDestroy } isCompletedProcess(): boolean { - return this.processInstance && this.processInstance.ended !== undefined && this.processInstance.ended !== null; + return this.processInstance?.ended != null; } } diff --git a/demo-shell/src/app/components/process-service/process-service.component.ts b/demo-shell/src/app/components/process-service/process-service.component.ts index a05e3ff633..fc8863a429 100644 --- a/demo-shell/src/app/components/process-service/process-service.component.ts +++ b/demo-shell/src/app/components/process-service/process-service.component.ts @@ -180,7 +180,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit .subscribe( (validateDynamicTableRowEvent: ValidateDynamicTableRowEvent) => { const row: DynamicTableRow = validateDynamicTableRowEvent.row; - if (row && row.value && row.value.name === 'admin') { + if (row?.value && row.value.name === 'admin') { validateDynamicTableRowEvent.summary.isValid = false; validateDynamicTableRowEvent.summary.message = 'Sorry, wrong value. You cannot use "admin".'; validateDynamicTableRowEvent.preventDefault(); diff --git a/demo-shell/src/app/components/process-service/task-attachments.component.ts b/demo-shell/src/app/components/process-service/task-attachments.component.ts index 8cd079e7bc..7c77225991 100644 --- a/demo-shell/src/app/components/process-service/task-attachments.component.ts +++ b/demo-shell/src/app/components/process-service/task-attachments.component.ts @@ -92,7 +92,7 @@ export class TaskAttachmentsComponent implements OnInit, OnChanges, OnDestroy { } isCompletedTask(): boolean { - return this.taskDetails && this.taskDetails.endDate !== undefined && this.taskDetails.endDate !== null; + return this.taskDetails?.endDate != null; } } diff --git a/demo-shell/src/app/components/search/search-filter-chips.component.ts b/demo-shell/src/app/components/search/search-filter-chips.component.ts index ac1101664a..81692d0781 100644 --- a/demo-shell/src/app/components/search/search-filter-chips.component.ts +++ b/demo-shell/src/app/components/search/search-filter-chips.component.ts @@ -51,7 +51,7 @@ export class SearchFilterChipsComponent implements OnInit, OnDestroy { .pipe(takeUntil(this.onDestroy$)) .subscribe(([params, searchConfig]) => { this.updateSearchSetting(searchConfig); - this.searchedWord = params.hasOwnProperty(this.queryParamName) ? params[this.queryParamName] : null; + this.searchedWord = Object.prototype.hasOwnProperty.call(params, this.queryParamName) ? params[this.queryParamName] : null; const query = this.formatSearchQuery(this.searchedWord, searchConfig['app:fields']); if (query) { this.queryBuilder.userQuery = query; @@ -87,7 +87,7 @@ export class SearchFilterChipsComponent implements OnInit, OnDestroy { if (this.route) { this.route.params.forEach((params: Params) => { - this.searchedWord = params.hasOwnProperty(this.queryParamName) ? params[this.queryParamName] : null; + this.searchedWord = Object.prototype.hasOwnProperty.call(params, this.queryParamName) ? params[this.queryParamName] : null; if (this.searchedWord) { this.queryBuilder.update(); } else { diff --git a/demo-shell/src/app/components/search/search-result.component.ts b/demo-shell/src/app/components/search/search-result.component.ts index fbfdffe01f..e38fde29fa 100644 --- a/demo-shell/src/app/components/search/search-result.component.ts +++ b/demo-shell/src/app/components/search/search-result.component.ts @@ -50,7 +50,7 @@ export class SearchResultComponent implements OnInit, OnDestroy { combineLatest([this.route.params, this.queryBuilder.configUpdated]) .pipe(takeUntil(this.onDestroy$)) .subscribe(([params, searchConfig]) => { - this.searchedWord = params.hasOwnProperty(this.queryParamName) ? params[this.queryParamName] : null; + this.searchedWord = Object.prototype.hasOwnProperty.call(params, this.queryParamName) ? params[this.queryParamName] : null; const query = this.formatSearchQuery(this.searchedWord, searchConfig['app:fields']); if (query) { this.queryBuilder.userQuery = query; @@ -86,7 +86,7 @@ export class SearchResultComponent implements OnInit, OnDestroy { if (this.route) { this.route.params.forEach((params: Params) => { - this.searchedWord = params.hasOwnProperty(this.queryParamName) ? params[this.queryParamName] : null; + this.searchedWord = Object.prototype.hasOwnProperty.call(params, this.queryParamName) ? params[this.queryParamName] : null; if (this.searchedWord) { this.queryBuilder.update(); } else { diff --git a/demo-shell/src/app/components/settings/host-settings.component.ts b/demo-shell/src/app/components/settings/host-settings.component.ts index 083a285a36..d7f7f9dfb5 100644 --- a/demo-shell/src/app/components/settings/host-settings.component.ts +++ b/demo-shell/src/app/components/settings/host-settings.component.ts @@ -21,7 +21,7 @@ import { AppConfigService, AppConfigValues, StorageService, AlfrescoApiService, import { ENTER } from '@angular/cdk/keycodes'; import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; -export const HOST_REGEX = '^(http|https):\/\/.*[^/]$'; +export const HOST_REGEX = '^(http|https)://.*[^/]$'; @Component({ providers: [{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { floatLabel: 'always' } }], diff --git a/demo-shell/src/app/components/task-list-demo/task-list-demo.component.ts b/demo-shell/src/app/components/task-list-demo/task-list-demo.component.ts index c2352fcb74..15866cc5c8 100644 --- a/demo-shell/src/app/components/task-list-demo/task-list-demo.component.ts +++ b/demo-shell/src/app/components/task-list-demo/task-list-demo.component.ts @@ -190,7 +190,7 @@ export class TaskListDemoComponent implements OnInit, OnDestroy { } isFormValid() { - return this.taskListForm && this.taskListForm.dirty && this.taskListForm.valid; + return this.taskListForm?.dirty && this.taskListForm.valid; } private getControl(key: string): T { diff --git a/lib/cli/scripts/check-cs-env.ts b/lib/cli/scripts/check-cs-env.ts index cc54849d7f..720caf8ea2 100755 --- a/lib/cli/scripts/check-cs-env.ts +++ b/lib/cli/scripts/check-cs-env.ts @@ -15,9 +15,9 @@ * limitations under the License. */ -import { AlfrescoApi, NodesApi, UploadApi } from '@alfresco/js-api'; +import { AlfrescoApi /*, NodesApi, UploadApi*/ } from '@alfresco/js-api'; import { argv, exit } from 'node:process'; -import { Buffer } from 'node:buffer'; +// import { Buffer } from 'node:buffer'; const program = require('commander'); import { logger } from './logger'; const MAX_RETRY = 3; @@ -71,7 +71,8 @@ async function checkEnv() { } } -// @ts-ignore +// TODO: https://alfresco.atlassian.net/browse/ACS-5873 +/* async function checkDiskSpaceFullEnv() { logger.info(`Start Check disk full space`); @@ -108,6 +109,7 @@ async function checkDiskSpaceFullEnv() { } } } +*/ function sleep(delay: number) { const start = new Date().getTime(); diff --git a/lib/cli/scripts/init-aae-env.ts b/lib/cli/scripts/init-aae-env.ts index fcb4c3c1a8..7bd27ac9a8 100755 --- a/lib/cli/scripts/init-aae-env.ts +++ b/lib/cli/scripts/init-aae-env.ts @@ -497,7 +497,7 @@ async function checkDescriptorExist(name: string): Promise { logger.info(`Check descriptor ${name} exist in the list `); const descriptorList = await getDescriptors(); - if (descriptorList && descriptorList.list && descriptorList.entries) { + if (descriptorList?.list && descriptorList.entries) { for (const descriptor of descriptorList.list.entries) { if (descriptor.entry.name === name) { if (descriptor.entry.deployed === false) { diff --git a/lib/cli/scripts/init-acs-env.ts b/lib/cli/scripts/init-acs-env.ts index 572ad3941f..ad84f8fdd4 100755 --- a/lib/cli/scripts/init-acs-env.ts +++ b/lib/cli/scripts/init-acs-env.ts @@ -56,24 +56,29 @@ async function initializeDefaultFiles() { for (let j = 0; j < ACS_DEFAULT.files.length; j++) { const fileInfo = ACS_DEFAULT.files[j]; switch (fileInfo.action) { - case 'UPLOAD': + case 'UPLOAD': { await uploadFile(fileInfo.name, parentFolderId); break; - case 'LOCK': + } + case 'LOCK': { const fileToLock = await uploadFile(fileInfo.name, parentFolderId); await lockFile(fileToLock.entry.id); break; - case 'SHARE': + } + case 'SHARE': { const fileToShare = await uploadFile(fileInfo.name, parentFolderId); await shareFile(fileToShare.entry.id); break; - case 'FAVORITE': + } + case 'FAVORITE': { const fileToFav = await uploadFile(fileInfo.name, parentFolderId); await favoriteFile(fileToFav.entry.id); break; - default: + } + default: { logger.error('No action found for file ', fileInfo.name, parentFolderId); break; + } } } } diff --git a/lib/cli/scripts/init-aps-env.ts b/lib/cli/scripts/init-aps-env.ts index 5a3099154f..a836487b63 100755 --- a/lib/cli/scripts/init-aps-env.ts +++ b/lib/cli/scripts/init-aps-env.ts @@ -117,8 +117,8 @@ async function main() { async function initializeDefaultApps() { for (let x = 0; x < ACTIVITI_APPS.apps.length; x++) { const appInfo = ACTIVITI_APPS.apps[x]; - const isDefaultAppDepl = await isDefaultAppDeployed(appInfo.name); - if (isDefaultAppDepl !== undefined && !isDefaultAppDepl) { + const isDeployed = await isDefaultAppDeployed(appInfo.name); + if (isDeployed !== undefined && !isDeployed) { const appDefinition = await importPublishApp(`${appInfo.name}`); await deployApp(appDefinition.appDefinition.id); } else { @@ -248,7 +248,7 @@ async function isDefaultAppDeployed(appName: string) { try { const runtimeAppDefinitionsApi = new RuntimeAppDefinitionsApi(alfrescoJsApi); const availableApps = await runtimeAppDefinitionsApi.getAppDefinitions(); - const defaultApp = availableApps.data && availableApps.data.filter(app => app.name && app.name.includes(appName)); + const defaultApp = availableApps.data?.filter(app => app.name?.includes(appName)); return defaultApp && defaultApp.length > 0; } catch (error) { logger.error(`Aps app failed to import/Publish!`); @@ -262,8 +262,8 @@ async function importPublishApp(appName: string) { const fileContent = createReadStream(pathFile); try { - const appdefinitionsApi = new AppDefinitionsApi(alfrescoJsApi); - const result = await appdefinitionsApi.importAndPublishApp(fileContent, {renewIdmEntries: true}); + const appDefinitionsApi = new AppDefinitionsApi(alfrescoJsApi); + const result = await appDefinitionsApi.importAndPublishApp(fileContent, {renewIdmEntries: true}); logger.info(`Aps app imported and published!`); return result; } catch (error) { @@ -398,7 +398,7 @@ async function authorizeUserToContentRepo(user: any) { ['application/json'], ['application/json'] ); - logger.info(`Found ${content.data && content.data.length} contents`); + logger.info(`Found ${content.data?.length} contents`); if (content.data) { for (let i = 0; i < content.data.length; i++) { if (content.data[i].authenticationType === 'basic') { diff --git a/lib/cli/scripts/kube-utils.ts b/lib/cli/scripts/kube-utils.ts index 5f1138a57f..999a9c06d7 100644 --- a/lib/cli/scripts/kube-utils.ts +++ b/lib/cli/scripts/kube-utils.ts @@ -63,6 +63,7 @@ export const deletePod = (args: KubeArgs) => { export const getNamespaces = (): string[] => { logger.info('Perform get namespaces name...'); const result = exec('kubectl', [`get`, `namespaces`, `-l`, `type=application`, `-o`, `name`], {}); + // eslint-disable-next-line no-useless-escape const namespaces = result.replace(/namespace[\/]+/g, '').split(/\r?\n/); logger.info(`namespaces found: ${namespaces}`); return namespaces; diff --git a/lib/cli/scripts/licenses.ts b/lib/cli/scripts/licenses.ts index 195d8673f7..a56e42f035 100644 --- a/lib/cli/scripts/licenses.ts +++ b/lib/cli/scripts/licenses.ts @@ -51,12 +51,12 @@ const missingRepositories = { function licenseWithMDLinks(licenseExp: string): string { let licenseUrl = ''; - if (licenseList[licenseExp] && licenseList[licenseExp]['url']) { + if (licenseList[licenseExp]?.['url']) { licenseUrl = licenseList[licenseExp]['url']; } else { const substituteLicString = nonStandardLicenses[licenseExp.toLowerCase()]; - if (licenseList[substituteLicString] && licenseList[substituteLicString]['url']) { + if (licenseList[substituteLicString]?.['url']) { licenseUrl = licenseList[substituteLicString]['url']; } } @@ -125,7 +125,7 @@ export default function main(_args: string[], workingDir: string) { const pack = packages[packageName]; pack['licenseExp'] = pack['licenses'].toString() .replace(/\*/, '') - .replace(/[a-zA-Z0-9\-\.]+/g, (match: string) => { + .replace(/[a-zA-Z0-9\-.]+/g, (match: string) => { const lowerMatch = match.toLowerCase(); if ((lowerMatch !== 'and') && (lowerMatch !== 'or') && (lowerMatch !== 'with')) { diff --git a/lib/cli/scripts/plugins/process-automation-health.ts b/lib/cli/scripts/plugins/process-automation-health.ts index 33a97566a9..818655971d 100644 --- a/lib/cli/scripts/plugins/process-automation-health.ts +++ b/lib/cli/scripts/plugins/process-automation-health.ts @@ -32,7 +32,7 @@ export class ProcessAutomationHealth { const url = `${this.plugInInfo.host}/${this.plugInInfo.appName}/ui/${this.plugInInfo.uiName}/app.config.json`; const appConfig = await this.config.getAppConfig(url); let isEnabled = true; - if (appConfig && appConfig.plugins && appConfig.plugins[this.plugInInfo.name]) { + if (appConfig?.plugins?.[this.plugInInfo.name]) { logger.info(`The plugin ${this.plugInInfo.name} has been correctly configured in app.config.json`); } else { this.logConfigurationError(); diff --git a/lib/cli/scripts/plugins/process-services-health.ts b/lib/cli/scripts/plugins/process-services-health.ts index 5a992d376f..1a32e7859f 100644 --- a/lib/cli/scripts/plugins/process-services-health.ts +++ b/lib/cli/scripts/plugins/process-services-health.ts @@ -32,7 +32,7 @@ export class ProcessServiceHealth { const url = `${this.plugInInfo.host}/app.config.json`; const appConfig = await this.config.getAppConfig(url); let isEnabled = true; - if (appConfig && appConfig.plugins && appConfig.plugins[this.plugInInfo.name]) { + if (appConfig?.plugins?.[this.plugInInfo.name]) { logger.info(`The plugin ${this.plugInInfo.name} has been correctly configured in app.config.json`); } else { this.logConfigurationError(); diff --git a/lib/cli/scripts/update-commit-sha.ts b/lib/cli/scripts/update-commit-sha.ts index ef56dfa460..24680841e5 100644 --- a/lib/cli/scripts/update-commit-sha.ts +++ b/lib/cli/scripts/update-commit-sha.ts @@ -38,6 +38,7 @@ function getSha(args: CommitArgs): string { function replacePerform(args: CommitArgs, sha: string) { logger.info(`Replace commit ${sha} in package...`); + // eslint-disable-next-line no-useless-escape const sedRule = `s/\"commit\": \".*\"/\"commit\": \"${sha}\"/g`; if (args.skipGnu) { diff --git a/lib/content-services/src/lib/aspect-list/aspect-list.component.spec.ts b/lib/content-services/src/lib/aspect-list/aspect-list.component.spec.ts index 83c318da3a..289aa37ea7 100644 --- a/lib/content-services/src/lib/aspect-list/aspect-list.component.spec.ts +++ b/lib/content-services/src/lib/aspect-list/aspect-list.component.spec.ts @@ -129,9 +129,9 @@ describe('AspectListComponent', () => { }); it('should show the loading spinner when result is loading', () => { - const delayReusult = of(null).pipe(delay(0)); - spyOn(nodeService, 'getNode').and.returnValue(delayReusult); - spyOn(aspectListService, 'getAspects').and.returnValue(delayReusult); + const delayResult = of(null).pipe(delay(0)); + spyOn(nodeService, 'getNode').and.returnValue(delayResult); + spyOn(aspectListService, 'getAspects').and.returnValue(delayResult); fixture.detectChanges(); const spinner = fixture.nativeElement.querySelector('#adf-aspect-spinner'); expect(spinner).toBeDefined(); diff --git a/lib/content-services/src/lib/category/categories-management/categories-management.component.spec.ts b/lib/content-services/src/lib/category/categories-management/categories-management.component.spec.ts index a72edfdc1a..5c75eefff8 100644 --- a/lib/content-services/src/lib/category/categories-management/categories-management.component.spec.ts +++ b/lib/content-services/src/lib/category/categories-management/categories-management.component.spec.ts @@ -140,9 +140,9 @@ describe('CategoriesManagementComponent', () => { }); it('should unassign/remove specific category after clicking at remove icon and emit categories change', () => { - const removeBtns = getRemoveCategoryButtons(); + const removeButtons = getRemoveCategoryButtons(); const categoriesChangeSpy = spyOn(component.categoriesChange, 'emit'); - removeBtns[0].click(); + removeButtons[0].click(); fixture.detectChanges(); @@ -156,9 +156,9 @@ describe('CategoriesManagementComponent', () => { it('should disable unassigning/removing categories when disableRemoval is set', () => { component.disableRemoval = true; fixture.detectChanges(); - const removeBtns = getRemoveCategoryButtons(); - const allBtnsDisabled = removeBtns.every((removeBtn) => removeBtn.disabled); - expect(allBtnsDisabled).toBeTrue(); + const removeButtons = getRemoveCategoryButtons(); + const allButtonsDisabled = removeButtons.every((removeBtn) => removeBtn.disabled); + expect(allButtonsDisabled).toBeTrue(); }); }); @@ -269,8 +269,8 @@ describe('CategoriesManagementComponent', () => { }); it('should have correct remove category title', () => { - const removeBtns = getRemoveCategoryButtons(); - const isTitleCorrect = removeBtns.every((removeBtn) => removeBtn.attributes.getNamedItem('title').textContent === 'CATEGORIES_MANAGEMENT.UNASSIGN_CATEGORY'); + const removeButtons = getRemoveCategoryButtons(); + const isTitleCorrect = removeButtons.every((removeBtn) => removeBtn.attributes.getNamedItem('title').textContent === 'CATEGORIES_MANAGEMENT.UNASSIGN_CATEGORY'); expect(isTitleCorrect).toBeTrue(); }); @@ -329,8 +329,8 @@ describe('CategoriesManagementComponent', () => { fixture.detectChanges(); const categoriesChangeSpy = spyOn(component.categoriesChange, 'emit').and.callThrough(); - const removeCategoryBtns = getRemoveCategoryButtons(); - removeCategoryBtns[2].click(); + const removeCategoryButtons = getRemoveCategoryButtons(); + removeCategoryButtons[2].click(); fixture.detectChanges(); expect(component.categories.length).toBe(2); @@ -345,8 +345,8 @@ describe('CategoriesManagementComponent', () => { typeCategory('test'); expect(component.existingCategories.length).toBe(2); const categoriesChangeSpy = spyOn(component.categoriesChange, 'emit').and.callThrough(); - const removeCategoryBtns = getRemoveCategoryButtons(); - removeCategoryBtns[0].click(); + const removeCategoryButtons = getRemoveCategoryButtons(); + removeCategoryButtons[0].click(); fixture.detectChanges(); expect(component.categories.length).toBe(1); @@ -375,8 +375,8 @@ describe('CategoriesManagementComponent', () => { }); it('should have correct remove category title', () => { - const removeBtns = getRemoveCategoryButtons(); - const isTitleCorrect = removeBtns.every((removeBtn) => removeBtn.attributes.getNamedItem('title').textContent === 'CATEGORIES_MANAGEMENT.DELETE_CATEGORY'); + const removeButtons = getRemoveCategoryButtons(); + const isTitleCorrect = removeButtons.every((removeBtn) => removeBtn.attributes.getNamedItem('title').textContent === 'CATEGORIES_MANAGEMENT.DELETE_CATEGORY'); expect(isTitleCorrect).toBeTrue(); }); @@ -434,8 +434,8 @@ describe('CategoriesManagementComponent', () => { createCategory('test'); const categoriesChangeSpy = spyOn(component.categoriesChange, 'emit'); - const removeCategoryBtns = getRemoveCategoryButtons(); - removeCategoryBtns[2].click(); + const removeCategoryButtons = getRemoveCategoryButtons(); + removeCategoryButtons[2].click(); fixture.detectChanges(); expect(component.categories.length).toBe(2); diff --git a/lib/content-services/src/lib/category/services/category-tree-datasource.service.ts b/lib/content-services/src/lib/category/services/category-tree-datasource.service.ts index 80f5885b6d..bac62fb8a4 100644 --- a/lib/content-services/src/lib/category/services/category-tree-datasource.service.ts +++ b/lib/content-services/src/lib/category/services/category-tree-datasource.service.ts @@ -64,17 +64,15 @@ export class CategoryTreeDatasourceService extends TreeService { .join(pathSeparator); return this.categoryService.getCategory(category.entry.id).pipe( - map((res) => { - return { - id: category.entry.id, - nodeName: path ? `${path}/${category.entry.name}` : category.entry.name, - parentId: category.entry.parentId, - level: 0, - nodeType: TreeNodeType.RegularNode, - hasChildren: res.entry.hasChildren, - isLoading: false - }; - }) + map((res) => ({ + id: category.entry.id, + nodeName: path ? `${path}/${category.entry.name}` : category.entry.name, + parentId: category.entry.parentId, + level: 0, + nodeType: TreeNodeType.RegularNode, + hasChildren: res.entry.hasChildren, + isLoading: false + })) ); }), toArray(), diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts index 891095142f..dbda527726 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts @@ -610,7 +610,7 @@ describe('ContentMetadataComponent', () => { let classesApi: ClassesApi; let expectedNode: Node; - const versionableResponse: PropertyGroup = { + const verResponse: PropertyGroup = { name: 'cm:versionable', title: 'Versionable', properties: { @@ -705,7 +705,7 @@ describe('ContentMetadataComponent', () => { 'cm:versionable': '*' }); - spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(versionableResponse)); + spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(verResponse)); component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) }); fixture.detectChanges(); @@ -713,9 +713,9 @@ describe('ContentMetadataComponent', () => { await component.groupedProperties$.toPromise(); fixture.detectChanges(); - const versionableProp = queryDom(fixture, 'Versionable'); + const verProp = queryDom(fixture, 'Versionable'); - expect(versionableProp).toBeTruthy(); + expect(verProp).toBeTruthy(); expect(classesApi.getClass).toHaveBeenCalledWith('cm_versionable'); }); @@ -725,7 +725,7 @@ describe('ContentMetadataComponent', () => { 'cm:versionable': '*' }); - spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(versionableResponse)); + spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(verResponse)); component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) }); fixture.detectChanges(); @@ -733,9 +733,9 @@ describe('ContentMetadataComponent', () => { await component.groupedProperties$.toPromise(); fixture.detectChanges(); - const versionableProps = fixture.debugElement.queryAll(By.css('[data-automation-id="adf-metadata-group-Versionable"]')); + const verProps = fixture.debugElement.queryAll(By.css('[data-automation-id="adf-metadata-group-Versionable"]')); - expect(versionableProps.length).toEqual(2); + expect(verProps.length).toEqual(2); expect(classesApi.getClass).toHaveBeenCalledWith('cm_versionable'); }); @@ -745,7 +745,7 @@ describe('ContentMetadataComponent', () => { exclude: 'cm:versionable' }); - spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(versionableResponse)); + spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(verResponse)); component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) }); fixture.detectChanges(); @@ -753,9 +753,9 @@ describe('ContentMetadataComponent', () => { await component.groupedProperties$.toPromise(); fixture.detectChanges(); - const versionableProp = queryDom(fixture, 'Versionable'); + const verProp = queryDom(fixture, 'Versionable'); - expect(versionableProp).toBeNull(); + expect(verProp).toBeNull(); expect(classesApi.getClass).toHaveBeenCalledWith('cm_versionable'); }); @@ -766,7 +766,7 @@ describe('ContentMetadataComponent', () => { 'cm:versionable': '*' }); - spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(versionableResponse)); + spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(verResponse)); component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) }); fixture.detectChanges(); @@ -774,9 +774,9 @@ describe('ContentMetadataComponent', () => { await component.groupedProperties$.toPromise(); fixture.detectChanges(); - const versionableProp = queryDom(fixture, 'Versionable'); + const verProp = queryDom(fixture, 'Versionable'); - expect(versionableProp).toBeTruthy(); + expect(verProp).toBeTruthy(); expect(classesApi.getClass).toHaveBeenCalledWith('cm_versionable'); }); @@ -786,7 +786,7 @@ describe('ContentMetadataComponent', () => { exclude: ['cm:versionable', 'cm:auditable'] }); - spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(versionableResponse)); + spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(verResponse)); component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) }); fixture.detectChanges(); @@ -794,8 +794,8 @@ describe('ContentMetadataComponent', () => { await component.groupedProperties$.toPromise(); fixture.detectChanges(); - const versionableProp = queryDom(fixture, 'Versionable'); - expect(versionableProp).toBeNull(); + const verProp = queryDom(fixture, 'Versionable'); + expect(verProp).toBeNull(); const auditableProp = queryDom(fixture, 'Auditable'); expect(auditableProp).toBeNull(); @@ -825,17 +825,17 @@ describe('ContentMetadataComponent', () => { exifProp.nativeElement.click(); - const pixelXDimentionElement = fixture.debugElement.query( + const pixelXDimensionElement = fixture.debugElement.query( By.css('[data-automation-id="card-textitem-label-properties.exif:pixelXDimension"]') ); - expect(pixelXDimentionElement).toBeTruthy(); - expect(pixelXDimentionElement.nativeElement.textContent.trim()).toEqual('Image Width'); + expect(pixelXDimensionElement).toBeTruthy(); + expect(pixelXDimensionElement.nativeElement.textContent.trim()).toEqual('Image Width'); - const pixelYDimentionElement = fixture.debugElement.query( + const pixelYDimensionElement = fixture.debugElement.query( By.css('[data-automation-id="card-textitem-label-properties.exif:pixelYDimension"]') ); - expect(pixelYDimentionElement).toBeTruthy(); - expect(pixelYDimentionElement.nativeElement.textContent.trim()).toEqual('Image Height'); + expect(pixelYDimensionElement).toBeTruthy(); + expect(pixelYDimensionElement.nativeElement.textContent.trim()).toEqual('Image Height'); }); it('should show Exif twice when includeAll is set to true', async () => { diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts index 27250ef567..4b188684ff 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts @@ -330,7 +330,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy { this.loadTagsForNode(this.node.id); } if (this.displayCategories && !!result.LinkingCategories) { - this.assignedCategories = !!result.LinkingCategories.list ? + this.assignedCategories = result.LinkingCategories.list ? result.LinkingCategories.list.entries.map((entry: CategoryEntry) => entry.entry) : [result.LinkingCategories.entry]; } diff --git a/lib/content-services/src/lib/content-metadata/services/content-metadata.service.spec.ts b/lib/content-services/src/lib/content-metadata/services/content-metadata.service.spec.ts index bd031b9873..45877c97a6 100644 --- a/lib/content-services/src/lib/content-metadata/services/content-metadata.service.spec.ts +++ b/lib/content-services/src/lib/content-metadata/services/content-metadata.service.spec.ts @@ -110,7 +110,7 @@ describe('ContentMetaDataService', () => { } }; - const versionableResponse: PropertyGroup = { + const verResponse: PropertyGroup = { name: 'cm:versionable', title: 'Versionable', properties: { @@ -232,7 +232,7 @@ describe('ContentMetaDataService', () => { 'cm:versionable': '*' }); - spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(versionableResponse)); + spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(verResponse)); const groupedProperties = await service.getGroupedProperties(fakeContentNode).toPromise(); @@ -249,7 +249,7 @@ describe('ContentMetaDataService', () => { 'cm:versionable': '*' }); - spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(versionableResponse)); + spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(verResponse)); const groupedProperties = await service.getGroupedProperties(fakeContentNode).toPromise(); @@ -267,7 +267,7 @@ describe('ContentMetaDataService', () => { exclude: 'cm:versionable' }); - spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(versionableResponse)); + spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(verResponse)); const groupedProperties = await service.getGroupedProperties(fakeContentNode).toPromise(); expect(groupedProperties.length).toEqual(0); @@ -283,7 +283,7 @@ describe('ContentMetaDataService', () => { 'cm:versionable': '*' }); - spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(versionableResponse)); + spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(verResponse)); const groupedProperties = await service.getGroupedProperties(fakeContentNode).toPromise(); expect(groupedProperties.length).toEqual(1); @@ -299,7 +299,7 @@ describe('ContentMetaDataService', () => { exclude: ['cm:versionable', 'cm:auditable'] }); - spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(versionableResponse)); + spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve(verResponse)); const groupedProperties = await service.getGroupedProperties(fakeContentNode).toPromise(); expect(groupedProperties.length).toEqual(0); diff --git a/lib/content-services/src/lib/content-type/content-type-dialog.component.spec.ts b/lib/content-services/src/lib/content-type/content-type-dialog.component.spec.ts index 8037fd0e19..46d01e720d 100644 --- a/lib/content-services/src/lib/content-type/content-type-dialog.component.spec.ts +++ b/lib/content-services/src/lib/content-type/content-type-dialog.component.spec.ts @@ -147,9 +147,9 @@ describe('Content Type Dialog Component', () => { }); it('should show the property with the aspect prefix not the inherited ones', async () => { - const showPropertyAccordon: HTMLButtonElement = fixture.nativeElement.querySelector('.adf-content-type-accordion .mat-expansion-panel-header'); - expect(showPropertyAccordon).toBeDefined(); - showPropertyAccordon.click(); + const showPropertyAccordion: HTMLButtonElement = fixture.nativeElement.querySelector('.adf-content-type-accordion .mat-expansion-panel-header'); + expect(showPropertyAccordion).toBeDefined(); + showPropertyAccordion.click(); fixture.detectChanges(); await fixture.whenStable(); const propertyShowed: NodeList = fixture.nativeElement.querySelectorAll('.adf-content-type-table .mat-row'); diff --git a/lib/content-services/src/lib/dialogs/folder-name.validators.ts b/lib/content-services/src/lib/dialogs/folder-name.validators.ts index ca9b58b6db..94d7e611f0 100644 --- a/lib/content-services/src/lib/dialogs/folder-name.validators.ts +++ b/lib/content-services/src/lib/dialogs/folder-name.validators.ts @@ -20,6 +20,7 @@ import { UntypedFormControl } from '@angular/forms'; const I18N_ERRORS_PATH = 'CORE.FOLDER_DIALOG.FOLDER_NAME.ERRORS'; export const forbidSpecialCharacters = ({ value }: UntypedFormControl) => { + // eslint-disable-next-line no-useless-escape const specialCharacters: RegExp = /([\*\"\<\>\\\/\?\:\|])/; const isValid: boolean = !specialCharacters.test(value); diff --git a/lib/content-services/src/lib/dialogs/node-lock.dialog.ts b/lib/content-services/src/lib/dialogs/node-lock.dialog.ts index 6daafec255..dac7f34cd5 100644 --- a/lib/content-services/src/lib/dialogs/node-lock.dialog.ts +++ b/lib/content-services/src/lib/dialogs/node-lock.dialog.ts @@ -59,7 +59,7 @@ export class NodeLockDialogComponent implements OnInit { isLocked: node.isLocked || false, allowOwner: node.properties['cm:lockType'] === 'WRITE_LOCK', isTimeLock: !!node.properties['cm:expiryDate'], - time: !!node.properties['cm:expiryDate'] ? moment(node.properties['cm:expiryDate']) : moment() + time: node.properties['cm:expiryDate'] ? moment(node.properties['cm:expiryDate']) : moment() }); } diff --git a/lib/content-services/src/lib/directives/auto-focus.directive.spec.ts b/lib/content-services/src/lib/directives/auto-focus.directive.spec.ts index 8a6e68f38f..5038c71ec3 100644 --- a/lib/content-services/src/lib/directives/auto-focus.directive.spec.ts +++ b/lib/content-services/src/lib/directives/auto-focus.directive.spec.ts @@ -24,10 +24,10 @@ import { TranslateModule } from '@ngx-translate/core'; @Component({ template: `
Test
` }) -class AutoFoucsTestComponent {} +class AutoFocusTestComponent {} describe('AutoFocusDirective', () => { - let fixture: ComponentFixture; + let fixture: ComponentFixture; beforeEach(() => { TestBed.configureTestingModule({ @@ -36,10 +36,10 @@ describe('AutoFocusDirective', () => { ], declarations: [ AutoFocusDirective, - AutoFoucsTestComponent + AutoFocusTestComponent ] }); - fixture = TestBed.createComponent(AutoFoucsTestComponent); + fixture = TestBed.createComponent(AutoFocusTestComponent); }); it('should focus the element after content is initialized', fakeAsync(() => { diff --git a/lib/content-services/src/lib/directives/node-delete.directive.ts b/lib/content-services/src/lib/directives/node-delete.directive.ts index 2ac6486582..7415bb5162 100644 --- a/lib/content-services/src/lib/directives/node-delete.directive.ts +++ b/lib/content-services/src/lib/directives/node-delete.directive.ts @@ -118,7 +118,7 @@ export class NodeDeleteDirective implements OnChanges { let promise: Promise; - if (node.entry.hasOwnProperty('archivedAt') && node.entry['archivedAt']) { + if (Object.prototype.hasOwnProperty.call(node.entry, 'archivedAt') && node.entry['archivedAt']) { promise = this.trashcanApi.deleteDeletedNode(id); } else { promise = this.nodesApi.deleteNode(id, { permanent: this.permanent }); diff --git a/lib/content-services/src/lib/directives/node-favorite.directive.ts b/lib/content-services/src/lib/directives/node-favorite.directive.ts index 2582f3ea85..eeb0cae5f1 100644 --- a/lib/content-services/src/lib/directives/node-favorite.directive.ts +++ b/lib/content-services/src/lib/directives/node-favorite.directive.ts @@ -130,7 +130,7 @@ export class NodeFavoriteDirective implements OnChanges { const node: Node | SharedLink = selected.entry; // ACS 6.x with 'isFavorite' include - if (node?.hasOwnProperty('isFavorite')) { + if (node && Object.prototype.hasOwnProperty.call(node, 'isFavorite')) { return of(selected); } diff --git a/lib/content-services/src/lib/document-list/models/content-action.model.ts b/lib/content-services/src/lib/document-list/models/content-action.model.ts index fe4405d725..a97f6eb900 100644 --- a/lib/content-services/src/lib/document-list/models/content-action.model.ts +++ b/lib/content-services/src/lib/document-list/models/content-action.model.ts @@ -39,11 +39,11 @@ export class ContentActionModel { this.permission = obj.permission; this.disableWithNoPermission = obj.disableWithNoPermission; - if (obj.hasOwnProperty('disabled')) { + if (Object.prototype.hasOwnProperty.call(obj, 'disabled')) { this.disabled = obj.disabled; } - if (obj.hasOwnProperty('visible')) { + if (Object.prototype.hasOwnProperty.call(obj, 'visible')) { this.visible = obj.visible; } } diff --git a/lib/content-services/src/lib/permission-manager/components/add-permission/add-permission-dialog.component.ts b/lib/content-services/src/lib/permission-manager/components/add-permission/add-permission-dialog.component.ts index ce986f03be..3558f08093 100644 --- a/lib/content-services/src/lib/permission-manager/components/add-permission/add-permission-dialog.component.ts +++ b/lib/content-services/src/lib/permission-manager/components/add-permission/add-permission-dialog.component.ts @@ -56,7 +56,7 @@ export class AddPermissionDialogComponent { this.selectedMembers.forEach((member) => { const existingMember = this.existingMembers.find(({authorityId}) => authorityId === member.id); - if (!!existingMember) { + if (existingMember) { member.role = existingMember.name; member.accessStatus = existingMember.accessStatus; member.readonly = true; // make role non editable @@ -66,7 +66,7 @@ export class AddPermissionDialogComponent { } canCloseDialog() { - if (!!this.selectedMembers.length) { + if (this.selectedMembers.length) { this.disableSearch(); } else { this.dialogRef.close(); diff --git a/lib/content-services/src/lib/permission-manager/components/add-permission/search-config-permission.service.ts b/lib/content-services/src/lib/permission-manager/components/add-permission/search-config-permission.service.ts index f8972d243b..391e2e7079 100644 --- a/lib/content-services/src/lib/permission-manager/components/add-permission/search-config-permission.service.ts +++ b/lib/content-services/src/lib/permission-manager/components/add-permission/search-config-permission.service.ts @@ -54,7 +54,7 @@ export class SearchPermissionConfigurationService implements SearchConfiguration if (this.queryProvider?.query) { query = this.queryProvider.query.replace(new RegExp(/\${([^}]+)}/g), searchTerm); } else { - query = `(email:*${searchTerm}* OR firstName:*${searchTerm}* OR lastName:*${searchTerm}* OR displayName:*${searchTerm}* OR authorityName:*${searchTerm}* OR authorityDisplayName:*${searchTerm}*) AND ANAME:(\"0/APP.DEFAULT\")`; + query = `(email:*${searchTerm}* OR firstName:*${searchTerm}* OR lastName:*${searchTerm}* OR displayName:*${searchTerm}* OR authorityName:*${searchTerm}* OR authorityDisplayName:*${searchTerm}*) AND ANAME:("0/APP.DEFAULT")`; } return query; } diff --git a/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts b/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts index 33af266509..79e967b0f6 100644 --- a/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts +++ b/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts @@ -65,6 +65,7 @@ export class NodePermissionService { /** * Get permissions for a given node + * * @param node Node to check permissions for */ getNodePermissions(node: Node): PermissionDisplayModel[] { diff --git a/lib/content-services/src/lib/search/components/search-logical-filter/search-logical-filter.component.ts b/lib/content-services/src/lib/search/components/search-logical-filter/search-logical-filter.component.ts index 5bbeed7703..0c66b1be82 100644 --- a/lib/content-services/src/lib/search/components/search-logical-filter/search-logical-filter.component.ts +++ b/lib/content-services/src/lib/search/components/search-logical-filter/search-logical-filter.component.ts @@ -89,7 +89,7 @@ export class SearchLogicalFilterComponent implements SearchWidget, OnInit { fieldQuery += field + '"' + this.searchCondition[key].trim() + '"'; } else { this.searchCondition[key].split(' ').filter((condition: string) => condition !== '').forEach((phrase: string) => { - const refinedPhrase = '\"' + phrase + '\"'; + const refinedPhrase = '"' + phrase + '"'; fieldQuery += fieldQuery === '(' ? `${key === LogicalSearchFields.EXCLUDE ? 'NOT ' : ''}${field}${refinedPhrase}` : ` ${connector} ${field}${refinedPhrase}`; diff --git a/lib/content-services/src/lib/search/components/search-slider/search-slider.component.ts b/lib/content-services/src/lib/search/components/search-slider/search-slider.component.ts index 52c5c8121a..1cc141a8bc 100644 --- a/lib/content-services/src/lib/search/components/search-slider/search-slider.component.ts +++ b/lib/content-services/src/lib/search/components/search-slider/search-slider.component.ts @@ -49,15 +49,15 @@ export class SearchSliderComponent implements SearchWidget, OnInit { ngOnInit() { if (this.settings) { - if (this.settings.hasOwnProperty('min')) { + if (Object.prototype.hasOwnProperty.call(this.settings, 'min')) { this.min = this.settings['min']; } - if (this.settings.hasOwnProperty('max')) { + if (Object.prototype.hasOwnProperty.call(this.settings, 'max')) { this.max = this.settings['max']; } - if (this.settings.hasOwnProperty('step')) { + if (Object.prototype.hasOwnProperty.call(this.settings, 'step')) { this.step = this.settings['step']; } diff --git a/lib/content-services/src/lib/search/services/base-query-builder.service.ts b/lib/content-services/src/lib/search/services/base-query-builder.service.ts index 3439a7aace..e561b33283 100644 --- a/lib/content-services/src/lib/search/services/base-query-builder.service.ts +++ b/lib/content-services/src/lib/search/services/base-query-builder.service.ts @@ -150,7 +150,7 @@ export abstract class BaseQueryBuilderService { default: configuration.default || false, selected: this.selectedConfiguration !== undefined ? index === this.selectedConfiguration : configuration.default })); - } else if (!!configurations) { + } else if (configurations) { return [ { index: 0, diff --git a/lib/content-services/src/lib/upload/components/base-upload/upload-base.ts b/lib/content-services/src/lib/upload/components/base-upload/upload-base.ts index 650e9849c1..3b8f04fc5c 100644 --- a/lib/content-services/src/lib/upload/components/base-upload/upload-base.ts +++ b/lib/content-services/src/lib/upload/components/base-upload/upload-base.ts @@ -103,7 +103,7 @@ export abstract class UploadBase implements OnInit, OnDestroy { */ uploadFiles(files: File[]): void { const filteredFiles: FileModel[] = files - .map((file: File) => this.createFileModel(file, this.rootFolderId, ((file as any).webkitRelativePath || '').replace(/\/[^\/]*$/, ''))); + .map((file: File) => this.createFileModel(file, this.rootFolderId, ((file as any).webkitRelativePath || '').replace(/\/[^/]*$/, ''))); this.uploadQueue(filteredFiles); } diff --git a/lib/content-services/src/lib/upload/components/upload-drag-area.component.spec.ts b/lib/content-services/src/lib/upload/components/upload-drag-area.component.spec.ts index 610ec758da..a683f35d8e 100644 --- a/lib/content-services/src/lib/upload/components/upload-drag-area.component.spec.ts +++ b/lib/content-services/src/lib/upload/components/upload-drag-area.component.spec.ts @@ -306,7 +306,7 @@ describe('UploadDragAreaComponent', () => { }); it('should upload a file to a specific target folder when dropped onto one', () => { - const fakePippoItem = { + const fakePngItem = { fullPath: '/folder-fake/file-fake.png', isDirectory: false, isFile: true, @@ -321,7 +321,7 @@ describe('UploadDragAreaComponent', () => { const fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { detail: { data: getFakeShareDataRow(), - files: [fakePippoItem] + files: [fakePngItem] } }); diff --git a/lib/content-services/src/lib/upload/components/upload-version-button.component.ts b/lib/content-services/src/lib/upload/components/upload-version-button.component.ts index 38706fbc20..211d283bc7 100644 --- a/lib/content-services/src/lib/upload/components/upload-version-button.component.ts +++ b/lib/content-services/src/lib/upload/components/upload-version-button.component.ts @@ -39,7 +39,7 @@ export class UploadVersionButtonComponent extends UploadButtonComponent implemen node: Node; protected createFileModel(file: File): FileModel { - const fileModel = super.createFileModel(file, this.rootFolderId, ((file as any).webkitRelativePath || '').replace(/\/[^\/]*$/, ''), this.node.id); + const fileModel = super.createFileModel(file, this.rootFolderId, ((file as any).webkitRelativePath || '').replace(/\/[^/]*$/, ''), this.node.id); if (!this.isFileAcceptable(fileModel)) { const message = this.translationService.instant('FILE_UPLOAD.VERSION.MESSAGES.INCOMPATIBLE_VERSION'); diff --git a/lib/content-services/src/lib/version-compatibility/version-compatibility.directive.spec.ts b/lib/content-services/src/lib/version-compatibility/version-compatibility.directive.spec.ts index cbdc18c7e6..86051905ac 100644 --- a/lib/content-services/src/lib/version-compatibility/version-compatibility.directive.spec.ts +++ b/lib/content-services/src/lib/version-compatibility/version-compatibility.directive.spec.ts @@ -52,7 +52,7 @@ describe('VersionCompatibilityDirective', () => { let fixture: ComponentFixture; let versionCompatibilityService: VersionCompatibilityService; - const acsResponceMock = new VersionInfo({ + const acsResponseMock = new VersionInfo({ display: '7.0.1', major: '7', minor: '0', @@ -70,7 +70,7 @@ describe('VersionCompatibilityDirective', () => { }); fixture = TestBed.createComponent(TestComponent); versionCompatibilityService = TestBed.inject(VersionCompatibilityService); - spyOn(versionCompatibilityService, 'getAcsVersion').and.returnValue(acsResponceMock); + spyOn(versionCompatibilityService, 'getAcsVersion').and.returnValue(acsResponseMock); }); it('should display component when the version is supported', () => { diff --git a/lib/content-services/src/lib/version-compatibility/version-compatibility.service.spec.ts b/lib/content-services/src/lib/version-compatibility/version-compatibility.service.spec.ts index d96621ac6a..47783d9239 100644 --- a/lib/content-services/src/lib/version-compatibility/version-compatibility.service.spec.ts +++ b/lib/content-services/src/lib/version-compatibility/version-compatibility.service.spec.ts @@ -28,7 +28,7 @@ describe('VersionCompatibilityService', () => { let discoveryApiService: DiscoveryApiService; const mockProductInfo = new BehaviorSubject(null); - const acsResponceMock = { + const acsResponseMock = { version: { display: '7.0.1', major: '7', @@ -54,7 +54,7 @@ describe('VersionCompatibilityService', () => { }); discoveryApiService = TestBed.inject(DiscoveryApiService); versionCompatibilityService = TestBed.inject(VersionCompatibilityService); - mockProductInfo.next(acsResponceMock as RepositoryInfo); + mockProductInfo.next(acsResponseMock as RepositoryInfo); versionCompatibilityService = new VersionCompatibilityService(discoveryApiService); }); diff --git a/lib/core/api/src/lib/adf-http-client.service.ts b/lib/core/api/src/lib/adf-http-client.service.ts index 6f35384ff3..702cda1830 100644 --- a/lib/core/api/src/lib/adf-http-client.service.ts +++ b/lib/core/api/src/lib/adf-http-client.service.ts @@ -151,18 +151,22 @@ export class AdfHttpClient implements ee.Emitter,JsApiHttpClient { private addPromiseListeners(promise: Promise, eventEmitter: any) { const eventPromise = Object.assign(promise, { on() { + // eslint-disable-next-line prefer-spread, prefer-rest-params eventEmitter.on.apply(eventEmitter, arguments); return this; }, once() { + // eslint-disable-next-line prefer-spread, prefer-rest-params eventEmitter.once.apply(eventEmitter, arguments); return this; }, emit() { + // eslint-disable-next-line prefer-spread, prefer-rest-params eventEmitter.emit.apply(eventEmitter, arguments); return this; }, off() { + // eslint-disable-next-line prefer-spread, prefer-rest-params eventEmitter.off.apply(eventEmitter, arguments); return this; } diff --git a/lib/core/shell/src/lib/components/shell/shell.component.spec.ts b/lib/core/shell/src/lib/components/shell/shell.component.spec.ts index 0f2b4989e8..dc5d971c89 100644 --- a/lib/core/shell/src/lib/components/shell/shell.component.spec.ts +++ b/lib/core/shell/src/lib/components/shell/shell.component.spec.ts @@ -52,8 +52,8 @@ describe('AppLayoutComponent', () => { hideSidenavConditions: [], minimizeSidenavConditions: [], preferencesService: { - get: (_key: string) => 'true', - set: (_key: string, _value: any) => {} + get: () => 'true', + set: () => {} } }; diff --git a/lib/core/src/lib/about/about-github-link/about-github-link.component.spec.ts b/lib/core/src/lib/about/about-github-link/about-github-link.component.spec.ts index c7b9c1a51d..2539f00158 100644 --- a/lib/core/src/lib/about/about-github-link/about-github-link.component.spec.ts +++ b/lib/core/src/lib/about/about-github-link/about-github-link.component.spec.ts @@ -27,10 +27,7 @@ describe('AboutGithubLinkComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - CoreTestingModule - ] + imports: [TranslateModule.forRoot(), CoreTestingModule] }); fixture = TestBed.createComponent(AboutGithubLinkComponent); component = fixture.componentInstance; @@ -62,7 +59,7 @@ describe('AboutGithubLinkComponent', () => { fixture.detectChanges(); await fixture.whenStable(); const githubUrl = fixture.nativeElement.querySelector('[data-automation-id="adf-github-url"]'); - expect(githubUrl.innerText).toEqual(aboutGithubDetails.defualrUrl); + expect(githubUrl.innerText).toEqual(aboutGithubDetails.defaultUrl); }); it('should display the github link', async () => { diff --git a/lib/core/src/lib/about/about.mock.ts b/lib/core/src/lib/about/about.mock.ts index 5236a0cc1c..229abdfe0e 100644 --- a/lib/core/src/lib/about/about.mock.ts +++ b/lib/core/src/lib/about/about.mock.ts @@ -43,7 +43,7 @@ export const mockPlugins = [ export const aboutGithubDetails = { url: 'https://github.com/componany/repository/commits/', - defualrUrl: 'https://github.com/Alfresco/alfresco-ng2-components/commits/', + defaultUrl: 'https://github.com/Alfresco/alfresco-ng2-components/commits/', version: '0.0.7', ecmHost: 'https://mock.ecmhost.com', bpmHost: 'https://mock.bpmhost.com', @@ -56,65 +56,65 @@ export const aboutAPSMockDetails = { type: 'bpmSuite', majorVersion: '1', minorVersion: '10' - }; +}; export const mockModules: any = { - edition: 'Enterprise', - version: { - major: '6', - minor: '2', - patch: '0', - hotfix: '0', - schema: 13001, - label: 'ra498a911-b5', - display: '6.2.0.0' - }, - license: { - issuedAt: '2018-12-20T12:07:31.276+0000', - expiresAt: '2019-05-31T23:00:00.000+0000', - remainingDays: 100, - holder: 'CompanyQA', - mode: 'ENTERPRISE', - entitlements: { - isClusterEnabled: true, - isCryptodocEnabled: true - } - }, - status: { - isReadOnly: false, - isAuditEnabled: true, - isQuickShareEnabled: true, - isThumbnailGenerationEnabled: true - }, - modules: [ - { - id: 'mock-id', - title: 'ABC Repo', - description: 'ABC Repository Extension', - version: '3.2.0', - installState: 'UNKNOWN', - versionMin: '6.1', - versionMax: '999' - }, - { - id: 'aos-module-id', - title: 'AOFS Module', - description: 'Allows applications that can talk to a SharePoint server to talk to your Alfresco installation', - version: '1.3.0', - installDate: '2019-02-07T12:26:13.271+0000', - installState: 'INSTALLED', - versionMin: '6.0', - versionMax: '999' - }, - { - id: 'mock-saml-repo', - title: 'SAML Repository Module', - description: 'The Repository piece of the Alfresco SAML Module', - version: '1.1.1', - installDate: '2019-02-07T12:26:12.565+0000', - installState: 'INSTALLED', - versionMin: '6.0', - versionMax: '6.99' - } - ] + edition: 'Enterprise', + version: { + major: '6', + minor: '2', + patch: '0', + hotfix: '0', + schema: 13001, + label: 'ra498a911-b5', + display: '6.2.0.0' + }, + license: { + issuedAt: '2018-12-20T12:07:31.276+0000', + expiresAt: '2019-05-31T23:00:00.000+0000', + remainingDays: 100, + holder: 'CompanyQA', + mode: 'ENTERPRISE', + entitlements: { + isClusterEnabled: true, + isCryptodocEnabled: true + } + }, + status: { + isReadOnly: false, + isAuditEnabled: true, + isQuickShareEnabled: true, + isThumbnailGenerationEnabled: true + }, + modules: [ + { + id: 'mock-id', + title: 'ABC Repo', + description: 'ABC Repository Extension', + version: '3.2.0', + installState: 'UNKNOWN', + versionMin: '6.1', + versionMax: '999' + }, + { + id: 'aos-module-id', + title: 'AOFS Module', + description: 'Allows applications that can talk to a SharePoint server to talk to your Alfresco installation', + version: '1.3.0', + installDate: '2019-02-07T12:26:13.271+0000', + installState: 'INSTALLED', + versionMin: '6.0', + versionMax: '999' + }, + { + id: 'mock-saml-repo', + title: 'SAML Repository Module', + description: 'The Repository piece of the Alfresco SAML Module', + version: '1.1.1', + installDate: '2019-02-07T12:26:12.565+0000', + installState: 'INSTALLED', + versionMin: '6.0', + versionMax: '6.99' + } + ] }; diff --git a/lib/core/src/lib/app-config/app-config.service.ts b/lib/core/src/lib/app-config/app-config.service.ts index b3e3112448..c17e7b1660 100644 --- a/lib/core/src/lib/app-config/app-config.service.ts +++ b/lib/core/src/lib/app-config/app-config.service.ts @@ -185,7 +185,7 @@ export class AppConfigService { * @returns Notification when loading is complete */ load(): Promise { - return new Promise(async (resolve) => { + return new Promise((resolve) => { const configUrl = `app.config.json?v=${Date.now()}`; if (this.status === Status.INIT) { @@ -218,7 +218,7 @@ export class AppConfigService { * @returns Discovery configuration */ loadWellKnown(hostIdp: string): Promise { - return new Promise(async (resolve, reject) => { + return new Promise((resolve, reject) => { this.http .get(`${hostIdp}/.well-known/openid-configuration`) .subscribe({ diff --git a/lib/core/src/lib/auth/authentication-interceptor/auth-bearer.interceptor.ts b/lib/core/src/lib/auth/authentication-interceptor/auth-bearer.interceptor.ts index 9afaf77b50..afb8c0b4be 100644 --- a/lib/core/src/lib/auth/authentication-interceptor/auth-bearer.interceptor.ts +++ b/lib/core/src/lib/auth/authentication-interceptor/auth-bearer.interceptor.ts @@ -40,7 +40,7 @@ export class AuthBearerInterceptor implements HttpInterceptor { this.authService = this.injector.get(AuthenticationService); - if (!this.authService || !this.authService.getBearerExcludedUrls()) { + if (!this.authService?.getBearerExcludedUrls()) { return next.handle(req); } diff --git a/lib/core/src/lib/auth/services/jwt-helper.service.spec.ts b/lib/core/src/lib/auth/services/jwt-helper.service.spec.ts index 824030150d..49a80812da 100644 --- a/lib/core/src/lib/auth/services/jwt-helper.service.spec.ts +++ b/lib/core/src/lib/auth/services/jwt-helper.service.spec.ts @@ -97,10 +97,10 @@ describe('JwtHelperService', () => { spyOn(jwtHelperService, 'decodeToken').and.returnValue( { - resource_access: { fakeapp: { roles: ['role1'] } } + resource_access: { fakeApp: { roles: ['role1'] } } }); - const result = jwtHelperService.hasRealmRolesForClientRole('fakeapp', ['role1']); + const result = jwtHelperService.hasRealmRolesForClientRole('fakeApp', ['role1']); expect(result).toBeTruthy(); }); @@ -109,10 +109,10 @@ describe('JwtHelperService', () => { spyOn(jwtHelperService, 'decodeToken').and.returnValue( { - resource_access: { fakeapp: { roles: ['role1'] } } + resource_access: { fakeApp: { roles: ['role1'] } } }); - const result = jwtHelperService.hasRealmRolesForClientRole('fakeapp', ['role1', 'role2']); + const result = jwtHelperService.hasRealmRolesForClientRole('fakeApp', ['role1', 'role2']); expect(result).toBeTruthy(); }); @@ -120,9 +120,9 @@ describe('JwtHelperService', () => { spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token'); spyOn(jwtHelperService, 'decodeToken').and.returnValue( { - resource_access: { fakeapp: { roles: ['role3'] } } + resource_access: { fakeApp: { roles: ['role3'] } } }); - const result = jwtHelperService.hasRealmRolesForClientRole('fakeapp', ['role1', 'role2']); + const result = jwtHelperService.hasRealmRolesForClientRole('fakeApp', ['role1', 'role2']); expect(result).toBeFalsy(); }); @@ -130,9 +130,9 @@ describe('JwtHelperService', () => { spyOn(jwtHelperService, 'getAccessToken').and.returnValue('my-access_token'); spyOn(jwtHelperService, 'decodeToken').and.returnValue( { - resource_access: { anotherfakeapp: { roles: ['role1'] } } + resource_access: { anotherFakeApp: { roles: ['role1'] } } }); - const result = jwtHelperService.hasRealmRolesForClientRole('fakeapp', ['role1', 'role2']); + const result = jwtHelperService.hasRealmRolesForClientRole('fakeApp', ['role1', 'role2']); expect(result).toBeFalsy(); }); }); diff --git a/lib/core/src/lib/card-view/components/card-view-arrayitem/card-view-arrayitem.component.spec.ts b/lib/core/src/lib/card-view/components/card-view-arrayitem/card-view-arrayitem.component.spec.ts index 39b5e4a3b8..5f72418ae8 100644 --- a/lib/core/src/lib/card-view/components/card-view-arrayitem/card-view-arrayitem.component.spec.ts +++ b/lib/core/src/lib/card-view/components/card-view-arrayitem/card-view-arrayitem.component.spec.ts @@ -46,10 +46,7 @@ describe('CardViewArrayItemComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - CoreTestingModule - ] + imports: [TranslateModule.forRoot(), CoreTestingModule] }); fixture = TestBed.createComponent(CardViewArrayItemComponent); service = TestBed.inject(CardViewUpdateService); @@ -87,8 +84,8 @@ describe('CardViewArrayItemComponent', () => { }); it('should NOT call service on chip list container click', () => { - const chiplistContainer: HTMLElement = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-list-container"]'); - chiplistContainer.dispatchEvent(new Event('click')); + const chipListContainer: HTMLElement = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-list-container"]'); + chipListContainer.dispatchEvent(new Event('click')); expect(serviceSpy).not.toHaveBeenCalled(); }); @@ -110,11 +107,11 @@ describe('CardViewArrayItemComponent', () => { }); fixture.detectChanges(); - const chiplistContainer = fixture.debugElement.query(By.css('[data-automation-id="card-arrayitem-chip-list-container"]')); + const chipListContainer = fixture.debugElement.query(By.css('[data-automation-id="card-arrayitem-chip-list-container"]')); const chip1 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-Zlatan"] span'); const chip2 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-Lionel Messi"] span'); - expect(chiplistContainer).not.toBeNull(); + expect(chipListContainer).not.toBeNull(); expect(chip1.innerText).toEqual('Zlatan'); expect(chip2.innerText).toEqual('Lionel Messi'); }); @@ -126,13 +123,13 @@ describe('CardViewArrayItemComponent', () => { }); fixture.detectChanges(); - const chiplistContainer = fixture.debugElement.query(By.css('[data-automation-id="card-arrayitem-chip-list-container"]')); + const chipListContainer = fixture.debugElement.query(By.css('[data-automation-id="card-arrayitem-chip-list-container"]')); const chip1 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-Zlatan"] span'); const chip1Icon = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-Zlatan"] mat-icon'); const chip2 = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-Lionel Messi"] span'); const chip2Icon = fixture.nativeElement.querySelector('[data-automation-id="card-arrayitem-chip-Lionel Messi"] mat-icon'); - expect(chiplistContainer).not.toBeNull(); + expect(chipListContainer).not.toBeNull(); expect(chip1.innerText).toEqual('Zlatan'); expect(chip1Icon.innerText).toEqual('person'); expect(chip2.innerText).toEqual('Lionel Messi'); @@ -145,9 +142,9 @@ describe('CardViewArrayItemComponent', () => { clickable: true }); fixture.detectChanges(); - const editicon = fixture.nativeElement.querySelector('[data-automation-id="card-array-item-clickable-icon-array"]'); - expect(editicon).toBeDefined(); - expect(editicon.innerText).toBe('edit'); + const editIcon = fixture.nativeElement.querySelector('[data-automation-id="card-array-item-clickable-icon-array"]'); + expect(editIcon).toBeDefined(); + expect(editIcon.innerText).toBe('edit'); }); it('should not render defined icon if clickable set to false', () => { @@ -156,18 +153,18 @@ describe('CardViewArrayItemComponent', () => { clickable: false }); fixture.detectChanges(); - const editicon = fixture.nativeElement.querySelector('[data-automation-id="card-array-item-clickable-icon-array"]'); - expect(editicon).toBeNull(); + const editIcon = fixture.nativeElement.querySelector('[data-automation-id="card-array-item-clickable-icon-array"]'); + expect(editIcon).toBeNull(); }); it('should render all values if noOfItemsToDisplay is not defined', () => { fixture.detectChanges(); - const chiplistContainer = fixture.debugElement.query(By.css('[data-automation-id="card-arrayitem-chip-list-container"]')); + const chipListContainer = fixture.debugElement.query(By.css('[data-automation-id="card-arrayitem-chip-list-container"]')); const moreElement = fixture.debugElement.query(By.css('[data-automation-id="card-arrayitem-more-chip"]')); const chip = fixture.nativeElement.querySelectorAll('mat-chip'); - expect(chiplistContainer).not.toBeNull(); + expect(chipListContainer).not.toBeNull(); expect(moreElement).toBeNull(); expect(chip.length).toBe(4); }); @@ -179,10 +176,10 @@ describe('CardViewArrayItemComponent', () => { }); fixture.detectChanges(); - const chiplistContainer = fixture.debugElement.query(By.css('[data-automation-id="card-arrayitem-chip-list-container"]')); + const chipListContainer = fixture.debugElement.query(By.css('[data-automation-id="card-arrayitem-chip-list-container"]')); const chip = fixture.debugElement.queryAll(By.css('mat-chip')); - expect(chiplistContainer).not.toBeNull(); + expect(chipListContainer).not.toBeNull(); expect(chip.length).toBe(3); expect(chip[2].nativeElement.innerText).toBe('2 CORE.CARDVIEW.MORE'); }); diff --git a/lib/core/src/lib/card-view/components/card-view-boolitem/card-view-boolitem.component.spec.ts b/lib/core/src/lib/card-view/components/card-view-boolitem/card-view-boolitem.component.spec.ts index 645e39f9ea..5dd121da2a 100644 --- a/lib/core/src/lib/card-view/components/card-view-boolitem/card-view-boolitem.component.spec.ts +++ b/lib/core/src/lib/card-view/components/card-view-boolitem/card-view-boolitem.component.spec.ts @@ -41,7 +41,7 @@ describe('CardViewBoolItemComponent', () => { component.property = new CardViewBoolItemModel({ label: 'Boolean label', value: true, - key: 'boolkey', + key: 'boolKey', default: false, editable: false }); @@ -207,7 +207,7 @@ describe('CardViewBoolItemComponent', () => { const disposableUpdate = cardViewUpdateService.itemUpdated$.subscribe( (updateNotification) => { expect(updateNotification.target).toEqual(property); - expect(updateNotification.changed).toEqual({ boolkey: true }); + expect(updateNotification.changed).toEqual({ boolKey: true }); disposableUpdate.unsubscribe(); done(); } diff --git a/lib/core/src/lib/card-view/components/card-view-item-dispatcher/card-view-item-dispatcher.component.ts b/lib/core/src/lib/card-view/components/card-view-item-dispatcher/card-view-item-dispatcher.component.ts index 138b7c098a..cfa5e2898e 100644 --- a/lib/core/src/lib/card-view/components/card-view-item-dispatcher/card-view-item-dispatcher.component.ts +++ b/lib/core/src/lib/card-view/components/card-view-item-dispatcher/card-view-item-dispatcher.component.ts @@ -118,6 +118,7 @@ export class CardViewItemDispatcherComponent implements OnChanges { private proxy(methodName, ...args) { if (this.componentReference.instance[methodName]) { + // eslint-disable-next-line prefer-spread this.componentReference.instance[methodName].apply(this.componentReference.instance, args); } } diff --git a/lib/core/src/lib/card-view/models/card-view-baseitem.model.spec.ts b/lib/core/src/lib/card-view/models/card-view-baseitem.model.spec.ts index d00f9f5a7f..169ee18175 100644 --- a/lib/core/src/lib/card-view/models/card-view-baseitem.model.spec.ts +++ b/lib/core/src/lib/card-view/models/card-view-baseitem.model.spec.ts @@ -45,7 +45,7 @@ describe('CardViewBaseItemModel', () => { expect(itemModel.data).toBe(properties.data); }); - it('should persist the params\' properties as own properties', () => { + it('should persist the params properties as own properties', () => { const allProperties = { ...properties, default: 'default-value', diff --git a/lib/core/src/lib/common/services/highlight-transform.service.ts b/lib/core/src/lib/common/services/highlight-transform.service.ts index 5cae81ed3f..15a588e370 100644 --- a/lib/core/src/lib/common/services/highlight-transform.service.ts +++ b/lib/core/src/lib/common/services/highlight-transform.service.ts @@ -40,6 +40,7 @@ export class HighlightTransformService { let result = text; if (search && text) { + // eslint-disable-next-line no-useless-escape let pattern = search.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); pattern = pattern.split(' ').filter((t) => t.length > 0).join('|'); diff --git a/lib/core/src/lib/common/services/sort-by-category.service.spec.ts b/lib/core/src/lib/common/services/sort-by-category.service.spec.ts index 35fbc51f7c..4127b1e001 100644 --- a/lib/core/src/lib/common/services/sort-by-category.service.spec.ts +++ b/lib/core/src/lib/common/services/sort-by-category.service.spec.ts @@ -24,12 +24,7 @@ interface TestSortableByCategoryItem extends SortableByCategoryItem { describe('SortByCategoryMapperService', () => { let mapper: SortByCategoryMapperService; - const DEFAULT_CATEGORIES = [ - '', - 'DefaultCategory1', - 'DefaultCategory2', - 'DefaultCategory3' - ]; + const DEFAULT_CATEGORIES = ['', 'DefaultCategory1', 'DefaultCategory2', 'DefaultCategory3']; beforeEach(() => { mapper = new SortByCategoryMapperService(); @@ -57,25 +52,29 @@ describe('SortByCategoryMapperService', () => { }); it('should set all items under default category', () => { - const defaulValues: TestSortableByCategoryItem[] = [{ - name: 'name-a', - id: 'id', - category: DEFAULT_CATEGORIES[1] - }, { - name: 'name-b', - id: 'id2', - category: DEFAULT_CATEGORIES[2] - }, { - name: 'name-c', - id: 'id3', - category: DEFAULT_CATEGORIES[0] - }]; + const defaultValues: TestSortableByCategoryItem[] = [ + { + name: 'name-a', + id: 'id', + category: DEFAULT_CATEGORIES[1] + }, + { + name: 'name-b', + id: 'id2', + category: DEFAULT_CATEGORIES[2] + }, + { + name: 'name-c', + id: 'id3', + category: DEFAULT_CATEGORIES[0] + } + ]; - const result = mapper.mapItems(defaulValues, DEFAULT_CATEGORIES); + const result = mapper.mapItems(defaultValues, DEFAULT_CATEGORIES); expect(result.length).toBe(1); expect(result[0].category).toBe(''); - expect(result[0].items.length).toBe(defaulValues.length); + expect(result[0].items.length).toBe(defaultValues.length); }); it('should work if no items are present', () => { @@ -85,7 +84,7 @@ describe('SortByCategoryMapperService', () => { }); it('should work if the default categories are empty', () => { - const result = mapper.mapItems([{id: 'id', name: 'name', category: ''}], []); + const result = mapper.mapItems([{ id: 'id', name: 'name', category: '' }], []); expect(result.length).toBe(1); expect(result[0].category).toBe(''); diff --git a/lib/core/src/lib/common/services/storage.service.ts b/lib/core/src/lib/common/services/storage.service.ts index 68c47a02a0..71c45dd12e 100644 --- a/lib/core/src/lib/common/services/storage.service.ts +++ b/lib/core/src/lib/common/services/storage.service.ts @@ -21,7 +21,6 @@ import { Injectable } from '@angular/core'; providedIn: 'root' }) export class StorageService { - private memoryStore: { [key: string]: any } = {}; private readonly useLocalStorage: boolean = false; private _prefix: string = ''; @@ -48,7 +47,7 @@ export class StorageService { if (this.useLocalStorage) { return localStorage.getItem(this.prefix + key); } else { - return this.memoryStore.hasOwnProperty(this.prefix + key) ? this.memoryStore[this.prefix + key] : null; + return Object.prototype.hasOwnProperty.call(this.memoryStore, this.prefix + key) ? this.memoryStore[this.prefix + key] : null; } } @@ -96,9 +95,9 @@ export class StorageService { */ hasItem(key: string): boolean { if (this.useLocalStorage) { - return localStorage.getItem(this.prefix + key) ? true : false; + return !!localStorage.getItem(this.prefix + key); } else { - return this.memoryStore.hasOwnProperty(key); + return Object.prototype.hasOwnProperty.call(this.memoryStore, key); } } diff --git a/lib/core/src/lib/common/utils/file-utils.ts b/lib/core/src/lib/common/utils/file-utils.ts index cd5f630ae8..b76920149a 100644 --- a/lib/core/src/lib/common/utils/file-utils.ts +++ b/lib/core/src/lib/common/utils/file-utils.ts @@ -41,7 +41,7 @@ export class FileUtils { files.push({ entry, file, - relativeFolder: entry.fullPath.replace(/\/[^\/]*$/, '') + relativeFolder: entry.fullPath.replace(/\/[^/]*$/, '') }); resolveFile(); }); diff --git a/lib/core/src/lib/datatable/components/datatable/datatable.component.spec.ts b/lib/core/src/lib/datatable/components/datatable/datatable.component.spec.ts index d9c33b2791..0a2ae738de 100644 --- a/lib/core/src/lib/datatable/components/datatable/datatable.component.spec.ts +++ b/lib/core/src/lib/datatable/components/datatable/datatable.component.spec.ts @@ -34,19 +34,13 @@ import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { take } from 'rxjs/operators'; import { By } from '@angular/platform-browser'; -@Component({selector: 'adf-custom-column-template-component', template: ` - -`}) +@Component({ selector: 'adf-custom-column-template-component', template: ` ` }) class CustomColumnTemplateComponent { @ViewChild('tmplRef', { static: true }) templateRef: TemplateRef; } @Component({ selector: 'adf-custom-column-header-component', - template: ` - - CUSTOM HEADER - - ` + template: ` CUSTOM HEADER ` }) class CustomColumnHeaderComponent { @ViewChild('tmplRef', { static: true }) templateRef: TemplateRef; @@ -73,13 +67,12 @@ class FakeDataRow implements DataRow { export const resolverFn = (row: DataRow, col: DataColumn) => { const value = row.getValue(col.key); if (col.key === 'name') { - return `${row.getValue('firstName')} - ${row.getValue('lastName')}`; + return `${row.getValue('firstName')} - ${row.getValue('lastName')}`; } return value; }; describe('DataTable', () => { - let fixture: ComponentFixture; let dataTable: DataTableComponent; let element: any; @@ -141,16 +134,12 @@ describe('DataTable', () => { tick(tickTime); - expect(doubleClickCount).toBe(1); }; beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - CoreTestingModule - ], + imports: [TranslateModule.forRoot(), CoreTestingModule], declarations: [CustomColumnHeaderComponent] }); fixture = TestBed.createComponent(DataTableComponent); @@ -163,10 +152,7 @@ describe('DataTable', () => { }); it('should preserve the historical selection order', () => { - dataTable.data = new ObjectDataTableAdapter( - [{ id: 0 }, { id: 1 }, { id: 2 }], - [new ObjectDataColumn({ key: 'id' })] - ); + dataTable.data = new ObjectDataTableAdapter([{ id: 0 }, { id: 1 }, { id: 2 }], [new ObjectDataColumn({ key: 'id' })]); const rows = dataTable.data.getRows(); @@ -181,7 +167,6 @@ describe('DataTable', () => { }); it('should update schema if columns change', fakeAsync(() => { - dataTable.columnList = new DataColumnListComponent(); dataTable.columnList.columns = new QueryList(); dataTable.data = new ObjectDataTableAdapter([], []); @@ -198,13 +183,7 @@ describe('DataTable', () => { })); it('should use the cardview style if cardview is true', () => { - const newData = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' } - ], - [new ObjectDataColumn({ key: 'name' })] - ); + const newData = new ObjectDataTableAdapter([{ name: '1' }, { name: '2' }], [new ObjectDataColumn({ key: 'name' })]); dataTable.display = 'gallery'; dataTable.ngOnChanges({ @@ -218,13 +197,7 @@ describe('DataTable', () => { }); it('should use the cardview style if cardview is false', () => { - const newData = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' } - ], - [new ObjectDataColumn({ key: 'name' })] - ); + const newData = new ObjectDataTableAdapter([{ name: '1' }, { name: '2' }], [new ObjectDataColumn({ key: 'name' })]); dataTable.ngOnChanges({ data: new SimpleChange(null, newData, false) @@ -237,18 +210,10 @@ describe('DataTable', () => { }); describe('Header modes', () => { - - const newData = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' } - ], - [new ObjectDataColumn({ key: 'name' })] - ); + const newData = new ObjectDataTableAdapter([{ name: '1' }, { name: '2' }], [new ObjectDataColumn({ key: 'name' })]); const emptyData = new ObjectDataTableAdapter(); it('should show the header if showHeader is `Data` and there is data', () => { - dataTable.showHeader = ShowHeaderMode.Data; dataTable.loading = false; dataTable.ngOnChanges({ @@ -261,7 +226,6 @@ describe('DataTable', () => { }); it('should hide the header if showHeader is `Data` and there is no data', () => { - dataTable.showHeader = ShowHeaderMode.Data; dataTable.loading = false; dataTable.ngOnChanges({ @@ -274,7 +238,6 @@ describe('DataTable', () => { }); it('should always show the header if showHeader is `Always`', () => { - dataTable.showHeader = ShowHeaderMode.Always; dataTable.loading = false; @@ -292,7 +255,6 @@ describe('DataTable', () => { }); it('should never show the header if showHeader is `Never`', () => { - dataTable.showHeader = ShowHeaderMode.Never; dataTable.loading = false; dataTable.ngOnChanges({ @@ -313,14 +275,12 @@ describe('DataTable', () => { }); it('should never show the header if noPermission is true', () => { - dataTable.loading = false; dataTable.noPermission = true; testNotShownHeader(emptyData); }); it('should never show the header if loading is true', () => { - dataTable.loading = true; testNotShownHeader(emptyData); }); @@ -328,13 +288,7 @@ describe('DataTable', () => { it('should emit "sorting-changed" DOM event', (done) => { const column = new ObjectDataColumn({ key: 'name', sortable: true, direction: 'asc', sortingKey: 'displayName' }); - dataTable.data = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' } - ], - [column] - ); + dataTable.data = new ObjectDataTableAdapter([{ name: '1' }, { name: '2' }], [column]); dataTable.data.setSorting(new DataSorting('name', 'desc')); fixture.nativeElement.addEventListener('sorting-changed', (event: CustomEvent) => { @@ -346,27 +300,15 @@ describe('DataTable', () => { fixture.detectChanges(); dataTable.ngAfterViewInit(); - const hedaderColumns = fixture.debugElement.nativeElement.querySelectorAll('.adf-datatable-cell-header-content'); + const headerColumns = fixture.debugElement.nativeElement.querySelectorAll('.adf-datatable-cell-header-content'); - hedaderColumns[0].click(); + headerColumns[0].click(); fixture.detectChanges(); }); it('should change the rows on changing of the data', () => { - const newData = new ObjectDataTableAdapter( - [ - { name: 'TEST' }, - { name: 'FAKE' } - ], - [new ObjectDataColumn({ key: 'name' })] - ); - dataTable.data = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' } - ], - [new ObjectDataColumn({ key: 'name' })] - ); + const newData = new ObjectDataTableAdapter([{ name: 'TEST' }, { name: 'FAKE' }], [new ObjectDataColumn({ key: 'name' })]); + dataTable.data = new ObjectDataTableAdapter([{ name: '1' }, { name: '2' }], [new ObjectDataColumn({ key: 'name' })]); dataTable.ngOnChanges({ data: new SimpleChange(null, newData, false) @@ -378,16 +320,8 @@ describe('DataTable', () => { }); it('should set rows to the data when rows defined', () => { - const dataRows = - [ - { name: 'test1' }, - { name: 'test2' }, - { name: 'test3' }, - { name: 'test4' } - ]; - dataTable.data = new ObjectDataTableAdapter([], - [new ObjectDataColumn({ key: 'name' })] - ); + const dataRows = [{ name: 'test1' }, { name: 'test2' }, { name: 'test3' }, { name: 'test4' }]; + dataTable.data = new ObjectDataTableAdapter([], [new ObjectDataColumn({ key: 'name' })]); dataTable.ngOnChanges({ rows: new SimpleChange(null, dataRows, false) @@ -403,13 +337,10 @@ describe('DataTable', () => { const event = new KeyboardEvent('keydown', { code: 'Enter', key: 'Enter' - } as KeyboardEventInit ); - const dataRows = - [ { name: 'test1'}, { name: 'test2' } ]; + } as KeyboardEventInit); + const dataRows = [{ name: 'test1' }, { name: 'test2' }]; - dataTable.data = new ObjectDataTableAdapter([], - [new ObjectDataColumn({ key: 'name' })] - ); + dataTable.data = new ObjectDataTableAdapter([], [new ObjectDataColumn({ key: 'name' })]); dataTable.ngOnChanges({ rows: new SimpleChange(null, dataRows, false) @@ -429,13 +360,7 @@ describe('DataTable', () => { it('should set custom sort order', () => { const dataSortObj = new DataSorting('dummyName', 'asc'); - const dataRows = - [ - { name: 'test1' }, - { name: 'test2' }, - { name: 'test3' }, - { name: 'test4' } - ]; + const dataRows = [{ name: 'test1' }, { name: 'test2' }, { name: 'test3' }, { name: 'test4' }]; dataTable.sorting = ['dummyName', 'asc']; dataTable.ngOnChanges({ rows: new SimpleChange(null, dataRows, false) @@ -448,13 +373,7 @@ describe('DataTable', () => { it('should reset selection on mode change', () => { spyOn(dataTable, 'resetSelection').and.callThrough(); - dataTable.data = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' } - ], - [new ObjectDataColumn({ key: 'name' })] - ); + dataTable.data = new ObjectDataTableAdapter([{ name: '1' }, { name: '2' }], [new ObjectDataColumn({ key: 'name' })]); const rows = dataTable.data.getRows(); rows[0].isSelected = true; rows[1].isSelected = true; @@ -470,14 +389,8 @@ describe('DataTable', () => { }); it('should select the row where isSelected is true', () => { - dataTable.rows = [ - { name: 'TEST1' }, - { name: 'FAKE2' }, - { name: 'TEST2', isSelected: true }, - { name: 'FAKE2' }]; - dataTable.data = new ObjectDataTableAdapter([], - [new ObjectDataColumn({ key: 'name' })] - ); + dataTable.rows = [{ name: 'TEST1' }, { name: 'FAKE2' }, { name: 'TEST2', isSelected: true }, { name: 'FAKE2' }]; + dataTable.data = new ObjectDataTableAdapter([], [new ObjectDataColumn({ key: 'name' })]); fixture.detectChanges(); const rows = dataTable.data.getRows(); expect(rows[0].isSelected).toBeFalsy(); @@ -487,15 +400,8 @@ describe('DataTable', () => { }); it('should not select any row when isSelected is not defined', () => { - const dataRows = - [ - { name: 'TEST1' }, - { name: 'FAKE2' }, - { name: 'TEST2' } - ]; - dataTable.data = new ObjectDataTableAdapter(dataRows, - [new ObjectDataColumn({ key: 'name' })] - ); + const dataRows = [{ name: 'TEST1' }, { name: 'FAKE2' }, { name: 'TEST2' }]; + dataTable.data = new ObjectDataTableAdapter(dataRows, [new ObjectDataColumn({ key: 'name' })]); dataTable.ngOnChanges({ rows: new SimpleChange(null, dataRows, false) @@ -509,46 +415,34 @@ describe('DataTable', () => { }); it('should select only one row with [single] selection mode', (done) => { - const rows = testIfRowIsSelected([ - { name: '1', isSelected: true }, - { name: '2' } - ], done); + const rows = testIfRowIsSelected([{ name: '1', isSelected: true }, { name: '2' }], done); dataTable.onRowClick(rows[1], new MouseEvent('click')); }); it('should select only one row with [single] selection mode and key modifier', (done) => { - const rows = testIfRowIsSelected([ - { name: '1', isSelected: true }, - { name: '2' } - ], done); - dataTable.onRowClick(rows[1], new MouseEvent('click', { - metaKey: true - })); + const rows = testIfRowIsSelected([{ name: '1', isSelected: true }, { name: '2' }], done); + dataTable.onRowClick( + rows[1], + new MouseEvent('click', { + metaKey: true + }) + ); }); it('should select only one row with [single] selection mode pressing enter key', () => { - const rows = testIfRowIsSelected([ - { name: '1' }, - { name: '2' } - ]); - dataTable.onEnterKeyPressed(rows[0], null); + const rows = testIfRowIsSelected([{ name: '1' }, { name: '2' }]); + dataTable.onEnterKeyPressed(rows[0], new KeyboardEvent('enter')); expect(rows[0].isSelected).toBeTruthy(); expect(rows[1].isSelected).toBeFalsy(); - dataTable.onEnterKeyPressed(rows[1], null); + dataTable.onEnterKeyPressed(rows[1], new KeyboardEvent('enter')); expect(rows[0].isSelected).toBeFalsy(); expect(rows[1].isSelected).toBeTruthy(); }); it('should select multiple rows with [multiple] selection mode pressing enter key', () => { dataTable.selectionMode = 'multiple'; - dataTable.data = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' } - ], - [new ObjectDataColumn({ key: 'name' })] - ); + dataTable.data = new ObjectDataTableAdapter([{ name: '1' }, { name: '2' }], [new ObjectDataColumn({ key: 'name' })]); const rows = dataTable.data.getRows(); const event = new KeyboardEvent('enter', { @@ -565,13 +459,7 @@ describe('DataTable', () => { it('should unselect the row with [single] selection mode', (done) => { dataTable.selectionMode = 'single'; - dataTable.data = new ObjectDataTableAdapter( - [ - {name: '1'}, - { name: '2' } - ], - [new ObjectDataColumn({ key: 'name' })] - ); + dataTable.data = new ObjectDataTableAdapter([{ name: '1' }, { name: '2' }], [new ObjectDataColumn({ key: 'name' })]); const rows = dataTable.data.getRows(); dataTable.ngOnChanges({}); fixture.detectChanges(); @@ -590,10 +478,7 @@ describe('DataTable', () => { it('should unselect the row with [multiple] selection mode and modifier key', (done) => { dataTable.selectionMode = 'multiple'; - dataTable.data = new ObjectDataTableAdapter( - [{ name: '1', isSelected: true }], - [new ObjectDataColumn({ key: 'name' })] - ); + dataTable.data = new ObjectDataTableAdapter([{ name: '1', isSelected: true }], [new ObjectDataColumn({ key: 'name' })]); const rows = dataTable.data.getRows(); rows[0].isSelected = true; @@ -613,9 +498,7 @@ describe('DataTable', () => { it('should unselect the row searching it by row id, when row id is defined', () => { const findSelectionByIdSpy = spyOn(dataTable, 'findSelectionById'); - dataTable.data = new ObjectDataTableAdapter([], - [new ObjectDataColumn({ key: 'name' })] - ); + dataTable.data = new ObjectDataTableAdapter([], [new ObjectDataColumn({ key: 'name' })]); const fakeDataRows = [new FakeDataRow(), new FakeDataRow()]; fakeDataRows[0].id = 'fakeRowId'; @@ -633,9 +516,7 @@ describe('DataTable', () => { it('should unselect the row by searching for the exact same reference of it (indexOf), when row id is not defined ', () => { const findSelectionByIdSpy = spyOn(dataTable, 'findSelectionById'); - dataTable.data = new ObjectDataTableAdapter([], - [new ObjectDataColumn({ key: 'name' })] - ); + dataTable.data = new ObjectDataTableAdapter([], [new ObjectDataColumn({ key: 'name' })]); const fakeDataRows = [new FakeDataRow(), new FakeDataRow()]; dataTable.data.setRows(fakeDataRows); @@ -652,13 +533,7 @@ describe('DataTable', () => { it('should select multiple rows with [multiple] selection mode and modifier key', (done) => { dataTable.selectionMode = 'multiple'; - dataTable.data = new ObjectDataTableAdapter( - [ - { name: '1', isSelected: true }, - { name: '2' } - ], - [new ObjectDataColumn({ key: 'name' })] - ); + dataTable.data = new ObjectDataTableAdapter([{ name: '1', isSelected: true }, { name: '2' }], [new ObjectDataColumn({ key: 'name' })]); const rows = dataTable.data.getRows(); rows[0].isSelected = true; @@ -678,12 +553,7 @@ describe('DataTable', () => { it('should put actions menu to the right by default', () => { dataTable.data = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' }, - { name: '3' }, - { name: '4' } - ], + [{ name: '1' }, { name: '2' }, { name: '3' }, { name: '4' }], [new ObjectDataColumn({ key: 'name' })] ); @@ -696,12 +566,7 @@ describe('DataTable', () => { it('should put actions menu to the left', () => { dataTable.data = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' }, - { name: '3' }, - { name: '4' } - ], + [{ name: '1' }, { name: '2' }, { name: '3' }, { name: '4' }], [new ObjectDataColumn({ key: 'name' })] ); @@ -757,13 +622,13 @@ describe('DataTable', () => { it('should emit double click if there are two single click in 250ms', fakeAsync(() => { testDoubleClickCount(); - })); + })); it('should emit double click if there are more than two single click in 250ms', fakeAsync(() => { testDoubleClickCount(740, 2); - })); + })); - it('should emit single click if there are two single click in more than 250ms', fakeAsync(() => { + it('should emit single click if there are two single click in more than 250ms', fakeAsync(() => { const row = {} as DataRow; let clickCount = 0; @@ -779,8 +644,7 @@ describe('DataTable', () => { setTimeout(() => { dataTable.onRowClick(row, new MouseEvent('click')); - } - , 260); + }, 260); tick(510); @@ -834,50 +698,37 @@ describe('DataTable', () => { it('should not sort upon clicking non-sortable column header', () => { dataTable.data = new ObjectDataTableAdapter( [{ name: '1' }, { name: '2' }], - [ - new ObjectDataColumn({ key: 'name', sortable: false }), - new ObjectDataColumn({ key: 'other', sortable: true }) - ] + [new ObjectDataColumn({ key: 'name', sortable: false }), new ObjectDataColumn({ key: 'other', sortable: true })] ); fixture.detectChanges(); dataTable.ngAfterViewInit(); const adapter = dataTable.data; spyOn(adapter, 'setSorting').and.callThrough(); - const hedaderColumns = fixture.debugElement.nativeElement.querySelectorAll('.adf-datatable-cell-header-content'); - hedaderColumns[0].click(); + const headerColumns = fixture.debugElement.nativeElement.querySelectorAll('.adf-datatable-cell-header-content'); + headerColumns[0].click(); fixture.detectChanges(); expect(adapter.setSorting).not.toHaveBeenCalled(); }); it('should set sorting upon column header clicked', () => { - dataTable.data = new ObjectDataTableAdapter( - [{ name: '1' }], - [ - new ObjectDataColumn({ key: 'column_1', sortable: true }) - ] - ); + dataTable.data = new ObjectDataTableAdapter([{ name: '1' }], [new ObjectDataColumn({ key: 'column_1', sortable: true })]); fixture.detectChanges(); dataTable.ngAfterViewInit(); const adapter = dataTable.data; spyOn(adapter, 'setSorting').and.callThrough(); spyOn(dataTable.data, 'getSorting').and.returnValue(new DataSorting('column_1', 'desc')); - const hedaderColumns = fixture.debugElement.nativeElement.querySelectorAll('.adf-datatable-cell-header-content'); - hedaderColumns[0].click(); + const headerColumns = fixture.debugElement.nativeElement.querySelectorAll('.adf-datatable-cell-header-content'); + headerColumns[0].click(); fixture.detectChanges(); expect(adapter.setSorting).toHaveBeenCalledWith(new DataSorting('column_1', 'asc')); }); it('should invert sorting upon column header clicked', () => { - dataTable.data = new ObjectDataTableAdapter( - [{ name: '1' }], - [ - new ObjectDataColumn({ key: 'column_1', sortable: true }) - ] - ); + dataTable.data = new ObjectDataTableAdapter([{ name: '1' }], [new ObjectDataColumn({ key: 'column_1', sortable: true })]); fixture.detectChanges(); dataTable.ngAfterViewInit(); @@ -885,37 +736,34 @@ describe('DataTable', () => { const sorting = new DataSorting('column_1', 'asc'); spyOn(adapter, 'setSorting').and.callThrough(); spyOn(adapter, 'getSorting').and.returnValue(sorting); - const hedaderColumns = fixture.debugElement.nativeElement.querySelectorAll('.adf-datatable-cell-header-content'); + const headerColumns = fixture.debugElement.nativeElement.querySelectorAll('.adf-datatable-cell-header-content'); // // check first click on the header - hedaderColumns[0].click(); + headerColumns[0].click(); fixture.detectChanges(); expect(adapter.setSorting).toHaveBeenCalledWith(new DataSorting('column_1', 'desc')); // check second click on the header sorting.direction = 'desc'; - hedaderColumns[0].click(); + headerColumns[0].click(); fixture.detectChanges(); expect(adapter.setSorting).toHaveBeenCalledWith(new DataSorting('column_1', 'asc')); - }); + }); it('should indicate column that has sorting applied', () => { dataTable.data = new ObjectDataTableAdapter( [{ name: '1' }, { name: '2' }], - [ - new ObjectDataColumn({ key: 'name', sortable: true }), - new ObjectDataColumn({ key: 'other', sortable: true }) - ] + [new ObjectDataColumn({ key: 'name', sortable: true }), new ObjectDataColumn({ key: 'other', sortable: true })] ); fixture.detectChanges(); dataTable.ngAfterViewInit(); const [col1, col2] = dataTable.getSortableColumns(); - const hedaderColumns = fixture.debugElement.nativeElement.querySelectorAll('.adf-datatable-cell-header-content'); + const headerColumns = fixture.debugElement.nativeElement.querySelectorAll('.adf-datatable-cell-header-content'); - hedaderColumns[1].click(); + headerColumns[1].click(); fixture.detectChanges(); expect(dataTable.isColumnSortActive(col1)).toBe(false); @@ -925,10 +773,7 @@ describe('DataTable', () => { it('should return false for columns that have no sorting', () => { dataTable.data = new ObjectDataTableAdapter( [{ name: '1' }, { name: '2' }], - [ - new ObjectDataColumn({ key: 'name', sortable: false }), - new ObjectDataColumn({ key: 'other', sortable: false }) - ] + [new ObjectDataColumn({ key: 'name', sortable: false }), new ObjectDataColumn({ key: 'other', sortable: false })] ); const [col1, col2] = dataTable.getSortableColumns(); @@ -977,10 +822,7 @@ describe('DataTable', () => { it('should have indeterminate state for "select all" when at least 1 row is selected or not all rows', () => { dataTable.data = new ObjectDataTableAdapter( [{ name: '1' }, { name: '2' }], - [ - new ObjectDataColumn({ key: 'name', sortable: false }), - new ObjectDataColumn({ key: 'other', sortable: false }) - ] + [new ObjectDataColumn({ key: 'name', sortable: false }), new ObjectDataColumn({ key: 'other', sortable: false })] ); const rows = dataTable.data.getRows(); @@ -1186,12 +1028,7 @@ describe('DataTable', () => { it('should enable sticky header if the stickyHeader is set to true and header is visible', () => { dataTable.data = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' }, - { name: '3' }, - { name: '4' } - ], + [{ name: '1' }, { name: '2' }, { name: '3' }, { name: '4' }], [new ObjectDataColumn({ key: 'name', title: 'Name' })] ); @@ -1204,12 +1041,7 @@ describe('DataTable', () => { it('should disable sticky header if component is loading', () => { dataTable.data = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' }, - { name: '3' }, - { name: '4' } - ], + [{ name: '1' }, { name: '2' }, { name: '3' }, { name: '4' }], [new ObjectDataColumn({ key: 'name', title: 'Name' })] ); @@ -1222,12 +1054,7 @@ describe('DataTable', () => { it('should disable sticky header if user has no permissions', () => { dataTable.data = new ObjectDataTableAdapter( - [ - { name: '1' }, - { name: '2' }, - { name: '3' }, - { name: '4' } - ], + [{ name: '1' }, { name: '2' }, { name: '3' }, { name: '4' }], [new ObjectDataColumn({ key: 'name', title: 'Name' })] ); @@ -1239,10 +1066,7 @@ describe('DataTable', () => { }); it('should disable sticky header if user has no content', () => { - dataTable.data = new ObjectDataTableAdapter( - [], - [new ObjectDataColumn({ key: 'name', title: 'Name' })] - ); + dataTable.data = new ObjectDataTableAdapter([], [new ObjectDataColumn({ key: 'name', title: 'Name' })]); dataTable.stickyHeader = true; dataTable.loading = false; @@ -1252,9 +1076,11 @@ describe('DataTable', () => { }); it('should be able to define values using the resolver function', () => { - dataTable.data = new ObjectDataTableAdapter([ - { id: 1, firstName: 'foo', lastName: 'bar' }, - { id: 2, firstName: 'bar', lastName: 'baz' }], + dataTable.data = new ObjectDataTableAdapter( + [ + { id: 1, firstName: 'foo', lastName: 'bar' }, + { id: 2, firstName: 'bar', lastName: 'baz' } + ], [new ObjectDataColumn({ key: 'id' }), new ObjectDataColumn({ key: 'name' })] ); spyOn(dataTable, 'resolverFn').and.callFake(resolverFn); @@ -1276,12 +1102,9 @@ describe('DataTable', () => { it('should update data columns when columns input changes', () => { const existingDataColumnsSchema = [new ObjectDataColumn({ key: 'id' })]; const existingData = [{ id: 'fake-data' }]; - dataTable.data = new ObjectDataTableAdapter( - existingData, - existingDataColumnsSchema - ); + dataTable.data = new ObjectDataTableAdapter(existingData, existingDataColumnsSchema); - const newDataColumnsSchema = { key: 'new-column'}; + const newDataColumnsSchema = { key: 'new-column' }; const columnsChange = new SimpleChange(null, [newDataColumnsSchema], false); dataTable.ngOnChanges({ columns: columnsChange }); const expectedNewDataColumns = [new ObjectDataColumn(newDataColumnsSchema)]; @@ -1290,14 +1113,12 @@ describe('DataTable', () => { it('should render the custom column header', () => { const customHeader = TestBed.createComponent(CustomColumnHeaderComponent).componentInstance.templateRef; - dataTable.data = new ObjectDataTableAdapter([ + dataTable.data = new ObjectDataTableAdapter( + [ { id: 1, name: 'foo' }, { id: 2, name: 'bar' } ], - [ - new ObjectDataColumn({ key: 'id', title: 'ID' }), - new ObjectDataColumn({ key: 'name', title: 'Name', header: customHeader }) - ] + [new ObjectDataColumn({ key: 'id', title: 'ID' }), new ObjectDataColumn({ key: 'name', title: 'Name', header: customHeader })] ); fixture.detectChanges(); @@ -1309,25 +1130,28 @@ describe('DataTable', () => { }); it('should set isContextMenuSource to true for row whose id matches selectedRowId', () => { - const rows = [{ - id: '1234', - isContextMenuSource: false - }, { - id: '2345', - isContextMenuSource: false - }, { - id: '3456', - isContextMenuSource: false - }] as DataRow[]; + const rows = [ + { + id: '1234', + isContextMenuSource: false + }, + { + id: '2345', + isContextMenuSource: false + }, + { + id: '3456', + isContextMenuSource: false + } + ] as DataRow[]; const row = { id: '2345', isContextMenuSource: false } as DataRow; - dataTable.data = new ObjectDataTableAdapter( - rows, - [new ObjectDataColumn({ key: 'id' }), - new ObjectDataColumn({ key: 'isContextMenuSource' })] - ); + dataTable.data = new ObjectDataTableAdapter(rows, [ + new ObjectDataColumn({ key: 'id' }), + new ObjectDataColumn({ key: 'isContextMenuSource' }) + ]); dataTable.markRowAsContextMenuSource(row); fixture.detectChanges(); @@ -1339,10 +1163,7 @@ describe('DataTable', () => { it('should select the row, regardless of where the user clicks in the row.', async () => { dataTable.selectionMode = 'single'; const dataRows = [{ id: 0 }, { id: 1 }]; - dataTable.data = new ObjectDataTableAdapter( - dataRows, - [new ObjectDataColumn({ key: 'id' })] - ); + dataTable.data = new ObjectDataTableAdapter(dataRows, [new ObjectDataColumn({ key: 'id' })]); dataTable.ngOnChanges({ rows: new SimpleChange(null, dataRows, false) }); @@ -1377,7 +1198,6 @@ describe('DataTable', () => { }); describe('Accesibility', () => { - let fixture: ComponentFixture; let dataTable: DataTableComponent; let element: any; @@ -1385,10 +1205,7 @@ describe('Accesibility', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - CoreTestingModule - ], + imports: [TranslateModule.forRoot(), CoreTestingModule], declarations: [CustomColumnTemplateComponent], schemas: [NO_ERRORS_SCHEMA] }); @@ -1403,17 +1220,8 @@ describe('Accesibility', () => { }); it('should have accessibility tags', () => { - - const dataRows = - [ - { name: 'test1' }, - { name: 'test2' }, - { name: 'test3' }, - { name: 'test4' } - ]; - dataTable.data = new ObjectDataTableAdapter([], - [new ObjectDataColumn({ key: 'name' })] - ); + const dataRows = [{ name: 'test1' }, { name: 'test2' }, { name: 'test3' }, { name: 'test4' }]; + dataTable.data = new ObjectDataTableAdapter([], [new ObjectDataColumn({ key: 'name' })]); dataTable.ngOnChanges({ rows: new SimpleChange(null, dataRows, false) @@ -1466,7 +1274,7 @@ describe('Accesibility', () => { describe('Focus row', () => { let event: KeyboardEvent; - let dataRows: {name: string}[]; + let dataRows: { name: string }[]; beforeEach(() => { event = new KeyboardEvent('keyup', { @@ -1474,10 +1282,8 @@ describe('Accesibility', () => { key: 'ArrowUp', keyCode: 38 } as KeyboardEventInit); - dataRows = [{name: 'test1'}, {name: 'test2'}]; - dataTable.data = new ObjectDataTableAdapter([], - [new ObjectDataColumn({key: 'name'})] - ); + dataRows = [{ name: 'test1' }, { name: 'test2' }]; + dataTable.data = new ObjectDataTableAdapter([], [new ObjectDataColumn({ key: 'name' })]); }); it('should focus next row on ArrowDown event', () => { @@ -1497,10 +1303,10 @@ describe('Accesibility', () => { const rowElement = document.querySelectorAll('.adf-datatable-body .adf-datatable-row')[0]; const rowCellElement = rowElement.querySelector('.adf-datatable-cell'); - rowCellElement.dispatchEvent(new MouseEvent('click', {bubbles: true})); + rowCellElement?.dispatchEvent(new MouseEvent('click', { bubbles: true })); fixture.debugElement.nativeElement.dispatchEvent(event); - expect(document.activeElement.getAttribute('data-automation-id')).toBe('datatable-row-1'); + expect(document.activeElement?.getAttribute('data-automation-id')).toBe('datatable-row-1'); }); it('should focus previous row on ArrowUp event', () => { @@ -1514,10 +1320,10 @@ describe('Accesibility', () => { const rowElement = document.querySelectorAll('.adf-datatable-body .adf-datatable-row')[1]; const rowCellElement = rowElement.querySelector('.adf-datatable-cell'); - rowCellElement.dispatchEvent(new MouseEvent('click', {bubbles: true})); + rowCellElement?.dispatchEvent(new MouseEvent('click', { bubbles: true })); fixture.debugElement.nativeElement.dispatchEvent(event); - expect(document.activeElement.getAttribute('data-automation-id')).toBe('datatable-row-0'); + expect(document.activeElement?.getAttribute('data-automation-id')).toBe('datatable-row-0'); }); it('should select header row when `showHeader` is `Always`', () => { @@ -1531,12 +1337,12 @@ describe('Accesibility', () => { dataTable.ngAfterViewInit(); const rowElement = document.querySelector('.adf-datatable-row[data-automation-id="datatable-row-0"]'); - const rowCellElement = rowElement.querySelector('.adf-datatable-cell'); + const rowCellElement = rowElement?.querySelector('.adf-datatable-cell'); - rowCellElement.dispatchEvent(new MouseEvent('click', {bubbles: true})); + rowCellElement?.dispatchEvent(new MouseEvent('click', { bubbles: true })); fixture.debugElement.nativeElement.dispatchEvent(event); - expect(document.activeElement.getAttribute('data-automation-id')).toBe('datatable-row-header'); + expect(document.activeElement?.getAttribute('data-automation-id')).toBe('datatable-row-header'); }); it('should not select header row when `showHeader` is `Never`', () => { @@ -1550,22 +1356,20 @@ describe('Accesibility', () => { dataTable.ngAfterViewInit(); const rowElement = document.querySelector('.adf-datatable-row[data-automation-id="datatable-row-0"]'); - const rowCellElement = rowElement.querySelector('.adf-datatable-cell'); + const rowCellElement = rowElement?.querySelector('.adf-datatable-cell'); - rowCellElement.dispatchEvent(new MouseEvent('click')); + rowCellElement?.dispatchEvent(new MouseEvent('click')); fixture.debugElement.nativeElement.dispatchEvent(event); - expect(document.activeElement.getAttribute('data-automation-id')).toBe('datatable-row-1'); + expect(document.activeElement?.getAttribute('data-automation-id')).toBe('datatable-row-1'); }); }); it('should remove cell focus when [focus] is set to false', () => { dataTable.showHeader = ShowHeaderMode.Never; - const dataRows = [ { name: 'name1' } ]; + const dataRows = [{ name: 'name1' }]; - dataTable.data = new ObjectDataTableAdapter([], - [new ObjectDataColumn({ key: 'name', template: columnCustomTemplate, focus: false })] - ); + dataTable.data = new ObjectDataTableAdapter([], [new ObjectDataColumn({ key: 'name', template: columnCustomTemplate, focus: false })]); dataTable.ngOnChanges({ rows: new SimpleChange(null, dataRows, false) @@ -1575,16 +1379,14 @@ describe('Accesibility', () => { dataTable.ngAfterViewInit(); const cell = document.querySelector('.adf-datatable-row[data-automation-id="datatable-row-0"] .adf-cell-value'); - expect(cell.getAttribute('tabindex')).toBe(null); + expect(cell?.getAttribute('tabindex')).toBe(null); }); it('should allow element focus when [focus] is set to true', () => { dataTable.showHeader = ShowHeaderMode.Never; - const dataRows = [ { name: 'name1' } ]; + const dataRows = [{ name: 'name1' }]; - dataTable.data = new ObjectDataTableAdapter([], - [new ObjectDataColumn({ key: 'name', template: columnCustomTemplate, focus: true })] - ); + dataTable.data = new ObjectDataTableAdapter([], [new ObjectDataColumn({ key: 'name', template: columnCustomTemplate, focus: true })]); dataTable.ngOnChanges({ rows: new SimpleChange(null, dataRows, false) @@ -1594,7 +1396,7 @@ describe('Accesibility', () => { dataTable.ngAfterViewInit(); const cell = document.querySelector('.adf-datatable-row[data-automation-id="datatable-row-0"] .adf-cell-value'); - expect(cell.getAttribute('tabindex')).toBe('0'); + expect(cell?.getAttribute('tabindex')).toBe('0'); }); }); @@ -1606,10 +1408,7 @@ describe('Drag&Drop column header', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - CoreTestingModule - ], + imports: [TranslateModule.forRoot(), CoreTestingModule], declarations: [CustomColumnTemplateComponent], schemas: [NO_ERRORS_SCHEMA] }); @@ -1625,29 +1424,30 @@ describe('Drag&Drop column header', () => { new ObjectDataColumn({ key: 'name', title: 'Name', draggable: true }) ]; - dataTable.data = new ObjectDataTableAdapter( - [...data], - [...dataTableSchema] - ); + dataTable.data = new ObjectDataTableAdapter([...data], [...dataTableSchema]); }); it('should show/hide drag indicator icon', () => { fixture.detectChanges(); - const hedaderColumn = fixture.debugElement.nativeElement.querySelector('[data-automation-id="auto_id_name"]'); - hedaderColumn.dispatchEvent(new MouseEvent('mouseenter')); + const headerColumn = fixture.debugElement.nativeElement.querySelector('[data-automation-id="auto_id_name"]'); + headerColumn.dispatchEvent(new MouseEvent('mouseenter')); fixture.detectChanges(); let dragIcon = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-datatable-cell-header-drag-icon-name"]'); - let dragIconPlaceholder = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-datatable-cell-header-drag-icon-placeholder-name"]'); + let dragIconPlaceholder = fixture.debugElement.nativeElement.querySelector( + '[data-automation-id="adf-datatable-cell-header-drag-icon-placeholder-name"]' + ); expect(dragIcon).toBeTruthy(); expect(dragIconPlaceholder).toBeTruthy(); - hedaderColumn.dispatchEvent(new MouseEvent('mouseleave')); + headerColumn.dispatchEvent(new MouseEvent('mouseleave')); fixture.detectChanges(); dragIcon = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-datatable-cell-header-drag-icon-name"]'); - dragIconPlaceholder = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-datatable-cell-header-drag-icon-placeholder-name"]'); + dragIconPlaceholder = fixture.debugElement.nativeElement.querySelector( + '[data-automation-id="adf-datatable-cell-header-drag-icon-placeholder-name"]' + ); expect(dragIcon).toBeFalsy(); expect(dragIconPlaceholder).toBeFalsy(); }); @@ -1655,12 +1455,14 @@ describe('Drag&Drop column header', () => { it('should not show drag indicator icon, when drag and drop is disabled', () => { fixture.detectChanges(); - const hedaderColumn = fixture.debugElement.nativeElement.querySelector('[data-automation-id="auto_id_id"]'); - hedaderColumn.dispatchEvent(new MouseEvent('mouseenter')); + const headerColumn = fixture.debugElement.nativeElement.querySelector('[data-automation-id="auto_id_id"]'); + headerColumn.dispatchEvent(new MouseEvent('mouseenter')); fixture.detectChanges(); const dragIcon = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-datatable-cell-header-drag-icon-id"]'); - const dragIconPlaceholder = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-datatable-cell-header-drag-icon-placeholder-id"]'); + const dragIconPlaceholder = fixture.debugElement.nativeElement.querySelector( + '[data-automation-id="adf-datatable-cell-header-drag-icon-placeholder-id"]' + ); expect(dragIcon).toBeFalsy(); expect(dragIconPlaceholder).toBeFalsy(); @@ -1717,10 +1519,7 @@ describe('Show/hide columns', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - CoreTestingModule - ], + imports: [TranslateModule.forRoot(), CoreTestingModule], declarations: [CustomColumnTemplateComponent], schemas: [NO_ERRORS_SCHEMA] }); @@ -1734,14 +1533,11 @@ describe('Show/hide columns', () => { dataTableSchema = [ new ObjectDataColumn({ key: 'id', title: 'ID' }), - new ObjectDataColumn({ key: 'name', title: 'Name'}), + new ObjectDataColumn({ key: 'name', title: 'Name' }), new ObjectDataColumn({ key: 'status', title: 'status', isHidden: true }) ]; - dataTable.data = new ObjectDataTableAdapter( - [...data], - [...dataTableSchema] - ); + dataTable.data = new ObjectDataTableAdapter([...data], [...dataTableSchema]); fixture.detectChanges(); }); @@ -1776,11 +1572,14 @@ describe('Show/hide columns', () => { describe('markRowAsContextMenuSource', () => { it('should set isContextMenuSource to false for all rows returned by getRows function', () => { - const rows = [{ - isContextMenuSource: true - }, { - isContextMenuSource: true - }] as DataRow[]; + const rows = [ + { + isContextMenuSource: true + }, + { + isContextMenuSource: true + } + ] as DataRow[]; spyOn(dataTable.data, 'getRows').and.returnValue(rows); dataTable.markRowAsContextMenuSource({} as DataRow); rows.forEach((row) => expect(row.isContextMenuSource).toBeFalse()); @@ -1802,7 +1601,6 @@ describe('Column Resizing', () => { let data: { id: number; name: string }[] = []; let dataTableSchema: DataColumn[] = []; - const testClassesAfterResizing = (headerColumnsSelector = '.adf-datatable-cell-header', excludedClass = 'adf-datatable__cursor--pointer') => { dataTable.isResizingEnabled = true; fixture.detectChanges(); @@ -1819,10 +1617,7 @@ describe('Column Resizing', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - CoreTestingModule - ], + imports: [TranslateModule.forRoot(), CoreTestingModule], declarations: [CustomColumnTemplateComponent], schemas: [NO_ERRORS_SCHEMA] }); @@ -1838,10 +1633,7 @@ describe('Column Resizing', () => { new ObjectDataColumn({ key: 'name', title: 'Name', draggable: true }) ]; - dataTable.data = new ObjectDataTableAdapter( - [...data], - [...dataTableSchema] - ); + dataTable.data = new ObjectDataTableAdapter([...data], [...dataTableSchema]); dataTable.isResizingEnabled = false; fixture.detectChanges(); @@ -1884,8 +1676,8 @@ describe('Column Resizing', () => { dataTable.isResizingEnabled = true; fixture.detectChanges(); - const hedaderColumn = fixture.debugElement.nativeElement.querySelector('[data-automation-id="auto_id_id"]'); - hedaderColumn.dispatchEvent(new MouseEvent('mouseenter')); + const headerColumn = fixture.debugElement.nativeElement.querySelector('[data-automation-id="auto_id_id"]'); + headerColumn.dispatchEvent(new MouseEvent('mouseenter')); fixture.detectChanges(); let dragIcon = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-datatable-cell-header-drag-icon-id"]'); @@ -2027,7 +1819,7 @@ describe('Column Resizing', () => { }); it('should emit on columns width change when resizing ends', () => { - spyOn(dataTable.columnsWidthChanged,'emit'); + spyOn(dataTable.columnsWidthChanged, 'emit'); dataTable.isResizingEnabled = true; fixture.detectChanges(); @@ -2047,5 +1839,4 @@ describe('Column Resizing', () => { expect(dataTable.isResizing).toBeFalse(); expect(dataTable.columnsWidthChanged.emit).toHaveBeenCalled(); }); - }); diff --git a/lib/core/src/lib/datatable/data/object-datatable-adapter.ts b/lib/core/src/lib/datatable/data/object-datatable-adapter.ts index 6a01842479..07c01fe4d3 100644 --- a/lib/core/src/lib/datatable/data/object-datatable-adapter.ts +++ b/lib/core/src/lib/datatable/data/object-datatable-adapter.ts @@ -40,7 +40,7 @@ export class ObjectDataTableAdapter implements DataTableAdapter { if (typeof rowToExamine === 'object') { for (const key in rowToExamine) { - if (rowToExamine.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(rowToExamine, key)) { schema.push({ type: 'text', key, diff --git a/lib/core/src/lib/datatable/directives/resizable/resizable.directive.ts b/lib/core/src/lib/datatable/directives/resizable/resizable.directive.ts index 873b240c8a..4d6058c1bc 100644 --- a/lib/core/src/lib/datatable/directives/resizable/resizable.directive.ts +++ b/lib/core/src/lib/datatable/directives/resizable/resizable.directive.ts @@ -51,26 +51,24 @@ export class ResizableDirective implements OnInit, OnDestroy { mousemove = new Subject(); - private pointerDown: Observable; - - private pointerMove: Observable; - - private pointerUp: Observable; + private readonly pointerDown: Observable; + private readonly pointerMove: Observable; + private readonly pointerUp: Observable; private startingRect: BoundingRectangle; private currentRect: BoundingRectangle; - private unlistenMouseDown?: () => void; - private unlistenMouseMove?: () => void; - private unlistenMouseUp?: () => void; + private unsubscribeMouseDown?: () => void; + private unsubscribeMouseMove?: () => void; + private unsubscribeMouseUp?: () => void; private destroy$ = new Subject(); constructor(private readonly renderer: Renderer2, private readonly element: ElementRef, private readonly zone: NgZone) { this.pointerDown = new Observable((observer: Observer) => { zone.runOutsideAngular(() => { - this.unlistenMouseDown = renderer.listen('document', 'mousedown', (event: MouseEvent) => { + this.unsubscribeMouseDown = renderer.listen('document', 'mousedown', (event: MouseEvent) => { observer.next(event); }); }); @@ -78,7 +76,7 @@ export class ResizableDirective implements OnInit, OnDestroy { this.pointerMove = new Observable((observer: Observer) => { zone.runOutsideAngular(() => { - this.unlistenMouseMove = renderer.listen('document', 'mousemove', (event: MouseEvent) => { + this.unsubscribeMouseMove = renderer.listen('document', 'mousemove', (event: MouseEvent) => { observer.next(event); }); }); @@ -86,7 +84,7 @@ export class ResizableDirective implements OnInit, OnDestroy { this.pointerUp = new Observable((observer: Observer) => { zone.runOutsideAngular(() => { - this.unlistenMouseUp = renderer.listen('document', 'mouseup', (event: MouseEvent) => { + this.unsubscribeMouseUp = renderer.listen('document', 'mouseup', (event: MouseEvent) => { observer.next(event); }); }); @@ -101,7 +99,7 @@ export class ResizableDirective implements OnInit, OnDestroy { const mouseDrag: Observable = mousedown$ .pipe( mergeMap(({ clientX = 0 }) => - merge(mousemove$.pipe(take(1)).pipe(map((coords) => [, coords])), mousemove$.pipe(pairwise())) + merge(mousemove$.pipe(take(1)).pipe(map((coords) => [undefined, coords])), mousemove$.pipe(pairwise())) .pipe( map(([previousCoords = {}, newCoords = {}]) => [ { clientX: previousCoords.clientX - clientX }, @@ -170,9 +168,9 @@ export class ResizableDirective implements OnInit, OnDestroy { this.mousedown.complete(); this.mousemove.complete(); this.mouseup.complete(); - this.unlistenMouseDown?.(); - this.unlistenMouseMove?.(); - this.unlistenMouseUp?.(); + this.unsubscribeMouseDown?.(); + this.unsubscribeMouseMove?.(); + this.unsubscribeMouseUp?.(); this.destroy$.next(); } diff --git a/lib/core/src/lib/form/components/form-renderer.component.spec.ts b/lib/core/src/lib/form/components/form-renderer.component.spec.ts index f026c60db2..6933b3628a 100644 --- a/lib/core/src/lib/form/components/form-renderer.component.spec.ts +++ b/lib/core/src/lib/form/components/form-renderer.component.spec.ts @@ -30,7 +30,7 @@ import { numberMinMaxForm, textWidgetVisibility, numberWidgetVisibilityForm, - radioWidgetVisibiltyForm, + radioWidgetVisibilityForm, customWidgetForm, formDateVisibility, customWidgetFormWithVisibility, @@ -86,7 +86,6 @@ const expectElementToBeValid = (fieldId: string, fixture: ComponentFixture { - let formRendererComponent: FormRendererComponent; let fixture: ComponentFixture>; let formService: FormService; @@ -95,11 +94,7 @@ describe('Form Renderer Component', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - CoreTestingModule, - FormBaseModule - ] + imports: [TranslateModule.forRoot(), CoreTestingModule, FormBaseModule] }); fixture = TestBed.createComponent(FormRendererComponent); formRendererComponent = fixture.componentInstance; @@ -287,7 +282,6 @@ describe('Form Renderer Component', () => { }); describe('Number widget', () => { - it('[C315169] - Should be able to complete a task with a form with number widgets', async () => { formRendererComponent.formDefinition = formService.parseForm(formNumberWidgetVisibility.formRepresentation.formDefinition); fixture.detectChanges(); @@ -364,8 +358,8 @@ describe('Form Renderer Component', () => { await fixture.whenStable(); numberContainerElement = fixture.nativeElement.querySelector('#field-Number2-container'); expectElementToBeHidden(numberContainerElement); - const errorWidetText: HTMLDivElement = fixture.nativeElement.querySelector('#field-Number1-container error-widget .adf-error-text'); - expect(errorWidetText.textContent).toBe(`FORM.FIELD.VALIDATOR.NOT_GREATER_THAN`); + const errorWidgetText: HTMLDivElement = fixture.nativeElement.querySelector('#field-Number1-container error-widget .adf-error-text'); + expect(errorWidgetText.textContent).toBe(`FORM.FIELD.VALIDATOR.NOT_GREATER_THAN`); expect(formRendererComponent.formDefinition.isValid).toBe(false, 'Form should not be valid without mandatory field'); }); @@ -397,12 +391,16 @@ describe('Form Renderer Component', () => { await fixture.whenStable(); const formSizedElement = fixture.nativeElement.querySelector('#field-2bc275fb-e113-4d7d-885f-6e74a7332d40-container div.adf-grid-list'); expectElementToBeVisible(formSizedElement); - const sectionGridElement: HTMLElement[] = fixture.nativeElement.querySelectorAll('#field-2bc275fb-e113-4d7d-885f-6e74a7332d40-container div .adf-grid-list-item'); + const sectionGridElement: HTMLElement[] = fixture.nativeElement.querySelectorAll( + '#field-2bc275fb-e113-4d7d-885f-6e74a7332d40-container div .adf-grid-list-item' + ); sectionGridElement.forEach((element) => { expect(element.style['grid-area']).toBe('auto / auto / span 1 / span 1', 'Elemens is wrong sized for this section'); }); - const fullWidthElement = fixture.nativeElement.querySelector('#field-d52ada4e-cbdc-4f0c-a480-5b85fa00e4f8-container div.adf-grid-list .adf-grid-list-item'); + const fullWidthElement = fixture.nativeElement.querySelector( + '#field-d52ada4e-cbdc-4f0c-a480-5b85fa00e4f8-container div.adf-grid-list .adf-grid-list-item' + ); expect(fullWidthElement.style['grid-area']).toBe('auto / auto / span 1 / span 2'); }); @@ -410,13 +408,19 @@ describe('Form Renderer Component', () => { formRendererComponent.formDefinition = formService.parseForm(colspanForm.formRepresentation.formDefinition, null, false, false); fixture.detectChanges(); await fixture.whenStable(); - const formSizedElement = fixture.nativeElement.querySelector('#field-2bc275fb-e113-4d7d-885f-6e74a7332d40-container section.adf-grid-list-column-view'); + const formSizedElement = fixture.nativeElement.querySelector( + '#field-2bc275fb-e113-4d7d-885f-6e74a7332d40-container section.adf-grid-list-column-view' + ); expectElementToBeVisible(formSizedElement); - const sectionGridElement: HTMLElement[] = fixture.nativeElement.querySelectorAll('#field-2bc275fb-e113-4d7d-885f-6e74a7332d40-container section .adf-grid-list-single-column'); + const sectionGridElement: HTMLElement[] = fixture.nativeElement.querySelectorAll( + '#field-2bc275fb-e113-4d7d-885f-6e74a7332d40-container section .adf-grid-list-single-column' + ); sectionGridElement.forEach((element) => { expect(element.style['width']).toBe('50%', 'Elemens is wrong sized for this section'); }); - const fullWidthElement = fixture.nativeElement.querySelector('#field-d52ada4e-cbdc-4f0c-a480-5b85fa00e4f8-container section.adf-grid-list-column-view .adf-grid-list-single-column'); + const fullWidthElement = fixture.nativeElement.querySelector( + '#field-d52ada4e-cbdc-4f0c-a480-5b85fa00e4f8-container section.adf-grid-list-column-view .adf-grid-list-single-column' + ); expect(fullWidthElement.style['width']).toBe('100%'); }); @@ -587,11 +591,9 @@ describe('Form Renderer Component', () => { expectInputElementValueIs(testTwoInput, 'aaa'); expectElementToBeHidden(numberFieldContainer); }); - }); describe('Text widget', () => { - it('[C309669] - Should be able to set visibility conditions for Text widget', async () => { formRendererComponent.formDefinition = formService.parseForm(textWidgetVisibility.formRepresentation.formDefinition); fixture.detectChanges(); @@ -630,13 +632,11 @@ describe('Form Renderer Component', () => { expectElementToBeVisible(elementFourContainer); expectElementToBeHidden(elementThreeContainer); }); - }); describe('Radio widget', () => { - it('[C310352] - Should be able to set visibility conditions for Radio Button widget', async () => { - formRendererComponent.formDefinition = formService.parseForm(radioWidgetVisibiltyForm.formRepresentation.formDefinition); + formRendererComponent.formDefinition = formService.parseForm(radioWidgetVisibilityForm.formRepresentation.formDefinition); fixture.detectChanges(); await fixture.whenStable(); const textInputElement = fixture.nativeElement.querySelector('#Text0cee7g'); @@ -651,11 +651,9 @@ describe('Form Renderer Component', () => { radioButtonContainer = fixture.nativeElement.querySelector('#field-Radiobuttons03rkbo-container'); expectElementToBeVisible(radioButtonContainer); }); - }); describe('Custom Widget', () => { - it('Should be able to correctly display a custom process cloud widget', async () => { formRenderingService.register({ bananaforevah: () => TextWidgetComponent }, true); formRendererComponent.formDefinition = formService.parseForm(customWidgetForm.formRepresentation.formDefinition); @@ -681,7 +679,6 @@ describe('Form Renderer Component', () => { customWidgetElementContainer = fixture.nativeElement.querySelector('#field-bananaforevah0k8gui-container'); expectElementToBeVisible(customWidgetElementContainer); }); - }); describe('Form rules', () => { diff --git a/lib/core/src/lib/form/components/form-renderer.component.ts b/lib/core/src/lib/form/components/form-renderer.component.ts index f53e7c13d1..1329a0e655 100644 --- a/lib/core/src/lib/form/components/form-renderer.component.ts +++ b/lib/core/src/lib/form/components/form-renderer.component.ts @@ -84,7 +84,7 @@ export class FormRendererComponent implements OnChanges, OnDestroy { const maxColumnFieldsSize = this.getMaxColumnFieldSize(content); for (let rowIndex = 0; rowIndex < maxColumnFieldsSize; rowIndex++) { content?.columns.flatMap((currentColumn) => { - if (!!currentColumn?.fields[rowIndex]) { + if (currentColumn?.fields[rowIndex]) { serialisedFormFields.push(currentColumn?.fields[rowIndex]); } else { const firstRowElementColSpan = currentColumn?.fields[0]?.colspan; diff --git a/lib/core/src/lib/form/components/mock/form-renderer.component.mock.ts b/lib/core/src/lib/form/components/mock/form-renderer.component.mock.ts index 82a652af16..1f952b8049 100644 --- a/lib/core/src/lib/form/components/mock/form-renderer.component.mock.ts +++ b/lib/core/src/lib/form/components/mock/form-renderer.component.mock.ts @@ -154,8 +154,7 @@ export const formDisplayValueForm = { colspan: 1, visibilityCondition: { leftFormFieldId: '', - leftRestResponseId: - 'bcdfe3af-d635-40ee-b9fd-4f9d3655d77b', + leftRestResponseId: 'bcdfe3af-d635-40ee-b9fd-4f9d3655d77b', operator: '==', rightValue: '', rightType: null, @@ -187,8 +186,7 @@ export const formDisplayValueForm = { rightValue: '', rightType: null, rightFormFieldId: '', - rightRestResponseId: - 'bcdfe3af-d635-40ee-b9fd-4f9d3655d77b', + rightRestResponseId: 'bcdfe3af-d635-40ee-b9fd-4f9d3655d77b', nextConditionOperator: '', nextCondition: null }, @@ -300,8 +298,7 @@ export const formDisplayValueForm = { existingColspan: 1, maxColspan: 2, field: { - id: - 'bcdfe3af-d635-40ee-b9fd-4f9d3655d77b', + id: 'bcdfe3af-d635-40ee-b9fd-4f9d3655d77b', name: 'vstring', type: 'string' } @@ -505,439 +502,436 @@ export const formNumberWidgetVisibility = { }; export const formNumberTextJson = { - formRepresentation: { - id: 'form-ed98955c-3e18-4689-a669-377ab801ad0e', - name: 'number', - description: '', - version: 0, - formDefinition: { - tabs: [], - fields: [ - { - id: 'fa0df048-3d73-4922-8b62-71a204b086b2', - name: 'Label', - type: 'container', - tab: null, - numberOfColumns: 2, - fields: { - 1: [ - { - id: 'NumberColspan', - name: 'NumberColspan', - type: 'integer', - colspan: 2, - placeholder: null, - minValue: null, - maxValue: null, - required: false, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - }, - { - id: 'NumberReq', - name: 'NumberReq', - type: 'integer', - colspan: 1, - placeholder: null, - minValue: null, - maxValue: null, - required: true, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - }, - { - id: 'NumberNotReq', - name: 'NumberNotReq', - type: 'integer', - colspan: 1, - placeholder: null, - minValue: null, - maxValue: null, - required: false, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - }, - { - id: 'NumberAdvanced', - name: 'NumberAdvanced', - type: 'integer', - colspan: 1, - placeholder: null, - minValue: 10, - maxValue: 50, - required: false, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ], - 2: [ - { - id: 'Text', - name: 'Text', - type: 'text', - required: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - regexPattern: null, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - }, - { - id: 'TextTwo', - name: 'TextTwo', - type: 'text', - required: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - regexPattern: null, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - }, - { - id: 'NumberFieldValue', - name: 'NumberFieldValue', - type: 'integer', - colspan: 1, - placeholder: null, - minValue: null, - maxValue: null, - required: false, - visibilityCondition: { - leftFormFieldId: 'Text', - leftRestResponseId: '', - operator: '==', - rightValue: 'aaa', - rightType: null, - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: '', - nextCondition: null - }, - params: { - existingColspan: 1, - maxColspan: 2 - } - }, - { - id: 'NumberVariableField', - name: 'NumberVariableField', - type: 'integer', - colspan: 1, - placeholder: null, - minValue: null, - maxValue: null, - required: false, - visibilityCondition: { - leftFormFieldId: '', - leftRestResponseId: - '3b316e21-3632-4dde-ba19-b27dca09a83b', - operator: '==', - rightValue: 'aaa', - rightType: null, - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: '', - nextCondition: null - }, - params: { - existingColspan: 1, - maxColspan: 2 - } - }, - { - id: 'NumberFieldVariable', - name: 'NumberFieldVariable', - type: 'integer', - colspan: 1, - placeholder: null, - minValue: null, - maxValue: null, - required: false, - visibilityCondition: { - leftFormFieldId: 'Text', - leftRestResponseId: '', - operator: '==', - rightValue: '', - rightType: null, - rightFormFieldId: '', - rightRestResponseId: - '3b316e21-3632-4dde-ba19-b27dca09a83b', - nextConditionOperator: '', - nextCondition: null - }, - params: { - existingColspan: 1, - maxColspan: 2 - } - }, - { - id: 'NumberOne', - name: 'NumberOne', - type: 'integer', - colspan: 1, - placeholder: null, - minValue: null, - maxValue: null, - required: false, - visibilityCondition: { - leftFormFieldId: 'Text', - leftRestResponseId: '', - operator: '==', - rightValue: 'aaa', - rightType: null, - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: 'and', - nextCondition: { - leftFormFieldId: 'TextTwo', - leftRestResponseId: '', - operator: 'not equal', - rightValue: 'aaa', - rightType: null, - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: '', - nextCondition: null - } - }, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ] - } - } - ], - outcomes: [], - metadata: {}, - variables: [ - { - id: '3b316e21-3632-4dde-ba19-b27dca09a83b', - name: 'name', - type: 'string', - value: 'aaa' - } - ] - } - } - + formRepresentation: { + id: 'form-ed98955c-3e18-4689-a669-377ab801ad0e', + name: 'number', + description: '', + version: 0, + formDefinition: { + tabs: [], + fields: [ + { + id: 'fa0df048-3d73-4922-8b62-71a204b086b2', + name: 'Label', + type: 'container', + tab: null, + numberOfColumns: 2, + fields: { + 1: [ + { + id: 'NumberColspan', + name: 'NumberColspan', + type: 'integer', + colspan: 2, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + }, + { + id: 'NumberReq', + name: 'NumberReq', + type: 'integer', + colspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + required: true, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + }, + { + id: 'NumberNotReq', + name: 'NumberNotReq', + type: 'integer', + colspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + }, + { + id: 'NumberAdvanced', + name: 'NumberAdvanced', + type: 'integer', + colspan: 1, + placeholder: null, + minValue: 10, + maxValue: 50, + required: false, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ], + 2: [ + { + id: 'Text', + name: 'Text', + type: 'text', + required: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + regexPattern: null, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + }, + { + id: 'TextTwo', + name: 'TextTwo', + type: 'text', + required: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + regexPattern: null, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + }, + { + id: 'NumberFieldValue', + name: 'NumberFieldValue', + type: 'integer', + colspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: { + leftFormFieldId: 'Text', + leftRestResponseId: '', + operator: '==', + rightValue: 'aaa', + rightType: null, + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: '', + nextCondition: null + }, + params: { + existingColspan: 1, + maxColspan: 2 + } + }, + { + id: 'NumberVariableField', + name: 'NumberVariableField', + type: 'integer', + colspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: { + leftFormFieldId: '', + leftRestResponseId: '3b316e21-3632-4dde-ba19-b27dca09a83b', + operator: '==', + rightValue: 'aaa', + rightType: null, + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: '', + nextCondition: null + }, + params: { + existingColspan: 1, + maxColspan: 2 + } + }, + { + id: 'NumberFieldVariable', + name: 'NumberFieldVariable', + type: 'integer', + colspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: { + leftFormFieldId: 'Text', + leftRestResponseId: '', + operator: '==', + rightValue: '', + rightType: null, + rightFormFieldId: '', + rightRestResponseId: '3b316e21-3632-4dde-ba19-b27dca09a83b', + nextConditionOperator: '', + nextCondition: null + }, + params: { + existingColspan: 1, + maxColspan: 2 + } + }, + { + id: 'NumberOne', + name: 'NumberOne', + type: 'integer', + colspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: { + leftFormFieldId: 'Text', + leftRestResponseId: '', + operator: '==', + rightValue: 'aaa', + rightType: null, + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: 'and', + nextCondition: { + leftFormFieldId: 'TextTwo', + leftRestResponseId: '', + operator: 'not equal', + rightValue: 'aaa', + rightType: null, + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: '', + nextCondition: null + } + }, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ] + } + } + ], + outcomes: [], + metadata: {}, + variables: [ + { + id: '3b316e21-3632-4dde-ba19-b27dca09a83b', + name: 'name', + type: 'string', + value: 'aaa' + } + ] + } + } }; export const formRequiredNumberWidget = { - formRepresentation: { - id: 'form-00dc42c7-b075-404b-a57c-a8b2adca9abe', - name: 'number_field', - description: '', - version: 0, - standAlone: true, - formDefinition: { - tabs: [], - fields: [ - { - id: '182eef06-d245-4388-b3f7-8e08d90fb07a', - name: 'Label', - type: 'container', - tab: null, - numberOfColumns: 2, - fields: { - 1: [ - { - id: 'Number1', - name: 'Number1', - type: 'integer', - colspan: 1, - placeholder: null, - minValue: 5, - maxValue: 7, - required: true, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ], - 2: [ - { - id: 'Number2', - name: 'Number2', - type: 'integer', - colspan: 1, - placeholder: null, - minValue: null, - maxValue: null, - required: false, - visibilityCondition: { - leftType: 'field', - leftValue: 'Number1', - operator: '==', - rightValue: 'integerVariable', - rightType: 'variable', - nextConditionOperator: '', - nextCondition: null - }, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ] - } - } - ], - outcomes: [], - metadata: {}, - variables: [ - { - id: 'f9f6d1ae-374a-49f9-b664-5286c558abaa', - name: 'integerVariable', - type: 'integer', - value: 5 - } - ] - } - } + formRepresentation: { + id: 'form-00dc42c7-b075-404b-a57c-a8b2adca9abe', + name: 'number_field', + description: '', + version: 0, + standAlone: true, + formDefinition: { + tabs: [], + fields: [ + { + id: '182eef06-d245-4388-b3f7-8e08d90fb07a', + name: 'Label', + type: 'container', + tab: null, + numberOfColumns: 2, + fields: { + 1: [ + { + id: 'Number1', + name: 'Number1', + type: 'integer', + colspan: 1, + placeholder: null, + minValue: 5, + maxValue: 7, + required: true, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ], + 2: [ + { + id: 'Number2', + name: 'Number2', + type: 'integer', + colspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: { + leftType: 'field', + leftValue: 'Number1', + operator: '==', + rightValue: 'integerVariable', + rightType: 'variable', + nextConditionOperator: '', + nextCondition: null + }, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ] + } + } + ], + outcomes: [], + metadata: {}, + variables: [ + { + id: 'f9f6d1ae-374a-49f9-b664-5286c558abaa', + name: 'integerVariable', + type: 'integer', + value: 5 + } + ] + } + } }; export const colspanForm = { - formRepresentation: { - id: 'form-a6af80b9-d200-4a00-b17a-b1309691493d', - name: 'regresion', - description: '', - version: 0, - standAlone: true, - formDefinition: { - tabs: [], - fields: [ - { - id: 'd52ada4e-cbdc-4f0c-a480-5b85fa00e4f8', - name: 'Label', - type: 'container', - tab: null, - numberOfColumns: 2, - fields: { - 1: [ - { - id: 'Number0u0kiv', - name: 'NumberColspan', - type: 'integer', - readOnly: false, - colspan: 2, - placeholder: null, - minValue: null, - maxValue: null, - required: false, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ] - } - }, - { - id: '2bc275fb-e113-4d7d-885f-6e74a7332d40', - name: 'Label', - type: 'container', - tab: null, - numberOfColumns: 2, - fields: { - 1: [ - { - id: 'Number00fuuk', - name: 'Number', - type: 'integer', - readOnly: false, - colspan: 1, - placeholder: null, - minValue: null, - maxValue: null, - required: false, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ], - 2: [ - { - id: 'Number03u9d4', - name: 'Number', - type: 'integer', - readOnly: false, - colspan: 1, - placeholder: null, - minValue: null, - maxValue: null, - required: false, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ] - } - }, - { - id: '1ff21afc-7df4-4607-8363-1dc8576e1c8e', - name: 'Label', - type: 'container', - tab: null, - numberOfColumns: 2, - fields: { - 1: [ - { - id: 'Text04sjhr', - name: 'Text', - type: 'text', - readOnly: false, - required: false, - colspan: 2, - placeholder: null, - minLength: 0, - maxLength: 0, - regexPattern: null, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ] - } - } - ], - outcomes: [], - metadata: {}, - variables: [] - } - } + formRepresentation: { + id: 'form-a6af80b9-d200-4a00-b17a-b1309691493d', + name: 'regresion', + description: '', + version: 0, + standAlone: true, + formDefinition: { + tabs: [], + fields: [ + { + id: 'd52ada4e-cbdc-4f0c-a480-5b85fa00e4f8', + name: 'Label', + type: 'container', + tab: null, + numberOfColumns: 2, + fields: { + 1: [ + { + id: 'Number0u0kiv', + name: 'NumberColspan', + type: 'integer', + readOnly: false, + colspan: 2, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ] + } + }, + { + id: '2bc275fb-e113-4d7d-885f-6e74a7332d40', + name: 'Label', + type: 'container', + tab: null, + numberOfColumns: 2, + fields: { + 1: [ + { + id: 'Number00fuuk', + name: 'Number', + type: 'integer', + readOnly: false, + colspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ], + 2: [ + { + id: 'Number03u9d4', + name: 'Number', + type: 'integer', + readOnly: false, + colspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + required: false, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ] + } + }, + { + id: '1ff21afc-7df4-4607-8363-1dc8576e1c8e', + name: 'Label', + type: 'container', + tab: null, + numberOfColumns: 2, + fields: { + 1: [ + { + id: 'Text04sjhr', + name: 'Text', + type: 'text', + readOnly: false, + required: false, + colspan: 2, + placeholder: null, + minLength: 0, + maxLength: 0, + regexPattern: null, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ] + } + } + ], + outcomes: [], + metadata: {}, + variables: [] + } + } }; export const numberNotRequiredForm = { @@ -983,48 +977,48 @@ export const numberNotRequiredForm = { }; export const numberMinMaxForm = { - formRepresentation: { - id: 'form-f1e1a17c-d4a2-40dc-b15a-6a9c08afb26f', - name: 'numbercol', - description: '', - version: 0, - standAlone: true, - formDefinition: { - tabs: [], - fields: [ - { - id: '530d73c8-9600-4d11-a1b7-20ad6b60a31a', - name: 'Label', - type: 'container', - tab: null, - numberOfColumns: 2, - fields: { - 1: [ - { - id: 'Number0him2z', - name: 'Number', - type: 'integer', - colspan: 2, - placeholder: null, - minValue: 10, - maxValue: 60, - required: false, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ], - 2: [] - } - } - ], - outcomes: [], - metadata: {}, - variables: [] - } - } + formRepresentation: { + id: 'form-f1e1a17c-d4a2-40dc-b15a-6a9c08afb26f', + name: 'numbercol', + description: '', + version: 0, + standAlone: true, + formDefinition: { + tabs: [], + fields: [ + { + id: '530d73c8-9600-4d11-a1b7-20ad6b60a31a', + name: 'Label', + type: 'container', + tab: null, + numberOfColumns: 2, + fields: { + 1: [ + { + id: 'Number0him2z', + name: 'Number', + type: 'integer', + colspan: 2, + placeholder: null, + minValue: 10, + maxValue: 60, + required: false, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ], + 2: [] + } + } + ], + outcomes: [], + metadata: {}, + variables: [] + } + } }; export const textWidgetVisibility = { @@ -1264,7 +1258,7 @@ export const numberWidgetVisibilityForm = { } }; -export const radioWidgetVisibiltyForm = { +export const radioWidgetVisibilityForm = { formRepresentation: { id: 'form-e0d77062-9b04-40d6-beed-6b63045f63b4', name: 'RadioVisibility', @@ -1473,116 +1467,116 @@ export const customWidgetFormWithVisibility = { export const formDateVisibility = { formRepresentation: { - id: 'form-f0d926e0-0cb9-46fc-a10e-705547fb0318', - name: 'form', - description: '', - version: 0, - standAlone: true, - formDefinition: { - tabs: [], - fields: [ - { - id: 'be820e5c-ee59-40df-bca2-03a5a1e1e29c', - name: 'Label', - type: 'container', - tab: null, - numberOfColumns: 2, - fields: { - 1: [ + id: 'form-f0d926e0-0cb9-46fc-a10e-705547fb0318', + name: 'form', + description: '', + version: 0, + standAlone: true, + formDefinition: { + tabs: [], + fields: [ { - id: 'Date0hwq20', - name: 'Date', - type: 'date', - readOnly: false, - required: false, - colspan: 1, - rowspan: 1, - placeholder: null, - minValue: null, - maxValue: null, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - }, - dateDisplayFormat: 'YYYY-MM-DD' - } - ], - 2: [ + id: 'be820e5c-ee59-40df-bca2-03a5a1e1e29c', + name: 'Label', + type: 'container', + tab: null, + numberOfColumns: 2, + fields: { + 1: [ + { + id: 'Date0hwq20', + name: 'Date', + type: 'date', + readOnly: false, + required: false, + colspan: 1, + rowspan: 1, + placeholder: null, + minValue: null, + maxValue: null, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + }, + dateDisplayFormat: 'YYYY-MM-DD' + } + ], + 2: [ + { + id: 'Text0pqd1u', + name: 'Text', + type: 'text', + readOnly: false, + required: false, + colspan: 1, + rowspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + regexPattern: null, + visibilityCondition: { + leftType: 'field', + leftValue: 'Date0hwq20', + operator: '==', + rightValue: '2019-11-19', + rightType: 'value', + nextConditionOperator: '', + nextCondition: null + }, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ] + } + }, { - id: 'Text0pqd1u', - name: 'Text', - type: 'text', - readOnly: false, - required: false, - colspan: 1, - rowspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - regexPattern: null, - visibilityCondition: { - leftType: 'field', - leftValue: 'Date0hwq20', - operator: '==', - rightValue: '2019-11-19', - rightType: 'value', - nextConditionOperator: '', - nextCondition: null - }, - params: { - existingColspan: 1, - maxColspan: 2 - } + id: 'ff5ebab0-99a0-42ca-b2e7-416af9fe713a', + name: 'Label', + type: 'container', + tab: null, + numberOfColumns: 2, + fields: { + 1: [ + { + id: 'Text0uyqd3', + name: 'Text', + type: 'text', + readOnly: false, + required: false, + colspan: 1, + rowspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + regexPattern: null, + visibilityCondition: { + leftType: 'field', + leftValue: 'Date0hwq20', + operator: '!=', + rightValue: '2019-11-19', + rightType: 'value', + nextConditionOperator: '', + nextCondition: null + }, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ], + 2: [] + } } - ] - } - }, - { - id: 'ff5ebab0-99a0-42ca-b2e7-416af9fe713a', - name: 'Label', - type: 'container', - tab: null, - numberOfColumns: 2, - fields: { - 1: [ - { - id: 'Text0uyqd3', - name: 'Text', - type: 'text', - readOnly: false, - required: false, - colspan: 1, - rowspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - regexPattern: null, - visibilityCondition: { - leftType: 'field', - leftValue: 'Date0hwq20', - operator: '!=', - rightValue: '2019-11-19', - rightType: 'value', - nextConditionOperator: '', - nextCondition: null - }, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ], - 2: [] - } - } - ], - outcomes: [], - metadata: {}, - variables: [] - } + ], + outcomes: [], + metadata: {}, + variables: [] + } } - }; +}; export const amountWidgetFormVisibilityMock = { formRepresentation: { @@ -1694,93 +1688,93 @@ export const amountWidgetFormVisibilityMock = { }; export const checkboxWidgetFormVisibilityMock = { - formRepresentation: { - id: 'form-a6af80b9-d200-4a00-b17a-b1309691493d', - name: 'regresion', - description: '', - version: 0, - standAlone: true, - formDefinition: { - tabs: [], - fields: [ - { - id: '09913af9-f91a-4ba5-ae4c-8e6ff3e21b6f', - name: 'Label', - type: 'container', - tab: null, - numberOfColumns: 2, - fields: { - 1: [ - { - id: 'Checkbox0pr51m', - name: 'Checkbox1', - type: 'boolean', - readOnly: false, - required: true, - colspan: 1, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ], - 2: [ - { - id: 'Checkbox0fp0zf', - name: 'Checkbox2', - type: 'boolean', - readOnly: false, - required: false, - colspan: 1, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ] - } - }, - { - id: '45086850-c83d-4bfc-bd94-eccd9634c4ce', - name: 'Label', - type: 'container', - tab: null, - numberOfColumns: 2, - fields: { - 1: [ - { - id: 'Checkbox0lb7ze', - name: 'Checkbox', - type: 'boolean', - readOnly: false, - required: false, - colspan: 1, - visibilityCondition: { - leftType: 'field', - leftValue: 'Checkbox0pr51m', - operator: '==', - rightValue: 'Checkbox0fp0zf', - rightType: 'field', - nextConditionOperator: '', - nextCondition: null - }, - params: { - existingColspan: 1, - maxColspan: 2 - } - } - ], - 2: [] - } - } - ], - outcomes: [], - metadata: {}, - variables: [] - } - } + formRepresentation: { + id: 'form-a6af80b9-d200-4a00-b17a-b1309691493d', + name: 'regresion', + description: '', + version: 0, + standAlone: true, + formDefinition: { + tabs: [], + fields: [ + { + id: '09913af9-f91a-4ba5-ae4c-8e6ff3e21b6f', + name: 'Label', + type: 'container', + tab: null, + numberOfColumns: 2, + fields: { + 1: [ + { + id: 'Checkbox0pr51m', + name: 'Checkbox1', + type: 'boolean', + readOnly: false, + required: true, + colspan: 1, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ], + 2: [ + { + id: 'Checkbox0fp0zf', + name: 'Checkbox2', + type: 'boolean', + readOnly: false, + required: false, + colspan: 1, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ] + } + }, + { + id: '45086850-c83d-4bfc-bd94-eccd9634c4ce', + name: 'Label', + type: 'container', + tab: null, + numberOfColumns: 2, + fields: { + 1: [ + { + id: 'Checkbox0lb7ze', + name: 'Checkbox', + type: 'boolean', + readOnly: false, + required: false, + colspan: 1, + visibilityCondition: { + leftType: 'field', + leftValue: 'Checkbox0pr51m', + operator: '==', + rightValue: 'Checkbox0fp0zf', + rightType: 'field', + nextConditionOperator: '', + nextCondition: null + }, + params: { + existingColspan: 1, + maxColspan: 2 + } + } + ], + 2: [] + } + } + ], + outcomes: [], + metadata: {}, + variables: [] + } + } }; export const dateWidgetFormVisibilityMock = { diff --git a/lib/core/src/lib/form/components/widgets/core/form-field-validator.spec.ts b/lib/core/src/lib/form/components/widgets/core/form-field-validator.spec.ts index a19e889d87..4e990d9a5b 100644 --- a/lib/core/src/lib/form/components/widgets/core/form-field-validator.spec.ts +++ b/lib/core/src/lib/form/components/widgets/core/form-field-validator.spec.ts @@ -38,13 +38,11 @@ import { FormModel } from './form.model'; declare let moment: any; describe('FormFieldValidator', () => { - describe('RequiredFieldValidator', () => { - let validator: RequiredFieldValidator; beforeEach(() => { - validator = new RequiredFieldValidator(); + validator = new RequiredFieldValidator(); }); it('should require [required] setting', () => { @@ -71,9 +69,7 @@ describe('FormFieldValidator', () => { const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DROPDOWN, value: '', - options: [ - {id: 'empty', name: 'Choose option...'} - ], + options: [{ id: 'empty', name: 'Choose option...' }], hasEmptyValue: true, required: true }); @@ -241,10 +237,9 @@ describe('FormFieldValidator', () => { expect(validator.validate(field)).toBeFalsy(); }); - }); + }); describe('NumberFieldValidator', () => { - let validator: NumberFieldValidator; beforeEach(() => { @@ -305,10 +300,9 @@ describe('FormFieldValidator', () => { expect(validator.validate(field)).toBeFalsy(); expect(field.validationSummary).not.toBeNull(); }); - }); + }); describe('MinLengthFieldValidator', () => { - let validator: MinLengthFieldValidator; beforeEach(() => { @@ -357,10 +351,9 @@ describe('FormFieldValidator', () => { expect(validator.validate(field)).toBeFalsy(); expect(field.validationSummary).not.toBeNull(); }); - }); + }); describe('MaxLengthFieldValidator', () => { - let validator: MaxLengthFieldValidator; beforeEach(() => { @@ -412,7 +405,6 @@ describe('FormFieldValidator', () => { }); describe('MinValueFieldValidator', () => { - let validator: MinValueFieldValidator; beforeEach(() => { @@ -480,10 +472,9 @@ describe('FormFieldValidator', () => { expect(validator.validate(field)).toBeFalsy(); expect(field.validationSummary).not.toBeNull(); }); - }); + }); describe('MaxValueFieldValidator', () => { - let validator: MaxValueFieldValidator; beforeEach(() => { @@ -551,10 +542,9 @@ describe('FormFieldValidator', () => { expect(validator.validate(field)).toBeFalsy(); expect(field.validationSummary).not.toBeNull(); }); - }); + }); describe('RegExFieldValidator', () => { - let validator: RegExFieldValidator; beforeEach(() => { @@ -610,10 +600,9 @@ describe('FormFieldValidator', () => { expect(validator.validate(field)).toBeFalsy(); }); - }); + }); describe('FixedValueFieldValidator', () => { - let validator: FixedValueFieldValidator; beforeEach(() => { @@ -647,7 +636,10 @@ describe('FormFieldValidator', () => { const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TYPEAHEAD, value: '1', - options: [{id: '1', name: 'Leanne Graham'}, {id: '2', name: 'Ervin Howell'}] + options: [ + { id: '1', name: 'Leanne Graham' }, + { id: '2', name: 'Ervin Howell' } + ] }); expect(validator.validate(field)).toBeTruthy(); @@ -657,15 +649,17 @@ describe('FormFieldValidator', () => { const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TYPEAHEAD, value: 'Lean', - options: [{id: '1', name: 'Leanne Graham'}, {id: '2', name: 'Ervin Howell'}] + options: [ + { id: '1', name: 'Leanne Graham' }, + { id: '2', name: 'Ervin Howell' } + ] }); expect(validator.validate(field)).toBeFalsy(); }); - }); + }); describe('MaxDateTimeFieldValidator', () => { - let validator: MaxDateTimeFieldValidator; beforeEach(() => { @@ -788,10 +782,9 @@ describe('FormFieldValidator', () => { expect(validator.validate(field)).toBeFalsy(); expect(field.validationSummary).not.toBeNull(); }); - }); + }); describe('MinDateTimeFieldValidator', () => { - let validator: MinDateTimeFieldValidator; beforeEach(() => { @@ -914,10 +907,9 @@ describe('FormFieldValidator', () => { expect(validator.validate(field)).toBeFalsy(); expect(field.validationSummary).not.toBeNull(); }); - }); + }); describe('MaxDateFieldValidator', () => { - let validator: MaxDateFieldValidator; beforeEach(() => { @@ -1007,10 +999,9 @@ describe('FormFieldValidator', () => { expect(validator.validate(field)).toBeFalsy(); expect(field.validationSummary).not.toBeNull(); }); - }); + }); describe('MinDateFieldValidator', () => { - let validator: MinDateFieldValidator; beforeEach(() => { @@ -1100,10 +1091,9 @@ describe('FormFieldValidator', () => { expect(validator.validate(field)).toBeFalsy(); expect(field.validationSummary).not.toBeNull(); }); - }); + }); describe('DateTimeFieldValidator', () => { - let validator: DateTimeFieldValidator; beforeEach(() => { @@ -1114,7 +1104,7 @@ describe('FormFieldValidator', () => { const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: '2021-06-09 14:10', - dateDisplayFormay: 'YYYY-MM-DD HH:mm' + dateDisplayFormat: 'YYYY-MM-DD HH:mm' }); expect(validator.validate(field)).toBeTruthy(); diff --git a/lib/core/src/lib/form/components/widgets/core/form-field.model.ts b/lib/core/src/lib/form/components/widgets/core/form-field.model.ts index 71f10f4361..ef450acaf8 100644 --- a/lib/core/src/lib/form/components/widgets/core/form-field.model.ts +++ b/lib/core/src/lib/form/components/widgets/core/form-field.model.ts @@ -272,11 +272,10 @@ export class FormFieldModel extends FormWidgetModel { if (json.fields) { for (const currentField in json.fields) { - if (json.fields.hasOwnProperty(currentField)) { + if (Object.prototype.hasOwnProperty.call(json.fields, currentField)) { const col = new ContainerColumnModel(); - const fields: FormFieldModel[] = (json.fields[currentField] || []).map((field) => new FormFieldModel(form, field)); - col.fields = fields; + col.fields = (json.fields[currentField] || []).map((field) => new FormFieldModel(form, field)); col.rowspan = json.fields[currentField].length; col.fields.forEach((colFields: any) => { @@ -291,7 +290,7 @@ export class FormFieldModel extends FormWidgetModel { } parseValue(json: any): any { - let value = json.hasOwnProperty('value') && json.value !== undefined ? json.value : null; + let value = Object.prototype.hasOwnProperty.call(json, 'value') && json.value !== undefined ? json.value : null; /* This is needed due to Activiti issue related to reading dropdown values as value string @@ -363,7 +362,7 @@ export class FormFieldModel extends FormWidgetModel { } switch (this.type) { - case FormFieldTypes.DROPDOWN: + case FormFieldTypes.DROPDOWN: { if (!this.value) { this.form.values[this.id] = null; break; @@ -390,13 +389,15 @@ export class FormFieldModel extends FormWidgetModel { } } break; - case FormFieldTypes.RADIO_BUTTONS: + } + case FormFieldTypes.RADIO_BUTTONS: { const radioButton: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value); if (radioButton.length > 0) { this.form.values[this.id] = radioButton[0]; } break; - case FormFieldTypes.UPLOAD: + } + case FormFieldTypes.UPLOAD: { this.form.hasUpload = true; if (this.value && this.value.length > 0) { this.form.values[this.id] = Array.isArray(this.value) ? this.value.map((elem) => elem.id).join(',') : [this.value]; @@ -404,7 +405,8 @@ export class FormFieldModel extends FormWidgetModel { this.form.values[this.id] = null; } break; - case FormFieldTypes.TYPEAHEAD: + } + case FormFieldTypes.TYPEAHEAD: { const typeAheadEntry: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value || opt.name === this.value); if (typeAheadEntry.length > 0) { this.form.values[this.id] = typeAheadEntry[0]; @@ -412,7 +414,8 @@ export class FormFieldModel extends FormWidgetModel { this.form.values[this.id] = null; } break; - case FormFieldTypes.DATE: + } + case FormFieldTypes.DATE: { if (typeof this.value === 'string' && this.value === 'today') { this.value = moment(new Date()).format(this.dateDisplayFormat); } @@ -425,7 +428,8 @@ export class FormFieldModel extends FormWidgetModel { this._value = this.value; } break; - case FormFieldTypes.DATETIME: + } + case FormFieldTypes.DATETIME: { if (typeof this.value === 'string' && this.value === 'now') { this.value = moment(new Date()).utc().format(this.dateDisplayFormat); } @@ -439,21 +443,27 @@ export class FormFieldModel extends FormWidgetModel { this._value = this.value; } break; - case FormFieldTypes.NUMBER: + } + case FormFieldTypes.NUMBER: { this.form.values[this.id] = this.enableFractions ? parseFloat(this.value) : parseInt(this.value, 10); break; - case FormFieldTypes.AMOUNT: + } + case FormFieldTypes.AMOUNT: { this.form.values[this.id] = this.enableFractions ? parseFloat(this.value) : parseInt(this.value, 10); break; - case FormFieldTypes.BOOLEAN: + } + case FormFieldTypes.BOOLEAN: { this.form.values[this.id] = this.value !== null && this.value !== undefined ? this.value : false; break; - case FormFieldTypes.PEOPLE: + } + case FormFieldTypes.PEOPLE: { this.form.values[this.id] = this.value ? this.value : null; break; - case FormFieldTypes.FUNCTIONAL_GROUP: + } + case FormFieldTypes.FUNCTIONAL_GROUP: { this.form.values[this.id] = this.value ? this.value : null; break; + } default: if (!FormFieldTypes.isReadOnlyType(this.type) && !this.isInvalidFieldType(this.type)) { this.form.values[this.id] = this.value; diff --git a/lib/core/src/lib/form/components/widgets/core/form.model.ts b/lib/core/src/lib/form/components/widgets/core/form.model.ts index 688b1b15e9..8d58ea0e2d 100644 --- a/lib/core/src/lib/form/components/widgets/core/form.model.ts +++ b/lib/core/src/lib/form/components/widgets/core/form.model.ts @@ -265,7 +265,7 @@ export class FormModel implements ProcessFormModel { getDefaultFormVariableValue(identifier: string): any { const variable = this.getFormVariable(identifier); - if (variable?.hasOwnProperty('value')) { + if (variable && Object.prototype.hasOwnProperty.call(variable, 'value')) { return this.parseValue(variable.type, variable.value); } @@ -420,7 +420,7 @@ export class FormModel implements ProcessFormModel { const visibilityRule: WidgetVisibilityModel = new WidgetVisibilityModel(); const field = this.getFieldById(fieldId); - if (!!field) { + if (field) { visibilityRule.operator = visibility ? 'empty' : '!empty'; visibilityRule.leftType = WidgetTypeEnum.field; field.visibilityCondition = visibilityRule; @@ -430,28 +430,28 @@ export class FormModel implements ProcessFormModel { changeFieldDisabled(fieldId: string, disabled: boolean): void { const field = this.getFieldById(fieldId); - if (!!field) { + if (field) { field.readOnly = this.readOnly || disabled; } } changeFieldRequired(fieldId: string, required: boolean): void { const field = this.getFieldById(fieldId); - if (!!field) { + if (field) { field.required = required; } } changeFieldValue(fieldId: string, value: any): void { const field = this.getFieldById(fieldId); - if (!!field) { + if (field) { field.value = value; } } changeVariableValue(variableId: string, value: any): void { const variable = this.getFormVariable(variableId); - if (!!variable) { + if (variable) { variable.value = value; } } diff --git a/lib/core/src/lib/form/models/form-rules.model.ts b/lib/core/src/lib/form/models/form-rules.model.ts index 31b959b207..fea9f251e0 100644 --- a/lib/core/src/lib/form/models/form-rules.model.ts +++ b/lib/core/src/lib/form/models/form-rules.model.ts @@ -33,7 +33,7 @@ export function formRulesManagerFactory(injector: Injector): FormRulesManager } export abstract class FormRulesManager { - constructor(private formService: FormService) { } + constructor(private formService: FormService) {} protected formModel: FormModel; private onDestroy$ = new Subject(); @@ -50,12 +50,13 @@ export abstract class FormRulesManager { if (!this.formModel.readOnly) { const rules = this.getRules(); - if (!!rules) { + if (rules) { this.formService.formRulesEvent .pipe( - filter(event => !!event?.form?.id && event.form.id === formModel?.id), + filter((event) => !!event?.form?.id && event.form.id === formModel?.id), takeUntil(this.onDestroy$) - ).subscribe(event => { + ) + .subscribe((event) => { this.handleRuleEvent(event, rules); }); @@ -76,7 +77,6 @@ export abstract class FormRulesManager { } export class ByPassFormRuleManager extends FormRulesManager { - protected getRules(): T { return null; } diff --git a/lib/core/src/lib/form/models/widget-visibility.model.ts b/lib/core/src/lib/form/models/widget-visibility.model.ts index ba63a0599d..e6904967c9 100644 --- a/lib/core/src/lib/form/models/widget-visibility.model.ts +++ b/lib/core/src/lib/form/models/widget-visibility.model.ts @@ -43,7 +43,7 @@ export class WidgetVisibilityModel { return WidgetTypeEnum.field; } else if (this.leftRestResponseId) { return WidgetTypeEnum.variable; - } else if (!!this.json.leftType) { + } else if (this.json.leftType) { return this.json.leftType; } return null; @@ -68,7 +68,7 @@ export class WidgetVisibilityModel { } get rightType(): string { - if (!!this.json.rightType) { + if (this.json.rightType) { return this.json.rightType; } else if (this.json.rightValue) { return WidgetTypeEnum.value; diff --git a/lib/core/src/lib/form/services/widget-visibility.service.ts b/lib/core/src/lib/form/services/widget-visibility.service.ts index 86561e3f2d..ff6add70a6 100644 --- a/lib/core/src/lib/form/services/widget-visibility.service.ts +++ b/lib/core/src/lib/form/services/widget-visibility.service.ts @@ -68,7 +68,7 @@ export class WidgetVisibilityService { } } - public isFieldVisible(form: FormModel, visibilityObj: WidgetVisibilityModel, accumulator: any[] = [], result: boolean = false): boolean { + public isFieldVisible(form: FormModel, visibilityObj: WidgetVisibilityModel, accumulator: any[] = [], result?: boolean): boolean { const leftValue = this.getLeftValue(form, visibilityObj); const rightValue = this.getRightValue(form, visibilityObj); const actualResult = this.evaluateCondition(leftValue, rightValue, visibilityObj.operator); @@ -88,7 +88,7 @@ export class WidgetVisibilityService { } private transformToLiteralExpression(currentExpression: any): string { - const currentTransformedValue = !!currentExpression.value ? 'true' : 'false'; + const currentTransformedValue = currentExpression.value ? 'true' : 'false'; return currentTransformedValue.concat(this.transformToLiteralOperator(currentExpression.operator)); } @@ -206,9 +206,9 @@ export class WidgetVisibilityService { const containers = this.getFormTabContainers(form); let isVisible: boolean = true; containers.map((container: ContainerModel) => { - if (!!this.getCurrentFieldFromTabById(container, currentFormField.id)) { + if (this.getCurrentFieldFromTabById(container, currentFormField.id)) { const currentTab = form.tabs.find((tab: TabModel) => tab.id === container.tab); - if (!!currentTab) { + if (currentTab) { isVisible = currentTab.isVisible; } } @@ -230,7 +230,7 @@ export class WidgetVisibilityService { } private getFormTabContainers(form: FormModel): ContainerModel[] { - if (!!form) { + if (form) { return form.fields.filter((field) => field.type === 'container' && field.tab) as ContainerModel[]; } return []; diff --git a/lib/core/src/lib/info-drawer/mock/info-drawer.mock.ts b/lib/core/src/lib/info-drawer/mock/info-drawer.mock.ts index 25d570fd10..12c37522bc 100644 --- a/lib/core/src/lib/info-drawer/mock/info-drawer.mock.ts +++ b/lib/core/src/lib/info-drawer/mock/info-drawer.mock.ts @@ -15,6 +15,8 @@ * limitations under the License. */ +/* eslint-disable @cspell/spellchecker */ + export const mockTabText = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam urna odio, sagittis vel nulla vel, condimentum egestas dolor. Interdum et malesuada fames ac ante ipsum primis in faucibus. Mauris eu hendrerit lectus. Aliquam et ex imperdiet, sodales tellus finibus, malesuada eros. Vestibulum aliquet eros sed diam euismod tincidunt. diff --git a/lib/core/src/lib/mock/cookie.service.mock.ts b/lib/core/src/lib/mock/cookie.service.mock.ts index 2d0815cff1..110a61c333 100644 --- a/lib/core/src/lib/mock/cookie.service.mock.ts +++ b/lib/core/src/lib/mock/cookie.service.mock.ts @@ -38,7 +38,7 @@ export class CookieServiceMock extends CookieService { /** @override */ clear() { Object.keys(this).forEach((key) => { - if (this.hasOwnProperty(key) && typeof this[key] !== 'function') { + if (Object.prototype.hasOwnProperty.call(this, key) && typeof this[key] !== 'function') { this[key] = undefined; } }); diff --git a/lib/core/src/lib/mock/form/demo-form.mock.ts b/lib/core/src/lib/mock/form/demo-form.mock.ts index 8bdcc52cf0..25d9c69b58 100644 --- a/lib/core/src/lib/mock/form/demo-form.mock.ts +++ b/lib/core/src/lib/mock/form/demo-form.mock.ts @@ -16,7 +16,6 @@ */ export class DemoForm { - easyForm: any = { formRepresentation: { id: 1001, @@ -1859,10 +1858,10 @@ export class DemoForm { id: 'my1r7YmMOs', type: 'paragraph', data: { - text: `Is simply a redonly + text: `Is simply a readonly dummy text of the printing and typesetting industry.\n - Lorem Ipsum has been the industry\'s standard du + Lorem Ipsum has been the industry's standard du mmy text ever since the 1500s,\n when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries,\n @@ -1880,10 +1879,7 @@ export class DemoForm { type: 'list', data: { style: 'unordered', - items: [ - 'Unordered list example', - 'Unordered list example' - ] + items: ['Unordered list example', 'Unordered list example'] } }, { @@ -1954,5 +1950,4 @@ export class DemoForm { getFormCloudDefinition(): any { return this.cloudFormDefinition; } - } diff --git a/lib/core/src/lib/mock/form/form-definition-visibility.mock.ts b/lib/core/src/lib/mock/form/form-definition-visibility.mock.ts index fcc4277463..01e101f586 100644 --- a/lib/core/src/lib/mock/form/form-definition-visibility.mock.ts +++ b/lib/core/src/lib/mock/form/form-definition-visibility.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export const formDefVisibilitiFieldDependsOnNextOne: any = { +export const formDefVisibilityFieldDependsOnNextOne: any = { id: 19, processDefinitionId: 'visibility:1:148', processDefinitionName: 'visibility', diff --git a/lib/core/src/lib/viewer/components/pdf-viewer.component.ts b/lib/core/src/lib/viewer/components/pdf-viewer.component.ts index 6b38882ed8..da0548f70b 100644 --- a/lib/core/src/lib/viewer/components/pdf-viewer.component.ts +++ b/lib/core/src/lib/viewer/components/pdf-viewer.component.ts @@ -173,13 +173,12 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { const urlFile = changes['urlFile']; if (urlFile?.currentValue) { - const pdfOptions = { + const pdfOptions: any = { ...this.pdfjsDefaultOptions, url: urlFile.currentValue, withCredentials: this.appConfigService.get('auth.withCredentials', undefined) }; if (this.cacheType) { - // @ts-ignore pdfOptions.httpHeaders = { 'Cache-Control': this.cacheType }; diff --git a/lib/core/src/lib/viewer/services/rendering-queue.services.ts b/lib/core/src/lib/viewer/services/rendering-queue.services.ts index 0a9706e793..50b884c4d9 100644 --- a/lib/core/src/lib/viewer/services/rendering-queue.services.ts +++ b/lib/core/src/lib/viewer/services/rendering-queue.services.ts @@ -24,7 +24,6 @@ import { Injectable } from '@angular/core'; */ @Injectable() export class RenderingQueueServices { - renderingStates = { INITIAL: 0, RUNNING: 1, @@ -149,22 +148,27 @@ export class RenderingQueueServices { renderView(view: any) { const state = view.renderingState; switch (state) { - case this.renderingStates.FINISHED: + case this.renderingStates.FINISHED: { return false; - case this.renderingStates.PAUSED: + } + case this.renderingStates.PAUSED: { this.highestPriorityPage = view.renderingId; view.resume(); break; - case this.renderingStates.RUNNING: + } + case this.renderingStates.RUNNING: { this.highestPriorityPage = view.renderingId; break; - case this.renderingStates.INITIAL: + } + case this.renderingStates.INITIAL: { this.highestPriorityPage = view.renderingId; - const continueRendering = function() { + // eslint-disable-next-line space-before-function-paren + const continueRendering = function () { this.renderHighestPriority(); }.bind(this); view.draw().then(continueRendering, continueRendering); break; + } default: break; } diff --git a/lib/core/src/lib/viewer/services/view-util.service.ts b/lib/core/src/lib/viewer/services/view-util.service.ts index d4cc42f158..1f1fe25d96 100644 --- a/lib/core/src/lib/viewer/services/view-util.service.ts +++ b/lib/core/src/lib/viewer/services/view-util.service.ts @@ -22,7 +22,6 @@ import { AppExtensionService, ViewerExtensionRef } from '@alfresco/adf-extension providedIn: 'root' }) export class ViewUtilService { - // Extensions that are supported by the Viewer without conversion private extensions = { image: ['png', 'jpg', 'jpeg', 'gif', 'bpm', 'svg'], @@ -50,11 +49,10 @@ export class ViewUtilService { * Provides a list of file extensions supported by external plugins. */ get externalExtensions(): string[] { - return this.viewerExtensions.map(ext => ext.fileExtension); + return this.viewerExtensions.map((ext) => ext.fileExtension); } - constructor(private extensionService: AppExtensionService) { - } + constructor(private extensionService: AppExtensionService) {} /** * get File name from url @@ -64,9 +62,7 @@ export class ViewUtilService { getFilenameFromUrl(url: string): string { const anchor = url.indexOf('#'); const query = url.indexOf('?'); - const end = Math.min( - anchor > 0 ? anchor : url.length, - query > 0 ? query : url.length); + const end = Math.min(anchor > 0 ? anchor : url.length, query > 0 ? query : url.length); return url.substring(url.lastIndexOf('/', end) + 1, end); } @@ -80,13 +76,13 @@ export class ViewUtilService { */ getFileExtension(fileName: string): string { if (fileName) { - const match = fileName.match(/\.([^\./\?\#]+)($|\?|\#)/); + const match = fileName.match(/\.([^./?#]+)($|\?|#)/); return match ? match[1] : null; } return null; } - getViewerType(extension: string, mimeType: string): string { + getViewerType(extension: string, mimeType: string): string { let viewerType = this.getViewerTypeByExtension(extension); if (viewerType === 'unknown') { @@ -143,7 +139,7 @@ export class ViewUtilService { } private isExternalViewer(): boolean { - return !!this.viewerExtensions.find(ext => ext.fileExtension === '*'); + return !!this.viewerExtensions.find((ext) => ext.fileExtension === '*'); } isCustomViewerExtension(extension: string): boolean { @@ -156,5 +152,4 @@ export class ViewUtilService { return false; } - } diff --git a/lib/extensions/src/lib/components/dynamic-column/dynamic-column.component.ts b/lib/extensions/src/lib/components/dynamic-column/dynamic-column.component.ts index a216f7d850..a22a3e9b4c 100644 --- a/lib/extensions/src/lib/components/dynamic-column/dynamic-column.component.ts +++ b/lib/extensions/src/lib/components/dynamic-column/dynamic-column.component.ts @@ -94,7 +94,7 @@ export class DynamicColumnComponent implements OnInit, OnChanges, OnDestroy { } private updateInstance() { - if (this.componentRef && this.componentRef.instance) { + if (this.componentRef?.instance) { this.componentRef.instance.context = this.context; } } diff --git a/lib/extensions/src/lib/components/dynamic-component/dynamic.component.ts b/lib/extensions/src/lib/components/dynamic-component/dynamic.component.ts index 648b216ad5..f32ffa740e 100644 --- a/lib/extensions/src/lib/components/dynamic-component/dynamic.component.ts +++ b/lib/extensions/src/lib/components/dynamic-component/dynamic.component.ts @@ -89,8 +89,9 @@ export class DynamicExtensionComponent implements OnChanges, OnDestroy { } } - private proxy(lifecycleMethod, ...args) { + private proxy(lifecycleMethod: string, ...args: any[]) { if (this.componentCreated() && this.lifecycleHookIsImplemented(lifecycleMethod)) { + // eslint-disable-next-line prefer-spread this.componentRef.instance[lifecycleMethod].apply(this.componentRef.instance, args); } } diff --git a/lib/extensions/src/lib/components/dynamic-tab/dynamic-tab.component.ts b/lib/extensions/src/lib/components/dynamic-tab/dynamic-tab.component.ts index 957f2f6ee6..e83ab6dbd2 100644 --- a/lib/extensions/src/lib/components/dynamic-tab/dynamic-tab.component.ts +++ b/lib/extensions/src/lib/components/dynamic-tab/dynamic-tab.component.ts @@ -80,7 +80,7 @@ export class DynamicTabComponent implements OnInit, OnChanges, OnDestroy { } private updateInstance() { - if (this.componentRef && this.componentRef.instance) { + if (this.componentRef?.instance) { this.componentRef.instance.node = this.node; } } diff --git a/lib/extensions/src/lib/components/viewer/preview-extension.component.ts b/lib/extensions/src/lib/components/viewer/preview-extension.component.ts index 6426619e91..fcb059c38a 100644 --- a/lib/extensions/src/lib/components/viewer/preview-extension.component.ts +++ b/lib/extensions/src/lib/components/viewer/preview-extension.component.ts @@ -87,7 +87,7 @@ export class PreviewExtensionComponent implements OnInit, OnChanges, OnDestroy { } private updateInstance() { - if (this.componentRef && this.componentRef.instance) { + if (this.componentRef?.instance) { const instance = this.componentRef.instance; instance.url = this.url; diff --git a/lib/extensions/src/lib/config/extension-utils.ts b/lib/extensions/src/lib/config/extension-utils.ts index e1d7acb7b5..95c231f31d 100644 --- a/lib/extensions/src/lib/config/extension-utils.ts +++ b/lib/extensions/src/lib/config/extension-utils.ts @@ -135,7 +135,7 @@ export const mergeArrays = (left: any[], right: any[]): any[] => { (left || []).forEach((entry) => { const element = entry; - if (element && element.hasOwnProperty('id')) { + if (element && Object.prototype.hasOwnProperty.call(element, 'id')) { map[element.id] = element; } else { result.push(element); @@ -144,7 +144,7 @@ export const mergeArrays = (left: any[], right: any[]): any[] => { (right || []).forEach((entry) => { const element = entry; - if (element && element.hasOwnProperty('id') && map[element.id]) { + if (element && Object.prototype.hasOwnProperty.call(element, 'id') && map[element.id]) { const merged = mergeObjects(map[element.id], element); map[element.id] = merged; } else { diff --git a/lib/extensions/src/lib/services/app-extension.service.ts b/lib/extensions/src/lib/services/app-extension.service.ts index 9d4c4a6010..eb80a4c6c4 100644 --- a/lib/extensions/src/lib/services/app-extension.service.ts +++ b/lib/extensions/src/lib/services/app-extension.service.ts @@ -79,7 +79,7 @@ export class AppExtensionService { return true; } - if (extension.rules && extension.rules.disabled) { + if (extension.rules?.disabled) { return this.extensionService.evaluateRule(extension.rules.disabled); } } diff --git a/lib/extensions/src/lib/services/extension-loader.service.ts b/lib/extensions/src/lib/services/extension-loader.service.ts index adf254c19b..92176a283b 100644 --- a/lib/extensions/src/lib/services/extension-loader.service.ts +++ b/lib/extensions/src/lib/services/extension-loader.service.ts @@ -42,7 +42,7 @@ export class ExtensionLoaderService { config = JSON.parse(override); } - if (!config.$references || !config.$references.length) { + if (!config.$references?.length) { config.$references = this.filterIgnoredExtensions(extensions || [], config.$ignoreReferenceList); } else { config.$references = this.filterIgnoredExtensions(config.$references, config.$ignoreReferenceList); @@ -102,7 +102,7 @@ export class ExtensionLoaderService { } getRules(config: ExtensionConfig): Array { - if (config && config.rules) { + if (config?.rules) { return config.rules; } return []; @@ -170,10 +170,10 @@ export class ExtensionLoaderService { } private filterIgnoredExtensions(extensions: Array, ignoreReferenceList: string[]): Array { - if (!ignoreReferenceList || !ignoreReferenceList.length) { + if (!ignoreReferenceList?.length) { return extensions; } - return extensions.map((file: string) => file.match('(?!.*\/).+')[0]).filter((fileName: string) => !ignoreReferenceList.includes(fileName)); + return extensions.map((file: string) => file.match('(?!.*/).+')[0]).filter((fileName: string) => !ignoreReferenceList.includes(fileName)); } } diff --git a/lib/extensions/src/lib/services/extension.service.spec.ts b/lib/extensions/src/lib/services/extension.service.spec.ts index 935aee2861..4d1962db30 100644 --- a/lib/extensions/src/lib/services/extension.service.spec.ts +++ b/lib/extensions/src/lib/services/extension.service.spec.ts @@ -68,8 +68,8 @@ describe('ExtensionService', () => { } }); - const requestedFeatue = service.getFeature('searchedArrayFeature'); - expect(requestedFeatue).toEqual(searchedArrayFeature); + const requestedFeature = service.getFeature('searchedArrayFeature'); + expect(requestedFeature).toEqual(searchedArrayFeature); }); it('should return object if seached feature is an object', async () => { @@ -81,16 +81,16 @@ describe('ExtensionService', () => { } }); - const requestedFeatue = service.getFeature<{ test: string }>('searchedObjectFeature'); - expect(requestedFeatue).toEqual(searchedObjectFeature); + const requestedFeature = service.getFeature<{ test: string }>('searchedObjectFeature'); + expect(requestedFeature).toEqual(searchedObjectFeature); }); it('should return default value if feature is not found', async () => { const defaultValue = {}; service.setup(blankConfig); - const requestedFeatue = service.getFeature<{ test: string }>('searchedFeature', defaultValue); - expect(requestedFeatue).toEqual(defaultValue); + const requestedFeature = service.getFeature<{ test: string }>('searchedFeature', defaultValue); + expect(requestedFeature).toEqual(defaultValue); }); }); diff --git a/lib/extensions/src/lib/services/extension.service.ts b/lib/extensions/src/lib/services/extension.service.ts index 647da21d52..c78bd3e58f 100644 --- a/lib/extensions/src/lib/services/extension.service.ts +++ b/lib/extensions/src/lib/services/extension.service.ts @@ -123,7 +123,7 @@ export class ExtensionService { */ getFeature(key: string | string[], defaultValue: any = []): T { const properties: string[] = Array.isArray(key) ? key : key.split('.'); - return properties.reduce((prev, curr) => prev && prev[curr], this.features) || defaultValue; + return properties.reduce((prev, curr) => prev?.[curr], this.features) || defaultValue; } getElements(key: string, fallback: Array = []): Array { diff --git a/lib/extensions/src/lib/services/rule.service.ts b/lib/extensions/src/lib/services/rule.service.ts index ac902cfba5..44ad3a709e 100644 --- a/lib/extensions/src/lib/services/rule.service.ts +++ b/lib/extensions/src/lib/services/rule.service.ts @@ -62,7 +62,7 @@ export class RuleService { * @returns RuleEvaluator or null if not found */ getEvaluator(key: string): RuleEvaluator { - if (key && key.startsWith('!')) { + if (key?.startsWith('!')) { const fn = this.evaluators[key.substring(1)]; return (context: RuleContext, ...args: RuleParameter[]): boolean => !fn(context, ...args); } diff --git a/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.ts b/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.ts index e22a1c6c15..875d29e4b5 100644 --- a/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.ts +++ b/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.ts @@ -175,7 +175,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On onValueChanged(values: any) { this.formValueChanged.emit(values); - if (this.reportForm && this.reportForm.valid) { + if (this.reportForm?.valid) { this.submit(values); } } @@ -306,7 +306,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On } ngAfterContentChecked() { - if (this.reportForm && this.reportForm.valid) { + if (this.reportForm?.valid) { this.reportForm.markAsDirty(); } } @@ -320,7 +320,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On } isFormValid() { - return this.reportForm && this.reportForm.dirty && this.reportForm.valid; + return this.reportForm?.dirty && this.reportForm.valid; } get taskGroup(): UntypedFormGroup { diff --git a/lib/insights/src/lib/diagram/components/diagram.component.ts b/lib/insights/src/lib/diagram/components/diagram.component.ts index 8b97c61f37..fba8c15283 100644 --- a/lib/insights/src/lib/diagram/components/diagram.component.ts +++ b/lib/insights/src/lib/diagram/components/diagram.component.ts @@ -117,7 +117,7 @@ export class DiagramComponent implements OnChanges { setMetricValueToDiagramElement(diagram: DiagramModel, metrics: any, metricType: string) { for (const key in metrics) { - if (metrics.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(metrics, key)) { const foundElement: DiagramElementModel = diagram.elements.find( (element: DiagramElementModel) => element.id === key); if (foundElement) { diff --git a/lib/insights/src/lib/diagram/models/chart/bar-chart.model.ts b/lib/insights/src/lib/diagram/models/chart/bar-chart.model.ts index 669ac52474..aa70cd3403 100644 --- a/lib/insights/src/lib/diagram/models/chart/bar-chart.model.ts +++ b/lib/insights/src/lib/diagram/models/chart/bar-chart.model.ts @@ -40,8 +40,8 @@ export class BarChart extends Chart { constructor(obj?: any) { super(obj); - this.xAxisType = obj && obj.xAxisType || null; - this.yAxisType = obj && obj.yAxisType || null; + this.xAxisType = obj?.xAxisType || null; + this.yAxisType = obj?.yAxisType || null; this.options.scales.xAxes[0].ticks.callback = this.xAxisTickFormatFunction(this.xAxisType); this.options.scales.yAxes[0].ticks.callback = this.yAxisTickFormatFunction(this.yAxisType); if (obj.values) { diff --git a/lib/insights/src/lib/diagram/services/diagram-color.service.ts b/lib/insights/src/lib/diagram/services/diagram-color.service.ts index 2adce69277..7ecabeeb83 100644 --- a/lib/insights/src/lib/diagram/services/diagram-color.service.ts +++ b/lib/insights/src/lib/diagram/services/diagram-color.service.ts @@ -34,7 +34,7 @@ export class DiagramColorService { } getFillColour(key: string) { - if (this.totalColors?.hasOwnProperty(key)) { + if (this.totalColors && Object.prototype.hasOwnProperty.call(this.totalColors, key)) { const colorPercentage = this.totalColors[key]; return this.convertColorToHsb(colorPercentage); } else { diff --git a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts index 3b615c2670..50a2487ad0 100644 --- a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.spec.ts @@ -578,7 +578,7 @@ describe('FormCloudComponent', () => { spyOn(formComponent, 'handleError').and.stub(); spyOn(formCloudService, 'getTaskForm').and.callFake(() => throwError(error)); - formComponent.getFormByTaskId('test-app', '123').then((_) => { + formComponent.getFormByTaskId('test-app', '123').then(() => { expect(formComponent.handleError).toHaveBeenCalledWith(error); done(); }); @@ -1049,7 +1049,7 @@ describe('FormCloudComponent', () => { pfx_property_five: 'orange', pfx_property_none: 'no_form_field' }, 'Complete', 123).subscribe({ - next: _ => done.fail('expected an error, not data'), + next: () => done.fail('expected an error, not data'), error: error => { expect(error).toBe(errorMessage); expect(formComponent.disableSaveButton).toBeFalse(); diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts index d41566e704..13f17aa618 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/attach-file/attach-file-cloud-widget.component.ts @@ -94,7 +94,7 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent i this.contentModelFormFileHandler(files[0]); } this.field.params.displayableCMProperties = this.field.params.displayableCMProperties ?? []; - this.displayedColumns.splice(2, 0, ...this.field.params.displayableCMProperties?.map(property => property?.name)); + this.displayedColumns.splice(2, 0, ...(this.field.params.displayableCMProperties?.map(property => property?.name) || [])); } isPathStaticType(): boolean { diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.ts b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.ts index f8ce4f9651..f86b3ef034 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/data-table/data-table.widget.ts @@ -128,7 +128,7 @@ export class DataTableWidgetComponent extends WidgetComponent implements OnInit const properties = path.split('.'); const currentProperty = properties.shift(); - if (!data.hasOwnProperty(currentProperty)) { + if (!Object.prototype.hasOwnProperty.call(data, currentProperty)) { return []; } diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/dropdown/dropdown-cloud.widget.ts b/lib/process-services-cloud/src/lib/form/components/widgets/dropdown/dropdown-cloud.widget.ts index bbfed58e9b..a53b52bb43 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/dropdown/dropdown-cloud.widget.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/dropdown/dropdown-cloud.widget.ts @@ -132,7 +132,7 @@ export class DropdownCloudWidgetComponent extends WidgetComponent implements OnI const properties = path.split('.'); const currentProperty = properties.shift(); - if (!data.hasOwnProperty(currentProperty)) { + if (!Object.prototype.hasOwnProperty.call(data, currentProperty)) { this.handleError(`${currentProperty} not found in ${JSON.stringify(data)}`); this.variableOptionsFailed = true; return []; diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts index 3b4227cd4d..309b82ff45 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts @@ -213,7 +213,7 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges, OnDes getFormControlsConfig(processFilterProperties: ProcessFilterProperties[]): any { const properties = processFilterProperties.map((property) => { - if (!!property.attributes) { + if (property.attributes) { return this.getAttributesControlConfig(property); } else { return { [property.key]: property.value }; @@ -288,7 +288,7 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges, OnDes } if (this.filterProperties.includes('initiator')) { - this.initiatorOptions = !!this.processFilter.initiator + this.initiatorOptions = this.processFilter.initiator ? this.processFilter.initiator.split(',').map((username) => Object.assign({}, { username })) : []; } diff --git a/lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts b/lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts index 5777d6c45e..259a42735d 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts @@ -19,7 +19,7 @@ import { DateCloudFilterType } from '../../../models/date-cloud-filter.model'; import { DateRangeFilterService } from '../../../common/date-range-filter/date-range-filter.service'; -import { ComponentSelectionMode } from '../../../types'; +import { ComponentSelectionMode } from '../../../types'; export class ProcessFilterCloudModel { id: string; diff --git a/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts b/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts index 4ce62f3b70..c824d92cee 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts @@ -40,17 +40,17 @@ export class ProcessFilterCloudService { readQueryParams(obj: any): ProcessFilterCloudModel { const model = Object.assign({}, obj) as ProcessFilterCloudModel; - if (obj.hasOwnProperty('appVersion') && obj['appVersion']) { + if (Object.prototype.hasOwnProperty.call(obj, 'appVersion') && obj['appVersion']) { if (typeof obj['appVersion'] === 'string') { model.appVersion = obj['appVersion'].split(',').map((str) => parseInt(str, 10)); } } - if (obj.hasOwnProperty('lastModifiedFrom')) { + if (Object.prototype.hasOwnProperty.call(obj, 'lastModifiedFrom')) { model.lastModifiedFrom = new Date(parseInt(obj['lastModifiedFrom'], 10)); } - if (obj.hasOwnProperty('lastModifiedTo')) { + if (Object.prototype.hasOwnProperty.call(obj, 'lastModifiedTo')) { model.lastModifiedTo = new Date(parseInt(obj['lastModifiedTo'], 10)); } @@ -82,7 +82,7 @@ export class ProcessFilterCloudService { if (value['lastModifiedTo']) { result['lastModifiedTo'] = value['lastModifiedTo'].valueOf(); } - } else if (value.hasOwnProperty(prop)) { + } else if (Object.prototype.hasOwnProperty.call(value, prop)) { result[prop] = value[prop]; } } diff --git a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts index 9b129c0283..5ba14d8764 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts @@ -365,7 +365,7 @@ export class ProcessListCloudComponent } private isPropertyChanged(changes: SimpleChanges, property: string): boolean { - return changes.hasOwnProperty(property); + return Object.prototype.hasOwnProperty.call(changes, property); } isListEmpty(): boolean { diff --git a/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts b/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts index dc80422f6b..51a0d10726 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts @@ -107,7 +107,7 @@ export class ProcessListCloudService extends BaseCloudService { const queryParam = {}; for (const property in requestNode) { - if (requestNode.hasOwnProperty(property) && !this.isExcludedField(property) && this.isPropertyValueValid(requestNode, property)) { + if (Object.prototype.hasOwnProperty.call(requestNode, property) && !this.isExcludedField(property) && this.isPropertyValueValid(requestNode, property)) { queryParam[property] = this.getQueryParamValueFromRequestNode(requestNode, property as keyof ProcessQueryCloudRequestModel); } } diff --git a/lib/process-services-cloud/src/lib/process/process-list/services/process-task-list-cloud.service.ts b/lib/process-services-cloud/src/lib/process/process-list/services/process-task-list-cloud.service.ts index 4755b8687b..a3dd5bf625 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/services/process-task-list-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/services/process-task-list-cloud.service.ts @@ -60,7 +60,7 @@ export class ProcessTaskListCloudService extends BaseCloudService implements Tas protected buildQueryParams(requestNode: TaskQueryCloudRequestModel): any { const queryParam: any = {}; for (const property in requestNode) { - if (requestNode.hasOwnProperty(property) && !this.isExcludedField(property) && this.isPropertyValueValid(requestNode, property)) { + if (Object.prototype.hasOwnProperty.call(requestNode, property) && !this.isExcludedField(property) && this.isPropertyValueValid(requestNode, property)) { queryParam[property] = requestNode[property]; } } diff --git a/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.ts b/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.ts index 11a9a26882..49b6b65e55 100755 --- a/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.ts @@ -377,7 +377,7 @@ export class StartProcessCloudComponent implements OnChanges, OnInit, OnDestroy } getProcessDefinitionValue(process: ProcessDefinitionCloud): string { - return !!process.name ? process.name : process.key; + return process.name ? process.name : process.key; } get processInstanceName(): UntypedFormControl { diff --git a/lib/process-services-cloud/src/lib/services/notification-cloud.service.ts b/lib/process-services-cloud/src/lib/services/notification-cloud.service.ts index 472c0ef742..517b632d1f 100644 --- a/lib/process-services-cloud/src/lib/services/notification-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/services/notification-cloud.service.ts @@ -81,7 +81,7 @@ export class NotificationCloudService extends BaseCloudService { if (graphQLErrors) { for (const err of graphQLErrors) { switch (err.extensions.code) { - case 'UNAUTHENTICATED': + case 'UNAUTHENTICATED': { const oldHeaders = operation.getContext().headers; operation.setContext({ headers: { @@ -92,7 +92,9 @@ export class NotificationCloudService extends BaseCloudService { }); forward(operation); break; + } default: + break; } } } diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/base-edit-task-filter-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/base-edit-task-filter-cloud.component.ts index 6a16930dd4..21bda735c5 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/base-edit-task-filter-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/base-edit-task-filter-cloud.component.ts @@ -434,7 +434,7 @@ export abstract class BaseEditTaskFilterCloudComponent implements OnInit, OnC getFormControlsConfig(taskFilterProperties: TaskFilterProperties[]): any { const properties = taskFilterProperties.map((property) => { - if (!!property.attributes) { + if (property.attributes) { return this.getAttributesControlConfig(property); } else { return { [property.key]: property.value }; diff --git a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts index 33b70f9ad3..5f4ad99a3d 100644 --- a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts @@ -318,7 +318,7 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy, OnChanges { } hasAssignee(): boolean { - return !!this.taskDetails.assignee ? true : false; + return this.taskDetails.assignee ? true : false; } isTaskValid(): boolean { diff --git a/lib/process-services-cloud/src/lib/task/task-list/services/service-task-list-cloud.service.ts b/lib/process-services-cloud/src/lib/task/task-list/services/service-task-list-cloud.service.ts index fc2c2c3c9e..789cf4d45b 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/services/service-task-list-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/services/service-task-list-cloud.service.ts @@ -86,7 +86,7 @@ export class ServiceTaskListCloudService extends BaseCloudService { protected buildQueryParams(requestNode: ServiceTaskQueryCloudRequestModel): any { const queryParam: any = {}; for (const property in requestNode) { - if (requestNode.hasOwnProperty(property) && + if (Object.prototype.hasOwnProperty.call(requestNode, property) && !this.isExcludedField(property) && this.isPropertyValueValid(requestNode, property)) { queryParam[property] = requestNode[property]; diff --git a/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts b/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts index d9a53f511d..4c0975e6cf 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts @@ -61,7 +61,7 @@ export class TaskListCloudService extends BaseCloudService implements TaskListCl const queryParam: any = {}; for (const propertyKey in requestNode) { if ( - requestNode.hasOwnProperty(propertyKey) && + Object.prototype.hasOwnProperty.call(requestNode, propertyKey) && !this.isExcludedField(propertyKey) && this.isPropertyValueValid(requestNode, propertyKey) ) { diff --git a/lib/process-services/src/lib/form/form.component.spec.ts b/lib/process-services/src/lib/form/form.component.spec.ts index 74eaeb6315..e80cdc1356 100644 --- a/lib/process-services/src/lib/form/form.component.spec.ts +++ b/lib/process-services/src/lib/form/form.component.spec.ts @@ -454,7 +454,7 @@ describe('FormComponent', () => { }); it('should fetch and parse form by task id', (done) => { - spyOn(taskService, 'getTask').and.returnValue(of({})); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); spyOn(taskFormService, 'getTaskForm').and.callFake((currentTaskId) => new Observable((observer) => { observer.next({taskId: currentTaskId}); observer.complete(); @@ -475,25 +475,25 @@ describe('FormComponent', () => { it('should handle error when getting form by task id', (done) => { const error = 'Some error'; - spyOn(taskService, 'getTask').and.returnValue(of({})); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); spyOn(formComponent, 'handleError').and.stub(); spyOn(taskFormService, 'getTaskForm').and.callFake(() => throwError(error)); - formComponent.getFormByTaskId('123').then((_) => { + formComponent.getFormByTaskId('123').then(() => { expect(formComponent.handleError).toHaveBeenCalledWith(error); done(); }); }); it('should apply readonly state when getting form by task id', (done) => { - spyOn(taskService, 'getTask').and.returnValue(of({})); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); spyOn(taskFormService, 'getTaskForm').and.callFake((taskId) => new Observable((observer) => { observer.next({taskId}); observer.complete(); })); formComponent.readOnly = true; - formComponent.getFormByTaskId('123').then((_) => { + formComponent.getFormByTaskId('123').then(() => { expect(formComponent.form).toBeDefined(); expect(formComponent.form.readOnly).toBe(true); done(); diff --git a/lib/process-services/src/lib/form/form.component.visibility.spec.ts b/lib/process-services/src/lib/form/form.component.visibility.spec.ts index 7b2981e5e9..34c33ad457 100644 --- a/lib/process-services/src/lib/form/form.component.visibility.spec.ts +++ b/lib/process-services/src/lib/form/form.component.visibility.spec.ts @@ -22,9 +22,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { - formDefinitionDropdownField, formDefinitionTwoTextFields, + formDefinitionDropdownField, + formDefinitionTwoTextFields, formDefinitionRequiredField, - formDefVisibilitiFieldDependsOnNextOne, formDefVisibilitiFieldDependsOnPreviousOne, + formDefVisibilityFieldDependsOnNextOne, + formDefVisibilitiFieldDependsOnPreviousOne, formReadonlyTwoTextFields } from '@alfresco/adf-core'; import { FormComponent } from './form.component'; @@ -47,10 +49,7 @@ describe('FormComponent UI and visibility', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - ProcessTestingModule - ], + imports: [TranslateModule.forRoot(), ProcessTestingModule], schemas: [CUSTOM_ELEMENTS_SCHEMA] }); fixture = TestBed.createComponent(FormComponent); @@ -64,13 +63,12 @@ describe('FormComponent UI and visibility', () => { }); describe('Validation icon', () => { - it('should display valid icon for valid form', () => { - spyOn(taskService, 'getTask').and.returnValue(of({})); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefinitionTwoTextFields)); const change = new SimpleChange(null, 1, true); - component.ngOnChanges({taskId: change}); + component.ngOnChanges({ taskId: change }); fixture.detectChanges(); expect(fixture.debugElement.query(By.css('#adf-valid-form-icon'))).toBeDefined(); expect(fixture.debugElement.query(By.css('#adf-valid-form-icon'))).not.toBeNull(); @@ -78,11 +76,11 @@ describe('FormComponent UI and visibility', () => { }); it('should display invalid icon for valid form', () => { - spyOn(taskService, 'getTask').and.returnValue(of({})); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefinitionRequiredField)); const change = new SimpleChange(null, 1, true); - component.ngOnChanges({taskId: change}); + component.ngOnChanges({ taskId: change }); fixture.detectChanges(); expect(fixture.debugElement.query(By.css('#adf-valid-form-icon'))).toBeNull(); expect(fixture.debugElement.query(By.css('#adf-invalid-form-icon'))).toBeDefined(); @@ -90,11 +88,11 @@ describe('FormComponent UI and visibility', () => { }); it('should NOT display validation icon when [showValidationIcon] is false', () => { - spyOn(taskService, 'getTask').and.returnValue(of({})); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefinitionTwoTextFields)); const change = new SimpleChange(null, 1, true); - component.ngOnChanges({taskId: change}); + component.ngOnChanges({ taskId: change }); component.showValidationIcon = false; fixture.detectChanges(); expect(fixture.debugElement.query(By.css('#adf-valid-form-icon'))).toBeNull(); @@ -103,13 +101,12 @@ describe('FormComponent UI and visibility', () => { }); describe('form definition', () => { - it('should display two text fields form definition', () => { - spyOn(taskService, 'getTask').and.returnValue(of({})); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefinitionTwoTextFields)); const change = new SimpleChange(null, 1, true); - component.ngOnChanges({taskId: change}); + component.ngOnChanges({ taskId: change }); fixture.detectChanges(); const firstNameEl = fixture.debugElement.query(By.css('#firstname')); @@ -122,11 +119,11 @@ describe('FormComponent UI and visibility', () => { }); it('should display dropdown field', async () => { - spyOn(taskService, 'getTask').and.returnValue(of({})); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefinitionDropdownField)); const change = new SimpleChange(null, 1, true); - component.ngOnChanges({taskId: change}); + component.ngOnChanges({ taskId: change }); fixture.detectChanges(); await fixture.whenStable(); @@ -154,13 +151,12 @@ describe('FormComponent UI and visibility', () => { }); describe('Visibility conditions', () => { - it('should hide the field based on the next one', () => { - spyOn(taskService, 'getTask').and.returnValue(of({})); - spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefVisibilitiFieldDependsOnNextOne)); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); + spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefVisibilityFieldDependsOnNextOne)); const change = new SimpleChange(null, 1, true); - component.ngOnChanges({taskId: change}); + component.ngOnChanges({ taskId: change }); fixture.detectChanges(); const firstEl = fixture.debugElement.query(By.css('#field-country-container')); @@ -173,11 +169,11 @@ describe('FormComponent UI and visibility', () => { }); it('should hide the field based on the previous one', () => { - spyOn(taskService, 'getTask').and.returnValue(of({})); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefVisibilitiFieldDependsOnPreviousOne)); const change = new SimpleChange(null, 1, true); - component.ngOnChanges({taskId: change}); + component.ngOnChanges({ taskId: change }); fixture.detectChanges(); const firstEl = fixture.debugElement.query(By.css('#name')); @@ -190,11 +186,11 @@ describe('FormComponent UI and visibility', () => { }); it('should show the hidden field when the visibility condition change to true', () => { - spyOn(taskService, 'getTask').and.returnValue(of({})); - spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefVisibilitiFieldDependsOnNextOne)); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); + spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefVisibilityFieldDependsOnNextOne)); const change = new SimpleChange(null, 1, true); - component.ngOnChanges({taskId: change}); + component.ngOnChanges({ taskId: change }); fixture.detectChanges(); let firstEl = fixture.debugElement.query(By.css('#field-country-container')); @@ -215,11 +211,11 @@ describe('FormComponent UI and visibility', () => { describe('Readonly Form', () => { it('should display two text fields readonly', async () => { - spyOn(taskService, 'getTask').and.returnValue(of({})); + spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation)); spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formReadonlyTwoTextFields)); const change = new SimpleChange(null, 1, true); - component.ngOnChanges({taskId: change}); + component.ngOnChanges({ taskId: change }); fixture.detectChanges(); await fixture.whenStable(); diff --git a/lib/process-services/src/lib/form/start-form.component.mock.ts b/lib/process-services/src/lib/form/start-form.component.mock.ts index aeaf81e9fa..685152efc5 100644 --- a/lib/process-services/src/lib/form/start-form.component.mock.ts +++ b/lib/process-services/src/lib/form/start-form.component.mock.ts @@ -1195,7 +1195,7 @@ export const preselectedSingleNode = { ] }; -export const preselectedMultipleeNode = { +export const preselectedMultipleNodes = { 'fake-multiple-upload': [ { id: 1027, diff --git a/lib/process-services/src/lib/form/start-form.component.spec.ts b/lib/process-services/src/lib/form/start-form.component.spec.ts index de00ae8d9b..47ab7da678 100644 --- a/lib/process-services/src/lib/form/start-form.component.spec.ts +++ b/lib/process-services/src/lib/form/start-form.component.spec.ts @@ -22,7 +22,7 @@ import { startFormDateWidgetMock, startFormDropdownDefinitionMock, startFormTextDefinitionMock, startMockForm, startMockFormWithTab, startFormAmountWidgetMock, startFormNumberWidgetMock, startFormRadioButtonWidgetMock, - taskFormSingleUploadMock, taskFormMultipleUploadMock, preselectedSingleNode, preselectedMultipleeNode + taskFormSingleUploadMock, taskFormMultipleUploadMock, preselectedSingleNode, preselectedMultipleNodes } from './start-form.component.mock'; import { StartFormComponent } from './start-form.component'; import { WidgetVisibilityService, FormModel, FormOutcomeModel } from '@alfresco/adf-core'; @@ -106,12 +106,12 @@ describe('StartFormComponent', () => { it('should be able to inject multiple files as value into the form with an upload multiple widget', () => { getStartFormSpy.and.returnValue(of(taskFormMultipleUploadMock)); - component.data = preselectedMultipleeNode; + component.data = preselectedMultipleNodes; component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId1, true) }); expect(component.form.getFieldById('fake-multiple-upload').value).toBeDefined(); expect(component.form.getFieldById('fake-multiple-upload').value.length).toBe(2); - expect(component.form.getFieldById('fake-multiple-upload').value).toBe(preselectedMultipleeNode['fake-multiple-upload']); + expect(component.form.getFieldById('fake-multiple-upload').value).toBe(preselectedMultipleNodes['fake-multiple-upload']); }); it('should show outcome buttons by default', () => { diff --git a/lib/process-services/src/lib/people/components/people/people.component.ts b/lib/process-services/src/lib/people/components/people/people.component.ts index 70cd683129..9009eecc17 100644 --- a/lib/process-services/src/lib/people/components/people/people.component.ts +++ b/lib/process-services/src/lib/people/components/people/people.component.ts @@ -79,7 +79,7 @@ export class PeopleComponent { } involveUser(user: UserProcessModel) { - if (user && user.id) { + if (user?.id) { this.peopleProcessService .involveUserWithTask(this.taskId, user.id.toString()) .subscribe( @@ -116,7 +116,7 @@ export class PeopleComponent { } onClickAction(event: UserEventModel) { - if (event && event.value && event.type === 'remove') { + if (event?.value && event.type === 'remove') { this.removeInvolvedUser(event.value); } } diff --git a/lib/process-services/src/lib/process-list/components/process-audit.directive.spec.ts b/lib/process-services/src/lib/process-list/components/process-audit.directive.spec.ts index 2c3bce3f22..79a3a43f44 100644 --- a/lib/process-services/src/lib/process-list/components/process-audit.directive.spec.ts +++ b/lib/process-services/src/lib/process-list/components/process-audit.directive.spec.ts @@ -147,6 +147,7 @@ describe('ProcessAuditDirective', () => { const auditJson = { processInstanceId: 42516, processInstanceName: 'Fake Process - August 3rd 2017', processDefinitionName: 'Claim Approval Process', processDefinitionVersion: 1, processInstanceStartTime: 'Thu Aug 03 15:32:47 UTC 2017', processInstanceEndTime: null, + // eslint-disable-next-line @cspell/spellchecker processInstanceDurationInMillis: null, processInstanceInitiator: 'MyName MyLastname', entries: [{ @@ -156,6 +157,7 @@ describe('ProcessAuditDirective', () => { fieldId: 'username', value: 'dsassd' }, { fieldName: 'Claim Amount', fieldId: 'claimamount', value: '22' }], taskName: null, taskAssignee: null, activityId: null, + // eslint-disable-next-line @cspell/spellchecker activityName: null, activityType: null, startTime: null, endTime: null, durationInMillis: null } ], decisionInfo: { calculatedValues: [], appliedRules: [] } diff --git a/lib/process-services/src/lib/process-list/components/process-list.component.spec.ts b/lib/process-services/src/lib/process-list/components/process-list.component.spec.ts index 37bb7aeac7..93a66e5812 100644 --- a/lib/process-services/src/lib/process-list/components/process-list.component.spec.ts +++ b/lib/process-services/src/lib/process-list/components/process-list.component.spec.ts @@ -42,7 +42,7 @@ describe('ProcessInstanceListComponent', () => { let getProcessInstancesSpy: jasmine.Spy; let appConfig: AppConfigService; - const resolverfn = (row: DataRow, col: DataColumn) => { + const resolverFn = (row: DataRow, col: DataColumn) => { const value = row.getValue(col.key); if (col.key === 'variables') { return (value || []).map((processVar) => `${processVar.name} - ${processVar.value}`).toString(); @@ -293,7 +293,7 @@ describe('ProcessInstanceListComponent', () => { } }; component.presetColumn = 'fakeProcessCustomSchema'; - component.resolverFn = resolverfn; + component.resolverFn = resolverFn; component.reload(); fixture.detectChanges(); @@ -458,7 +458,7 @@ describe('ProcessInstanceListComponent', () => { @Component({ template: ` - + @@ -554,7 +554,7 @@ describe('Process List: Custom EmptyTemplateComponent', () => { [appId]="appId" [showContextMenu]="true" (showRowContextMenu)="onShowRowContextMenu($event)" - #processlistComponentInstance> + #processListComponentInstance> diff --git a/lib/process-services/src/lib/process-list/components/start-process.component.ts b/lib/process-services/src/lib/process-list/components/start-process.component.ts index 121b2f67ff..7e69b5c568 100644 --- a/lib/process-services/src/lib/process-list/components/start-process.component.ts +++ b/lib/process-services/src/lib/process-list/components/start-process.component.ts @@ -329,7 +329,7 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit, OnDestr const accountIdentifier = this.getAlfrescoRepositoryName(); for (const key in this.values) { - if (this.values.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(this.values, key)) { const currentValue = Array.isArray(this.values[key]) ? this.values[key] : [this.values[key]]; const contents = currentValue .filter((value: any) => !!value?.isFile) diff --git a/lib/process-services/src/lib/process-list/services/process-filter.service.spec.ts b/lib/process-services/src/lib/process-list/services/process-filter.service.spec.ts index 9ecb2a812f..538c56a938 100644 --- a/lib/process-services/src/lib/process-list/services/process-filter.service.spec.ts +++ b/lib/process-services/src/lib/process-list/services/process-filter.service.spec.ts @@ -212,7 +212,7 @@ describe('Process filter', () => { describe('add filter', () => { beforeEach(() => { createFilter = spyOn(service['userFiltersApi'], 'createUserProcessInstanceFilter').and.callFake( - (processfilter: FilterProcessRepresentationModel) => Promise.resolve(processfilter) + (processFilter) => Promise.resolve(processFilter) ); }); diff --git a/lib/process-services/src/lib/task-list/components/task-details.component.spec.ts b/lib/process-services/src/lib/task-list/components/task-details.component.spec.ts index b2697659fa..7337eb537c 100644 --- a/lib/process-services/src/lib/task-list/components/task-details.component.spec.ts +++ b/lib/process-services/src/lib/task-list/components/task-details.component.spec.ts @@ -84,7 +84,7 @@ describe('TaskDetailsComponent', () => { logService = TestBed.inject(LogService); peopleProcessService = TestBed.inject(PeopleProcessService); - spyOn(peopleProcessService, 'getCurrentUserInfo').and.returnValue(of({ email: 'fake-email' })); + spyOn(peopleProcessService, 'getCurrentUserInfo').and.returnValue(of({ email: 'fake-email' } as any)); taskListService = TestBed.inject(TaskListService); spyOn(taskListService, 'getTaskChecklist').and.returnValue(of(noDataMock)); diff --git a/lib/process-services/src/lib/task-list/components/task-form/task-form.component.spec.ts b/lib/process-services/src/lib/task-list/components/task-form/task-form.component.spec.ts index 9bb5f151cf..30a0911b15 100644 --- a/lib/process-services/src/lib/task-list/components/task-form/task-form.component.spec.ts +++ b/lib/process-services/src/lib/task-list/components/task-form/task-form.component.spec.ts @@ -83,7 +83,7 @@ describe('TaskFormComponent', () => { taskDetailsMock.processDefinitionId = null; spyOn(taskService, 'getTask').and.returnValue(of(taskDetailsMock)); peopleProcessService = TestBed.inject(PeopleProcessService); - getBpmLoggedUserSpy = spyOn(peopleProcessService, 'getCurrentUserInfo').and.returnValue(of(fakeUser)); + getBpmLoggedUserSpy = spyOn(peopleProcessService, 'getCurrentUserInfo').and.returnValue(of(fakeUser as any)); }); afterEach(async () => { @@ -106,11 +106,11 @@ describe('TaskFormComponent', () => { getTaskDetailsSpy.and.returnValue(of(taskDetailsMock)); fixture.detectChanges(); await fixture.whenStable(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1'); const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2'); const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(inputFieldOne['disabled']).toEqual(false); expect(inputFieldTwo['disabled']).toEqual(false); expect(inputFieldThree['disabled']).toEqual(false); @@ -144,9 +144,9 @@ describe('TaskFormComponent', () => { component.taskId = '123'; fixture.detectChanges(); await fixture.whenStable(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const completeButton = fixture.debugElement.nativeElement.querySelector('#adf-form-complete'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(completeButton['disabled']).toEqual(false); completeButton.click(); expect(completeTaskFormSpy).toHaveBeenCalled(); @@ -192,11 +192,11 @@ describe('TaskFormComponent', () => { getTaskDetailsSpy.and.returnValue(of(claimableTaskDetailsMock)); fixture.detectChanges(); await fixture.whenStable(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1'); const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2'); const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(inputFieldOne['disabled']).toEqual(true); expect(inputFieldTwo['disabled']).toEqual(true); expect(inputFieldThree['disabled']).toEqual(true); @@ -271,11 +271,11 @@ describe('TaskFormComponent', () => { getTaskDetailsSpy.and.returnValue(of(completedTaskDetailsMock)); fixture.detectChanges(); await fixture.whenStable(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1'); const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2'); const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(inputFieldOne['disabled']).toEqual(true); expect(inputFieldTwo['disabled']).toEqual(true); expect(inputFieldThree['disabled']).toEqual(true); @@ -352,9 +352,9 @@ describe('TaskFormComponent', () => { component.taskDetails = new TaskDetailsModel(taskDetailsWithOutFormMock); fixture.detectChanges(); await fixture.whenStable(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const completeButtonElement = fixture.debugElement.nativeElement.querySelector('#adf-no-form-complete-button'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(completeButtonElement['disabled']).toEqual(false); completeButtonElement.click(); expect(errorSpy).toHaveBeenCalled(); @@ -592,10 +592,10 @@ describe('TaskFormComponent', () => { fixture.detectChanges(); await fixture.whenStable(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const completeButton = fixture.debugElement.nativeElement.querySelector('#adf-form-complete'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(completeButton['disabled']).toEqual(false); expect(component.isProcessInitiator()).toEqual(true); @@ -616,10 +616,10 @@ describe('TaskFormComponent', () => { expect(component.isProcessInitiator()).toEqual(true); expect(component.isCandidateMember()).toEqual(true); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const completeButton = fixture.debugElement.nativeElement.querySelector('#adf-form-complete'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(completeButton['disabled']).toEqual(true); }); @@ -638,10 +638,10 @@ describe('TaskFormComponent', () => { fixture.detectChanges(); await fixture.whenStable(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const completeButton = fixture.debugElement.nativeElement.querySelector('#adf-form-complete'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(component.canInitiatorComplete()).toEqual(false); expect(component.isProcessInitiator()).toEqual(false); expect(completeButton['disabled']).toEqual(false); @@ -824,10 +824,10 @@ describe('TaskFormComponent', () => { getTaskDetailsSpy.and.returnValue(of(involvedUserTaskForm)); fixture.detectChanges(); await fixture.whenStable(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const saveButton = fixture.debugElement.nativeElement.querySelector('[id="adf-form-save"]'); const completeButton = fixture.debugElement.nativeElement.querySelector('[id="adf-form-complete"]'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(saveButton.disabled).toEqual(false); expect(completeButton.disabled).toEqual(true); }); @@ -845,10 +845,10 @@ describe('TaskFormComponent', () => { getTaskDetailsSpy.and.returnValue(of(involvedGroupTaskForm)); fixture.detectChanges(); await fixture.whenStable(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const saveButton = fixture.debugElement.nativeElement.querySelector('[id="adf-form-save"]'); const completeButton = fixture.debugElement.nativeElement.querySelector('[id="adf-form-complete"]'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(saveButton.disabled).toEqual(false); expect(completeButton.disabled).toEqual(true); saveButton.click(); @@ -869,11 +869,11 @@ describe('TaskFormComponent', () => { await fixture.whenStable(); fixture.detectChanges(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1'); const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2'); const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(inputFieldOne['disabled']).toEqual(true, 'Task Form field is enabled'); expect(inputFieldTwo['disabled']).toEqual(true, 'Task Form field is enabled'); expect(inputFieldThree['disabled']).toEqual(true, 'Task Form field is enabled'); @@ -889,11 +889,11 @@ describe('TaskFormComponent', () => { await fixture.whenStable(); fixture.detectChanges(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1'); const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2'); const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(inputFieldOne['disabled']).toEqual(true, 'Task Form field is enabled'); expect(inputFieldTwo['disabled']).toEqual(true, 'Task Form field is enabled'); expect(inputFieldThree['disabled']).toEqual(true, 'Task Form field is enabled'); @@ -908,12 +908,12 @@ describe('TaskFormComponent', () => { await fixture.whenStable(); fixture.detectChanges(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1'); const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2'); const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(inputFieldOne['disabled']).toEqual(true); expect(inputFieldTwo['disabled']).toEqual(true); expect(inputFieldThree['disabled']).toEqual(true); @@ -929,12 +929,12 @@ describe('TaskFormComponent', () => { await fixture.whenStable(); fixture.detectChanges(); - const activitFormSelector = element.querySelector('adf-form'); + const formSelector = element.querySelector('adf-form'); const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1'); const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2'); const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3'); - expect(activitFormSelector).toBeDefined(); + expect(formSelector).toBeDefined(); expect(inputFieldOne['disabled']).toEqual(false, 'Task Form field is disabled'); expect(inputFieldTwo['disabled']).toEqual(false, 'Task Form field is disabled'); expect(inputFieldThree['disabled']).toEqual(false, 'Task Form field is disabled'); diff --git a/lib/process-services/src/lib/task-list/components/task-form/task-form.component.ts b/lib/process-services/src/lib/task-list/components/task-form/task-form.component.ts index a127f79bae..7e4babdf63 100644 --- a/lib/process-services/src/lib/task-list/components/task-form/task-form.component.ts +++ b/lib/process-services/src/lib/task-list/components/task-form/task-form.component.ts @@ -214,7 +214,7 @@ export class TaskFormComponent implements OnInit, OnChanges { } isStandaloneTask(): boolean { - return !!!this.taskDetails?.processDefinitionId; + return !this.taskDetails?.processDefinitionId; } isTaskLoaded(): boolean { diff --git a/lib/testing/src/lib/protractor/core/actions/identity/query.service.ts b/lib/testing/src/lib/protractor/core/actions/identity/query.service.ts index 463ae97cc6..7b98364c82 100644 --- a/lib/testing/src/lib/protractor/core/actions/identity/query.service.ts +++ b/lib/testing/src/lib/protractor/core/actions/identity/query.service.ts @@ -101,7 +101,7 @@ export class QueryService { const postBody = {}; const data = await this.api.performBpmOperation(path, method, queryParams, postBody); - return data.list && data.list.entries.length && data.list.entries.find(task => task.entry.name === taskName && task.entry.status === status); + return data.list?.entries.length && data.list.entries.find(task => task.entry.name === taskName && task.entry.status === status); } catch (error) { Logger.error('get process-instances tasks by status - Service error'); } diff --git a/lib/testing/src/lib/protractor/core/pages/data-table-component.page.ts b/lib/testing/src/lib/protractor/core/pages/data-table-component.page.ts index 867d1e00b0..e0bd10bc48 100644 --- a/lib/testing/src/lib/protractor/core/pages/data-table-component.page.ts +++ b/lib/testing/src/lib/protractor/core/pages/data-table-component.page.ts @@ -402,14 +402,14 @@ export class DataTableComponentPage { /** @deprecated use Playwright instead **/ async isColumnDisplayed(columnTitle: string): Promise { - const isColumnDisplated = (await this.allColumns).some( + const isColumnDisplayed = (await this.allColumns).some( async column => { const columnText = await column.getText(); return columnText === columnTitle; } ); - return isColumnDisplated; + return isColumnDisplayed; } /** @deprecated use Playwright instead **/ diff --git a/lib/testing/src/lib/protractor/core/utils/browser-visibility.ts b/lib/testing/src/lib/protractor/core/utils/browser-visibility.ts index 34190c1b73..2acbbdf205 100644 --- a/lib/testing/src/lib/protractor/core/utils/browser-visibility.ts +++ b/lib/testing/src/lib/protractor/core/utils/browser-visibility.ts @@ -26,13 +26,13 @@ export class BrowserVisibility { static DEFAULT_TIMEOUT = BrowserVisibility.getVisibleTimeout() ? browser.params.testConfig.timeouts.visible_timeout : 10000; static getVisibleTimeout() { - if (browser && browser.params && browser.params.testConfig && browser.params.testConfig.timeouts) { + if (browser?.params?.testConfig?.timeouts) { return browser.params.testConfig.timeouts.visible_timeout; } } static getNoVisibleTimeout() { - if (browser && browser.params && browser.params.testConfig && browser.params.testConfig.timeouts) { + if (browser?.params?.testConfig?.timeouts) { return browser.params.testConfig.timeouts.no_visible_timeout; } } @@ -91,7 +91,7 @@ export class BrowserVisibility { static async waitUntilElementHasValue(elementToCheck: ElementFinder, elementValue, waitTimeout: number = BrowserVisibility.DEFAULT_TIMEOUT): Promise { Logger.info(`Wait Until Element has value ${elementToCheck.locator().toString()} for ${waitTimeout}`); - return browser.wait(BrowserVisibility.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, `Element doesn\'t have a value ${elementValue} ${elementToCheck.locator()}`); + return browser.wait(BrowserVisibility.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, `Element doesn't have a value ${elementValue} ${elementToCheck.locator()}`); } /* @@ -100,7 +100,7 @@ export class BrowserVisibility { static async waitUntilElementHasText(elementToCheck: ElementFinder, text, waitTimeout: number = BrowserVisibility.DEFAULT_TIMEOUT): Promise { Logger.info(`Wait Until Element has value ${elementToCheck.locator().toString()} for ${waitTimeout}`); - return browser.wait(protractor.ExpectedConditions.textToBePresentInElement(elementToCheck, text), waitTimeout, `Element doesn\'t have the text ${text} ${elementToCheck.locator()}`); + return browser.wait(protractor.ExpectedConditions.textToBePresentInElement(elementToCheck, text), waitTimeout, `Element doesn't have the text ${text} ${elementToCheck.locator()}`); } static async waitUntilElementIsNotPresent(elementToCheck: ElementFinder, waitTimeout: number = BrowserVisibility.NOT_VISIBLE_DEFAULT_TIMEOUT): Promise { diff --git a/lib/testing/src/lib/protractor/core/utils/form.util.ts b/lib/testing/src/lib/protractor/core/utils/form.util.ts index f2e9afc4b8..137f72c85f 100644 --- a/lib/testing/src/lib/protractor/core/utils/form.util.ts +++ b/lib/testing/src/lib/protractor/core/utils/form.util.ts @@ -44,8 +44,7 @@ export class FormUtil { } async getFormByName(name: string): Promise { - // @ts-ignore - const forms: any = await this.editorApi.getForms(); + const forms: any = await this.editorApi.getForms(undefined); return forms.data.find((currentForm) => currentForm.name === name); } diff --git a/lib/testing/src/lib/protractor/process-services-cloud/resources/resources.ts b/lib/testing/src/lib/protractor/process-services-cloud/resources/resources.ts index d94eb5e4b1..764136022e 100644 --- a/lib/testing/src/lib/protractor/process-services-cloud/resources/resources.ts +++ b/lib/testing/src/lib/protractor/process-services-cloud/resources/resources.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +/* eslint-disable @cspell/spellchecker */ /* eslint-disable @typescript-eslint/naming-convention */ export const ACTIVITI_CLOUD_APPS = { diff --git a/nx.json b/nx.json index 4291bc49e4..99873b9743 100644 --- a/nx.json +++ b/nx.json @@ -35,7 +35,6 @@ }, "lint": { "dependsOn": [ - "spellcheck", "stylelint" ] } @@ -44,7 +43,7 @@ "default": { "runner": "nx/tasks-runners/default", "options": { - "cacheableOperations": ["build", "lint", "test", "spellcheck", "stylelint"], + "cacheableOperations": ["build", "lint", "test", "stylelint"], "cacheDirectory": "nxcache", "runtimeCacheInputs": ["node -v"] } diff --git a/package-lock.json b/package-lock.json index c706350b31..dc6d6756cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "@angular/platform-browser-dynamic": "14.1.3", "@angular/router": "14.1.3", "@apollo/client": "^3.7.10", + "@cspell/eslint-plugin": "^7.3.6", "@editorjs/editorjs": "^2.26.5", "@editorjs/header": "2.7.0", "@editorjs/list": "1.8.0", @@ -90,16 +91,17 @@ "@typescript-eslint/typescript-estree": "6.7.0", "ajv": "^8.12.0", "commander": "6.2.1", - "cspell": "^5.5.1", "css-loader": "^6.7.4", "dotenv": "16.1.3", "editorjs-text-color-plugin": "1.13.1", "eslint": "^8.47.0", + "eslint-config-prettier": "^8.10.0", "eslint-plugin-ban": "^1.6.0", "eslint-plugin-import": "2.27.5", "eslint-plugin-jsdoc": "40.1.0", "eslint-plugin-license-header": "0.6.0", "eslint-plugin-prefer-arrow": "1.2.3", + "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-rxjs": "^5.0.3", "eslint-plugin-unicorn": "^46.0.0", "github-api": "^3.4.0", @@ -127,6 +129,7 @@ "nx": "14.4.2", "postcss": "^8.4.29", "postcss-sass": "^0.5.0", + "prettier": "2.8.8", "protractor": "^7.0.0", "protractor-retry-angular-cli": "^2.0.3", "protractor-screenshoter-plugin": "0.10.3", @@ -3159,271 +3162,674 @@ "node": ">=0.1.90" } }, - "node_modules/@cspell/cspell-bundled-dicts": { - "version": "5.21.2", - "dev": true, - "license": "MIT", + "node_modules/@cspell/cspell-resolver": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-7.3.6.tgz", + "integrity": "sha512-rFmeqhRFfmlq4oh9tYQIIVZ9aWlP88cU48oCBjvwxjj+GambrD/qobWiW9VYl/CQBPVq4S39cTirf5RXbBHMJA==", "dependencies": { - "@cspell/dict-ada": "^2.0.0", - "@cspell/dict-aws": "^2.0.0", - "@cspell/dict-bash": "^2.0.2", - "@cspell/dict-companies": "^2.0.4", - "@cspell/dict-cpp": "^3.1.0", - "@cspell/dict-cryptocurrencies": "^2.0.0", - "@cspell/dict-csharp": "^3.0.1", - "@cspell/dict-css": "^2.0.0", - "@cspell/dict-dart": "^1.1.0", - "@cspell/dict-django": "^2.0.0", - "@cspell/dict-dotnet": "^2.0.1", - "@cspell/dict-elixir": "^2.0.1", - "@cspell/dict-en_us": "^2.2.5", - "@cspell/dict-en-gb": "^1.1.33", - "@cspell/dict-filetypes": "^2.0.1", - "@cspell/dict-fonts": "^2.0.0", - "@cspell/dict-fullstack": "^2.0.5", - "@cspell/dict-git": "^1.0.1", - "@cspell/dict-golang": "^3.0.1", - "@cspell/dict-haskell": "^2.0.0", - "@cspell/dict-html": "^3.0.1", - "@cspell/dict-html-symbol-entities": "^3.0.0", - "@cspell/dict-java": "^2.0.0", - "@cspell/dict-latex": "^2.0.3", - "@cspell/dict-lorem-ipsum": "^2.0.0", - "@cspell/dict-lua": "^2.0.0", - "@cspell/dict-node": "^2.0.1", - "@cspell/dict-npm": "^2.0.3", - "@cspell/dict-php": "^2.0.0", - "@cspell/dict-powershell": "^2.0.0", - "@cspell/dict-public-licenses": "^1.0.4", - "@cspell/dict-python": "^3.0.5", - "@cspell/dict-r": "^1.0.2", - "@cspell/dict-ruby": "^2.0.1", - "@cspell/dict-rust": "^2.0.0", - "@cspell/dict-scala": "^2.0.0", - "@cspell/dict-software-terms": "^2.1.7", - "@cspell/dict-swift": "^1.0.2", - "@cspell/dict-typescript": "^2.0.0", - "@cspell/dict-vue": "^2.0.2" + "global-dirs": "^3.0.1" }, "engines": { - "node": ">=12.13.0" + "node": ">=16" } }, - "node_modules/@cspell/cspell-pipe": { - "version": "5.21.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.13.0" - } - }, - "node_modules/@cspell/cspell-types": { - "version": "5.21.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.13.0" - } - }, - "node_modules/@cspell/dict-ada": { - "version": "2.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/@cspell/dict-aws": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/@cspell/dict-bash": { - "version": "2.0.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@cspell/dict-companies": { - "version": "2.0.14", - "dev": true, - "license": "MIT" - }, - "node_modules/@cspell/dict-cpp": { - "version": "3.2.1", - "dev": true, - "license": "MIT" - }, - "node_modules/@cspell/dict-cryptocurrencies": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/@cspell/dict-csharp": { + "node_modules/@cspell/cspell-resolver/node_modules/global-dirs": { "version": "3.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/@cspell/dict-css": { - "version": "2.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/@cspell/dict-dart": { - "version": "1.1.1", - "dev": true, - "license": "MIT" - }, - "node_modules/@cspell/dict-django": { + "node_modules/@cspell/cspell-resolver/node_modules/ini": { "version": "2.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "engines": { + "node": ">=10" + } }, - "node_modules/@cspell/dict-dotnet": { - "version": "2.0.1", - "dev": true, - "license": "MIT" + "node_modules/@cspell/cspell-service-bus": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-7.3.6.tgz", + "integrity": "sha512-jRXII9ceuostAqr/eft9RJR44TMzivuUkufhNZG4657alfhjHQBv/gME4QeFt/jOQqsDi/ifDhw5+r8ew/LsJA==", + "engines": { + "node": ">=16" + } }, - "node_modules/@cspell/dict-elixir": { - "version": "2.0.1", - "dev": true, - "license": "MIT" + "node_modules/@cspell/dict-data-science": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-1.0.11.tgz", + "integrity": "sha512-TaHAZRVe0Zlcc3C23StZqqbzC0NrodRwoSAc8dis+5qLeLLnOCtagYQeROQvDlcDg3X/VVEO9Whh4W/z4PAmYQ==" }, - "node_modules/@cspell/dict-en_us": { - "version": "2.3.3", - "dev": true, - "license": "MIT" + "node_modules/@cspell/dict-docker": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.7.tgz", + "integrity": "sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A==" + }, + "node_modules/@cspell/dict-en-common-misspellings": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-1.0.2.tgz", + "integrity": "sha512-jg7ZQZpZH7+aAxNBlcAG4tGhYF6Ksy+QS5Df73Oo+XyckBjC9QS+PrRwLTeYoFIgXy5j3ICParK5r3MSSoL4gw==" }, "node_modules/@cspell/dict-en-gb": { "version": "1.1.33", - "dev": true, "license": "MIT" }, - "node_modules/@cspell/dict-filetypes": { - "version": "2.1.1", - "dev": true, - "license": "MIT" + "node_modules/@cspell/dict-fsharp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.0.0.tgz", + "integrity": "sha512-dHPkMHwW4dWv3Lv9VWxHuVm4IylqvcfRBSnZ7usJTRThraetSVrOPIJwr6UJh7F5un/lGJx2lxWVApf2WQaB/A==" }, - "node_modules/@cspell/dict-fonts": { - "version": "2.1.0", - "dev": true, - "license": "MIT" + "node_modules/@cspell/dict-gaming-terms": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.0.4.tgz", + "integrity": "sha512-hbDduNXlk4AOY0wFxcDMWBPpm34rpqJBeqaySeoUH70eKxpxm+dvjpoRLJgyu0TmymEICCQSl6lAHTHSDiWKZg==" }, - "node_modules/@cspell/dict-fullstack": { - "version": "2.0.6", - "dev": true, - "license": "MIT" - }, - "node_modules/@cspell/dict-git": { + "node_modules/@cspell/dict-k8s": { "version": "1.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.1.tgz", + "integrity": "sha512-gc5y4Nm3hVdMZNBZfU2M1AsAmObZsRWjCUk01NFPfGhFBXyVne41T7E62rpnzu5330FV/6b/TnFcPgRmak9lLw==" }, - "node_modules/@cspell/dict-golang": { + "node_modules/@cspell/dict-sql": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.1.1.tgz", + "integrity": "sha512-v1mswi9NF40+UDUMuI148YQPEQvWjac72P6ZsjlRdLjEiQEEMEsTQ+zlkIdnzC9QCNyJaqD5Liq9Mn78/8Zxtw==" + }, + "node_modules/@cspell/dict-svelte": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.2.tgz", + "integrity": "sha512-rPJmnn/GsDs0btNvrRBciOhngKV98yZ9SHmg8qI6HLS8hZKvcXc0LMsf9LLuMK1TmS2+WQFAan6qeqg6bBxL2Q==" + }, + "node_modules/@cspell/dynamic-import": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-7.3.6.tgz", + "integrity": "sha512-NLWawhLkfTSkf36UwYJrRyMh3snXOHhuRFO7eVanPqE7oeU+1+OF/C467sYdiJGZnrCL3ojIr399JTVMz148Iw==", + "dependencies": { + "import-meta-resolve": "^3.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@cspell/eslint-plugin": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/eslint-plugin/-/eslint-plugin-7.3.6.tgz", + "integrity": "sha512-AMsFzo57zFaf+vuR50WGPX3Pu5flWf0nYzGenKGZRGGEVg3QOTECCRBxzB8QKxBr6d01PQlSRYQnxpmXRuD8Bw==", + "dependencies": { + "@cspell/cspell-types": "7.3.6", + "cspell-lib": "7.3.6", + "estree-walker": "^3.0.3", + "synckit": "^0.8.5" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/cspell-bundled-dicts": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-7.3.6.tgz", + "integrity": "sha512-9T0fFdHbKJXAQgQjLJ9SjtlHvKceKE2Vpa2sdnIXz3K1/coLLF04wHM/wzEPe2VXjYZjbjBatBRfTGjzRGJlbw==", + "dependencies": { + "@cspell/dict-ada": "^4.0.2", + "@cspell/dict-aws": "^4.0.0", + "@cspell/dict-bash": "^4.1.1", + "@cspell/dict-companies": "^3.0.22", + "@cspell/dict-cpp": "^5.0.5", + "@cspell/dict-cryptocurrencies": "^4.0.0", + "@cspell/dict-csharp": "^4.0.2", + "@cspell/dict-css": "^4.0.7", + "@cspell/dict-dart": "^2.0.3", + "@cspell/dict-django": "^4.1.0", + "@cspell/dict-docker": "^1.1.7", + "@cspell/dict-dotnet": "^5.0.0", + "@cspell/dict-elixir": "^4.0.3", + "@cspell/dict-en_us": "^4.3.7", + "@cspell/dict-en-common-misspellings": "^1.0.2", + "@cspell/dict-en-gb": "1.1.33", + "@cspell/dict-filetypes": "^3.0.1", + "@cspell/dict-fonts": "^4.0.0", + "@cspell/dict-fsharp": "^1.0.0", + "@cspell/dict-fullstack": "^3.1.5", + "@cspell/dict-gaming-terms": "^1.0.4", + "@cspell/dict-git": "^2.0.0", + "@cspell/dict-golang": "^6.0.2", + "@cspell/dict-haskell": "^4.0.1", + "@cspell/dict-html": "^4.0.3", + "@cspell/dict-html-symbol-entities": "^4.0.0", + "@cspell/dict-java": "^5.0.5", + "@cspell/dict-k8s": "^1.0.1", + "@cspell/dict-latex": "^4.0.0", + "@cspell/dict-lorem-ipsum": "^4.0.0", + "@cspell/dict-lua": "^4.0.1", + "@cspell/dict-node": "^4.0.3", + "@cspell/dict-npm": "^5.0.8", + "@cspell/dict-php": "^4.0.2", + "@cspell/dict-powershell": "^5.0.2", + "@cspell/dict-public-licenses": "^2.0.3", + "@cspell/dict-python": "^4.1.8", + "@cspell/dict-r": "^2.0.1", + "@cspell/dict-ruby": "^5.0.0", + "@cspell/dict-rust": "^4.0.1", + "@cspell/dict-scala": "^5.0.0", + "@cspell/dict-software-terms": "^3.2.3", + "@cspell/dict-sql": "^2.1.1", + "@cspell/dict-svelte": "^1.0.2", + "@cspell/dict-swift": "^2.0.1", + "@cspell/dict-typescript": "^3.1.1", + "@cspell/dict-vue": "^3.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/cspell-pipe": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-7.3.6.tgz", + "integrity": "sha512-tvNgi31f/p8M108YlDhkC8nqLJBpD1mvVqYNxL+kB/aQtkaw0AHKDsuRhg0rU6xL5MAEnoi3fXgT1HoADhJpbA==", + "engines": { + "node": ">=16" + } + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/cspell-types": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-7.3.6.tgz", + "integrity": "sha512-JnuIMJasZtJpZm0+hzr3emkRJ0PP6QWc9zgd3fx4U8W0lHGZ3Zil5peg67SnjmdTVm4UE63UviAl1y6DyD4kLg==", + "engines": { + "node": ">=16" + } + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-ada": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.0.2.tgz", + "integrity": "sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-aws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.0.tgz", + "integrity": "sha512-1YkCMWuna/EGIDN/zKkW+j98/55mxigftrSFgsehXhPld+ZMJM5J9UuBA88YfL7+/ETvBdd7mwW6IwWsC+/ltQ==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-bash": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.1.1.tgz", + "integrity": "sha512-8czAa/Mh96wu2xr0RXQEGMTBUGkTvYn/Pb0o+gqOO1YW+poXGQc3gx0YPqILDryP/KCERrNvkWUJz3iGbvwC2A==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-companies": { + "version": "3.0.24", + "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.0.24.tgz", + "integrity": "sha512-zn9QN99yIvhpGl6fZwt0mvHYcsV2w6XDdK2XWA86A0s9A94U1LCCUsvA4wijUclbZEj9ewsNMlidHcV/D329eQ==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-cpp": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-5.0.5.tgz", + "integrity": "sha512-ojCpQ4z+sHHLJYfvA3SApqQ1BjO/k3TUdDgqR3sVhFl5qjT9yz1/srBNzqCaBBSz/fiO5A8NKdSA9+IFrUHcig==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-cryptocurrencies": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-4.0.0.tgz", + "integrity": "sha512-EiZp91ATyRxTmauIQfOX9adLYCunKjHEh092rrM7o2eMXP9n7zpXAL9BK7LviL+LbB8VDOm21q+s83cKrrRrsg==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-csharp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.2.tgz", + "integrity": "sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-css": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.9.tgz", + "integrity": "sha512-uiwdqbyrqynVDl9COs9gJSmIcm76je2yHs6rnI5USJ6y0PXfiBiFKQ7/q8oi2ff9AK8RedsGU4luSor6nLYpVA==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-dart": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.0.3.tgz", + "integrity": "sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-django": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.0.tgz", + "integrity": "sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-dotnet": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.0.tgz", + "integrity": "sha512-EOwGd533v47aP5QYV8GlSSKkmM9Eq8P3G/eBzSpH3Nl2+IneDOYOBLEUraHuiCtnOkNsz0xtZHArYhAB2bHWAw==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-elixir": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.3.tgz", + "integrity": "sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-en_us": { + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.3.8.tgz", + "integrity": "sha512-rCPsbDHuRnFUbzWAY6O1H9+cLZt5FNQwjPVw2TdQZfipdb0lim984aLGY+nupi1iKC3lfjyd5SVUgmSZEG1QNA==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-filetypes": { "version": "3.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.1.tgz", + "integrity": "sha512-8z8mY1IbrTyTRumx2vvD9yzRhNMk9SajM/GtI5hdMM2pPpNSp25bnuauzjRf300eqlqPY2MNb5MmhBFO014DJw==" }, - "node_modules/@cspell/dict-haskell": { + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-fonts": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.0.tgz", + "integrity": "sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-fullstack": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.1.5.tgz", + "integrity": "sha512-6ppvo1dkXUZ3fbYn/wwzERxCa76RtDDl5Afzv2lijLoijGGUw5yYdLBKJnx8PJBGNLh829X352ftE7BElG4leA==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-git": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-2.0.0.tgz", + "integrity": "sha512-n1AxyX5Kgxij/sZFkxFJlzn3K9y/sCcgVPg/vz4WNJ4K9YeTsUmyGLA2OQI7d10GJeiuAo2AP1iZf2A8j9aj2w==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-golang": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.2.tgz", + "integrity": "sha512-5pyZn4AAiYukAW+gVMIMVmUSkIERFrDX2vtPDjg8PLQUhAHWiVeQSDjuOhq9/C5GCCEZU/zWSONkGiwLBBvV9A==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-haskell": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.1.tgz", + "integrity": "sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-html": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.4.tgz", + "integrity": "sha512-CWFe9jt1g7asuRMGUguqz8+53BJjDnkafayavXk2+f/KGQ7mwyQtVAjf/gD9h1w7qO+NwXIbYweFkbQ8ki6+gQ==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-html-symbol-entities": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.0.tgz", + "integrity": "sha512-HGRu+48ErJjoweR5IbcixxETRewrBb0uxQBd6xFGcxbEYCX8CnQFTAmKI5xNaIt2PKaZiJH3ijodGSqbKdsxhw==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-java": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.6.tgz", + "integrity": "sha512-kdE4AHHHrixyZ5p6zyms1SLoYpaJarPxrz8Tveo6gddszBVVwIUZ+JkQE1bWNLK740GWzIXdkznpUfw1hP9nXw==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-latex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-4.0.0.tgz", + "integrity": "sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-lorem-ipsum": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.0.tgz", + "integrity": "sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-lua": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.1.tgz", + "integrity": "sha512-j0MFmeCouSoC6EdZTbvGe1sJ9V+ruwKSeF+zRkNNNload7R72Co5kX1haW2xLHGdlq0kqSy1ODRZKdVl0e+7hg==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-node": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-4.0.3.tgz", + "integrity": "sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-npm": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.0.9.tgz", + "integrity": "sha512-+MqhnE+QI3M1OKV8QsM8vKRHsrvN84G/I0NClloEXTovUexCit8UwcHdlWK7dTbtmYUvEJglCTUG5DWqxwOlhw==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-php": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.0.3.tgz", + "integrity": "sha512-PxtSmWJCDEB4M8R9ER9ijxBum/tvUqYT26QeuV58q2IFs5IrPZ6hocQKvnFGXItjCWH4oYXyAEAAzINlBC4Opg==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-powershell": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.2.tgz", + "integrity": "sha512-IHfWLme3FXE7vnOmMncSBxOsMTdNWd1Vcyhag03WS8oANSgX8IZ+4lMI00mF0ptlgchf16/OU8WsV4pZfikEFw==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-public-licenses": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.4.tgz", + "integrity": "sha512-KjsfuGwMWvPkp6s0nR+s4mZc9SQhh1tHDOyQZfEVRwi+2ev7f8l7R6ts9sP2Mplb8UcxwO6YmKwxHjN+XHoMoA==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-python": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.1.8.tgz", + "integrity": "sha512-yFrO9gGI3KIbw0Y1odAEtagrzmthjJVank9B7qlsSQvN78RgD1JQQycTadNWpzdjCj+JuiiH8pJBFWflweZoxw==", + "dependencies": { + "@cspell/dict-data-science": "^1.0.11" + } + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-r": { "version": "2.0.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.0.1.tgz", + "integrity": "sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA==" }, - "node_modules/@cspell/dict-html": { - "version": "3.3.2", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-ruby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.0.0.tgz", + "integrity": "sha512-ssb96QxLZ76yPqFrikWxItnCbUKhYXJ2owkoIYzUGNFl2CHSoHCb5a6Zetum9mQ/oUA3gNeUhd28ZUlXs0la2A==" }, - "node_modules/@cspell/dict-html-symbol-entities": { + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-rust": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.0.1.tgz", + "integrity": "sha512-xJSSzHDK2z6lSVaOmMxl3PTOtfoffaxMo7fTcbZUF+SCJzfKbO6vnN9TCGX2sx1RHFDz66Js6goz6SAZQdOwaw==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-scala": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.0.tgz", + "integrity": "sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-software-terms": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-3.3.1.tgz", + "integrity": "sha512-nZtlPNe3se9Maj6HQhABUAG9HzgKvAmwli0WoITlxxhlfU4on74evZJ7FtJpUTCXSkAXgKWz8pMQtsRXvRY40w==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-swift": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.1.tgz", + "integrity": "sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-typescript": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.2.tgz", + "integrity": "sha512-lcNOYWjLUvDZdLa0UMNd/LwfVdxhE9rKA+agZBGjL3lTA3uNvH7IUqSJM/IXhJoBpLLMVEOk8v1N9xi+vDuCdA==" + }, + "node_modules/@cspell/eslint-plugin/node_modules/@cspell/dict-vue": { "version": "3.0.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.0.tgz", + "integrity": "sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==" }, - "node_modules/@cspell/dict-java": { - "version": "2.0.0", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/@types/estree": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.2.tgz", + "integrity": "sha512-VeiPZ9MMwXjO32/Xu7+OwflfmeoRwkE/qzndw42gGtgJwZopBnzy2gD//NN1+go1mADzkDcqf/KnFRSjTJ8xJA==" }, - "node_modules/@cspell/dict-latex": { - "version": "2.0.9", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/configstore": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", + "integrity": "sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==", + "dependencies": { + "dot-prop": "^6.0.1", + "graceful-fs": "^4.2.6", + "unique-string": "^3.0.0", + "write-file-atomic": "^3.0.3", + "xdg-basedir": "^5.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/yeoman/configstore?sponsor=1" + } }, - "node_modules/@cspell/dict-lorem-ipsum": { - "version": "2.0.1", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/cosmiconfig": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.0.0.tgz", + "integrity": "sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ==", + "dependencies": { + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=14" + } }, - "node_modules/@cspell/dict-lua": { - "version": "2.0.0", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "dependencies": { + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/@cspell/dict-node": { - "version": "2.0.1", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/cspell-glob": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-7.3.6.tgz", + "integrity": "sha512-xfVmqkkg/Pznij3VJCLbUvEKWqs/+AyyHIXo9s1j/d4M0Nw/O4HJFoHwNiMoAk6aceMTgjjVIneGmSZsHVGYZg==", + "dependencies": { + "micromatch": "^4.0.5" + }, + "engines": { + "node": ">=16" + } }, - "node_modules/@cspell/dict-npm": { - "version": "2.0.5", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/cspell-io": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-7.3.6.tgz", + "integrity": "sha512-FzynVc3OE9rS4t0cxTCVD9VFwOAnhvhV/WBWMrMUtvi8DVnRu7of/1ZJsC+XDtij+G1Kd6EOrzSnTj5gn9aQaQ==", + "dependencies": { + "@cspell/cspell-service-bus": "7.3.6", + "node-fetch": "^2.7.0" + }, + "engines": { + "node": ">=16" + } }, - "node_modules/@cspell/dict-php": { - "version": "2.0.0", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/cspell-lib": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-7.3.6.tgz", + "integrity": "sha512-ixPnudlaNh4UwFkHeKUXbBYB/wLHNv1Gf+zBGy4oz2Uu9ZZTVgczhE/t2pPTD6ZRcq4+YulGuqxYCS+3qqOQQQ==", + "dependencies": { + "@cspell/cspell-bundled-dicts": "7.3.6", + "@cspell/cspell-pipe": "7.3.6", + "@cspell/cspell-resolver": "7.3.6", + "@cspell/cspell-types": "7.3.6", + "@cspell/dynamic-import": "7.3.6", + "@cspell/strong-weak-map": "7.3.6", + "clear-module": "^4.1.2", + "comment-json": "^4.2.3", + "configstore": "^6.0.0", + "cosmiconfig": "8.0.0", + "cspell-dictionary": "7.3.6", + "cspell-glob": "7.3.6", + "cspell-grammar": "7.3.6", + "cspell-io": "7.3.6", + "cspell-trie-lib": "7.3.6", + "fast-equals": "^5.0.1", + "find-up": "^6.3.0", + "gensequence": "^6.0.0", + "import-fresh": "^3.3.0", + "resolve-from": "^5.0.0", + "vscode-languageserver-textdocument": "^1.0.8", + "vscode-uri": "^3.0.7" + }, + "engines": { + "node": ">=16" + } }, - "node_modules/@cspell/dict-powershell": { - "version": "2.0.0", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/cspell-trie-lib": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-7.3.6.tgz", + "integrity": "sha512-75lSsKTdmFpewEl8Q+/WnSbpZ+JjoNnSDobNDcjZHTTnj/TlgCVxXASTaFLlXnqWU51QX+5798smnqpWBcJigg==", + "dependencies": { + "@cspell/cspell-pipe": "7.3.6", + "@cspell/cspell-types": "7.3.6", + "gensequence": "^6.0.0" + }, + "engines": { + "node": ">=16" + } }, - "node_modules/@cspell/dict-public-licenses": { - "version": "1.0.6", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/dot-prop": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/@cspell/dict-python": { - "version": "3.0.6", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dependencies": { + "@types/estree": "^1.0.0" + } }, - "node_modules/@cspell/dict-r": { - "version": "1.0.3", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/fast-equals": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz", + "integrity": "sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==", + "engines": { + "node": ">=6.0.0" + } }, - "node_modules/@cspell/dict-ruby": { - "version": "2.0.2", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/@cspell/dict-rust": { - "version": "2.0.1", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/gensequence": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-6.0.0.tgz", + "integrity": "sha512-8WwuywE9pokJRAcg2QFR/plk3cVPebSUqRPzpGQh3WQ0wIiHAw+HyOQj5IuHyUTQBHpBKFoB2JUMu9zT3vJ16Q==", + "engines": { + "node": ">=16" + } }, - "node_modules/@cspell/dict-scala": { - "version": "2.0.0", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/locate-path": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", + "dependencies": { + "p-locate": "^6.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/@cspell/dict-software-terms": { - "version": "2.3.0", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/@cspell/dict-swift": { - "version": "1.0.3", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/@cspell/dict-typescript": { - "version": "2.0.2", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } }, - "node_modules/@cspell/dict-vue": { - "version": "2.0.2", - "dev": true, - "license": "MIT" + "node_modules/@cspell/eslint-plugin/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@cspell/eslint-plugin/node_modules/unique-string": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", + "integrity": "sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==", + "dependencies": { + "crypto-random-string": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@cspell/eslint-plugin/node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/@cspell/eslint-plugin/node_modules/xdg-basedir": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", + "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@cspell/eslint-plugin/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@cspell/strong-weak-map": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-7.3.6.tgz", + "integrity": "sha512-PoVFTvY8CGhc+7W3uvyPUWIBakc+ga9X5QpSkFI/HQghmaGDDaaQBfbuv/LsS7T9bkEoWz4jLtJoNBas870gZA==", + "engines": { + "node": ">=16" + } }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", @@ -4823,26 +5229,6 @@ "semver": "bin/semver.js" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "optional": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/@mapbox/node-pre-gyp/node_modules/nopt": { "version": "5.0.0", "license": "ISC", @@ -12143,6 +12529,68 @@ "node": ">=14" } }, + "node_modules/@pkgr/utils": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz", + "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==", + "dependencies": { + "cross-spawn": "^7.0.3", + "fast-glob": "^3.3.0", + "is-glob": "^4.0.3", + "open": "^9.1.0", + "picocolors": "^1.0.0", + "tslib": "^2.6.0" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@pkgr/utils/node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@pkgr/utils/node_modules/fast-glob": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/@pkgr/utils/node_modules/open": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-9.1.0.tgz", + "integrity": "sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==", + "dependencies": { + "default-browser": "^4.0.0", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@playwright/test": { "version": "1.35.1", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.35.1.tgz", @@ -18799,25 +19247,6 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/@storybook/core-server/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/@storybook/core-server/node_modules/readable-stream": { "version": "2.3.8", "license": "MIT", @@ -20159,25 +20588,6 @@ "node": ">=4.0.0" } }, - "node_modules/@storybook/manager-webpack4/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/@storybook/manager-webpack4/node_modules/p-locate": { "version": "4.1.0", "license": "MIT", @@ -21095,26 +21505,6 @@ "node": ">=8.9.0" } }, - "node_modules/@storybook/manager-webpack5/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dev": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/@storybook/manager-webpack5/node_modules/schema-utils": { "version": "3.1.2", "dev": true, @@ -24529,7 +24919,6 @@ }, "node_modules/argparse": { "version": "2.0.1", - "devOptional": true, "license": "Python-2.0" }, "node_modules/aria-query": { @@ -24603,7 +24992,6 @@ }, "node_modules/array-timsort": { "version": "1.0.3", - "dev": true, "license": "MIT" }, "node_modules/array-union": { @@ -25385,7 +25773,6 @@ "node_modules/big-integer": { "version": "1.6.51", "license": "Unlicense", - "optional": true, "engines": { "node": ">=0.6" } @@ -26251,6 +26638,20 @@ "semver": "^7.0.0" } }, + "node_modules/bundle-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz", + "integrity": "sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==", + "dependencies": { + "run-applescript": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/bytes": { "version": "3.0.0", "license": "MIT", @@ -26776,7 +27177,6 @@ }, "node_modules/clear-module": { "version": "4.1.2", - "dev": true, "license": "MIT", "dependencies": { "parent-module": "^2.0.0", @@ -27041,7 +27441,6 @@ }, "node_modules/comment-json": { "version": "4.2.3", - "dev": true, "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", @@ -27156,56 +27555,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/configstore": { - "version": "5.0.1", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "dot-prop": "^5.2.0", - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "unique-string": "^2.0.0", - "write-file-atomic": "^3.0.0", - "xdg-basedir": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/configstore/node_modules/make-dir": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/configstore/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/configstore/node_modules/write-file-atomic": { - "version": "3.0.3", - "dev": true, - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, "node_modules/confusing-browser-globals": { "version": "1.0.11", "dev": true, @@ -28099,186 +28448,92 @@ "node": "*" } }, - "node_modules/crypto-random-string": { - "version": "2.0.0", - "dev": true, - "license": "MIT", + "node_modules/cspell-dictionary": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-7.3.6.tgz", + "integrity": "sha512-8E0qsGTP7uHZeQ0qD6au+bjaj4M9F4AgurssG3VQuvsYpzEI6S/81U3GQVzcn/4mn7Z5KE286CElZQWAiQPLQA==", + "dependencies": { + "@cspell/cspell-pipe": "7.3.6", + "@cspell/cspell-types": "7.3.6", + "cspell-trie-lib": "7.3.6", + "fast-equals": "^4.0.3", + "gensequence": "^6.0.0" + }, "engines": { - "node": ">=8" + "node": ">=16" } }, - "node_modules/cspell": { - "version": "5.21.2", - "dev": true, - "license": "MIT", + "node_modules/cspell-dictionary/node_modules/@cspell/cspell-pipe": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-7.3.6.tgz", + "integrity": "sha512-tvNgi31f/p8M108YlDhkC8nqLJBpD1mvVqYNxL+kB/aQtkaw0AHKDsuRhg0rU6xL5MAEnoi3fXgT1HoADhJpbA==", + "engines": { + "node": ">=16" + } + }, + "node_modules/cspell-dictionary/node_modules/@cspell/cspell-types": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-7.3.6.tgz", + "integrity": "sha512-JnuIMJasZtJpZm0+hzr3emkRJ0PP6QWc9zgd3fx4U8W0lHGZ3Zil5peg67SnjmdTVm4UE63UviAl1y6DyD4kLg==", + "engines": { + "node": ">=16" + } + }, + "node_modules/cspell-dictionary/node_modules/cspell-trie-lib": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-7.3.6.tgz", + "integrity": "sha512-75lSsKTdmFpewEl8Q+/WnSbpZ+JjoNnSDobNDcjZHTTnj/TlgCVxXASTaFLlXnqWU51QX+5798smnqpWBcJigg==", "dependencies": { - "@cspell/cspell-pipe": "^5.21.2", - "chalk": "^4.1.2", - "commander": "^9.2.0", - "cspell-gitignore": "^5.21.2", - "cspell-glob": "^5.21.2", - "cspell-lib": "^5.21.2", - "fast-json-stable-stringify": "^2.1.0", - "file-entry-cache": "^6.0.1", - "fs-extra": "^10.1.0", - "get-stdin": "^8.0.0", - "glob": "^8.0.3", - "imurmurhash": "^0.1.4", - "semver": "^7.3.7", - "strip-ansi": "^6.0.1", - "vscode-uri": "^3.0.3" + "@cspell/cspell-pipe": "7.3.6", + "@cspell/cspell-types": "7.3.6", + "gensequence": "^6.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/cspell-dictionary/node_modules/fast-equals": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz", + "integrity": "sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg==" + }, + "node_modules/cspell-dictionary/node_modules/gensequence": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-6.0.0.tgz", + "integrity": "sha512-8WwuywE9pokJRAcg2QFR/plk3cVPebSUqRPzpGQh3WQ0wIiHAw+HyOQj5IuHyUTQBHpBKFoB2JUMu9zT3vJ16Q==", + "engines": { + "node": ">=16" + } + }, + "node_modules/cspell-grammar": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-7.3.6.tgz", + "integrity": "sha512-04kvcptwvJBSMfcOTbanEFa194Xkpkjo4wkTImO26Zzu06tGawbL4FPPQdGygMz7yTdc6Wlrlks5TNChWlcn+Q==", + "dependencies": { + "@cspell/cspell-pipe": "7.3.6", + "@cspell/cspell-types": "7.3.6" }, "bin": { - "cspell": "bin.js" + "cspell-grammar": "bin.mjs" }, "engines": { - "node": ">=12.13.0" - }, - "funding": { - "url": "https://github.com/streetsidesoftware/cspell?sponsor=1" + "node": ">=16" } }, - "node_modules/cspell-gitignore": { - "version": "5.21.2", - "dev": true, - "license": "MIT", - "dependencies": { - "cspell-glob": "^5.21.2", - "find-up": "^5.0.0" - }, - "bin": { - "cspell-gitignore": "bin.js" - }, + "node_modules/cspell-grammar/node_modules/@cspell/cspell-pipe": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-7.3.6.tgz", + "integrity": "sha512-tvNgi31f/p8M108YlDhkC8nqLJBpD1mvVqYNxL+kB/aQtkaw0AHKDsuRhg0rU6xL5MAEnoi3fXgT1HoADhJpbA==", "engines": { - "node": ">=12.13.0" + "node": ">=16" } }, - "node_modules/cspell-glob": { - "version": "5.21.2", - "dev": true, - "license": "MIT", - "dependencies": { - "micromatch": "^4.0.5" - }, + "node_modules/cspell-grammar/node_modules/@cspell/cspell-types": { + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-7.3.6.tgz", + "integrity": "sha512-JnuIMJasZtJpZm0+hzr3emkRJ0PP6QWc9zgd3fx4U8W0lHGZ3Zil5peg67SnjmdTVm4UE63UviAl1y6DyD4kLg==", "engines": { - "node": ">=12.13.0" - } - }, - "node_modules/cspell-io": { - "version": "5.21.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.13.0" - } - }, - "node_modules/cspell-lib": { - "version": "5.21.2", - "dev": true, - "license": "MIT", - "dependencies": { - "@cspell/cspell-bundled-dicts": "^5.21.2", - "@cspell/cspell-pipe": "^5.21.2", - "@cspell/cspell-types": "^5.21.2", - "clear-module": "^4.1.2", - "comment-json": "^4.2.2", - "configstore": "^5.0.1", - "cosmiconfig": "^7.0.1", - "cspell-glob": "^5.21.2", - "cspell-io": "^5.21.2", - "cspell-trie-lib": "^5.21.2", - "fast-equals": "^3.0.2", - "find-up": "^5.0.0", - "fs-extra": "^10.1.0", - "gensequence": "^3.1.1", - "import-fresh": "^3.3.0", - "resolve-from": "^5.0.0", - "resolve-global": "^1.0.0", - "vscode-languageserver-textdocument": "^1.0.4", - "vscode-uri": "^3.0.3" - }, - "engines": { - "node": ">=12.13.0" - } - }, - "node_modules/cspell-trie-lib": { - "version": "5.21.2", - "dev": true, - "license": "MIT", - "dependencies": { - "@cspell/cspell-pipe": "^5.21.2", - "fs-extra": "^10.1.0", - "gensequence": "^3.1.1" - }, - "engines": { - "node": ">=12.13.0" - } - }, - "node_modules/cspell/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/cspell/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/cspell/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/cspell/node_modules/commander": { - "version": "9.5.0", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || >=14" - } - }, - "node_modules/cspell/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/cspell/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "node": ">=16" } }, "node_modules/css": { @@ -28976,6 +29231,23 @@ "node": ">=0.10.0" } }, + "node_modules/default-browser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-4.0.0.tgz", + "integrity": "sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==", + "dependencies": { + "bundle-name": "^3.0.0", + "default-browser-id": "^3.0.0", + "execa": "^7.1.1", + "titleize": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/default-browser-id": { "version": "1.0.4", "license": "MIT", @@ -29195,6 +29467,142 @@ "node": ">=0.10.0" } }, + "node_modules/default-browser/node_modules/bplist-parser": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", + "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "dependencies": { + "big-integer": "^1.6.44" + }, + "engines": { + "node": ">= 5.10.0" + } + }, + "node_modules/default-browser/node_modules/default-browser-id": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-3.0.0.tgz", + "integrity": "sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==", + "dependencies": { + "bplist-parser": "^0.2.0", + "untildify": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/execa": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", + "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^4.3.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/default-browser/node_modules/human-signals": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", + "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/default-browser/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "engines": { + "node": ">=8" + } + }, "node_modules/default-gateway": { "version": "6.0.3", "dev": true, @@ -29627,17 +30035,6 @@ "tslib": "^2.0.3" } }, - "node_modules/dot-prop": { - "version": "5.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/dotenv": { "version": "16.1.3", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.1.3.tgz", @@ -30427,6 +30824,18 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", + "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-etc": { "version": "5.2.1", "dev": true, @@ -30658,6 +31067,27 @@ "eslint": ">=2.0.0" } }, + "node_modules/eslint-plugin-prettier": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } + } + }, "node_modules/eslint-plugin-rxjs": { "version": "5.0.3", "dev": true, @@ -30957,7 +31387,6 @@ }, "node_modules/esprima": { "version": "4.0.1", - "dev": true, "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", @@ -31478,10 +31907,11 @@ "version": "3.1.3", "license": "MIT" }, - "node_modules/fast-equals": { - "version": "3.0.3", - "dev": true, - "license": "MIT" + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true }, "node_modules/fast-glob": { "version": "3.2.7", @@ -32362,14 +32792,6 @@ "node": ">=10" } }, - "node_modules/gensequence": { - "version": "3.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "license": "MIT", @@ -32413,17 +32835,6 @@ "node": ">=8.0.0" } }, - "node_modules/get-stdin": { - "version": "8.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/get-stream": { "version": "6.0.1", "license": "MIT", @@ -32561,22 +32972,6 @@ "process": "^0.11.10" } }, - "node_modules/global-dirs": { - "version": "0.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ini": "^1.3.4" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/global-dirs/node_modules/ini": { - "version": "1.3.8", - "dev": true, - "license": "ISC" - }, "node_modules/global-modules": { "version": "2.0.0", "dev": true, @@ -32895,7 +33290,6 @@ }, "node_modules/has-own-prop": { "version": "2.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -33815,6 +34209,15 @@ "node": ">=8" } }, + "node_modules/import-meta-resolve": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-3.0.0.tgz", + "integrity": "sha512-4IwhLhNNA8yy445rPjD/lWh++7hMDOml2eHtd58eG7h+qK3EryMuuRbsHGPikCoAgIkkDnckKfWSk2iDla/ejg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "license": "MIT", @@ -34294,6 +34697,37 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container/node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-interactive": { "version": "1.0.0", "dev": true, @@ -34359,7 +34793,6 @@ }, "node_modules/is-obj": { "version": "2.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -34520,7 +34953,6 @@ }, "node_modules/is-typedarray": { "version": "1.0.0", - "dev": true, "license": "MIT" }, "node_modules/is-unicode-supported": { @@ -34646,25 +35078,6 @@ "unfetch": "^4.2.0" } }, - "node_modules/isomorphic-unfetch/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/isstream": { "version": "0.1.2", "dev": true, @@ -37433,7 +37846,6 @@ }, "node_modules/js-yaml": { "version": "4.1.0", - "devOptional": true, "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -40116,6 +40528,25 @@ "dev": true, "license": "MIT" }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/node-forge": { "version": "1.3.1", "dev": true, @@ -41447,7 +41878,6 @@ }, "node_modules/parent-module": { "version": "2.0.0", - "dev": true, "license": "MIT", "dependencies": { "callsites": "^3.1.0" @@ -43071,8 +43501,6 @@ "version": "2.8.8", "dev": true, "license": "MIT", - "optional": true, - "peer": true, "bin": { "prettier": "bin-prettier.js" }, @@ -43083,6 +43511,18 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/pretty-bytes": { "version": "5.6.0", "dev": true, @@ -44930,17 +45370,6 @@ "node": ">=8" } }, - "node_modules/resolve-global": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "global-dirs": "^0.1.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/resolve-url": { "version": "0.2.1", "license": "MIT" @@ -45192,6 +45621,20 @@ "node": "6.* || >= 7.*" } }, + "node_modules/run-applescript": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", + "integrity": "sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==", + "dependencies": { + "execa": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/run-async": { "version": "2.4.1", "dev": true, @@ -47780,6 +48223,21 @@ "version": "2.0.17", "license": "BSD-3-Clause" }, + "node_modules/synckit": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", + "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==", + "dependencies": { + "@pkgr/utils": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/table": { "version": "6.8.1", "dev": true, @@ -48167,6 +48625,17 @@ "node": ">=0.6.0" } }, + "node_modules/titleize": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", + "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tmp": { "version": "0.2.1", "dev": true, @@ -48767,7 +49236,6 @@ }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", - "dev": true, "license": "MIT", "dependencies": { "is-typedarray": "^1.0.0" @@ -48941,17 +49409,6 @@ "imurmurhash": "^0.1.4" } }, - "node_modules/unique-string": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "crypto-random-string": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/unist-builder": { "version": "2.0.3", "license": "MIT", @@ -49450,12 +49907,10 @@ }, "node_modules/vscode-languageserver-textdocument": { "version": "1.0.8", - "dev": true, "license": "MIT" }, "node_modules/vscode-uri": { "version": "3.0.7", - "dev": true, "license": "MIT" }, "node_modules/w3c-hr-time": { @@ -50714,14 +51169,6 @@ "default-browser-id": "^1.0.4" } }, - "node_modules/xdg-basedir": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/xml-name-validator": { "version": "3.0.0", "dev": true, diff --git a/package.json b/package.json index 92e9ce5c1d..66f6ece86d 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "@angular/platform-browser-dynamic": "14.1.3", "@angular/router": "14.1.3", "@apollo/client": "^3.7.10", + "@cspell/eslint-plugin": "^7.3.6", "@editorjs/editorjs": "^2.26.5", "@editorjs/header": "2.7.0", "@editorjs/list": "1.8.0", @@ -134,16 +135,17 @@ "@typescript-eslint/typescript-estree": "6.7.0", "ajv": "^8.12.0", "commander": "6.2.1", - "cspell": "^5.5.1", "css-loader": "^6.7.4", "dotenv": "16.1.3", "editorjs-text-color-plugin": "1.13.1", "eslint": "^8.47.0", + "eslint-config-prettier": "^8.10.0", "eslint-plugin-ban": "^1.6.0", "eslint-plugin-import": "2.27.5", "eslint-plugin-jsdoc": "40.1.0", "eslint-plugin-license-header": "0.6.0", "eslint-plugin-prefer-arrow": "1.2.3", + "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-rxjs": "^5.0.3", "eslint-plugin-unicorn": "^46.0.0", "github-api": "^3.4.0", @@ -171,6 +173,7 @@ "nx": "14.4.2", "postcss": "^8.4.29", "postcss-sass": "^0.5.0", + "prettier": "2.8.8", "protractor": "^7.0.0", "protractor-retry-angular-cli": "^2.0.3", "protractor-screenshoter-plugin": "0.10.3",