Skip to content

Commit

Permalink
Merge pull request #2421 from Leantime/miscUXFixes
Browse files Browse the repository at this point in the history
Misc ux fixes
  • Loading branch information
marcelfolaron authored Mar 19, 2024
2 parents 499ccde + 64c8cf5 commit 690bd64
Show file tree
Hide file tree
Showing 14 changed files with 171 additions and 153 deletions.
2 changes: 1 addition & 1 deletion app/Core/AppSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class AppSettings
{

public string $appVersion = "3.0.7";
public string $appVersion = "3.1.0-beta";


public string $dbVersion = "3.0.2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,13 @@ function toggleCommentBoxes(id, formHash) {

jQuery('.commentBox-'+formHash+'').hide();

jQuery('#comment-'+formHash+'-' + id + ' .commentReply').prepend('<textarea rows="5" cols="75" name="text" class="tinymceSimple"></textarea>');
jQuery('#comment-'+formHash+'-' + id + ' .commentReply').prepend('<textarea rows="5" cols="75" name="text" id="editor_'+formHash+'" class="tinymceSimple"></textarea>');
leantime.editorController.initSimpleEditor();

setTimeout(function () { // you may not need the timeout
tinyMCE.get('editor_'+formHash+'').focus();
}, 50);

jQuery('#comment-'+formHash+'-' + id + '').show();
jQuery('#father-'+formHash).val(id);

Expand Down
229 changes: 115 additions & 114 deletions app/Domain/Menu/Templates/menu.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,123 +11,124 @@
);
@endphp

@isset($_SESSION['currentProjectName'])

@dispatchEvent('beforeMenu')

<ul class="nav nav-tabs nav-stacked">

@dispatchEvent('afterMenuOpen')

@if ($allAvailableProjects || !empty($_SESSION['currentProject']))

<li class="dropdown scrollableMenu">

<ul style="display:block;">

@foreach ($menuStructure as $key => $menuItem)

@switch ($menuItem['type'])
@case('header')
<li>
<a href="javascript:void(0);">
<strong>{!! __($menuItem['title']) !!}</strong>
</a>
</li>
@break

@case('separator')
<li class="separator"></li>
@break

@case('item')
<li
@if (
$module == $menuItem['module']
&& (!isset($menuItem['active']) || in_array($action, $menuItem['active']))
)
class="active"
@dispatchEvent('beforeMenu')

<ul class="nav nav-tabs nav-stacked">

@dispatchEvent('afterMenuOpen')

@if ($allAvailableProjects
|| !empty($_SESSION['currentProject'])
|| $menuType == "personal"
|| $menuType == "company")

<li class="dropdown scrollableMenu">

<ul style="display:block;">

@foreach ($menuStructure as $key => $menuItem)

@switch ($menuItem['type'])
@case('header')
<li>
<a href="javascript:void(0);">
<strong>{!! __($menuItem['title']) !!}</strong>
</a>
</li>
@break

@case('separator')
<li class="separator"></li>
@break

@case('item')
<li
@if (
$module == $menuItem['module']
&& (!isset($menuItem['active']) || in_array($action, $menuItem['active']))
)
class="active"
@endif
>
<a href="{!! BASE_URL . $menuItem['href'] !!}">
{!! __($menuItem['title']) !!}
</a>
</li>
@break

@case('submenu')
<li class="submenuToggle">
<a href="javascript:void(0);"
@if ( $menuItem['visual'] !== 'always' )
onclick="leantime.menuController.toggleSubmenu('{{ $menuItem['id'] }}')"
@endif
>
<a href="{!! BASE_URL . $menuItem['href'] !!}">
{!! __($menuItem['title']) !!}
</a>
</li>
@break

@case('submenu')
<li class="submenuToggle">
<a href="javascript:void(0);"
@if ( $menuItem['visual'] !== 'always' )
onclick="leantime.menuController.toggleSubmenu('{{ $menuItem['id'] }}')"
@endif
>
<i class="submenuCaret fa fa-angle-{{ $menuItem['visual'] == 'closed' ? 'right' : 'down' }}"
id="submenu-icon-{{ $menuItem['id'] }}"></i>
<strong>{!! __($menuItem['title']) !!}</strong>
</a>
</li>
<ul id="submenu-{{ $menuItem['id'] }}" class="submenu {{ $menuItem['visual'] == 'closed' ? 'closed' : 'open' }}">
@foreach ($menuItem['submenu'] as $subkey => $submenuItem)
@switch ($submenuItem['type'])
@case('header')
<li class="title">
<a href="javascript:void(0);">
<strong>{!! __($submenuItem['title']) !!}</strong>
</a>
</li>
@break
@case('item')
<li
@if(
$module == $submenuItem['module']
&& (!isset($submenuItem['active']) || in_array($action, $submenuItem['active']))
)
class='active'
@endif
>
<a href="{{ BASE_URL . $submenuItem['href'] }}"
data-tippy-content="{{ strip_tags(__($submenuItem['tooltip'])) }}"
data-tippy-placement="right">
{!! __($submenuItem['title']) !!}
</a>
</li>
@endswitch
@endforeach
</ul>
@break
@endswitch
@endforeach

@if ($login::userIsAtLeast(Roles::$manager) && $menuType != 'company' && $menuType != 'personal' && $menuType != 'projecthub')
<li class="fixedMenuPoint {{ $module == $settingsLink['module'] && $action == $settingsLink['action'] ? 'active' : '' }}">
<a href="{{ BASE_URL }}/{{ $settingsLink['module'] }}/{{ $settingsLink['action'] }}/{{ $_SESSION['currentProject'] }}">
{!! $settingsLink['label'] !!}
</a>
</li>
@endif

@if ($menuType == 'personal')
<li class="fixedMenuPoint {{ $module == $settingsLink['module'] && $action == $settingsLink['action'] ? 'active' : '' }}">
<a href="@if(isset($settingsLink['url'])) {{ $settingsLink['url'] }} @else {{ BASE_URL }}/{{ $settingsLink['module'] }}/{{ $settingsLink['action'] }} @endif">
{!! __($settingsLink['label']) !!}
</a>
</li>
@endif


</ul>

</li>

@endif

@dispatchEvent('beforeMenuClose')

</ul>
@dispatchEvent('afterMenuClose')

@endisset
<i class="submenuCaret fa fa-angle-{{ $menuItem['visual'] == 'closed' ? 'right' : 'down' }}"
id="submenu-icon-{{ $menuItem['id'] }}"></i>
<strong>{!! __($menuItem['title']) !!}</strong>
</a>
</li>
<ul id="submenu-{{ $menuItem['id'] }}" class="submenu {{ $menuItem['visual'] == 'closed' ? 'closed' : 'open' }}">
@foreach ($menuItem['submenu'] as $subkey => $submenuItem)
@switch ($submenuItem['type'])
@case('header')
<li class="title">
<a href="javascript:void(0);">
<strong>{!! __($submenuItem['title']) !!}</strong>
</a>
</li>
@break
@case('item')
<li
@if(
$module == $submenuItem['module']
&& (!isset($submenuItem['active']) || in_array($action, $submenuItem['active']))
)
class='active'
@endif
>
<a href="{{ BASE_URL . $submenuItem['href'] }}"
data-tippy-content="{{ strip_tags(__($submenuItem['tooltip'])) }}"
data-tippy-placement="right">
{!! __($submenuItem['title']) !!}
</a>
</li>
@endswitch
@endforeach
</ul>
@break
@endswitch
@endforeach

@if ($login::userIsAtLeast(Roles::$manager) && $menuType != 'company' && $menuType != 'personal' && $menuType != 'projecthub')
<li class="fixedMenuPoint {{ $module == $settingsLink['module'] && $action == $settingsLink['action'] ? 'active' : '' }}">
<a href="{{ BASE_URL }}/{{ $settingsLink['module'] }}/{{ $settingsLink['action'] }}/{{ $_SESSION['currentProject'] }}">
{!! $settingsLink['label'] !!}
</a>
</li>
@endif

@if ($menuType == 'personal')
<li class="fixedMenuPoint {{ $module == $settingsLink['module'] && $action == $settingsLink['action'] ? 'active' : '' }}">
<a href="@if(isset($settingsLink['url'])) {{ $settingsLink['url'] }} @else {{ BASE_URL }}/{{ $settingsLink['module'] }}/{{ $settingsLink['action'] }} @endif">
{!! __($settingsLink['label']) !!}
</a>
</li>
@endif


</ul>

</li>

@endif

@dispatchEvent('beforeMenuClose')

</ul>
@dispatchEvent('afterMenuClose')


@once
@push('scripts')
Expand Down
5 changes: 3 additions & 2 deletions app/Domain/Projects/Templates/projectHub.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
</div>

@if(is_array($allProjects) && count($allProjects) == 0)
<x-global::undrawSvg image="undraw_a_moment_to_relax_bbpa.svg" headline="{{ __('notifications.not_assigned_to_any_project') }}" maxWidth="30%">
<x-global::undrawSvg image="undraw_a_moment_to_relax_bbpa.svg" style="color:var(--main-titles-color);" maxWidth="30%">
</x-global::undrawSvg>

@endif

<div id="myProjectsHub"
Expand Down Expand Up @@ -64,7 +65,7 @@
@if (count($allProjects) == 0)
<br /><br />
<div class='center'>
<div style='width:70%' class='svgContainer'>
<div style='width:70%; color:var(--main-titles-color)' class='svgContainer'>
{{ __('notifications.not_assigned_to_any_project') }}
@if($login::userIsAtLeast($roles::$manager))
<br /><br />
Expand Down
9 changes: 6 additions & 3 deletions app/Domain/Tickets/Controllers/NewTicket.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function get(): Response
],
]);

$ticket->date = format(date("Y-m-d H:i:s"))->date();
$ticket->date = dtHelper()->userNow();

$this->tpl->assign('ticket', $ticket);
$this->tpl->assign('ticketParents', $this->ticketService->getAllPossibleParents($ticket));
Expand All @@ -106,7 +106,7 @@ public function get(): Response
$this->tpl->assign('userInfo', $this->userService->getUser($_SESSION['userdata']['id']));
$this->tpl->assign('users', $this->projectService->getUsersAssignedToProject($_SESSION["currentProject"]));

$allAssignedprojects = $this->projectService->getProjectsAssignedToUser($_SESSION['userdata']['id'], 'open');
$allAssignedprojects = $this->projectService->getProjectsUserHasAccessTo($_SESSION['userdata']['id'], 'open');
$this->tpl->assign('allAssignedprojects', $allAssignedprojects);

return $this->tpl->displayPartial('tickets.newTicketModal');
Expand Down Expand Up @@ -138,7 +138,7 @@ public function post($params): Response
} else {
$this->tpl->setNotification($this->language->__($result["msg"]), "error");

$ticket = app()->make(TicketModel::class, [$params]);
$ticket = app()->makeWith(TicketModel::class, ["values"=>$params]);
$ticket->userLastname = $_SESSION['userdata']["name"];

$this->tpl->assign('ticket', $ticket);
Expand All @@ -159,6 +159,9 @@ public function post($params): Response
$this->tpl->assign('userInfo', $this->userService->getUser($_SESSION['userdata']['id']));
$this->tpl->assign('users', $this->projectService->getUsersAssignedToProject($_SESSION["currentProject"]));

$allAssignedprojects = $this->projectService->getProjectsUserHasAccessTo($_SESSION['userdata']['id'], 'open');
$this->tpl->assign('allAssignedprojects', $allAssignedprojects);

return $this->tpl->displayPartial('tickets.newTicketModal');
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Tickets/Controllers/ShowTicket.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function get($params): Response
//TODO: Refactor thumbnail generation in file manager
$this->tpl->assign('imgExtensions', array('jpg', 'jpeg', 'png', 'gif', 'psd', 'bmp', 'tif', 'thm', 'yuv'));

$allAssignedprojects = $this->projectService->getProjectsAssignedToUser($_SESSION['userdata']['id'], 'open');
$allAssignedprojects = $this->projectService->getProjectsUserHasAccessTo($_SESSION['userdata']['id'], 'open');
$this->tpl->assign('allAssignedprojects', $allAssignedprojects);

$response = $this->tpl->displayPartial('tickets.showTicketModal');
Expand Down
6 changes: 4 additions & 2 deletions app/Domain/Tickets/Templates/submodules/ticketDetails.sub.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,11 @@ class="accordion-toggle"
jQuery(document).ready(function(){
//Set accordion states
//All accordions start open
leantime.editorController.initComplexEditor();
tinymce.activeEditor.hide()
});

leantime.editorController.initComplexEditor();

jQuery(".viewDescription").click(function(e){

Expand All @@ -436,8 +439,7 @@ class="accordion-toggle"
jQuery(this).hide();
jQuery('#descriptionEditor').show('fast',
function() {
leantime.editorController.initComplexEditor();

tinymce.activeEditor.show();
}
);
}
Expand Down
9 changes: 6 additions & 3 deletions app/Domain/Widgets/Templates/partials/myToDos.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<div class="row" id="yourToDoContainer">
<div class="col-md-12">
<div class="tw-mb-l">

<form method="get">
@if($allAssignedprojects)
<form method="get">
@dispatchEvent("beforeTodoWidgetGroupByDropdown")

<a href="javascript:void(0);"
Expand Down Expand Up @@ -104,6 +104,7 @@ class='active'
@dispatchEvent("afterTodoWidgetGroupByDropdown")
<div class="clearall"></div>
</form>
@endif
</div>
<div class="hideOnLoad " id="ticket_new" style="padding-top:5px; padding-bottom:15px;">

Expand Down Expand Up @@ -153,7 +154,9 @@ class='active'
<br />
<h4>{{ __("headlines.no_todos_this_week") }}</h4>
{{ __("text.take_the_day_off") }}
<a href='{{ BASE_URL }}/tickets/showAll'>{{ __("links.goto_backlog") }}</a><br/><br/>
@if($allAssignedprojects)
<a href='{{ BASE_URL }}/tickets/showAll'>{{ __("links.goto_backlog") }}</a><br/><br/>
@endif
</div>
@endif

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "leantime/leantime",
"description": "Open source project management system",
"version": "3.0.7",
"version": "3.1.0-beta",
"type": "project",
"config": {
"platform-check": false,
Expand Down
Loading

0 comments on commit 690bd64

Please sign in to comment.