Skip to content

Commit

Permalink
Merge pull request #2891 from Leantime/selectsComponentUpdates
Browse files Browse the repository at this point in the history
Selects component updates
  • Loading branch information
marcelfolaron authored Jan 10, 2025
2 parents 611f59c + ddd6e5e commit 8c42b56
Show file tree
Hide file tree
Showing 83 changed files with 1,941 additions and 2,230 deletions.
57 changes: 57 additions & 0 deletions app/Core/Support/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Carbon\CarbonImmutable;
use Carbon\CarbonInterface;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Str;
use Leantime\Core\Language;
use PHPUnit\Exception;

Expand Down Expand Up @@ -315,4 +316,60 @@ public function diffForHumans(): string
return $this->value->endOfDay()->diffForHumans();
}
}

/**
*
* This is the result of years of different frameworks and ways to represent color in
* statuses, priorities etc.
* Future talk: We should have a few defined semantic colors and then allow hex code colors only
*
*/
public function getStatusClass(): string {

$statusClass = '';

//If the string starts with the color we can just return the color in [] for tailwind to use
if(Str::startsWith($this->value, "#")){
return "[".$this->value."]";
}

//Map various semantic color names to our central color names
switch($this->value) {
case 'green':
case 'done':
case 'success':
case 'label-success':
case 4:
$statusClass = 'success';
break;
case 'blue':
case 'info':
case 'label-info':
$statusClass = 'info';
break;
case 'warning':
case 'yellow':
case 'inprogress':
case 'label-warning':
case 3:
$statusClass = 'warning';
break;
case 'error':
case 'red':
case 'new':
case 'label-important':
case 2:
$statusClass = 'error';
break;
case 'critical':
case 1:
$statusClass = 'error';
break;
default:
$statusClass = 'trivial';
}

return $statusClass;

}
}
3 changes: 2 additions & 1 deletion app/Domain/Auth/Templates/includes/loginInfo.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@
</a>
</x-global::actions.dropdown.item>

<x-global::actions.dropdown.item class="nav-header border">
<x-global::actions.dropdown.item variant="header">
{!! __("menu.help_support") !!}
</x-global::actions.dropdown.item>

<x-global::actions.dropdown.item variant='list-item'>
<a href='javascript:void(0);' onclick="leantime.helperController.showHelperModal('{{ $modal }}', 300, 500);">
{!! __("menu.what_is_this_page") !!}
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Calendar/Js/calendarController.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import jQuery from 'jquery';
import htmx from 'htmx.org';
import {Calendar, ThirdPartyDraggable} from 'fullcalendar';
import { appUrl } from 'js/app/core/instance-info.module';
import { getFormatFromSettings } from 'js/app/components/dates/dateHelper.module';
import { getFormatFromSettings } from 'js/app/support/dateHelper.module';
import { DateTime } from 'luxon';
import iCalendarPlugin from '@fullcalendar/icalendar';
import luxon3Plugin from '@fullcalendar/luxon3'
Expand Down
18 changes: 14 additions & 4 deletions app/Domain/Canvas/Templates/element.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
@if ($login::userIsAtLeast($roles::$editor))
<x-global::content.context-menu label-text="<i class='fa fa-ellipsis-v' aria-hidden='true'></i>"
contentRole="link" position="bottom" align="start">
<li class="nav-header">{{ __('subtitles.edit') }}</li>
<x-global::actions.dropdown.item variant="header">
{{ __('subtitles.edit') }}
</x-global::actions.dropdown.item>
<x-global::actions.dropdown.item variant="link"
href="#/{{ $canvasName }}canvas/editCanvasItem/{{ $row['id'] }}"
data="item_{{ $row['id'] }}">
Expand Down Expand Up @@ -65,7 +67,10 @@

<x-slot:menu>
<!-- Header Item -->
<li class="nav-header border">{{ __('dropdown.choose_status') }}</li>

<x-global::actions.dropdown.item variant="header">
{{ __('dropdown.choose_status') }}
</x-global::actions.dropdown.item>

<!-- Dynamic Status Menu Items -->
@foreach ($statusLabels as $key => $data)
Expand All @@ -89,7 +94,10 @@ class="label-{{ $data['dropdown'] }}" :data-label="$data['title']" :data-value="

<x-slot:menu>
<!-- Header Item -->
<li class="nav-header border">{{ __('dropdown.choose_relates') }}</li>

<x-global::actions.dropdown.item variant="header">
{{ __('dropdown.choose_relates') }}
</x-global::actions.dropdown.item>

<!-- Dynamic Relates Menu Items -->
@foreach ($relatesLabels as $key => $data)
Expand Down Expand Up @@ -124,7 +132,9 @@ class="label-{{ $data['dropdown'] }}" :data-label="$data['title']" :data-value="

<x-slot:menu>
<!-- Header Item -->
<li class="nav-header border">{{ __('dropdown.choose_user') }}</li>
<x-global::actions.dropdown.item variant="header">
{{ __('dropdown.choose_user') }}
</x-global::actions.dropdown.item>

<!-- Dynamic User Menu Items -->
@foreach ($tpl->get('users') as $user)
Expand Down
157 changes: 80 additions & 77 deletions app/Domain/Clients/Templates/showClient.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,105 +39,105 @@
<h4 class="widgettitle title-light">
<span class="fa fa-leaf"></span> {{ __('subtitle.details') }}
</h4>

<div class="form-group">
<x-global::forms.text-input
inputType="text"
name="id"
id="id"
value="{{ $values->id }}"
labelText="{{ __('label.client_id') }}"
readonly
<x-global::forms.text-input
inputType="text"
name="id"
id="id"
value="{{ $values->id }}"
labelText="{{ __('label.client_id') }}"
readonly
/>
</div>

<div class="form-group">
<x-global::forms.text-input
inputType="text"
name="name"
id="name"
value="{{ $values->name }}"
labelText="{{ __('label.name') }}"
<x-global::forms.text-input
inputType="text"
name="name"
id="name"
value="{{ $values->name }}"
labelText="{{ __('label.name') }}"
/>
</div>

<div class="form-group">
<x-global::forms.text-input
inputType="text"
name="email"
id="email"
value="{{ $values->email }}"
labelText="{{ __('label.email') }}"
<x-global::forms.text-input
inputType="text"
name="email"
id="email"
value="{{ $values->email }}"
labelText="{{ __('label.email') }}"
/>
</div>

<div class="form-group">
<x-global::forms.text-input
inputType="text"
name="internet"
id="internet"
value="{{ $values->internet }}"
labelText="{{ __('label.url') }}"
<x-global::forms.text-input
inputType="text"
name="internet"
id="internet"
value="{{ $values->internet }}"
labelText="{{ __('label.url') }}"
/>
</div>

<div class="form-group">
<x-global::forms.text-input
inputType="text"
name="street"
id="street"
value="{{ $values->street }}"
labelText="{{ __('label.street') }}"
<x-global::forms.text-input
inputType="text"
name="street"
id="street"
value="{{ $values->street }}"
labelText="{{ __('label.street') }}"
/>
</div>

<div class="form-group">
<x-global::forms.text-input
inputType="text"
name="zip"
id="zip"
value="{{ $values->zip }}"
labelText="{{ __('label.zip') }}"
<x-global::forms.text-input
inputType="text"
name="zip"
id="zip"
value="{{ $values->zip }}"
labelText="{{ __('label.zip') }}"
/>
</div>

<div class="form-group">
<x-global::forms.text-input
inputType="text"
name="city"
id="city"
value="{{ $values->city }}"
labelText="{{ __('label.city') }}"
<x-global::forms.text-input
inputType="text"
name="city"
id="city"
value="{{ $values->city }}"
labelText="{{ __('label.city') }}"
/>
</div>

<div class="form-group">
<x-global::forms.text-input
inputType="text"
name="state"
id="state"
value="{{ $values->state }}"
labelText="{{ __('label.state') }}"
<x-global::forms.text-input
inputType="text"
name="state"
id="state"
value="{{ $values->state }}"
labelText="{{ __('label.state') }}"
/>
</div>

<div class="form-group">
<x-global::forms.text-input
inputType="text"
name="country"
id="country"
value="{{ $values->country }}"
labelText="{{ __('label.country') }}"
<x-global::forms.text-input
inputType="text"
name="country"
id="country"
value="{{ $values->country }}"
labelText="{{ __('label.country') }}"
/>
</div>

<div class="form-group">
<x-global::forms.text-input
inputType="text"
name="phone"
id="phone"
value="{{ $values->phone }}"
labelText="{{ __('label.phone') }}"
<x-global::forms.text-input
inputType="text"
name="phone"
id="phone"
value="{{ $values->phone }}"
labelText="{{ __('label.phone') }}"
/>
</div>
</div>
Expand Down Expand Up @@ -183,10 +183,10 @@
<x-global::forms.button type="submit" name="save" value="true" id="save">
{{ __('buttons.save') }}
</x-global::forms.button>
<x-global::forms.button
tag="a"
href="/clients/showAll"

<x-global::forms.button
tag="a"
href="/clients/showAll"
content-role="tertiary"
>
{{ __('buttons.back') }}
Expand Down Expand Up @@ -253,7 +253,10 @@ class="fileupload-preview"></span>

<x-slot:menu>
<!-- File Section Header -->
<li class="nav-header">{{ __('subtitles.file') }}</li>

<x-global::actions.dropdown.item variant="header">
{{ __('subtitles.file') }}
</x-global::actions.dropdown.item>

<!-- Download Link -->
<x-global::actions.dropdown.item variant="link"
Expand Down Expand Up @@ -309,4 +312,4 @@ class="delete">
<?php $tpl->dispatchTplEvent('scripts.beforeClose'); ?>
</script>

@endsection()
@endsection()
2 changes: 1 addition & 1 deletion app/Domain/Dashboard/Js/dashboardController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Chart from 'chart.js/auto';
import jQuery from 'jquery';
import i18n from 'i18n';
import { theme } from 'js/app/core/instance-info.module';
import { getFormatFromSettings } from 'js/app/components/dates/dateHelper.module';
import { getFormatFromSettings } from 'js/app/support/dateHelper.module';
import { updateDueDates } from 'domain/Tickets/Js/ticketsRepository';
import moment from 'moment';
import {DateTime} from "luxon";
Expand Down
5 changes: 4 additions & 1 deletion app/Domain/Files/Templates/components/file-manager.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@
<x-global::content.context-menu>

<!-- Menu Header -->
<li class="nav-header">{{ __('subtitles.file') }}</li>

<x-global::actions.dropdown.item variant="header">
{{ __('subtitles.file') }}
</x-global::actions.dropdown.item>

<!-- Download File Menu Item -->
<x-global::actions.dropdown.item variant="link"
Expand Down
4 changes: 3 additions & 1 deletion app/Domain/Files/Templates/components/file-upload.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@
style="float:right;">

<!-- Menu Header -->
<li class="nav-header">{{ __('subtitles.file') }}</li>
<x-global::actions.dropdown.item variant="header">
{{ __('subtitles.file') }}
</x-global::actions.dropdown.item>

<!-- Download File Menu Item -->
<x-global::actions.dropdown.item variant="link"
Expand Down
5 changes: 4 additions & 1 deletion app/Domain/Files/Templates/partials/showAll.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ class="fileupload-preview"></span>
style="float:right;">

<!-- Menu Header -->
<li class="nav-header">{{ __('subtitles.file') }}</li>

<x-global::actions.dropdown.item variant="header">
{{ __('subtitles.file') }}
</x-global::actions.dropdown.item>

<!-- Download File Menu Item -->
<x-global::actions.dropdown.item variant="link"
Expand Down
Loading

0 comments on commit 8c42b56

Please sign in to comment.