Skip to content

Commit

Permalink
Merge pull request #7 from dubas-pro/1.0.0
Browse files Browse the repository at this point in the history
1.0.0
  • Loading branch information
emillod authored May 19, 2022
2 parents 8c4d127 + b8fcc79 commit a79076d
Show file tree
Hide file tree
Showing 56 changed files with 7,109 additions and 23,224 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{*.yml,*.yaml}]
indent_style = space
indent_size = 2

[NOTICE]
insert_final_newline = false

[*.txt]
insert_final_newline = false
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NGROK_REGION=eu
NGROK_AUTH=
92 changes: 92 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
const extensionParams = require('./extension.json');
const releaseYear = (new Date(extensionParams.releaseDate)).getFullYear();
const currentYear = (new Date()).getFullYear();
const copyrightHeader = [
'***********************************************************************',
`This file is part of the ${extensionParams.name} - EspoCRM extension.`,
'',
`${extensionParams.author}`,
`Copyright (C) ${releaseYear}-${currentYear} ${extensionParams.authors.join(', ')}`,
'',
'This program is free software: you can redistribute it and/or modify',
'it under the terms of the GNU General Public License as published by',
'the Free Software Foundation, either version 3 of the License, or',
'(at your option) any later version.',
'',
'This program is distributed in the hope that it will be useful,',
'but WITHOUT ANY WARRANTY; without even the implied warranty of',
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the',
'GNU General Public License for more details.',
'',
'You should have received a copy of the GNU General Public License',
'along with this program. If not, see <https://www.gnu.org/licenses/>.',
'***********************************************************************'
];

module.exports = {
extends: 'eslint:recommended',
env: {
'browser': true,
'node': true,
'es2021': true,
'jquery': true,
},
globals: {
'Espo': 'readonly',
'define': 'readonly',
'_': 'readonly',
'moment': 'readonly',
'Backbone': 'readonly',
'Html5QrcodeScanner': 'readonly',
},
parserOptions: {
'ecmaVersion': 12,
'sourceType': 'module'

},
plugins: [
'header'
],
ignorePatterns: [
'/site/**',
'src/**/lib/**',
'build.js',
'copy-custom.js',
'helpers.js'
],
rules: {
'no-var': 'error',
'prefer-arrow-callback': ['error', { 'allowUnboundThis': false }],
'no-console': 'error',
'block-spacing': ['error', 'always'],
'indent': ['error', 4, { 'SwitchCase': 1 }],
'no-unused-vars': 'warn',
'comma-spacing': ['error', { 'before': false, 'after': true }],
'quotes': ['error', 'single', { 'avoidEscape': true }],
'padding-line-between-statements': [
'error',
{
'blankLine': 'always',
'prev': '*',
'next': [
'return'
]
}
],
'padded-blocks': [
'error',
{
'classes': 'always'
}
],
},
overrides: [
{
files: ['src/**/*.js'],
extends: 'eslint:recommended',
rules: {
'header/header': ['error', 'block', copyrightHeader]
}
},
]
};
55 changes: 0 additions & 55 deletions .eslintrc.json

This file was deleted.

31 changes: 28 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,40 @@ project.properties
.project
.settings*
.idea
.vscode
*.sublime-project
*.sublime-workspace
.sublimelinterrc
*.swp

build/
site/
vendor/
!src/**/site/
tests/integration/config.php
node_modules
.env
config.json
config.php
config.php
/extensions/

# Package Managers
.eslintcache
.pnpm-store/
node_modules/
vendor/

# Extension Directory
src/**/client/**/lib/*
src/**/client/**/css/espo/*
# src/**/client/**/fonts/*

# +----------------------------+
# | Keep .gitkeep files |
# +----------------------------+-------------------------------+
# | To keep an empty directory, add a .gitkeep file to it |
# | and ignore the directory with a wildcard: |
# | |
# | /path/to/dir/* |
# | |
# | this will ignore the content but not the director itself. |
# +------------------------------------------------------------+
!/**/.gitkeep
9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

29 changes: 0 additions & 29 deletions .vscode/settings.json

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.0.0 - 2022-05-18

- Switched to LESS
- Fixed compatibility issues
- Changed required version to 7+
65 changes: 65 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
const fs = require('fs');

module.exports = grunt => {

let themeList = [];

fs.readdirSync('src/files/custom/Espo/Modules/DubasLightTheme/Resources/metadata/themes').forEach(file => {
themeList.push(file.substr(0, file.length - 5));
});

let cssminFilesData = {};

let lessData = {};

themeList.forEach(theme => {
let name = camelCaseToHyphen(theme);

let files = {};

files['src/files/client/custom/modules/dubas-light-theme/css/espo/'+name+'.css'] = 'frontend/less/'+name+'/main.less';
files['src/files/client/custom/modules/dubas-light-theme/css/espo/'+name+'-iframe.css'] = 'frontend/less/'+name+'/iframe/main.less';

cssminFilesData['src/files/client/custom/modules/dubas-light-theme/css/espo/'+name+'.css'] = 'src/files/client/custom/modules/dubas-light-theme/css/espo/'+name+'.css';
cssminFilesData['src/files/client/custom/modules/dubas-light-theme/css/espo/'+name+'-iframe.css'] = 'src/files/client/custom/modules/dubas-light-theme/css/espo/'+name+'-iframe.css';

let o = {
options: {
yuicompress: true,
},
files: files,
};

lessData[theme] = o;
});

grunt.initConfig({
less: lessData,

cssmin: {
themes: {
files: cssminFilesData,
},
},
});

grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');

grunt.registerTask('css', [
'less',
'cssmin',
]);

grunt.registerTask('default', [
'css',
]);
};

function camelCaseToHyphen(string){
if (string === null) {
return string;
}

return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
}
14 changes: 7 additions & 7 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

Amazon Transcribe Integration
Copyright (C) 2020 dubas-pro / assets / php / espocrm / extensions
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -645,14 +645,14 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

Amazon Transcribe Integration Copyright (C) 2020 dubas-pro / assets / php / espocrm / extensions
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand All @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
8 changes: 0 additions & 8 deletions NOTICE

This file was deleted.

Loading

0 comments on commit a79076d

Please sign in to comment.