Compare commits

...

47 Commits

Author SHA1 Message Date
3e7c79d6ce test app async working 2021-04-23 12:10:37 +02:00
bc1f624e14 fix dummy controller 2021-04-23 10:49:15 +02:00
f73d3bf320 test app 2021-04-22 20:42:48 +02:00
2de8338651 webpack alias + move vues firsts files in better place 2021-04-22 14:13:47 +02:00
e7df62b373 A first VueJS component, get api datas, a simple button add person
* !! composer require serializer !!
* see: http://localhost:8001/fr/parcours/861/show
2021-04-21 08:53:51 +02:00
69ea88a4d5 Merge branch 'master' into _31_interface_creation_parcours 2021-04-19 19:19:19 +02:00
332178981a fix documentation for installation + various refernces 2021-04-19 14:36:03 +02:00
9566ea89b1 fix stylesheets locations, in chill-bundles or in project files 2021-04-15 20:51:04 +02:00
425d51649f vuejs hello world component 2021-04-15 17:14:35 +02:00
c32f730713 add vuejs npm packages and configure webpack 2021-04-15 17:04:49 +02:00
a48d6d2a0a composer require webpack-encore-bundle
Note:
* move flex in root composer.json (otherwise it is not read)
* webpack-encore-bundle needed to use twig function {{ encore_entry_script_tags() }}
* flex recipe add new 'assets' dir
2021-04-15 17:04:49 +02:00
16b155d449 init new AccompanyingCourse (parcours) section 2021-04-15 17:04:02 +02:00
985f067387 fix migration namespace 2021-04-14 13:25:08 +02:00
083f56bff0 Merge branch 'master' into _bootstrap_modal 2021-04-14 10:46:27 +02:00
8a83e8ed22 Merge branch '_8_entity_parcours' into 'master'
WIP issue8 : entity parcours

See merge request Chill-Projet/chill-bundles!8
2021-04-13 20:48:36 +00:00
f526453ba3 enable bootstrap assets for modals features 2021-04-13 19:37:02 +02:00
cc40e7a99a fix sql migration syntax 2021-04-13 15:31:04 +02:00
aa05223a4e fix translation 2021-04-02 19:22:57 +02:00
5bee607afb fix migration review: improve up and down query 2021-04-02 19:21:44 +02:00
de240b099f remove commented code in new repositories 2021-04-02 17:50:45 +02:00
36cdf4c220 Merge branch 'add-wysiwyg' into 'master'
Applique l'éditeur de texte sur plusieurs instances + rendu des "Comment Embeddable"

See merge request Chill-Projet/chill-bundles!7
2021-04-02 12:11:39 +00:00
34e5fbedf2 Merge branch 'features/new-phones' into 'master'
Features/new phones

See merge request Chill-Projet/chill-bundles!5
2021-04-02 12:11:20 +00:00
Jean-Francois Monfort
27c680bb03 Features/new phones 2021-04-02 12:11:20 +00:00
25634ba12b Make some relations bidirectionnal 2021-04-01 11:06:36 +02:00
01f24ecf1f Adapt entity AccompanyingPeriodParticipation attributes and methods (dont break UI) 2021-03-31 20:57:15 +02:00
a98056d31b Transform join table between Person and AccompanyingPeriod in Doctrine entity 2021-03-31 14:42:06 +02:00
bd7b4b3fdb fix repository for AccompanyingPeriod 2021-03-31 10:37:31 +02:00
a3395895cb Rename table closinmotive 2021-03-30 19:44:48 +02:00
1d6a8987e9 Allow to enable multiple simultaneous accompanyingPeriods 2021-03-30 18:35:15 +02:00
fa5d0fbd21 Merge branch 'master' into _8_entity_parcours 2021-03-30 11:21:06 +02:00
3a50aea138 fix service dependency injection for validatorInterface 2021-03-30 11:13:36 +02:00
24d8b55591 minor corrections 2021-03-30 10:18:08 +02:00
85c4560f22 Complete accompanying period entity 2021-03-29 18:40:56 +02:00
c45390dd89 add Accompanying Period Comment and Resource entities 2021-03-29 14:34:02 +02:00
acff64c16f Add Origin Entity in Accompanying Period package 2021-03-29 11:24:57 +02:00
ba31927dc3 move CloseMotive Repository in AccompanyingPeriod package 2021-03-29 11:04:01 +02:00
365a398743 fixtures accompanyingPeriod + fixture new firstnames set 2021-03-27 16:50:57 +01:00
ea4e3c715e fix syntax php7 2021-03-27 13:37:37 +01:00
0a17011cc3 add fixtures to test duplicate person 2021-03-27 12:36:15 +01:00
0d9f3d7dba fix inconsistency in fixtures 2021-03-27 11:50:03 +01:00
dcc6969310 add migration down query to preserve datas 2021-03-27 11:30:50 +01:00
f6801c0c4f make new relation many-to-many between Person and AccompagnyingPeriod 2021-03-26 21:57:18 +01:00
813ecb0201 cleaning 2021-03-26 21:48:27 +01:00
89d95a0eae bootstrap, enable only conflicts assets (><scratch) 2021-03-21 15:09:08 +01:00
6bcdbaf668 separate scratch from chill entrypoint, and move it into a specific module 2021-03-21 15:09:08 +01:00
0a0895584c remove button bourbon hack 2021-03-21 15:09:08 +01:00
d7d8f2a60a enable bootstrap, disable ckeditor 2021-03-21 15:09:08 +01:00
207 changed files with 4339 additions and 807 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.composer/*
composer.phar
docs/build/

View File

@@ -22,7 +22,6 @@
"require": {
"champs-libres/async-uploader-bundle": "dev-sf4",
"graylog2/gelf-php": "^1.5",
"symfony/flex": "^1.9",
"symfony/form": "4.*",
"symfony/twig-bundle": "^4.4",
"twig/extra-bundle": "^2.12|^3.0",
@@ -38,6 +37,7 @@
"symfony/validator": "4.*",
"sensio/framework-extra-bundle": "^5.5",
"symfony/yaml": "4.*",
"symfony/webpack-encore-bundle": "^1.11",
"knplabs/knp-menu": "^3.1",
"knplabs/knp-menu-bundle": "^3.0",
"symfony/templating": "4.*",
@@ -52,7 +52,8 @@
"symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2",
"twig/markdown-extra": "^3.3",
"erusev/parsedown": "^1.7"
"erusev/parsedown": "^1.7",
"symfony/serializer": "^5.2"
},
"conflict": {
"symfony/symfony": "*"

View File

@@ -14,7 +14,6 @@ As Chill rely on the `symfony <http://symfony.com>`_ framework, reading the fram
.. toctree::
:maxdepth: 2
Install Chill for development <installation.rst>
Instructions to create a new bundle <create-a-new-bundle.rst>
CRUD (Create - Update - Delete) for one entity <crud.rst>
Routing <routing.rst>

View File

@@ -1,155 +0,0 @@
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
.. _installation-for-development :
Installation for development
****************************
Installation for development should allow:
- access to the source code,
- upload the code to our CVS (i.e. `git`_) and
- work with `composer`_.
As Chill is divided into bundles (the Symfony name for 'modules'), each bundle has his own repository.
Installation and big picture
----------------------------
First, you should install Chill as described in the :ref:`basic-installation` section.
Two things must be modified :
First, add the `--prefer-source` argument when you create project.
.. code-block:: bash
composer create-project chill-project/standard path/to/your/directory --stability=dev --prefer-source
Second, when composer ask you the following question : ::
Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]?
**You should answer `n` (no).**
Once Chill is installed, all the downloaded bundles will be stored in the `/vendor` directories.
In those directories, you will have access to the git commands.
.. code-block:: bash
$ cd vendor/chill-project/main/
$ git remote -v
composer git://github.com/Chill-project/Standard.git (fetch)
composer git://github.com/Chill-project/Standard.git (push)
origin git://github.com/Chill-project/Standard.git (fetch)
origin git@github.com:Chill-project/Standard.git (push)
Files cleaning after installation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Composer will delete unrequired files, and add some. This is perfectly normal and will appears in your git index.
But you should NOT delete those files.
This is the expected 'git status' result:
.. code-block:: bash
$git status
#(...)
Modifications qui ne seront pas validées :
(utilisez "git add/rm <fichier>..." pour mettre à jour ce qui sera validé)
(utilisez "git checkout -- <fichier>..." pour annuler les modifications dans la copie de travail)
modifié: app/SymfonyRequirements.php
supprimé: app/SymfonyStandard/Composer.php
supprimé: app/SymfonyStandard/RootPackageInstallSubscriber.php
modifié: app/check.php
You can ignore the local changes using the `git update-index --assume-unchanged` command.
.. code-block:: bash
$ git update-index --assume-unchanged app/check.php
$ git update-index --assume-unchanged app/SymfonyRequirements.php
$ git update-index --assume-unchanged app/SymfonyStandard/Composer.php
$ git update-index --assume-unchanged app/SymfonyStandard/RootPackageInstallSuscriber.php
Working with your own fork
^^^^^^^^^^^^^^^^^^^^^^^^^^
Ideally, you will work on a fork of the main github repository.
To ensure that composer will download the code from **your** repository, you will have to adapt the `composer.json` file accordingly, using your own repositories.
For each Chill module that you have forked, add an indexed array into the "repositories" key of the composer.json file
at the root of the chill installation directory if you want to force composer to download from your own forked repositories:
.. code-block:: json
"repositories": [
{
"type": "git",
"url": "git://github.com/your-github-username/ChillMain.git"
},
{
"type": "git",
"url": "git://github.com/your-github-username/Chill-Person.git"
}
]
Then run composer update to load your forked code.
If it does not happen, delete the content of the chill/vendor/chill-project/my_forked_bundle and relaunch composer update and the code will be downloaded from your fork.
.. code-block:: bash
composer update
You may also `use aliases <https://getcomposer.org/doc/articles/aliases.md>`_ to define versions.
.. _editing-code-and-commiting :
Editing the code and commiting
------------------------------
You may edit code in the `vendor/path/to/the/bundle` directory.
Once satisfied with your changes, you should commit as usually :
.. code-block:: bash
$ cd vendor/path/to/bundle
$ git status
Sur la branche master
Votre branche est à jour avec 'origin/master'.
rien à valider, la copie de travail est propre
.. warning
The git command must be run from you vendor bundle's path (`vendor/path/to/bundle`).
Tips
^^^^
The command `composer status` (`see composer documentation <https://getcomposer.org/doc/03-cli.md#status>`_) will give you and idea of which bundle has been edited :
.. code-block:: bash
$ cd ./../../ #back to the root project directory
$ composer status
You have changes in the following dependencies:
/path/to/your/project/install/vendor/chill-project/main
Use --verbose (-v) to see modified files
.. _git: http://git-scm.org
.. _composer: https://getcomposer.org

View File

@@ -30,21 +30,14 @@ Contents of this documentation:
Let's talk together !
======================
Subscribe to the dev mailing-list to discuss your project and extend Chill with the feature you need!
- `The dev mailing-list <https://lists.chill.social/listinfo/dev>`_
- `Read the archives of the mailing-list <https://lists.chill.social/pipermail/dev/>`_
You may talk to developers using the matrix room: `https://app.element.io/#/room/#chill-social-admin:matrix.org`_
Contribute
==========
* `Issue tracker <https://git.framasoft.org/groups/Chill-project/issues>`_ You may want to dispatch the issue in the multiple projects. If you do not know in which project is located your bug / feature request, use the project Chill-Main.
* `The dev mailing-list <https://lists.chill.social/listinfo/dev>`_
* `Issue tracker <https://gitlab.com/groups/Chill-project/issues>`_ You may want to dispatch the issue in the multiple projects. If you do not know in which project is located your bug / feature request, use the project Chill-Main.
Source code is dispatched in multiple bundle, to improve re-usability. Each bundle has dependencies with other chill bundle, but the developer take care that bundles may not be installed if the user do not need it.
User manual
===========
@@ -56,22 +49,22 @@ An user manual exists in French and currently focuses on describing the main con
Available bundles
=================
* Chill-standard | https://git.framasoft.org/Chill-project/Chill-Standard This is the skeleton of the project. It does contains only few code, but information about configuration of your instance ;
* Chill-Main : https://git.framasoft.org/Chill-project/Chill-Main : the main, required bundle for all the subsequent chill bundles. It contains the framework to add features (like searching, timeline, ...). It also provides the user managements (authentification and authorization) ;
* Chill-Person : https://git.framasoft.org/Chill-project/Chill-Person This is the bundle which provides the possibility to create and add a person.
* Chill-CustomFields : https://git.framasoft.org/Chill-project/Chill-CustomFields This bundle allows you to create custom fields on other bundles. It provides the framework for this features, and modify the schema according to this. It is required by Chill-Person and Chill-Report.
* Chill-Report: https://git.framasoft.org/Chill-project/Chill-Report This bundle allow to add report about People recorded in your database ;
* Chill-Activity : https://git.framasoft.org/Chill-project/Chill-Activity This bundle allow to add activities about People recorded in your database ;
* Chill-ICPC2 : https://git.framasoft.org/Chill-project/Chill-ICPC2 This bundle provides a custom fields for `ICPC code <https://en.wikipedia.org/wiki/International_Classification_of_Primary_Care>`_ (international classification for primary care)
* Chill-Group: https://git.framasoft.org/Chill-project/Chill-Group This bundle provides a way to create link between accompanyed people
* Chill-Event: https://git.framasoft.org/Chill-project/Chill-Event This bundle provides a way to create event and associate people to event through a "participation"
* Chill-Ldap: https://git.framasoft.org/Chill-project/Chill-Ldap Allow to synchronize the database with a ldap directory.
* Chill-ONEStat : https://framagit.org/Chill-project/Chill-ONEStat Provide statistics for the Belgian one "Centre de vacances" and "Ecoles de devoir".
* Chill-app | https://gitlab.com/Chill-project/Chill-app This is the skeleton of the project. It does contains only few code, but information about configuration of your instance ;
* Chill-bundle: contains the main bundles, the most used in an instance. This means:
* chill-main, the main framework,
* Chill Person, to deal with persons,
* chill custom fields, to add custom fields to some entities,
* chill activity: to add activities to people,
* chill report: to add report to people,
* chill event: to gather people into events,
* chill docs store: to store documents to people, but also entities,
* chill task: to register task with people,
* chill third party: to register third parties,
* chill family members: to register family members
You will also found the following projects :
* The present documentation : https://git.framasoft.org/Chill-project/chill-documentation
* The website https://chill.social : https://git.framasoft.org/Chill-project/chill.social
* The website https://chill.social : https://gitlab.com/Chill-project/chill.social
And various project to build docker containers with Chill.

View File

@@ -27,13 +27,13 @@ Installation in development mode
1. Get the code
===============
Clone or download the chill-standard project and `cd` into the main directory.
Clone or download the chill-app project and `cd` into the main directory.
.. code-block:: bash
git clone https://framagit.org/Chill-project/Chill-Standard.git
cd Chill-Standard
git clone https://gitlab.com/Chill-Projet/chill-app.git
cd chill-app
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command ``id -u`` in each following scripts.

View File

@@ -14,6 +14,7 @@ use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\Role\RoleHierarchy;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Form\Type\ComposedRoleScopeType;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
@@ -43,6 +44,11 @@ class PermissionsGroupController extends AbstractController
*/
private $translator;
/**
* @var ValidatorInterface
*/
private $validator;
/**
* PermissionsGroupController constructor.
*
@@ -50,18 +56,21 @@ class PermissionsGroupController extends AbstractController
* @param RoleProvider $roleProvider
* @param RoleHierarchy $roleHierarchy
* @param TranslatorInterface $translator
* @param ValidatorInterface $validator
*/
public function __construct(
TranslatableStringHelper $translatableStringHelper,
RoleProvider $roleProvider,
RoleHierarchy $roleHierarchy,
TranslatorInterface $translator
TranslatorInterface $translator,
ValidatorInterface $validator
)
{
$this->translatableStringHelper = $translatableStringHelper;
$this->roleProvider = $roleProvider;
$this->roleHierarchy = $roleHierarchy;
$this->translator = $translator;
$this->validator = $validator;
}
/**
@@ -452,7 +461,7 @@ class PermissionsGroupController extends AbstractController
);
$permissionsGroup->addRoleScope($roleScope);
$violations = $this->get('validator')->validate($permissionsGroup);
$violations = $this->validator->validate($permissionsGroup);
if ($violations->count() === 0) {
$em->flush();

View File

@@ -11,6 +11,7 @@ use Chill\MainBundle\Form\UserType;
use Chill\MainBundle\Entity\GroupCenter;
use Chill\MainBundle\Form\Type\ComposedGroupCenterType;
use Chill\MainBundle\Form\UserPasswordType;
use Symfony\Component\Validator\Validator\ValidatorInterface;
/**
@@ -28,14 +29,21 @@ class UserController extends AbstractController
*/
private $logger;
/**
* @var ValidatorInterface
*/
private $validator;
/**
* UserController constructor.
*
* @param LoggerInterface $logger
* @param ValidatorInterface $validator
*/
public function __construct(LoggerInterface $logger)
public function __construct(LoggerInterface $logger, ValidatorInterface $validator)
{
$this->logger = $logger;
$this->validator = $validator;
}
/**
@@ -258,7 +266,7 @@ class UserController extends AbstractController
$form[self::FORM_GROUP_CENTER_COMPOSED]->getData());
$user->addGroupCenter($groupCenter);
if ($this->get('validator')->validate($user)->count() === 0) {
if ($this->validator->validate($user)->count() === 0) {
$em->flush();
$this->addFlash('success', $this->get('translator')->trans('The '
@@ -267,7 +275,7 @@ class UserController extends AbstractController
return $this->redirect($this->generateUrl('admin_user_edit',
array('id' => $uid)));
} else {
foreach($this->get('validator')->validate($user) as $error)
foreach($this->validator->validate($user) as $error)
$this->addFlash('error', $error->getMessage());
}
}
@@ -380,7 +388,7 @@ class UserController extends AbstractController
// logging for prod
$this->logger->info('update password for an user', [
'by' => $this->getUser()->getUsername(),
'by' => $this->getUser()->getUsername(),
'user' => $user->getUsername()
]);

View File

@@ -26,146 +26,168 @@ use Psr\Cache\CacheItemPoolInterface;
/**
* Helper to some task linked to phonenumber.
*
* Currently, only Twilio is supported (https://www.twilio.com/lookup). A method
*
* Currently, only Twilio is supported (https://www.twilio.com/lookup). A method
* allow to check if the helper is configured for validation. This should be used
* before doing some validation.
*
*
*
*/
class PhonenumberHelper
{
/**
*
* @var Client
* Twilio client
*/
protected $twilioClient;
protected Client $twilioClient;
/**
*
* @var LoggerInterface
* TRUE if the client is properly configured
*/
protected $logger;
/**
*
* @var CacheItemPoolInterface
*/
protected $cachePool;
protected bool $isConfigured = false;
protected LoggerInterface $logger;
protected CacheItemPoolInterface $cachePool;
const LOOKUP_URI = 'https://lookups.twilio.com/v1/PhoneNumbers/%s';
const FORMAT_URI = 'https://lookups.twilio.com/v1/PhoneNumbers/%s';
public function __construct(
CacheItemPoolInterface $cachePool,
$config,
$config,
LoggerInterface $logger
) {
$this->logger = $logger;
$this->cachePool = $cachePool;
if (\array_key_exists('twilio_sid', $config)
if (\array_key_exists('twilio_sid', $config)
&& !empty($config['twilio_sid'])
&& \array_key_exists('twilio_secret', $config)
&& !empty($config['twilio_secret'])) {
&& strlen($config['twilio_sid']) > 2
&& \array_key_exists('twilio_secret', $config)
&& !empty($config['twilio_secret'])
&& strlen($config['twilio_secret']) > 2
) {
$this->twilioClient = new Client([
'auth' => [ $config['twilio_sid'], $config['twilio_secret'] ]
]);
}
$this->isConfigured = TRUE;
}
}
/**
* Return true if the validation is configured and available.
*
*
* @return bool
*/
public function isPhonenumberValidationConfigured() : bool
{
return NULL !== $this->twilioClient;
return $this->isConfigured;
}
/**
* REturn true if the phoennumber is a mobile phone. Return always false
* REturn true if the phoennumber is a mobile phone. Return always true
* if the validation is not configured.
*
*
* @param string $phonenumber
* @return bool
*/
public function isValidPhonenumberMobile($phonenumber) : bool
{
$validation = $this->performTwilioLookup($phonenumber);
if (NULL === $validation) {
return false;
if (FALSE === $this->isPhonenumberValidationConfigured()) {
return true;
}
$validation = $this->performTwilioLookup($phonenumber);
if (NULL === $validation) {
return true;
}
return $validation === 'mobile';
}
/**
* Return true if the phonenumber is a landline or voip phone. Return always false
* Return true if the phonenumber is a landline or voip phone. Return always true
* if the validation is not configured.
*
*
* @param string $phonenumber
* @return bool
*/
public function isValidPhonenumberLandOrVoip($phonenumber) : bool
{
$validation = $this->performTwilioLookup($phonenumber);
if (NULL === $validation) {
return false;
if (FALSE === $this->isPhonenumberValidationConfigured()) {
return true;
}
$validation = $this->performTwilioLookup($phonenumber);
if (NULL === $validation) {
return true;
}
return \in_array($validation, [ 'landline', 'voip' ]);
}
/**
* Return true if the phonenumber is a landline or voip phone. Return always false
* Return true if the phonenumber is a landline or voip phone. Return always true
* if the validation is not configured.
*
*
* @param string $phonenumber
* @return bool
*/
public function isValidPhonenumberAny($phonenumber) : bool
{
if (FALSE === $this->isPhonenumberValidationConfigured()) {
return true;
}
$validation = $this->performTwilioLookup($phonenumber);
;
if (NULL === $validation) {
return false;
}
return \in_array($validation, [ 'landline', 'voip', 'mobile' ]);
}
/**
* Get type (mobile, landline, ...) for phone number
*
* @param string $phonenumber
*
* @return string
*/
public function getType(string $phonenumber): string
{
return $this->performTwilioLookup($phonenumber) ?? 'unknown';
}
public function format($phonenumber)
{
return $this->performTwilioFormat($phonenumber);
}
protected function performTwilioFormat($phonenumber)
{
if (FALSE === $this->isPhonenumberValidationConfigured()) {
return $phonenumber;
}
// filter only number
$filtered = \preg_replace("/[^0-9]/", "", $phonenumber);
$item = $this->cachePool->getItem('pnum_format_nat_'.$filtered);
if ($item->isHit()) {
return $item->get();
}
try {
$response = $this->twilioClient->get(sprintf(self::FORMAT_URI, '+'.$filtered), [
'http_errors' => true,
]);
} catch (ClientException $e) {
$response = $e->getResponse();
$this->logger->error("[phonenumber helper] Could not format number "
@@ -174,7 +196,7 @@ class PhonenumberHelper
"status_code" => $response->getStatusCode(),
"phonenumber" => $phonenumber
]);
return $phonenumber;
} catch (ServerException $e) {
$response = $e->getResponse();
@@ -184,7 +206,7 @@ class PhonenumberHelper
"status_code" => $response->getStatusCode(),
"phonenumber" => $phonenumber
]);
return null;
} catch (ConnectException $e) {
$this->logger->error("[phonenumber helper] Could not format number "
@@ -192,38 +214,38 @@ class PhonenumberHelper
"message" => $e->getMessage(),
"phonenumber" => $phonenumber
]);
return null;
}
$format = \json_decode($response->getBody())->national_format;
$item
->set($format)
// expires after 3d
->expiresAfter(3600 * 24 * 3)
;
$this->cachePool->save($item);
return $format;
}
protected function performTwilioLookup($phonenumber)
{
if (FALSE === $this->isPhonenumberValidationConfigured()) {
return null;
}
// filter only number
$filtered = \preg_replace("/[^0-9]/", "", $phonenumber);
$item = $this->cachePool->getItem('pnum_'.$filtered);
if ($item->isHit()) {
return $item->get();
//return $item->get();
}
try {
$response = $this->twilioClient->get(sprintf(self::LOOKUP_URI, '+'.$filtered), [
'http_errors' => true,
@@ -241,7 +263,7 @@ class PhonenumberHelper
"status_code" => $response->getStatusCode(),
"phonenumber" => $phonenumber
]);
return null;
} catch (ConnectException $e) {
$this->logger->error("[phonenumber helper] Could not format number "
@@ -249,20 +271,20 @@ class PhonenumberHelper
"message" => $e->getMessage(),
"phonenumber" => $phonenumber
]);
return null;
}
$validation = \json_decode($response->getBody())->carrier->type;
$item
->set($validation)
// expires after 12h
->expiresAfter(3600 * 12)
;
$this->cachePool->save($item);
return $validation;
}
}

View File

@@ -21,9 +21,7 @@ global.chill = chill;
/*
* load requirements in chill entrypoint
*/
require('./sass/scratch.scss');
require('./scss/chillmain.scss');
require('./css/chillmain.css');
require('./css/pikaday.css');
@@ -37,10 +35,11 @@ require('./modules/download-report/index.js');
require('./modules/select_interactive_loading/index.js');
require('./modules/export-list/export-list.scss');
require('./modules/entity/index.js');
//require('./modules/tabs/index.js');
/*
* load img
*/
require('./img/favicon.ico');
require('./img/logo-chill-sans-slogan_white.png');
require('./img/logo-chill-outil-accompagnement_white.png');
require('./img/logo-chill-outil-accompagnement_white.png');

View File

@@ -0,0 +1,4 @@
/*
* These custom styles will override bootstrap enabled stylesheets
*/

View File

@@ -0,0 +1,47 @@
/*
* Enable / disable bootstrap assets
*/
@import "bootstrap/scss/functions";
/* replace variables */
// @import "bootstrap/scss/variables";
@import "custom/_variables";
@import "bootstrap/scss/mixins";
// @import "bootstrap/scss/root";
// @import "bootstrap/scss/reboot";
// @import "bootstrap/scss/type";
// @import "bootstrap/scss/images";
// @import "bootstrap/scss/code";
// @import "bootstrap/scss/grid";
// @import "bootstrap/scss/tables";
// @import "bootstrap/scss/forms";
// @import "bootstrap/scss/buttons";
// @import "bootstrap/scss/transitions";
// @import "bootstrap/scss/dropdown";
// @import "bootstrap/scss/button-group";
// @import "bootstrap/scss/input-group";
// @import "bootstrap/scss/custom-forms";
// @import "bootstrap/scss/nav";
// @import "bootstrap/scss/navbar";
// @import "bootstrap/scss/card";
// @import "bootstrap/scss/breadcrumb";
// @import "bootstrap/scss/pagination";
// @import "bootstrap/scss/badge";
// @import "bootstrap/scss/jumbotron";
// @import "bootstrap/scss/alert";
// @import "bootstrap/scss/progress";
// @import "bootstrap/scss/media";
// @import "bootstrap/scss/list-group";
// @import "bootstrap/scss/close";
// @import "bootstrap/scss/toasts";
@import "bootstrap/scss/modal";
// @import "bootstrap/scss/tooltip";
// @import "bootstrap/scss/popover";
// @import "bootstrap/scss/carousel";
// @import "bootstrap/scss/spinners";
// @import "bootstrap/scss/utilities";
// @import "bootstrap/scss/print";
@import "custom";

View File

@@ -1,42 +0,0 @@
/*
* when bootstrap.css comes after chill.css
* we have to disable conflict classes
*/
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/root";
//@import "bootstrap/scss/reboot"; // h1, h2, h3, ...
//@import "bootstrap/scss/type"; // h1, h2, h3, ...
@import "bootstrap/scss/images";
@import "bootstrap/scss/code";
//@import "bootstrap/scss/grid"; // container
@import "bootstrap/scss/tables";
@import "bootstrap/scss/forms";
@import "bootstrap/scss/buttons";
@import "bootstrap/scss/transitions";
@import "bootstrap/scss/dropdown";
@import "bootstrap/scss/button-group";
@import "bootstrap/scss/input-group";
@import "bootstrap/scss/custom-forms";
@import "bootstrap/scss/nav";
@import "bootstrap/scss/navbar";
@import "bootstrap/scss/card";
@import "bootstrap/scss/breadcrumb";
@import "bootstrap/scss/pagination";
@import "bootstrap/scss/badge";
@import "bootstrap/scss/jumbotron";
@import "bootstrap/scss/alert";
@import "bootstrap/scss/progress";
@import "bootstrap/scss/media";
@import "bootstrap/scss/list-group";
@import "bootstrap/scss/close";
@import "bootstrap/scss/toasts";
@import "bootstrap/scss/modal";
@import "bootstrap/scss/tooltip";
@import "bootstrap/scss/popover";
@import "bootstrap/scss/carousel";
@import "bootstrap/scss/spinners";
@import "bootstrap/scss/utilities";
@import "bootstrap/scss/print";

View File

@@ -1,9 +1,9 @@
// Compile all bootstrap assets from nodes-modules
//require('bootstrap/scss/bootstrap.scss')
// Compile custom styles to adapt bootstrap in chill context
require('./custom.scss')
// Or compile bootstrap only enabled assets
require('./bootstrap.scss');
// You can specify which plugins you need
//import { Tooltip, Toast, Popover } from 'bootstrap';
//import Alert from 'bootstrap/js/dist/alert';
import Modal from 'bootstrap/js/dist/modal';

View File

@@ -1,3 +1,9 @@
/*
* NOTE 2021.04
* scss/chill.scss is the main sass file for the new chill.2
* scratch will be replaced by bootstrap, please avoid to edit in modules/scratch/_custom.scss
*/
// YOUR CUSTOM SCSS
@import 'custom/config/colors';
@import 'custom/config/variables';
@@ -156,7 +162,6 @@ dl.chill_view_data {
}
blockquote.chill-user-quote,
div.chill-user-quote {
border-left: 10px solid $chill-yellow;
@@ -164,12 +169,12 @@ div.chill-user-quote {
padding: 0.5em 10px;
quotes: "\201C""\201D""\2018""\2019";
background-color: $chill-llight-gray;
blockquote {
margin: 1.5em 10px;
padding: 0.5em 10px;
}
blockquote:before {
color: #ccc;
content: open-quote;
@@ -182,5 +187,4 @@ div.chill-user-quote {
.chill-no-data-statement {
font-style: italic;
}

View File

@@ -1,42 +1,42 @@
@charset "UTF-8";
/// Outputs the spec and prefixed versions of the `::selection` pseudo-element.
///
/// @param {Bool} $current-selector [false]
/// If set to `true`, it takes the current element into consideration.
///
/// @example scss - Usage
/// .element {
/// @include selection(true) {
/// background-color: #ffbb52;
/// }
/// }
///
/// @example css - CSS Output
/// .element::-moz-selection {
/// background-color: #ffbb52;
/// }
///
/// .element::selection {
/// background-color: #ffbb52;
/// }
@mixin selection($current-selector: false) {
@if $current-selector {
&::-moz-selection {
@content;
}
&::selection {
@content;
}
} @else {
::-moz-selection {
@content;
}
::selection {
@content;
}
}
}
@charset "UTF-8";
/// Outputs the spec and prefixed versions of the `::selection` pseudo-element.
///
/// @param {Bool} $current-selector [false]
/// If set to `true`, it takes the current element into consideration.
///
/// @example scss - Usage
/// .element {
/// @include selection(true) {
/// background-color: #ffbb52;
/// }
/// }
///
/// @example css - CSS Output
/// .element::-moz-selection {
/// background-color: #ffbb52;
/// }
///
/// .element::selection {
/// background-color: #ffbb52;
/// }
@mixin selection($current-selector: false) {
@if $current-selector {
&::-moz-selection {
@content;
}
&::selection {
@content;
}
} @else {
::-moz-selection {
@content;
}
::selection {
@content;
}
}
}

Some files were not shown because too many files have changed in this diff Show More