diff --git a/LICENSE b/LICENSE index 99b46b9..4633614 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Sergey D. +Copyright (c) 2024 Sergey D. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README_suitecrm.md b/README_suitecrm.md index 6c7b577..88f68ab 100644 --- a/README_suitecrm.md +++ b/README_suitecrm.md @@ -6,7 +6,7 @@ Features: * Forwarding calls to assigned user. ## Install -**For SuiteCRM 8 minimum working version is 8.2.0!** +**For SuiteCRM 8 minimum working version is 8.5.0!** * [Install and configure asterlink service](https://github.com/serfreeman1337/asterlink/blob/master/README.md) first. * Uncomment `suitecrm` entry in `conf.yml` file and set: * `url` - SuiteCRM site address. @@ -15,7 +15,7 @@ Features: **Note:** config file is using YAML format and it requires to have proper indentation. Use online yaml validator to check your file for errors. * Download [suitecrm-asterlink-module.zip](https://github.com/serfreeman1337/asterlink/releases/latest/download/suitecrm-asterlink-module.zip) archive from the [releases page](https://github.com/serfreeman1337/asterlink/releases). - **SuiteCRM 8:** Extension in the module archive was built with the `8.2.0` version and tested to work with the `8.3.1`. + **SuiteCRM 8:** Extension in the module archive was built and tested to work with the `8.5.0` version. * Upload and install this module using **Module Loader** on the SuiteCRM Admin page. * On the SuiteCRM Admin page open **AsterLink Connector** module settings and set: * `Token` - to `endpoint_token` value in the `conf.yml` file. diff --git a/connect/suitecrm/suitecrm-asterlink-module/LICENSE.txt b/connect/suitecrm/suitecrm-asterlink-module/LICENSE.txt index 92c8078..4633614 100644 --- a/connect/suitecrm/suitecrm-asterlink-module/LICENSE.txt +++ b/connect/suitecrm/suitecrm-asterlink-module/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Sergey D. +Copyright (c) 2024 Sergey D. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/.browserslistrc b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/.browserslistrc deleted file mode 100644 index 427441d..0000000 --- a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/.browserslistrc +++ /dev/null @@ -1,17 +0,0 @@ -# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries - -# For the full list of supported browsers by the Angular framework, please see: -# https://angular.io/guide/browser-support - -# You can see what browsers were selected by your queries by running: -# npx browserslist - -last 1 Chrome version -last 1 Firefox version -last 2 Edge major versions -last 2 Safari major versions -last 2 iOS major versions -Firefox ESR -not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. diff --git a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/karma.conf.js b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/karma.conf.js index 44a92e1..cc9751f 100644 --- a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/karma.conf.js +++ b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/karma.conf.js @@ -13,24 +13,15 @@ module.exports = function (config) { require('@angular-devkit/build-angular/plugins/karma') ], client: { - jasmine: { - // you can add configuration options for Jasmine here - // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html - // for example, you can disable the random execution with `random: false` - // or set a specific seed with `seed: 4321` - }, clearContext: false // leave Jasmine Spec Runner output visible in browser }, - jasmineHtmlReporter: { - suppressAll: true // removes the duplicated traces - }, coverageReporter: { - dir: require('path').join(__dirname, '../../../coverage/asterlink'), + dir: require('path').join(__dirname, '../../coverage/validators'), subdir: '.', reporters: [ { type: 'html' }, { type: 'text-summary' } - ] + ], }, reporters: ['progress', 'kjhtml'], port: 9876, diff --git a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/src/extension/extension.module.ts b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/src/extension/extension.module.ts index e566bc9..733763c 100644 --- a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/src/extension/extension.module.ts +++ b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/src/extension/extension.module.ts @@ -1,4 +1,4 @@ -import { NgModule, ComponentFactoryResolver, ApplicationRef, Injector, ComponentRef, EmbeddedViewRef } from '@angular/core'; +import { NgModule, ApplicationRef, ComponentRef, EmbeddedViewRef, createComponent } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterModule } from '@angular/router'; import { takeWhile } from 'rxjs/operators'; @@ -46,11 +46,9 @@ export class ExtensionModule { constructor( private fieldRegistry: FieldRegistry, - private componentFactoryResolver: ComponentFactoryResolver, private appRef: ApplicationRef, - private injector: Injector, private asterlinkService: AsterlinkService, - private appStateStore: AppStateStore, + private appStateStore: AppStateStore ) { // Override phone fields. this.fieldRegistry.register('default', 'phone', 'list', PhoneFieldComponent); @@ -69,12 +67,10 @@ export class ExtensionModule { init() { this.asterlinkService.ready$.subscribe(v => { if (v) { // Attach asterlink to the body. - this.componentRef = this.componentFactoryResolver - .resolveComponentFactory(AsterLinkComponent) - .create(this.injector); + this.componentRef = createComponent(AsterLinkComponent, { environmentInjector: this.appRef.injector }); this.appRef.attachView(this.componentRef.hostView); const domElem = (this.componentRef.hostView as EmbeddedViewRef).rootNodes[0] as HTMLElement; - document.body.appendChild(domElem); + document.getElementsByTagName('app-root')[0].appendChild(domElem); } else { if (this.componentRef) { this.appRef.detachView(this.componentRef.hostView); diff --git a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/src/fields/phone-field/phone-field.component.html b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/src/fields/phone-field/phone-field.component.html old mode 100755 new mode 100644 diff --git a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/src/fields/phone-field/phone-field.component.ts b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/src/fields/phone-field/phone-field.component.ts old mode 100755 new mode 100644 index 6bc25f1..a7586da --- a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/src/fields/phone-field/phone-field.component.ts +++ b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/src/fields/phone-field/phone-field.component.ts @@ -1,7 +1,6 @@ import { Component} from '@angular/core'; -import { BaseFieldComponent, DataTypeFormatter, FieldLogicManager, LanguageStore, MessageService } from 'core'; +import { BaseFieldComponent, DataTypeFormatter, FieldLogicDisplayManager, FieldLogicManager, LanguageStore, MessageService } from 'core'; import { AsterlinkService } from '../../services/asterlink.service'; -import { Field } from 'common'; @Component({ selector: 'asterlink-phone-field', @@ -14,11 +13,12 @@ export class PhoneFieldComponent extends BaseFieldComponent { constructor( protected typeFormatter: DataTypeFormatter, protected logic: FieldLogicManager, + protected logicDisplay: FieldLogicDisplayManager, private asterlinkService: AsterlinkService, private messageService: MessageService, private languageStore: LanguageStore ) { - super(typeFormatter, logic); + super(typeFormatter, logic, logicDisplay); } originate(phone: string) { diff --git a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/tsconfig.app.json b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/tsconfig.app.json index 33ea3fa..fac8015 100644 --- a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/tsconfig.app.json +++ b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/tsconfig.app.json @@ -2,7 +2,8 @@ { "extends": "../../../tsconfig.json", "compilerOptions": { - "outDir": "../../../out-tsc/app", + "outDir": "../../out-tsc/app", + "target": "es2022", "types": [] }, "files": [ diff --git a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/tsconfig.spec.json b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/tsconfig.spec.json index 60c397a..b66a2f0 100644 --- a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/tsconfig.spec.json +++ b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/tsconfig.spec.json @@ -1,8 +1,8 @@ /* To learn more about this file see: https://angular.io/config/tsconfig. */ { - "extends": "../../../tsconfig.json", + "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "../../../out-tsc/spec", + "outDir": "../../out-tsc/spec", "types": [ "jasmine" ] diff --git a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/webpack.config.js b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/webpack.config.js index a3877df..5fec9c9 100644 --- a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/webpack.config.js +++ b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/app/webpack.config.js @@ -8,13 +8,15 @@ module.exports = { optimization: { runtimeChunk: false }, + experiments: { + outputModule: true + }, plugins: [ new ModuleFederationPlugin({ name: 'asterlink', filename: 'remoteEntry.js', library: { - type: 'window', - name: 'asterlink', + type: 'module', }, exposes: { './Module': './extensions/asterlink/app/src/extension/extension.module.ts' @@ -23,63 +25,55 @@ module.exports = { shared: { '@angular/core': { singleton: true, - requiredVersion: '^12.0.0' + requiredVersion: '^16.1.1' }, '@angular/common': { singleton: true, - requiredVersion: '^12.0.0' + requiredVersion: '^16.1.1' }, '@angular/common/http': { singleton: true, - requiredVersion: '^12.0.0' + requiredVersion: '^16.1.1' }, '@angular/router': { singleton: true, - requiredVersion: '^12.0.0' + requiredVersion: '^16.1.1' }, '@angular/animations': { singleton: true, - requiredVersion: '^12.0.0' + requiredVersion: '^16.1.1' }, '@angular/cdk': { singleton: true, - requiredVersion: '^11.2.13' + requiredVersion: '^16.1.1' }, '@angular/cdk/table': { singleton: true, - requiredVersion: '^11.2.13' + requiredVersion: '^16.1.1' }, '@angular/cdk/observers': { singleton: true, - requiredVersion: '^11.2.13' + requiredVersion: '^16.1.1' }, '@angular/forms': { singleton: true, - requiredVersion: '^12.0.0' + requiredVersion: '^16.1.1' }, '@apollo/client': { singleton: true, - requiredVersion: '^3.3.7' - }, - '@apollo/link-error': { - singleton: true, - requiredVersion: '^2.0.0-beta.3' + requiredVersion: '^3.7.14' }, 'angular-svg-icon': { singleton: true, - requiredVersion: '^12.0.0' + requiredVersion: '^16.0.0' }, 'apollo-angular': { singleton: true, - requiredVersion: '^2.2.0' + requiredVersion: '^5.0.0' }, graphql: { singleton: true, - requiredVersion: '^14.7.0' - }, - 'graphql-tag': { - singleton: true, - requiredVersion: '^2.11.0' + requiredVersion: '^16.7.1' }, 'lodash-es': { singleton: true, @@ -87,40 +81,40 @@ module.exports = { }, luxon: { singleton: true, - requiredVersion: '3.0.0' + requiredVersion: '3.3.0' }, 'ng-animate': { singleton: true, - requiredVersion: '^1.0.0' + requiredVersion: '^2.0.1' }, 'ngx-chips': { singleton: true, - requiredVersion: '^2.2.2' + requiredVersion: '^3.0.0' }, '@swimlane/ngx-charts': { singleton: true, - requiredVersion: '^17.0.0' + requiredVersion: '^20.3.0' }, '@ng-bootstrap/ng-bootstrap': { singleton: true, - requiredVersion: '^9.0.2' + requiredVersion: '^15.0.1' }, 'bn-ng-idle': { singleton: true, - requiredVersion: '^1.0.1' + requiredVersion: '^2.0.5' }, 'rxjs': { singleton: true, - requiredVersion: '^6.6.3' + requiredVersion: '^7.8.1' }, 'rxjs/operators': { singleton: true, - requiredVersion: '^6.6.3' + requiredVersion: '^7.8.1' }, common: { @@ -134,7 +128,6 @@ module.exports = { import: 'dist/core', requiredVersion: false }, - } }), diff --git a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/config/extension.php b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/config/extension.php index 057ab39..483c353 100644 --- a/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/config/extension.php +++ b/connect/suitecrm/suitecrm-asterlink-module/extensions/asterlink/config/extension.php @@ -10,13 +10,13 @@ $extensions = $container->getParameter('extensions') ?? []; $extensions['asterlink'] = [ - 'remoteEntry' => './extensions/asterlink/remoteEntry.js', + 'remoteEntry' => '../extensions/asterlink/remoteEntry.js', 'remoteName' => 'asterlink', 'enabled' => true, 'extension_name' => 'AsterLink', 'extension_uri' => 'https://github.com/serfreeman1337/asterlink', 'description' => 'Asterisk PBX integration with SuiteCRM', - 'version' => '0.5.0', + 'version' => '0.5.1', 'author' => 'serfreeman1337', 'author_uri' => 'https://github.com/serfreeman1337', 'license' => 'MIT' diff --git a/connect/suitecrm/suitecrm-asterlink-module/manifest.php b/connect/suitecrm/suitecrm-asterlink-module/manifest.php index ebbff51..7c1ad61 100644 --- a/connect/suitecrm/suitecrm-asterlink-module/manifest.php +++ b/connect/suitecrm/suitecrm-asterlink-module/manifest.php @@ -1,9 +1,9 @@ - 'AsterLink', 'description' => 'Asterisk PBX integration with SuiteCRM', - 'version' => '0.5.0', + 'version' => '0.5.1', 'author' => 'serfreeman1337', 'readme' => '', 'acceptable_sugar_versions' => [ @@ -11,7 +11,7 @@ ], 'icon' => '', 'is_uninstallable' => true, - 'published_date' => '2023-07-14', + 'published_date' => '2024-02-04', 'type' => 'module', 'remove_tables' => 'prompt', ]; diff --git a/connect/suitecrm/suitecrm-asterlink-module/modules/AsterLink/AsterLinkEntryPoint.php b/connect/suitecrm/suitecrm-asterlink-module/modules/AsterLink/AsterLinkEntryPoint.php index 4a0d5d2..f80b45a 100644 --- a/connect/suitecrm/suitecrm-asterlink-module/modules/AsterLink/AsterLinkEntryPoint.php +++ b/connect/suitecrm/suitecrm-asterlink-module/modules/AsterLink/AsterLinkEntryPoint.php @@ -1,4 +1,4 @@ -get_list("", implode(' OR ', $fields), 0, 1); - if (!$rel['row_count']) { + if (!count($rel['list'])) { continue; }