From ce863294b46601f1e70dfe047caf4825cb8915db Mon Sep 17 00:00:00 2001 From: Arkadiusz Kondas Date: Wed, 6 May 2020 09:21:30 +0200 Subject: [PATCH 1/4] Tuning php-fpm configuration for better resources utilization (#141) --- ansible/roles/php/defaults/main.yml | 5 ++++- ansible/roles/php/tasks/configure.yml | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ansible/roles/php/defaults/main.yml b/ansible/roles/php/defaults/main.yml index 9e593854..6a9f20f8 100644 --- a/ansible/roles/php/defaults/main.yml +++ b/ansible/roles/php/defaults/main.yml @@ -26,4 +26,7 @@ php_packages: - php{{ php_version }}-mbstring - php{{ php_version }}-zip -php_fpm_max_children: 25 +php_fpm_max_children: 45 +php_fpm_start_servers: 8 +php_fpm_min_spare_servers: 4 +php_fpm_max_spare_servers: 8 diff --git a/ansible/roles/php/tasks/configure.yml b/ansible/roles/php/tasks/configure.yml index 0d94c4bf..1a93484f 100644 --- a/ansible/roles/php/tasks/configure.yml +++ b/ansible/roles/php/tasks/configure.yml @@ -108,3 +108,24 @@ regexp='^;?pm.max_children' line='pm.max_children = {{ php_fpm_max_children }}' notify: restart php7-fpm + +- name: Set php-fpm start_servers + lineinfile: > + dest=/etc/php/7.4/fpm/pool.d/www.conf + regexp='^;?pm.start_servers' + line='pm.start_servers = {{ php_fpm_start_servers }}' + notify: restart php7-fpm + +- name: Set php-fpm min_spare_servers + lineinfile: > + dest=/etc/php/7.4/fpm/pool.d/www.conf + regexp='^;?pm.min_spare_servers' + line='pm.min_spare_servers = {{ php_fpm_min_spare_servers }}' + notify: restart php7-fpm + +- name: Set php-fpm max_spare_servers + lineinfile: > + dest=/etc/php/7.4/fpm/pool.d/www.conf + regexp='^;?pm.max_spare_servers' + line='pm.max_spare_servers = {{ php_fpm_max_spare_servers }}' + notify: restart php7-fpm From 63447d81aeefb6bf8897654dab4072141665e4df Mon Sep 17 00:00:00 2001 From: Arkadiusz Kondas Date: Wed, 6 May 2020 13:22:02 +0200 Subject: [PATCH 2/4] Handle package not found exception on app level (#142) --- .../Organization/MembersController.php | 4 ++-- .../Package/AddBitbucketHookHandler.php | 7 ++++++- .../Package/AddGitHubHookHandler.php | 6 +++++- .../Package/AddGitLabHookHandler.php | 7 ++++++- .../Organization/SynchronizePackageHandler.php | 7 ++++++- .../Package/AddBitbucketHookHandlerTest.php | 12 ++++++++++++ .../Package/AddGitHubHookHandlerTest.php | 12 ++++++++++++ .../Package/AddGitLabHookHandlerTest.php | 12 ++++++++++++ .../Package/RemoveGitHubHookHandlerTest.php | 9 +++++++++ .../SynchronizePackageHandlerTest.php | 17 ++++++++++------- 10 files changed, 80 insertions(+), 13 deletions(-) diff --git a/src/Controller/Organization/MembersController.php b/src/Controller/Organization/MembersController.php index a3d2ed0d..1826625a 100644 --- a/src/Controller/Organization/MembersController.php +++ b/src/Controller/Organization/MembersController.php @@ -22,7 +22,6 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; -use Symfony\Component\Security\Core\Exception\AuthenticationException; final class MembersController extends AbstractController { @@ -59,7 +58,8 @@ public function acceptInvitation(string $token): Response if ($organization->isEmpty()) { $this->addFlash('danger', 'Invitation not found or belongs to different user'); $this->tokenStorage->setToken(); - throw new AuthenticationException(); + + return $this->redirectToRoute('app_login'); } $this->dispatchMessage(new AcceptInvitation($token, $user->id()->toString())); diff --git a/src/MessageHandler/Organization/Package/AddBitbucketHookHandler.php b/src/MessageHandler/Organization/Package/AddBitbucketHookHandler.php index 50f89703..1cc2cc66 100644 --- a/src/MessageHandler/Organization/Package/AddBitbucketHookHandler.php +++ b/src/MessageHandler/Organization/Package/AddBitbucketHookHandler.php @@ -4,6 +4,7 @@ namespace Buddy\Repman\MessageHandler\Organization\Package; +use Buddy\Repman\Entity\Organization\Package; use Buddy\Repman\Entity\Organization\Package\Metadata; use Buddy\Repman\Message\Organization\Package\AddBitbucketHook; use Buddy\Repman\Repository\PackageRepository; @@ -27,7 +28,11 @@ public function __construct(PackageRepository $packages, BitbucketApi $api, UrlG public function __invoke(AddBitbucketHook $message): void { - $package = $this->packages->getById(Uuid::fromString($message->packageId())); + $package = $this->packages->find(Uuid::fromString($message->packageId())); + if (!$package instanceof Package) { + return; + } + $this->api->addHook( $package->oauthToken(), $package->metadata(Metadata::BITBUCKET_REPO_NAME), diff --git a/src/MessageHandler/Organization/Package/AddGitHubHookHandler.php b/src/MessageHandler/Organization/Package/AddGitHubHookHandler.php index 59b970dc..8e1bb2af 100644 --- a/src/MessageHandler/Organization/Package/AddGitHubHookHandler.php +++ b/src/MessageHandler/Organization/Package/AddGitHubHookHandler.php @@ -4,6 +4,7 @@ namespace Buddy\Repman\MessageHandler\Organization\Package; +use Buddy\Repman\Entity\Organization\Package; use Buddy\Repman\Entity\Organization\Package\Metadata; use Buddy\Repman\Message\Organization\Package\AddGitHubHook; use Buddy\Repman\Repository\PackageRepository; @@ -27,7 +28,10 @@ public function __construct(PackageRepository $packages, GitHubApi $api, UrlGene public function __invoke(AddGitHubHook $message): void { - $package = $this->packages->getById(Uuid::fromString($message->packageId())); + $package = $this->packages->find(Uuid::fromString($message->packageId())); + if (!$package instanceof Package) { + return; + } $this->api->addHook( $package->oauthToken(), diff --git a/src/MessageHandler/Organization/Package/AddGitLabHookHandler.php b/src/MessageHandler/Organization/Package/AddGitLabHookHandler.php index b48d82a2..5e8c6868 100644 --- a/src/MessageHandler/Organization/Package/AddGitLabHookHandler.php +++ b/src/MessageHandler/Organization/Package/AddGitLabHookHandler.php @@ -4,6 +4,7 @@ namespace Buddy\Repman\MessageHandler\Organization\Package; +use Buddy\Repman\Entity\Organization\Package; use Buddy\Repman\Entity\Organization\Package\Metadata; use Buddy\Repman\Message\Organization\Package\AddGitLabHook; use Buddy\Repman\Repository\PackageRepository; @@ -27,7 +28,11 @@ public function __construct(PackageRepository $packages, GitLabApi $api, UrlGene public function __invoke(AddGitLabHook $message): void { - $package = $this->packages->getById(Uuid::fromString($message->packageId())); + $package = $this->packages->find(Uuid::fromString($message->packageId())); + if (!$package instanceof Package) { + return; + } + $this->api->addHook( $package->oauthToken(), $package->metadata(Metadata::GITLAB_PROJECT_ID), diff --git a/src/MessageHandler/Organization/SynchronizePackageHandler.php b/src/MessageHandler/Organization/SynchronizePackageHandler.php index ac762508..3e35e9e2 100644 --- a/src/MessageHandler/Organization/SynchronizePackageHandler.php +++ b/src/MessageHandler/Organization/SynchronizePackageHandler.php @@ -4,6 +4,7 @@ namespace Buddy\Repman\MessageHandler\Organization; +use Buddy\Repman\Entity\Organization\Package; use Buddy\Repman\Message\Organization\SynchronizePackage; use Buddy\Repman\Repository\PackageRepository; use Buddy\Repman\Service\PackageSynchronizer; @@ -23,7 +24,11 @@ public function __construct(PackageSynchronizer $synchronizer, PackageRepository public function __invoke(SynchronizePackage $message): void { - $package = $this->packages->getById(Uuid::fromString($message->id())); + $package = $this->packages->find(Uuid::fromString($message->id())); + if (!$package instanceof Package) { + return; + } + $this->synchronizer->synchronize($package); } } diff --git a/tests/Integration/MessageHandler/Organization/Package/AddBitbucketHookHandlerTest.php b/tests/Integration/MessageHandler/Organization/Package/AddBitbucketHookHandlerTest.php index 69a6cfbf..580b7d87 100644 --- a/tests/Integration/MessageHandler/Organization/Package/AddBitbucketHookHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/Package/AddBitbucketHookHandlerTest.php @@ -30,4 +30,16 @@ public function testAddHook(): void self::assertInstanceOf(\DateTimeImmutable::class, $package->get()->webhookCreatedAt()); } + + public function testHandlePackageNotFoundWithoutError(): void + { + $exception = null; + try { + $handler = $this->container()->get(AddBitbucketHookHandler::class); + $handler->__invoke(new AddBitbucketHook('e0ea4d32-4144-4a67-9310-6dae483a6377')); + } catch (\Exception $exception) { + } + + self::assertNull($exception); + } } diff --git a/tests/Integration/MessageHandler/Organization/Package/AddGitHubHookHandlerTest.php b/tests/Integration/MessageHandler/Organization/Package/AddGitHubHookHandlerTest.php index f698ee6b..2995cdb6 100644 --- a/tests/Integration/MessageHandler/Organization/Package/AddGitHubHookHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/Package/AddGitHubHookHandlerTest.php @@ -30,4 +30,16 @@ public function testAddHook(): void self::assertInstanceOf(\DateTimeImmutable::class, $package->get()->webhookCreatedAt()); } + + public function testHandlePackageNotFoundWithoutError(): void + { + $exception = null; + try { + $handler = $this->container()->get(AddGitHubHookHandler::class); + $handler->__invoke(new AddGitHubHook('e0ea4d32-4144-4a67-9310-6dae483a6377')); + } catch (\Exception $exception) { + } + + self::assertNull($exception); + } } diff --git a/tests/Integration/MessageHandler/Organization/Package/AddGitLabHookHandlerTest.php b/tests/Integration/MessageHandler/Organization/Package/AddGitLabHookHandlerTest.php index 073fa49f..ea46e545 100644 --- a/tests/Integration/MessageHandler/Organization/Package/AddGitLabHookHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/Package/AddGitLabHookHandlerTest.php @@ -30,4 +30,16 @@ public function testAddHook(): void self::assertInstanceOf(\DateTimeImmutable::class, $package->get()->webhookCreatedAt()); } + + public function testHandlePackageNotFoundWithoutError(): void + { + $exception = null; + try { + $handler = $this->container()->get(AddGitLabHookHandler::class); + $handler->__invoke(new AddGitLabHook('e0ea4d32-4144-4a67-9310-6dae483a6377')); + } catch (\Exception $exception) { + } + + self::assertNull($exception); + } } diff --git a/tests/Integration/MessageHandler/Organization/Package/RemoveGitHubHookHandlerTest.php b/tests/Integration/MessageHandler/Organization/Package/RemoveGitHubHookHandlerTest.php index 69e8b939..82f0cb13 100644 --- a/tests/Integration/MessageHandler/Organization/Package/RemoveGitHubHookHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/Package/RemoveGitHubHookHandlerTest.php @@ -31,4 +31,13 @@ public function testRemoveHook(): void self::assertEquals(null, $package->get()->webhookCreatedAt()); } + + public function testPackageNotFound(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Package 9691e73b-1738-42fe-9d5b-31d0dadf7407 not found.'); + + $handler = $this->container()->get(RemoveGitHubHookHandler::class); + $handler->__invoke(new RemoveGitHubHook('9691e73b-1738-42fe-9d5b-31d0dadf7407')); + } } diff --git a/tests/Integration/MessageHandler/Organization/SynchronizePackageHandlerTest.php b/tests/Integration/MessageHandler/Organization/SynchronizePackageHandlerTest.php index 1b89de02..b0fa6dbf 100644 --- a/tests/Integration/MessageHandler/Organization/SynchronizePackageHandlerTest.php +++ b/tests/Integration/MessageHandler/Organization/SynchronizePackageHandlerTest.php @@ -25,7 +25,7 @@ public function testSuccess(): void ); $handler = $this->container()->get(SynchronizePackageHandler::class); - $handler(new SynchronizePackage($packageId)); + $handler->__invoke(new SynchronizePackage($packageId)); $this->container()->get('doctrine.orm.entity_manager')->flush(); /** @var Package $package */ @@ -40,12 +40,15 @@ public function testSuccess(): void self::assertEquals($date->format('Y-m-d H:i:s'), $releaseDate->format('Y-m-d H:i:s')); } - public function testPackageNotFound(): void + public function testHandlePackageNotFoundWithoutError(): void { - self::expectException(\InvalidArgumentException::class); - self::expectExceptionMessage('Package e0ea4d32-4144-4a67-9310-6dae483a6377 not found'); - - $handler = $this->container()->get(SynchronizePackageHandler::class); - $handler(new SynchronizePackage('e0ea4d32-4144-4a67-9310-6dae483a6377')); + $exception = null; + try { + $handler = $this->container()->get(SynchronizePackageHandler::class); + $handler->__invoke(new SynchronizePackage('e0ea4d32-4144-4a67-9310-6dae483a6377')); + } catch (\Exception $exception) { + } + + self::assertNull($exception); } } From af6ce4e316e50eca581f42505165ff8c1e7d6061 Mon Sep 17 00:00:00 2001 From: Piotr Rogowski Date: Wed, 6 May 2020 19:09:21 +0200 Subject: [PATCH 3/4] Small fixes (#143) * Cleanup JS; Fix number of days in admin stats view; Force referrer in GA * Cleanup inline SVGs --- .../Admin/OrganizationController.php | 1 + templates/admin/proxy/stats.html.twig | 2 +- templates/admin/stats.html.twig | 2 +- templates/base.html.twig | 127 +++++------------- .../TwigBundle/Exception/error.html.twig | 3 +- .../TwigBundle/Exception/error403.html.twig | 3 +- .../component/confirmationModal.html.twig | 22 +++ templates/component/js/addPackage.js | 8 ++ templates/component/js/base.js | 25 ++++ templates/component/js/ga.js | 18 +++ templates/component/js/stats.js.twig | 49 +++++++ templates/component/user.html.twig | 28 ++-- templates/organization/addPackage.html.twig | 9 +- .../organization/member/invitations.html.twig | 5 +- .../organization/member/members.html.twig | 3 +- templates/organization/overview.html.twig | 14 +- .../organization/package/stats.html.twig | 2 +- .../organization/package/webhook.html.twig | 9 +- templates/organization/packages.html.twig | 23 ++-- templates/organization/stats.html.twig | 62 ++------- templates/organization/tokens.html.twig | 20 +-- templates/registration/register.html.twig | 11 +- templates/security/login.html.twig | 11 +- templates/svg/arrow-left.svg | 1 + templates/svg/bar-chart.svg | 1 + templates/svg/bitbucket-icon.svg | 1 + templates/svg/briefcase.svg | 1 + templates/svg/check.svg | 1 + templates/svg/clipboard.svg | 1 + templates/svg/github-icon.svg | 1 + templates/svg/gitlab-icon.svg | 1 + templates/svg/home.svg | 1 + templates/svg/link.svg | 1 + templates/svg/lock.svg | 1 + templates/svg/log-out.svg | 1 + templates/svg/package.svg | 1 + templates/svg/plus-square.svg | 1 + templates/svg/refresh.svg | 1 + templates/svg/sliders.svg | 1 + templates/svg/trash.svg | 1 + templates/svg/user.svg | 1 + templates/svg/users.svg | 1 + 42 files changed, 232 insertions(+), 244 deletions(-) create mode 100644 templates/component/confirmationModal.html.twig create mode 100644 templates/component/js/addPackage.js create mode 100644 templates/component/js/base.js create mode 100644 templates/component/js/ga.js create mode 100644 templates/component/js/stats.js.twig create mode 100644 templates/svg/arrow-left.svg create mode 100644 templates/svg/bar-chart.svg create mode 100644 templates/svg/bitbucket-icon.svg create mode 100644 templates/svg/briefcase.svg create mode 100644 templates/svg/check.svg create mode 100644 templates/svg/clipboard.svg create mode 100644 templates/svg/github-icon.svg create mode 100644 templates/svg/gitlab-icon.svg create mode 100644 templates/svg/home.svg create mode 100644 templates/svg/link.svg create mode 100644 templates/svg/lock.svg create mode 100644 templates/svg/log-out.svg create mode 100644 templates/svg/package.svg create mode 100644 templates/svg/plus-square.svg create mode 100644 templates/svg/refresh.svg create mode 100644 templates/svg/sliders.svg create mode 100644 templates/svg/trash.svg create mode 100644 templates/svg/user.svg create mode 100644 templates/svg/users.svg diff --git a/src/Controller/Admin/OrganizationController.php b/src/Controller/Admin/OrganizationController.php index acd97e14..0b74055a 100644 --- a/src/Controller/Admin/OrganizationController.php +++ b/src/Controller/Admin/OrganizationController.php @@ -52,6 +52,7 @@ public function stats(Request $request): Response return $this->render('admin/stats.html.twig', [ 'installs' => $this->organizationQuery->getInstalls($days), + 'days' => $days, ]); } } diff --git a/templates/admin/proxy/stats.html.twig b/templates/admin/proxy/stats.html.twig index 2bf8b08c..2f228c4c 100644 --- a/templates/admin/proxy/stats.html.twig +++ b/templates/admin/proxy/stats.html.twig @@ -1,3 +1,3 @@ {% extends 'organization/stats.html.twig' %} -{% block header %}Repman proxy packages installs (last {{days ?? 30}} days){% endblock %} +{% block header %}Repman proxy packages installs (last {{ days }} days){% endblock %} diff --git a/templates/admin/stats.html.twig b/templates/admin/stats.html.twig index 4404dbef..1f2bceb9 100644 --- a/templates/admin/stats.html.twig +++ b/templates/admin/stats.html.twig @@ -1,3 +1,3 @@ {% extends 'organization/stats.html.twig' %} -{% block header %}Repman private packages installs (last {{days ?? 30}} days){% endblock %} +{% block header %}Repman private packages installs (last {{ days }} days){% endblock %} diff --git a/templates/base.html.twig b/templates/base.html.twig index 479cab3e..54745c3e 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -1,29 +1,29 @@ {% set current_route = app.request.get('_route') %} - - - - - - - - - - - - + + + + + + + + + + + + - - - {% block title %}Repman - PHP Repository Manager{% endblock %} - {% block stylesheets %} - - - {% endblock %} - + + + {% block title %}Repman - PHP Repository Manager{% endblock %} + {% block stylesheets %} + + + {% endblock %} + + {% block body %} - + {% endblock body %} + {% include 'component/confirmationModal.html.twig' %} - - - - {% if ga_tracking is not empty %} - - - {% endif %} - + {% if ga_tracking is not empty %} + + + {% endif %} + {% block javascripts %}{% endblock %} - - {% endblock body %} + diff --git a/templates/bundles/TwigBundle/Exception/error.html.twig b/templates/bundles/TwigBundle/Exception/error.html.twig index bd476d5a..0cb83060 100644 --- a/templates/bundles/TwigBundle/Exception/error.html.twig +++ b/templates/bundles/TwigBundle/Exception/error.html.twig @@ -14,8 +14,7 @@ {% block button %} {% endblock %} diff --git a/templates/bundles/TwigBundle/Exception/error403.html.twig b/templates/bundles/TwigBundle/Exception/error403.html.twig index 3801f80c..85f55ad5 100644 --- a/templates/bundles/TwigBundle/Exception/error403.html.twig +++ b/templates/bundles/TwigBundle/Exception/error403.html.twig @@ -7,8 +7,7 @@ {% block button %} {% endblock %} diff --git a/templates/component/confirmationModal.html.twig b/templates/component/confirmationModal.html.twig new file mode 100644 index 00000000..9e620d65 --- /dev/null +++ b/templates/component/confirmationModal.html.twig @@ -0,0 +1,22 @@ + diff --git a/templates/component/js/addPackage.js b/templates/component/js/addPackage.js new file mode 100644 index 00000000..1d475392 --- /dev/null +++ b/templates/component/js/addPackage.js @@ -0,0 +1,8 @@ +(function() { + $('.addPackageType').on('change', function(e) { + const type = e.target.value; + const baseUrl = $('.addPackageFormUrl').val(); + + window.location.href = `${baseUrl}/${type}`; + }); +})(); diff --git a/templates/component/js/base.js b/templates/component/js/base.js new file mode 100644 index 00000000..44855662 --- /dev/null +++ b/templates/component/js/base.js @@ -0,0 +1,25 @@ +(function() { + $('[data-target="confirmation"]').on('click', function() { + const confirmationModalId = '#confirmation-modal'; + const $source = $(this); + const $modal = $(`${confirmationModalId}`); + const $modalForm = $(`${confirmationModalId} form`); + const $modalTitle = $(`${confirmationModalId} .modal-title`); + + $modalForm.prop('action', $source.data('action')); + $modalForm.children('[name=_method]').val($source.data('method')); + $modalTitle.html($source.data('title') || 'Confirm action'); + + $modal.modal('show'); + }); + + $('.copy-to-clipboard').click(function() { + $($(this).data('clipboard-target')).select(); + document.execCommand('copy'); + }); + + $('.show-token').click(function() { + $(this).parent().find('[data-type="token"]').removeClass('d-none'); + $(this).remove(); + }); +})(); diff --git a/templates/component/js/ga.js b/templates/component/js/ga.js new file mode 100644 index 00000000..67f3dba3 --- /dev/null +++ b/templates/component/js/ga.js @@ -0,0 +1,18 @@ +(function() { + window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; + ga('create', '{{ ga_tracking }}', 'auto'); + ga('send', 'pageview'); + + if (isOAuthReferrer(document.referrer)) { + ga('set', 'referrer', '{{ url("index") }}'); + } + + function isOAuthReferrer(referrer) { + return referrer.indexOf('https://bitbucket.org/site/oauth2') === 0 + || [ + 'https://github.com/', + 'https://gitlab.com/', + 'https://app.buddy.works/' + ].includes(referrer); + } +})(); diff --git a/templates/component/js/stats.js.twig b/templates/component/js/stats.js.twig new file mode 100644 index 00000000..f33fb070 --- /dev/null +++ b/templates/component/js/stats.js.twig @@ -0,0 +1,49 @@ + diff --git a/templates/component/user.html.twig b/templates/component/user.html.twig index aa991677..46199822 100644 --- a/templates/component/user.html.twig +++ b/templates/component/user.html.twig @@ -11,7 +11,7 @@ {% endif %} - + {% include 'svg/briefcase.svg' %} @@ -34,7 +33,7 @@ - + {% include 'svg/user.svg' %} {{ app.user.username }} @@ -46,36 +45,29 @@ diff --git a/templates/organization/addPackage.html.twig b/templates/organization/addPackage.html.twig index 5a1564a4..f85a0b45 100644 --- a/templates/organization/addPackage.html.twig +++ b/templates/organization/addPackage.html.twig @@ -55,12 +55,5 @@ {% endblock %} {% block javascripts %} - + {% endblock %} diff --git a/templates/organization/member/invitations.html.twig b/templates/organization/member/invitations.html.twig index cf13e7fb..c2b1e7f8 100644 --- a/templates/organization/member/invitations.html.twig +++ b/templates/organization/member/invitations.html.twig @@ -2,10 +2,7 @@ {% block header_btn %} - - - - Back to members + {% include 'svg/users.svg' %} Back to members {% endblock %} {% block header %} {{ organization.name }} invitations:{% endblock %} diff --git a/templates/organization/member/members.html.twig b/templates/organization/member/members.html.twig index c3378e39..08155df5 100644 --- a/templates/organization/member/members.html.twig +++ b/templates/organization/member/members.html.twig @@ -8,8 +8,7 @@ {% endif %} - - Invite new member + {% include 'svg/user.svg' %} Invite new member {% endif %} {% endblock %} diff --git a/templates/organization/overview.html.twig b/templates/organization/overview.html.twig index 4a971287..f674ed98 100644 --- a/templates/organization/overview.html.twig +++ b/templates/organization/overview.html.twig @@ -4,14 +4,14 @@ {% block header_btn %} - - Package stats + {% include 'svg/bar-chart.svg' %} Package stats {% endblock %} {% block token %} {% if tokenCount <= 1 %} - {{ organization.token }} + {{ organization.token }} + {% else %} Get token {% endif %} @@ -47,12 +47,4 @@ to allow users to access your organization packages {% endif %} - {% endblock %} diff --git a/templates/organization/package/stats.html.twig b/templates/organization/package/stats.html.twig index f03b0690..3e49851b 100644 --- a/templates/organization/package/stats.html.twig +++ b/templates/organization/package/stats.html.twig @@ -1,3 +1,3 @@ {% extends 'organization/stats.html.twig' %} -{% block header %}{{ package.name }} installs (last {{days ?? 30}} days){% endblock %} +{% block header %}{{ package.name }} installs (last {{ days }} days){% endblock %} diff --git a/templates/organization/package/webhook.html.twig b/templates/organization/package/webhook.html.twig index d27d5979..c77274f4 100644 --- a/templates/organization/package/webhook.html.twig +++ b/templates/organization/package/webhook.html.twig @@ -18,8 +18,7 @@ Webhook status: {% if package.allowToAutoAddWebhook %} {% if package.webhookCreatedAt is not null %} - - created at {{ package.webhookCreatedAt | date('Y-m-d H:i:s') }} + {% include 'svg/check.svg' %} created at {{ package.webhookCreatedAt | date('Y-m-d H:i:s') }} {% else %} not added {% endif %} @@ -43,9 +42,9 @@
- +
diff --git a/templates/organization/packages.html.twig b/templates/organization/packages.html.twig index 0fb519db..64be2dc4 100644 --- a/templates/organization/packages.html.twig +++ b/templates/organization/packages.html.twig @@ -3,8 +3,7 @@ {% block header_btn %} {% if is_granted('ROLE_ORGANIZATION_OWNER', organization) %} - - Add package + {% include 'svg/plus-square.svg' %} Add package {% endif %} {% endblock %} @@ -30,10 +29,14 @@ {% if package.name %} {{ package.name }}
- {{ package.url }}
+ + {{ package.url }} +
synced: {{ package.lastSyncAt | time_diff }} {% elseif package.lastSyncError is null %} - Synchronizing from {{ package.url }} + Synchronizing from + {{ package.url }} +
@@ -69,12 +72,10 @@