-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In progress - chip dropdown component #2857
base: 4.0-dev
Are you sure you want to change the base?
Conversation
if (is_numeric($result)) { | ||
$params['id'] = $result; | ||
$this->tpl->setNotification($this->language->__('notification.milestone_created_successfully'), 'success'); | ||
$subject = $this->language->__('email_notifications.milestone_created_subject'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The email notification part should actually just be in the quickAddMilestone Service. That way people will get notified event if the milestone is being created via api
id="{{ $milestoneDropdownId }}" | ||
:style="'background-color:' . $milestoneColor" | ||
<x-global::forms.chip | ||
class="ticketDropdown milestoneDropdown colorized milestone show f-left" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need those classes still? Or is this something we can move into a chip component css so that it's less tied to "tickets" and more generally applicable
<x-global::actions.dropdown.item class="nav-header border"> | ||
:parentId="$row['id']" | ||
:quickaddOption="true" | ||
quickaddPostUrl="{{ BASE_URL }}/hx/tickets/Milestones" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just pass the hx-* attributes rather than create a new attribute.
Basically just use hx-post and create the appropriate hxPost variable in your component. Maybe add hx-swap, hx-target, hx-trigger etc as well I am pretty sure you could just use the $attributes array that is available in the component and look for entries that start with hx
]) | ||
|
||
<div {{ $attributes->merge([ 'class' => '' ]) }}> | ||
<div class="dropdown ticketDropdown {{ $type }}Dropdown colorized show px-2 py-0.5 ml-1.5 {{ $extraClass }}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems this is the old dropdown code, we should use our dropdown component for this
$inputName = $type == 'milestone' ? 'headline' : 'name'; | ||
@endphp | ||
|
||
<div {{ $attributes->merge([ 'class' => 'mx-2' ]) }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From above: You can take the attributes array and look for keys() that start with
'hx'. Then take all those keys and add them below to the form tag.
I believe $attribute is a collection so you can do:
$hxAttributes = $attributes->filter(function($field, $key){
if(Str::startsWith($key, 'hx')) {
return;
}
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: You would want to only show the non hx tags up here in the div tag
style="padding-top:5px; padding-bottom:5px;"> | ||
|
||
<form | ||
hx-post={{ $postUrl }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then here you would just do {{ $hxAttributes }}
<i class="fas fa-plus-circle"></i> Add {{ $type }} | ||
</a> | ||
<div class="hideOnLoad" id="{{ $type }}_new_{{ $parentId }}" | ||
style="padding-top:5px; padding-bottom:5px;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove inline styles
Description
Chip dropdown with quickadd htmx call added
Link to ticket
Please add a link to the GitHub issue being addressed by this change.
Type
Screenshot of the result
If your change affects the user interface, you should include a screenshot of the result with the pull request.