From 61e4fb29f733e446326a3241227628f9b53372b4 Mon Sep 17 00:00:00 2001 From: Marcel Folaron Date: Sun, 10 Nov 2024 18:12:36 -0500 Subject: [PATCH] Improved theme styles --- .idea/codebuddy.xml | 6 + .idea/leantime-oss.iml | 34 --- .idea/php.xml | 37 +-- .idea/vcs.xml | 1 - app/Domain/Menu/Composers/HeadMenu.php | 43 ++- app/Domain/Menu/Composers/Menu.php | 45 +-- app/Domain/Menu/Templates/headMenu.blade.php | 2 +- app/Domain/Menu/Templates/menu.blade.php | 78 +---- .../partials/leftnav/fixed.blade.php | 5 + .../partials/leftnav/header.blade.php | 5 + .../Templates/partials/leftnav/item.blade.php | 20 ++ .../partials/leftnav/separator.blade.php | 1 + .../partials/leftnav/submenu.blade.php | 23 ++ .../Templates/partials/latestNews.blade.php | 4 +- .../Projects/Templates/showProject.tpl.php | 16 +- .../Templates/partials/subtasks.blade.php | 2 +- .../Templates/partials/ticketCard.blade.php | 187 ++++++++---- app/Domain/Tickets/Templates/showAll.tpl.php | 6 +- .../Tickets/Templates/showTicket.tpl.php | 1 - .../Tickets/Templates/showTicketModal.tpl.php | 1 - app/Domain/Users/Templates/editOwn.tpl.php | 2 +- .../components/moveableWidget.blade.php | 1 - .../Templates/partials/myToDos.blade.php | 14 +- .../Templates/partials/welcome.blade.php | 2 +- .../Widgets/Templates/widgetManager.blade.php | 24 +- app/Domain/Wiki/Templates/show.tpl.php | 4 +- app/Domain/Wiki/Templates/wikiDialog.tpl.php | 2 +- app/Views/Composers/App.php | 2 +- app/Views/Composers/Entry.php | 4 +- app/Views/Composers/Footer.php | 2 +- app/Views/Composers/PageBottom.php | 2 +- .../components/dropdownPill.blade.php | 4 +- .../components/inlineSelect.blade.php | 50 ++++ .../Templates/components/selectable.blade.php | 35 ++- app/Views/Templates/layouts/app.blade.php | 2 +- app/Views/Templates/layouts/blank.blade.php | 2 + app/Views/Templates/layouts/entry.blade.php | 9 +- .../Templates/layouts/registration.blade.php | 14 +- app/Views/Templates/sections/footer.blade.php | 2 - .../Templates/sections/pageBottom.blade.php | 24 +- blocklist.json | 44 +++ package.json | 5 +- public/assets/css/components/calendar.css | 187 ++++++++++++ public/assets/css/components/forms.css | 87 +++++- public/assets/css/components/kanban.css | 5 +- public/assets/css/components/nav.css | 13 +- public/assets/css/components/progressbars.css | 41 ++- public/assets/css/components/structure.css | 45 +-- .../assets/css/components/style.default.css | 195 ++----------- public/assets/css/libs/gridstack.min.css | 272 +++++++++++++++++- public/assets/images/background-default.png | Bin 0 -> 1710551 bytes public/assets/images/background-minimal.png | Bin 0 -> 667642 bytes public/assets/js/app/core/editors.js | 44 ++- public/assets/js/app/core/snippets.js | 17 +- .../slashcommands/slashcommands.js | 1 + public/assets/less/main.less | 2 +- .../assets/lottie/leo/celebration-robot.json | 1 + .../lottie/leo/robot-transform-loading.json | 1 + .../{Rolling LEO.json => rolling_leo.json} | 0 public/dist/mix-manifest.json | 51 ++-- public/favicon.ico | Bin 0 -> 26075 bytes public/theme/default/css/dark.css | 18 +- public/theme/default/css/light.css | 69 ++--- public/theme/default/theme.ini | 6 +- public/theme/minimal/css/dark.css | 7 +- public/theme/minimal/css/light.css | 4 + public/theme/minimal/theme.ini | 2 +- tailwind.config.js | 4 +- tests/Unit/app/Core/ThemeTest.php | 4 +- webpack.mix.js | 3 + 70 files changed, 1227 insertions(+), 619 deletions(-) create mode 100644 .idea/codebuddy.xml create mode 100644 app/Domain/Menu/Templates/partials/leftnav/fixed.blade.php create mode 100644 app/Domain/Menu/Templates/partials/leftnav/header.blade.php create mode 100644 app/Domain/Menu/Templates/partials/leftnav/item.blade.php create mode 100644 app/Domain/Menu/Templates/partials/leftnav/separator.blade.php create mode 100644 app/Domain/Menu/Templates/partials/leftnav/submenu.blade.php create mode 100644 app/Views/Templates/components/inlineSelect.blade.php create mode 100644 public/assets/css/components/calendar.css create mode 100644 public/assets/images/background-default.png create mode 100644 public/assets/images/background-minimal.png create mode 100644 public/assets/lottie/leo/celebration-robot.json create mode 100644 public/assets/lottie/leo/robot-transform-loading.json rename public/assets/lottie/leo/{Rolling LEO.json => rolling_leo.json} (100%) create mode 100644 public/favicon.ico diff --git a/.idea/codebuddy.xml b/.idea/codebuddy.xml new file mode 100644 index 0000000000..0309ba3b06 --- /dev/null +++ b/.idea/codebuddy.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/leantime-oss.iml b/.idea/leantime-oss.iml index 6e2f5ed590..a930af603e 100644 --- a/.idea/leantime-oss.iml +++ b/.idea/leantime-oss.iml @@ -168,40 +168,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.idea/php.xml b/.idea/php.xml index 4a3eb7d126..f3fc192972 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -233,40 +233,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -293,6 +259,8 @@ + + @@ -320,7 +288,6 @@ - diff --git a/.idea/vcs.xml b/.idea/vcs.xml index a3835b65e4..bd69c239ca 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -3,6 +3,5 @@ - \ No newline at end of file diff --git a/app/Domain/Menu/Composers/HeadMenu.php b/app/Domain/Menu/Composers/HeadMenu.php index a5c702d11a..808f4deb15 100644 --- a/app/Domain/Menu/Composers/HeadMenu.php +++ b/app/Domain/Menu/Composers/HeadMenu.php @@ -5,7 +5,7 @@ use Illuminate\Contracts\Container\BindingResolutionException; use Leantime\Core\Controller\Composer; use Leantime\Core\Controller\Frontcontroller as FrontcontrollerCore; -use Leantime\Core\Theme; +use Leantime\Core\UI\Theme; use Leantime\Domain\Auth\Services\Auth as AuthService; use Leantime\Domain\Help\Services\Helper; use Leantime\Domain\Menu\Repositories\Menu as MenuRepo; @@ -13,9 +13,6 @@ use Leantime\Domain\Timesheets\Services\Timesheets as TimesheetService; use Leantime\Domain\Users\Services\Users as UserService; -/** - * - */ class HeadMenu extends Composer { public static array $views = [ @@ -23,20 +20,19 @@ class HeadMenu extends Composer ]; private NotificationService $notificationService; + private TimesheetService $timesheets; + private UserService $userService; + private AuthService $authService; + private Helper $helperService; + private Theme $themeCore; + private MenuRepo $menuRepo; - /** - * @param NotificationService $notificationService - * @param TimesheetService $timesheets - * @param UserService $userService - * @param AuthService $authService - * @return void - */ public function init( NotificationService $notificationService, TimesheetService $timesheets, @@ -56,17 +52,16 @@ public function init( } /** - * @return array * @throws BindingResolutionException */ public function with(): array { $notificationService = $this->notificationService; - $notifications = array(); + $notifications = []; $newnotificationCount = 0; - if (session()->exists("userdata")) { - $notifications = $notificationService->getAllNotifications(session("userdata.id")); - $newnotificationCount = $notificationService->getAllNotifications(session("userdata.id"), true); + if (session()->exists('userdata')) { + $notifications = $notificationService->getAllNotifications(session('userdata.id')); + $newnotificationCount = $notificationService->getAllNotifications(session('userdata.id'), true); } $nCount = is_array($newnotificationCount) ? count($newnotificationCount) : 0; @@ -75,7 +70,7 @@ public function with(): array $totalNewMentions = $totalNewNotifications = 0; - $menuType = $this->menuRepo->getSectionMenuType(FrontcontrollerCore::getCurrentRoute(), "project"); + $menuType = $this->menuRepo->getSectionMenuType(FrontcontrollerCore::getCurrentRoute(), 'project'); foreach ($notifications as $notif) { if ($notif['type'] == 'mention') { @@ -92,19 +87,19 @@ public function with(): array } $user = false; - if (session()->exists("userdata")) { - $user = $this->userService->getUser(session("userdata.id")); + if (session()->exists('userdata')) { + $user = $this->userService->getUser(session('userdata.id')); } - if (!$user) { + if (! $user) { $this->authService->logout(); - FrontcontrollerCore::redirect(BASE_URL . '/auth/login'); + FrontcontrollerCore::redirect(BASE_URL.'/auth/login'); } $modal = $this->helperService->getHelperModalByRoute(FrontcontrollerCore::getCurrentRoute()); - if (!session()->exists("companysettings.logoPath")) { - session(["companysettings.logoPath" => $this->themeCore->getLogoUrl()]); + if (! session()->exists('companysettings.logoPath')) { + session(['companysettings.logoPath' => $this->themeCore->getLogoUrl()]); } return [ @@ -115,7 +110,7 @@ public function with(): array 'totalNewNotifications' => $totalNewNotifications, 'menuType' => $menuType, 'notifications' => $notifications ?? [], - 'onTheClock' => session()->exists("userdata") ? $this->timesheets->isClocked(session("userdata.id")) : false, + 'onTheClock' => session()->exists('userdata') ? $this->timesheets->isClocked(session('userdata.id')) : false, 'activePath' => FrontcontrollerCore::getCurrentRoute(), 'action' => FrontcontrollerCore::getActionName(), 'module' => FrontcontrollerCore::getModuleName(), diff --git a/app/Domain/Menu/Composers/Menu.php b/app/Domain/Menu/Composers/Menu.php index 7e1f0ebfc0..51829273fb 100644 --- a/app/Domain/Menu/Composers/Menu.php +++ b/app/Domain/Menu/Composers/Menu.php @@ -9,9 +9,6 @@ use Leantime\Core\Http\IncomingRequest as IncomingRequestCore; use Leantime\Domain\Menu\Repositories\Menu as MenuRepository; -/** - * - */ class Menu extends Composer { use DispatchesEvents; @@ -21,15 +18,11 @@ class Menu extends Composer ]; private MenuRepository $menuRepo; + private IncomingRequestCore $incomingRequest; + private \Leantime\Domain\Menu\Services\Menu $menuService; - /** - * @param MenuRepository $menuRepo - * @param \Leantime\Domain\Menu\Services\Menu $menuService - * @param IncomingRequestCore $request - * @return void - */ public function init( MenuRepository $menuRepo, \Leantime\Domain\Menu\Services\Menu $menuService, @@ -41,13 +34,13 @@ public function init( } /** - * @param array $data - * @return array + * @param array $data + * * @throws BindingResolutionException */ public function with(): array { - $allAssignedprojects = + $allAssignedprojects = $showSettingsIndicator = false; $allAvailableProjects = $recentProjects = $favoriteProjects = @@ -60,14 +53,14 @@ public function with(): array $projectType = ''; $menuType = 'default'; - $projectSelectFilter = session("usersettings.projectSelectFilter") ?? array( - "groupBy" => "structure", - "client" => null, - ); + $projectSelectFilter = session('usersettings.projectSelectFilter') ?? [ + 'groupBy' => 'structure', + 'client' => null, + ]; - if (session()->exists("userdata")) { + if (session()->exists('userdata')) { //Getting all projects (ignoring client filter, clients are filtered on the frontend) - $projectVars = $this->menuService->getUserProjectList(session("userdata.id"), $projectSelectFilter["client"]); + $projectVars = $this->menuService->getUserProjectList(session('userdata.id'), $projectSelectFilter['client']); $allAssignedprojects = $projectVars['assignedProjects']; $allAvailableProjects = $projectVars['availableProjects']; @@ -82,6 +75,13 @@ public function with(): array $currentProject = $projectVars['currentProject']; } + // Check for new widgets to show settings indicator + if (session()->exists('userdata')) { + $widgetService = app()->make(\Leantime\Domain\Widgets\Services\Widgets::class); + $newWidgets = $widgetService->getNewWidgets(session('userdata.id')); + $showSettingsIndicator = !empty($newWidgets); + } + $menuType = $this->menuRepo->getSectionMenuType(FrontcontrollerCore::getCurrentRoute(), $menuType); if (str_contains($redirectUrl = $this->incomingRequest->getRequestUri(), 'showProject')) { @@ -97,9 +97,9 @@ public function with(): array 'action' => '', 'settingsIcon' => '', 'settingsTooltip' => '', - ]; + ]; - if ($menuType == "project" || $menuType == "default") { + if ($menuType == 'project' || $menuType == 'default') { $settingsLink = [ 'label' => __('menu.project_settings'), 'module' => 'projects', @@ -109,7 +109,9 @@ public function with(): array ]; } - $newProjectUrl = self::dispatch_filter("startSomething", "#/projects/createnew"); + $settingsLink = self::dispatch_filter('settingsLink', $settingsLink, ["type" => $menuType]); + + $newProjectUrl = self::dispatch_filter('startSomething', '#/projects/createnew'); return [ 'currentClient' => $currentClient, @@ -132,6 +134,7 @@ public function with(): array 'projectSelectFilter' => $projectSelectFilter, 'clients' => $clients, 'startSomethingUrl' => $newProjectUrl, + 'showSettingsIndicator' => $showSettingsIndicator, ]; } } diff --git a/app/Domain/Menu/Templates/headMenu.blade.php b/app/Domain/Menu/Templates/headMenu.blade.php index 2e0f386bdf..6983894088 100644 --- a/app/Domain/Menu/Templates/headMenu.blade.php +++ b/app/Domain/Menu/Templates/headMenu.blade.php @@ -27,7 +27,7 @@ class="dropdown-toggle profileHandler newsDropDownHandler" -