Skip to content

Commit

Permalink
fix(suite): update to suitecrm version 8.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
serfreeman1337 committed Feb 4, 2024
1 parent 4dd6d5f commit 2b99444
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 85 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions README_suitecrm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion connect/suitecrm/suitecrm-asterlink-module/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
Expand All @@ -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<any>).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);
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/app",
"outDir": "../../out-tsc/app",
"target": "es2022",
"types": []
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -23,104 +25,96 @@ 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,
requiredVersion: '^4.17.20'
},
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: {
Expand All @@ -134,7 +128,6 @@ module.exports = {
import: 'dist/core',
requiredVersion: false
},

}

}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions connect/suitecrm/suitecrm-asterlink-module/manifest.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php // serfreeman1337 // 14.07.2023 //
<?php

$manifest = [
'name' => 'AsterLink',
'description' => 'Asterisk PBX integration with SuiteCRM',
'version' => '0.5.0',
'version' => '0.5.1',
'author' => 'serfreeman1337',
'readme' => '',
'acceptable_sugar_versions' => [
'regex_matches' => ['6\.5\.\d*$'],
],
'icon' => '',
'is_uninstallable' => true,
'published_date' => '2023-07-14',
'published_date' => '2024-02-04',
'type' => 'module',
'remove_tables' => 'prompt',
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php // serfreeman1337 // 13.07.2023 //
<?php

if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

Expand Down Expand Up @@ -64,7 +64,7 @@

$rel = BeanFactory::getBean($rel_config['module'])->get_list("", implode(' OR ', $fields), 0, 1);

if (!$rel['row_count']) {
if (!count($rel['list'])) {
continue;
}

Expand Down

0 comments on commit 2b99444

Please sign in to comment.