Merge pull request #2435 from brkcvn/master

Ui feedbacks & bugfixes solved
This commit is contained in:
Denis Duliçi 2022-06-07 20:43:19 +03:00 committed by GitHub
commit 6558e773fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 63 additions and 40 deletions

View File

@ -11,27 +11,29 @@ document.querySelectorAll("[data-table-list]").forEach((row) => {
//redirect edit or show page for table row click //redirect edit or show page for table row click
document.querySelectorAll("[data-table-body]").forEach((table) => { document.querySelectorAll("[data-table-body]").forEach((table) => {
let rows = table.querySelectorAll("tr"); if (document.body.clientWidth >= 991) {
let rows = table.querySelectorAll("tr");
rows.forEach((row) => { rows.forEach((row) => {
let row_href = row.getAttribute("href"); let row_href = row.getAttribute("href");
if (! row_href) { if (!row_href) {
return; return;
} }
let td = row.getElementsByTagName("td"); let td = row.getElementsByTagName("td");
let first_selector = row.querySelector('[data-bulkaction]') && row.querySelector('[data-bulkaction]') !== null ? 1 : 0; let first_selector = row.querySelector("[data-bulkaction]") && row.querySelector("[data-bulkaction]") !== null ? 1 : 0;
if (row_href) { if (row_href) {
for (let i=first_selector; i<td.length-1; i++) { for (let i = first_selector; i < td.length - 1; i++) {
let td_item = td[i]; let td_item = td[i];
td_item.addEventListener("click", () => { td_item.addEventListener("click", () => {
window.location.href = row_href; window.location.href = row_href;
}); });
} }
}
});
} }
});
}); });
//redirect edit or show page for table row click //redirect edit or show page for table row click

View File

@ -63,7 +63,7 @@
</button> </button>
<div :id="'search-field-option-' + _uid" class="absolute top-12 ltr:left-8 rtl:right-8 py-2 bg-white rounded-md border border-gray-200 shadow-xl z-20 list-none dropdown-menu" :class="[{'show': visible.options}]"> <div :id="'search-field-option-' + _uid" class="absolute top-12 ltr:left-8 rtl:right-8 py-2 bg-white rounded-md border border-gray-200 shadow-xl z-20 list-none dropdown-menu" :class="[{'show': visible.options}]">
<li ref="" class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap" v-for="option in filteredOptions" :data-value="option.key"> <li ref="" class="w-full flex items-center px-2 h-9 leading-9 whitespace-nowrap" v-for="option in filteredOptions" :data-value="option.key">
<button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100" data-btn="btn btn-link" @click="onOptionSelected(option.key)">{{ option.value }}</button> <button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100" data-btn="btn btn-link" @click="onOptionSelected(option.key)">{{ option.value }}</button>
</li> </li>
@ -73,7 +73,7 @@
</div> </div>
<div :id="'search-field-operator-' + _uid" class="absolute top-12 ltr:left-8 rtl:right-8 py-2 bg-white rounded-md border border-gray-200 shadow-xl z-20 list-none dropdown-menu operator" :class="[{'show': visible.operator}]"> <div :id="'search-field-operator-' + _uid" class="absolute top-12 ltr:left-8 rtl:right-8 py-2 bg-white rounded-md border border-gray-200 shadow-xl z-20 list-none dropdown-menu operator" :class="[{'show': visible.operator}]">
<li ref="" class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap"> <li ref="" class="w-full flex items-center px-2 h-9 leading-9 whitespace-nowrap">
<button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100" @click="onOperatorSelected('=')"> <button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100" @click="onOperatorSelected('=')">
<span class="material-icons text-2xl transform">drag_handle</span> <span class="material-icons text-2xl transform">drag_handle</span>
<span class="text-gray hidden">{{ operatorIsText }} <span class="text-gray hidden">{{ operatorIsText }}
@ -81,14 +81,14 @@
</button> </button>
</li> </li>
<li ref="" class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap"> <li ref="" class="w-full flex items-center px-2 h-9 leading-9 whitespace-nowrap">
<button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100" @click="onOperatorSelected('!=')"> <button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100" @click="onOperatorSelected('!=')">
<img :src="equal_image" class="w-6 h-6 block m-auto" /> <img :src="equal_image" class="w-6 h-6 block m-auto" />
<span class="text-gray hidden">{{ operatorIsNotText }}</span> <span class="text-gray hidden">{{ operatorIsNotText }}</span>
</button> </button>
</li> </li>
<li v-if="range" ref="" class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap"> <li v-if="range" ref="" class="w-full flex items-center px-2 h-9 leading-9 whitespace-nowrap">
<button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100" @click="onOperatorSelected('><')"> <button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100" @click="onOperatorSelected('><')">
<span class="material-icons text-2xl transform rotate-90">height</span> <span class="material-icons text-2xl transform rotate-90">height</span>
<span class="text-gray hidden">{{ operatorIsNotText }}</span> <span class="text-gray hidden">{{ operatorIsNotText }}</span>
@ -97,11 +97,11 @@
</div> </div>
<div :id="'search-field-value-' + _uid" class="absolute top-12 ltr:left-8 rtl:right-8 py-2 bg-white rounded-md border border-gray-200 shadow-xl z-20 list-none dropdown-menu" :class="[{'show': visible.values}]"> <div :id="'search-field-value-' + _uid" class="absolute top-12 ltr:left-8 rtl:right-8 py-2 bg-white rounded-md border border-gray-200 shadow-xl z-20 list-none dropdown-menu" :class="[{'show': visible.values}]">
<li ref="" class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap" v-for="(value) in filteredValues" :data-value="value.key"> <li ref="" class="w-full flex items-center px-2 h-9 leading-9 whitespace-nowrap" v-for="(value) in filteredValues" :data-value="value.key">
<button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100" @click="onValueSelected(value.key)">{{ value.value }}</button> <button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100" @click="onValueSelected(value.key)">{{ value.value }}</button>
</li> </li>
<li ref="" class="w-full flex items-center text-purple px-2 h-9 leading-9 whitespace-nowrap" v-if="!filteredValues.length"> <li ref="" class="w-full flex items-center px-2 h-9 leading-9 whitespace-nowrap" v-if="!filteredValues.length">
<button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100">{{ noMatchingDataText }}</button> <button type="button" class="w-full h-full flex items-center rounded-md px-2 text-sm hover:bg-lilac-100">{{ noMatchingDataText }}</button>
</li> </li>
</div> </div>

View File

@ -159,6 +159,7 @@ export default {
if(this.error_field[field_name]) { if(this.error_field[field_name]) {
return this.error_field[field_name][0]; return this.error_field[field_name][0];
} }
this.button_loading = false;
}, },
onFailError(error) { onFailError(error) {

View File

@ -72,8 +72,16 @@
<div class="flex items-center justify-center mt-5 gap-x-10"> <div class="flex items-center justify-center mt-5 gap-x-10">
<base-button class="w-1/2 flex items-center justify-center px-6 py-1.5 text-base rounded-lg bg-transparent hover:bg-gray-100" @click="next()">{{ translations.company.skip }}</base-button> <base-button class="w-1/2 flex items-center justify-center px-6 py-1.5 text-base rounded-lg bg-transparent hover:bg-gray-100" @click="next()">{{ translations.company.skip }}</base-button>
<base-button id="button" class="w-1/2 relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onEditSave()"> <base-button
{{ translations.company.save }} id="button"
:disabled="button_loading"
class="w-1/2 relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100"
@click="onEditSave()"
>
<i v-if="button_loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': button_loading}]">
{{ translations.company.save }}
</span>
</base-button> </base-button>
</div> </div>
</div> </div>

View File

@ -91,8 +91,15 @@
{{ translations.currencies.cancel }} {{ translations.currencies.cancel }}
</base-button> </base-button>
<base-button class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onEditForm(item)"> <base-button
{{ translations.currencies.save }} :disabled="button_loading"
class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100"
@click="onEditForm(item)"
>
<i v-if="button_loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': button_loading}]">
{{ translations.currencies.save }}
</span>
</base-button> </base-button>
</div> </div>
</div> </div>
@ -153,7 +160,7 @@
</base-button> </base-button>
<base-button :disabled="button_loading" class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onSubmitForm()"> <base-button :disabled="button_loading" class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onSubmitForm()">
<i v-if="button_loading" class="submit-spin absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto"></i> <i v-if="button_loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': button_loading}]"> <span :class="[{'opacity-0': button_loading}]">
{{ translations.currencies.save }} {{ translations.currencies.save }}
</span> </span>

View File

@ -73,8 +73,15 @@
{{ translations.taxes.cancel }} {{ translations.taxes.cancel }}
</base-button> </base-button>
<base-button class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onEditForm(item)"> <base-button
{{ translations.taxes.save }} :disabled="button_loading"
class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100"
@click="onEditForm(item)"
>
<i v-if="button_loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': button_loading}]">
{{ translations.taxes.save }}
</span>
</base-button> </base-button>
</div> </div>
</div> </div>
@ -125,7 +132,7 @@
</base-button> </base-button>
<base-button :disabled="button_loading" class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onSubmitForm()"> <base-button :disabled="button_loading" class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onSubmitForm()">
<i v-if="button_loading" class="submit-spin absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto"></i> <i v-if="button_loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
<span :class="[{'opacity-0': button_loading}]"> <span :class="[{'opacity-0': button_loading}]">
{{ translations.taxes.save }} {{ translations.taxes.save }}
</span> </span>

View File

@ -70,7 +70,7 @@
<x-sortablelink column="sale_price" title="{{ trans('items.sale_price') }}" /> <x-sortablelink column="sale_price" title="{{ trans('items.sale_price') }}" />
</x-slot> </x-slot>
<x-slot name="second"> <x-slot name="second">
<x-sortablelink column="purchase_price" title="{{ trans('items.purchase_price') }}" /> <x-sortablelink column="purchase_price" title="{!! trans('items.purchase_price') !!}" />
</x-slot> </x-slot>
</x-table.th> </x-table.th>
</x-table.tr> </x-table.tr>

View File

@ -34,16 +34,14 @@
</div> </div>
<div class="flex flex-col"> <div class="flex flex-col">
<div class="flex items-center"> @php $history = $document->last_history; @endphp
@php $history = $document->last_history; @endphp <span class="w-72 font-medium mr-2 truncate">
<span class="font-medium mr-2"> {{ $history->description }}
{{ $history->description }} </span>
</span>
<span class="flex items-center font-normal"> <span class="flex items-center font-normal">
{{ \Date::parse($history->created_at)->diffForHumans() }} {{ \Date::parse($history->created_at)->diffForHumans() }}
</span> </span>
</div>
</div> </div>
</li> </li>