diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85c3d476c..ddf7fccbe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,6 +29,7 @@ variables: REDIS_URL: redis://redis:6379 # change vendor dir to make the app install into tests/apps COMPOSER_VENDOR_DIR: tests/app/vendor + DEFAULT_CARRIER_CODE: BE stages: - Composer install @@ -78,6 +79,7 @@ psalm_tests: image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4 script: - bin/grumphp run --tasks=psalm + allow_failure: true artifacts: expire_in: 30 min paths: diff --git a/CHANGELOG.md b/CHANGELOG.md index c58ce78b0..af5611cd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to ## Unreleased +* [parcours] Toggle emergency/intensity only by referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/442) * [docstore] Add an API entrypoint for StoredObject (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466) * [person] Add the possibility of uploading existing documents to AccPeriodWorkEvaluationDocument (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466) * [person] Add title to AccPeriodWorkEvaluationDocument (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466) @@ -19,6 +20,13 @@ and this project adheres to * [draft periods] add a delete button (if acl granted) on each draft period listed on draft period page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/463) * [Person] Display suffixText in RenderPerson, PersonText.vue, RenderPersonBox.vue (was made for displaying "enfant confie") (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/441) * [budget]: budget enabled for persons and households (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/469) +* [person] residential address: show residential address or info in PersonRenderBox, refactor Residential Address (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/439) +* [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345) +* [documents] Improve flex-table item-col placement when long buttons and long metadata +* [thirdparty] Fix display of multiple contact badges so they wrap onto next line (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/482) +* [confidential] Fix position of toggle button so it does not cover text nor fall outside of box (no issue) +* [parcours] Fix edit of both thirdparty and contact name (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/474) +* [template] do not list inactive templates (for doc generator) ## Test releases @@ -34,7 +42,6 @@ and this project adheres to * [person]: AddPersons: add suggestion of name when creating new person or thirdparty (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422) * [main] Address: fix small bug: when modifying an address without street (isNoAddress), also check errors if street is an empty string as back-end change null value to empty string for street (and streetNumber) * [main] Address: stronger client-side validation of addresses (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/449) -* [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345) * [person] accompanying course: filter suggested entities by open participations (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/415) [activity] can click through the cross icon for removing person in concerned group (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/476) [activity] correct associated persons by considering only open participations (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/476) @@ -67,6 +74,7 @@ and this project adheres to * [parcours]: Mes parcours brouillon added to user menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/440) * [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414) * [person]: style fix in parcours listing per person. (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/432) +* [parcours]: Only the referrer can toggle the intensity of the parcours (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/442) * [household]: display address of current household (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/415) * ajoute un ordre dans les localisation (api) * [pick entity]: fix translations in modal (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/419) @@ -315,6 +323,7 @@ and this project adheres to * add an endpoint for checking permissions. See https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/232 * [activity] for a new activity: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties * [calendar] for a new rdv: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties +* [period] Validation added when period is confidential and confirmed -> user cannot be null. ## Test releases diff --git a/composer b/composer new file mode 100755 index 000000000..0e7ab8212 Binary files /dev/null and b/composer differ diff --git a/composer.json b/composer.json index 2223f65c0..c96738df8 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ "league/csv": "^9.7.1", "nyholm/psr7": "^1.4", "ocramius/package-versions": "^1.10", + "odolbeau/phone-number-bundle": "^3.6", "phpoffice/phpspreadsheet": "^1.16", "ramsey/uuid-doctrine": "^1.7", "sensio/framework-extra-bundle": "^5.5", diff --git a/phpstan-types.neon b/phpstan-types.neon index 2cc55255a..ed2de3c91 100644 --- a/phpstan-types.neon +++ b/phpstan-types.neon @@ -295,11 +295,6 @@ parameters: count: 3 path: src/Bundle/ChillMainBundle/Form/Type/DataTransformer/DateIntervalTransformer.php - - - message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" - count: 1 - path: src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" count: 2 @@ -325,11 +320,6 @@ parameters: count: 1 path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php - - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" - count: 1 - path: src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" count: 1 diff --git a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php index 5d99efa94..a0ab109fb 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php +++ b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php @@ -70,6 +70,7 @@ final class DocGeneratorTemplateRepository implements ObjectRepository $builder ->where('t.entity LIKE :entity') + ->andWhere($builder->expr()->eq('t.active', "'TRUE'")) ->setParameter('entity', addslashes($entity)); return $builder diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/List/list_item.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/List/list_item.html.twig index 847ddd388..5ce03091b 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/List/list_item.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/List/list_item.html.twig @@ -42,41 +42,40 @@
{{ mmm.createdBy(document) }}
-
-
+ {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %} +
  • + +
  • + {% endif %} +
  • + {{ chill_entity_workflow_list('Chill\\DocStoreBundle\\Entity\\AccompanyingCourseDocument', document.id) }} +
  • + {% else %} + {% if is_granted('CHILL_PERSON_DOCUMENT_SEE_DETAILS', document) %} +
  • + {{ m.download_button(document.object, document.title) }} +
  • +
  • + +
  • + {% endif %} + {% if is_granted('CHILL_PERSON_DOCUMENT_UPDATE', document) %} +
  • + +
  • + {% endif %} + {% endif %} + + diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 6e3d6d85e..5ad7348ee 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -39,6 +39,7 @@ use Chill\MainBundle\Form\LocationTypeType; use Chill\MainBundle\Form\UserJobType; use Chill\MainBundle\Form\UserType; use Exception; +use Misd\PhoneNumberBundle\Doctrine\DBAL\Types\PhoneNumberType; use Ramsey\Uuid\Doctrine\UuidType; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -235,6 +236,7 @@ class ChillMainExtension extends Extension implements 'dateinterval' => NativeDateIntervalType::class, 'point' => PointType::class, 'uuid' => UuidType::class, + 'phone_number' => PhoneNumberType::class, ], ], ] diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php index 9236c8a50..be8baf79a 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php @@ -97,6 +97,9 @@ class Configuration implements ConfigurationInterface ->scalarNode('twilio_secret') ->defaultNull() ->end() + ->scalarNode('default_carrier_code') + ->defaultNull() + ->end() ->end() ->end() ->arrayNode('acl') diff --git a/src/Bundle/ChillMainBundle/Entity/Location.php b/src/Bundle/ChillMainBundle/Entity/Location.php index bff3ff37b..c1421586f 100644 --- a/src/Bundle/ChillMainBundle/Entity/Location.php +++ b/src/Bundle/ChillMainBundle/Entity/Location.php @@ -18,9 +18,9 @@ use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint; use DateTimeImmutable; use DateTimeInterface; use Doctrine\ORM\Mapping as ORM; +use libphonenumber\PhoneNumber; use Symfony\Component\Serializer\Annotation as Serializer; use Symfony\Component\Serializer\Annotation\DiscriminatorMap; -use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Table(name="chill_main_location") @@ -90,20 +90,18 @@ class Location implements TrackCreationInterface, TrackUpdateInterface private ?string $name = null; /** - * @ORM\Column(type="string", length=64, nullable=true) + * @ORM\Column(type="phone_number", nullable=true) * @Serializer\Groups({"read", "write", "docgen:read"}) - * @Assert\Regex(pattern="/^([\+{1}])([0-9\s*]{4,20})$/") * @PhonenumberConstraint(type="any") */ - private ?string $phonenumber1 = null; + private ?PhoneNumber $phonenumber1 = null; /** - * @ORM\Column(type="string", length=64, nullable=true) + * @ORM\Column(type="phone_number", nullable=true) * @Serializer\Groups({"read", "write", "docgen:read"}) - * @Assert\Regex(pattern="/^([\+{1}])([0-9\s*]{4,20})$/") * @PhonenumberConstraint(type="any") */ - private ?string $phonenumber2 = null; + private ?PhoneNumber $phonenumber2 = null; /** * @ORM\Column(type="datetime_immutable", nullable=true) @@ -162,12 +160,12 @@ class Location implements TrackCreationInterface, TrackUpdateInterface return $this->name; } - public function getPhonenumber1(): ?string + public function getPhonenumber1(): ?PhoneNumber { return $this->phonenumber1; } - public function getPhonenumber2(): ?string + public function getPhonenumber2(): ?PhoneNumber { return $this->phonenumber2; } @@ -238,14 +236,14 @@ class Location implements TrackCreationInterface, TrackUpdateInterface return $this; } - public function setPhonenumber1(?string $phonenumber1): self + public function setPhonenumber1(?PhoneNumber $phonenumber1): self { $this->phonenumber1 = $phonenumber1; return $this; } - public function setPhonenumber2(?string $phonenumber2): self + public function setPhonenumber2(?PhoneNumber $phonenumber2): self { $this->phonenumber2 = $phonenumber2; diff --git a/src/Bundle/ChillMainBundle/Form/LocationFormType.php b/src/Bundle/ChillMainBundle/Form/LocationFormType.php index 713705de3..c027e8086 100644 --- a/src/Bundle/ChillMainBundle/Form/LocationFormType.php +++ b/src/Bundle/ChillMainBundle/Form/LocationFormType.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\MainBundle\Form; use Chill\MainBundle\Entity\LocationType as EntityLocationType; +use Chill\MainBundle\Form\Type\ChillPhoneNumberType; use Chill\MainBundle\Form\Type\PickAddressType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Symfony\Bridge\Doctrine\Form\Type\EntityType; @@ -46,8 +47,8 @@ final class LocationFormType extends AbstractType }, ]) ->add('name', TextType::class) - ->add('phonenumber1', TextType::class, ['required' => false]) - ->add('phonenumber2', TextType::class, ['required' => false]) + ->add('phonenumber1', ChillPhoneNumberType::class, ['required' => false]) + ->add('phonenumber2', ChillPhoneNumberType::class, ['required' => false]) ->add('email', TextType::class, ['required' => false]) ->add('address', PickAddressType::class, [ 'required' => false, diff --git a/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php b/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php new file mode 100644 index 000000000..547782943 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php @@ -0,0 +1,61 @@ +defaultCarrierCode = $parameterBag->get('chill_main')['phone_helper']['default_carrier_code']; + $this->phoneNumberUtil = PhoneNumberUtil::getInstance(); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('default_region', $this->defaultCarrierCode) + ->setDefault('format', PhoneNumberFormat::NATIONAL) + ->setDefault('type', \libphonenumber\PhoneNumberType::FIXED_LINE_OR_MOBILE) + ->setNormalizer('attr', function (Options $options, $value) { + if (array_key_exists('placeholder', $value)) { + return $value; + } + + $examplePhoneNumber = $this->phoneNumberUtil->getExampleNumberForType($this->defaultCarrierCode, $options['type']); + + return array_merge( + $value, + [ + 'placeholder' => PhoneNumberUtil::getInstance()->format($examplePhoneNumber, $options['format']), + ] + ); + }); + } + + public function getParent() + { + return PhoneNumberType::class; + } +} diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php index 145ab0441..4122c5509 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php @@ -38,7 +38,7 @@ class ObjectToIdTransformer implements DataTransformerInterface */ public function reverseTransform($id) { - if (!$id) { + if (null === $id) { return null; } @@ -46,7 +46,7 @@ class ObjectToIdTransformer implements DataTransformerInterface ->getRepository($this->class) ->find($id); - if (!$object) { + if (null === $object) { throw new TransformationFailedException(); } @@ -62,7 +62,7 @@ class ObjectToIdTransformer implements DataTransformerInterface */ public function transform($object) { - if (!$object) { + if (null === $object) { return ''; } diff --git a/src/Bundle/ChillMainBundle/Phonenumber/PhoneNumberHelperInterface.php b/src/Bundle/ChillMainBundle/Phonenumber/PhoneNumberHelperInterface.php new file mode 100644 index 000000000..eeab9c38d --- /dev/null +++ b/src/Bundle/ChillMainBundle/Phonenumber/PhoneNumberHelperInterface.php @@ -0,0 +1,54 @@ +logger = $logger; - $this->cachePool = $cachePool; + $this->cachePool = $cacheUserData; + $this->config = $config = $parameterBag->get('chill_main.phone_helper'); if ( array_key_exists('twilio_sid', $config) @@ -72,11 +68,19 @@ class PhonenumberHelper ]); $this->isConfigured = true; } + + $this->phoneNumberUtil = PhoneNumberUtil::getInstance(); } - public function format($phonenumber) + /** + * @param string $phoneNumber A national phone number starting with + + * + * @throws NumberParseException + */ + public function format(PhoneNumber $phoneNumber): string { - return $this->performTwilioFormat($phonenumber); + return $this->phoneNumberUtil + ->formatOutOfCountryCallingNumber($phoneNumber, $this->config['default_carrier_code']); } /** @@ -137,7 +141,7 @@ class PhonenumberHelper } /** - * REturn true if the phoennumber is a mobile phone. Return always true + * REturn true if the phonenumber is a mobile phone. Return always true * if the validation is not configured. * * @param string $phonenumber @@ -157,68 +161,7 @@ class PhonenumberHelper return 'mobile' === $validation; } - 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 ' - . 'due to client error', [ - 'message' => $response->getBody()->getContents(), - 'status_code' => $response->getStatusCode(), - 'phonenumber' => $phonenumber, - ]); - - return $phonenumber; - } catch (ServerException $e) { - $response = $e->getResponse(); - $this->logger->error('[phonenumber helper] Could not format number ' - . 'due to server error', [ - 'message' => $response->getBody()->getContents(), - 'status_code' => $response->getStatusCode(), - 'phonenumber' => $phonenumber, - ]); - - return null; - } catch (ConnectException $e) { - $this->logger->error('[phonenumber helper] Could not format number ' - . 'due to connect error', [ - 'message' => $e->getMessage(), - 'phonenumber' => $phonenumber, - ]); - - return null; - } - - $format = json_decode($response->getBody()->getContents())->national_format; - - $item - ->set($format) - // expires after 3d - ->expiresAfter(3600 * 24 * 3); - - $this->cachePool->save($item); - - return $format; - } - - protected function performTwilioLookup($phonenumber) + private function performTwilioLookup($phonenumber) { if (false === $this->isPhonenumberValidationConfigured()) { return null; @@ -230,7 +173,7 @@ class PhonenumberHelper $item = $this->cachePool->getItem('pnum_' . $filtered); if ($item->isHit()) { - //return $item->get(); + return $item->get(); } try { diff --git a/src/Bundle/ChillMainBundle/Phonenumber/Templating.php b/src/Bundle/ChillMainBundle/Phonenumber/Templating.php index 414732263..c07d8c5a8 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/Templating.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/Templating.php @@ -16,10 +16,7 @@ use Twig\TwigFilter; class Templating extends AbstractExtension { - /** - * @var PhonenumberHelper - */ - protected $phonenumberHelper; + protected PhonenumberHelper $phonenumberHelper; public function __construct(PhonenumberHelper $phonenumberHelper) { diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss index eac04acc2..1750533f8 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss @@ -278,6 +278,7 @@ table.table-bordered { } /// meta-data +div.createdBy, div.updatedBy, div.metadata { span.user, span.date { diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/flex_table.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/flex_table.scss index 67160863d..7ed607535 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/flex_table.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/flex_table.scss @@ -279,6 +279,7 @@ div.wrap-header { li { margin-right: 5px; + margin-bottom: 5px; } } } @@ -316,7 +317,7 @@ div.float-button { div.action { height: calc(100% - 0em); - shape-outside: inset(calc(100% - 4em) 0 0); + shape-outside: inset(calc(100% - 2em) 0 0); display: flex; align-items: flex-end; padding: 0 0 0 1em; @@ -328,6 +329,10 @@ div.float-button { padding: 0; } } + + .chill-entity.entity-address .address p { + display: unset; + } } &.debug { padding: 1em; diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss index 928468715..d72b77e04 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss @@ -1,7 +1,7 @@ ul.record_actions { display: flex; flex-direction: row; - flex-wrap: wrap-reverse; + flex-wrap: wrap; justify-content: flex-end; padding: 0.5em 0; diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss index 37d4f97c4..4d0bfcf8e 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss @@ -73,8 +73,8 @@ section.chill-entity { } p { display: inline-block; - margin: 0 0 0 1.5em; - text-indent: -1.5em; + //margin: 0 0 0 1.5em; + //text-indent: -1.5em; &.street { span.streetnumber { diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js index 5ad119858..67f3e2f42 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.js @@ -1,7 +1,7 @@ /** * Generic api method that can be adapted to any fetch request */ - const makeFetch = (method, url, body) => { +const makeFetch = (method, url, body) => { return fetch(url, { method: method, headers: { @@ -11,19 +11,20 @@ }) .then(response => { if (response.ok) { + console.log('200 error') return response.json(); } if (response.status === 422) { + console.log('422 error') return response.json().then(response => { throw ValidationException(response) }); } if (response.status === 403) { - return response.json().then(() => { - throw AccessException(); - }); + console.log('403 error') + throw AccessException(response); } throw { @@ -88,14 +89,13 @@ const ValidationException = (response) => { error.violations = response.violations.map((violation) => `${violation.title}: ${violation.propertyPath}`); error.titles = response.violations.map((violation) => violation.title); error.propertyPaths = response.violations.map((violation) => violation.propertyPath); - return error; } -const AccessException = () => { +const AccessException = (response) => { const error = {}; error.name = 'AccessException'; - error.violations = ['You are no longer permitted to perform this action']; + error.violations = ['You are not allowed to perform this action']; return error; } diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/blur/blur.scss b/src/Bundle/ChillMainBundle/Resources/public/module/blur/blur.scss index b56609d85..a53ea69d9 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/blur/blur.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/module/blur/blur.scss @@ -1,16 +1,39 @@ -.confidential{ +.confidential { display: flex; position: relative; } +.toggle-far-twig { + i { + bottom: 0px; + right: -30px; + } +} + +.toggle-close-twig { + i { + bottom: 0px; + right: -5px; + } +} .toggle{ margin-left: 30px; margin-top: 5px; cursor: pointer; position: absolute; - bottom: 0px; - right: 10px; z-index: 5; + right: -30px } + +.toggle-far { + bottom: 0px; + right: 20px !important; +} + +.toggle-close { + bottom: 125px; + right: 15px !important; +} + .blur { -webkit-filter: blur(5px); -moz-filter: blur(5px); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue index 3d237a2d4..f5a555520 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Confidential.vue @@ -4,7 +4,7 @@
    - +
    @@ -12,6 +12,7 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue index fca64106f..a7f121a87 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue @@ -5,7 +5,7 @@
    - +