From b463f9e446372c13d2f09085eba7a90b3683ddec Mon Sep 17 00:00:00 2001 From: Dominik Frey <37086622+dominikfrey@users.noreply.github.com> Date: Mon, 26 Sep 2022 18:31:53 +0200 Subject: [PATCH 01/18] Correct date for sent recurring invoices --- resources/views/components/documents/show/children.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/documents/show/children.blade.php b/resources/views/components/documents/show/children.blade.php index cc451bcb8..3f36f5dc7 100644 --- a/resources/views/components/documents/show/children.blade.php +++ b/resources/views/components/documents/show/children.blade.php @@ -14,7 +14,7 @@ @endphp
- {!! trans('recurring.child', ['url' => $url, 'date' => company_date($child->due_at)]) !!} + {!! trans('recurring.child', ['url' => $url, 'date' => company_date($child->created_at)]) !!}
@endforeach @else From e80e9b5f3434bc51b575c471e5ede89d9b0ca705 Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Wed, 5 Oct 2022 09:59:37 +0300 Subject: [PATCH 02/18] dynamic options controlled --- .../assets/js/components/AkauntingSelect.vue | 52 +++++++++++++++---- .../components/form/group/select.blade.php | 6 +++ 2 files changed, 48 insertions(+), 10 deletions(-) diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 4aa377ea4..bfce3274e 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -299,6 +299,11 @@ export default { default: '', description: "Selectbox input search placeholder text" }, + + selectedControl: { + type: [Boolean, String], + default: false, + }, }, data() { @@ -882,18 +887,20 @@ export default { let is_string = false; let pre_value = []; - selected.forEach(item => { - if (typeof item != 'string') { - is_string = true; + if (selected !== undefined) { + selected.forEach(item => { + if (typeof item != 'string') { + is_string = true; - if (item != '') { - pre_value.push(item.toString()); + if (item != '') { + pre_value.push(item.toString()); + } } - } - }); + }); - if (is_string) { - this.selected = pre_value; + if (is_string) { + this.selected = pre_value; + } } } } @@ -949,7 +956,6 @@ export default { dynamicOptions: function(options) { this.sorted_options = []; - this.selected = ''; if (this.group) { // Option set sort_option data @@ -1018,6 +1024,32 @@ export default { } }, this); } + + + if (this.selectedControl) { + if (this.multiple) { + let selected = this.selected; + this.selected = []; + + selected.forEach(function (select, index) { + if (this.sorted_options.find(option => option.key == select)) { + this.selected.push(select); + } else { + this.selected = []; + } + }, this); + } else { + if (! options.find(option => option == this.selected)) { + this.selected = []; + } + } + } else { + if (this.multiple) { + this.selected = []; + } else { + this.selected = ''; + } + } } }, }, diff --git a/resources/views/components/form/group/select.blade.php b/resources/views/components/form/group/select.blade.php index ff2c421ed..be60b9a8d 100644 --- a/resources/views/components/form/group/select.blade.php +++ b/resources/views/components/form/group/select.blade.php @@ -65,6 +65,12 @@ search-text="{{ $searchText }}" @endif + @if (! empty($attributes['selected-control'])) + selected-control + @elseif (! empty($selectedControl)) + selected-control + @endif + @if (empty($multiple)) @if (isset($selected) || old($name)) value="{{ old($name, $selected) }}" From b04c6a1e21ea220411af71a621ab6f405e1977a3 Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Wed, 5 Oct 2022 10:04:28 +0300 Subject: [PATCH 03/18] watcher controlled --- resources/assets/js/components/AkauntingSelect.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index bfce3274e..650d38aa2 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -887,7 +887,7 @@ export default { let is_string = false; let pre_value = []; - if (selected !== undefined) { + if (selected !== undefined && selected.length) { selected.forEach(item => { if (typeof item != 'string') { is_string = true; From a7da2ab3c923f2d96fcd035f6aaf5c232d618d4e Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Wed, 5 Oct 2022 10:14:39 +0300 Subject: [PATCH 04/18] refactoring --- .../assets/js/components/AkauntingSelect.vue | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 650d38aa2..5cfd6e5cd 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -897,10 +897,10 @@ export default { } } }); + } - if (is_string) { - this.selected = pre_value; - } + if (is_string) { + this.selected = pre_value; } } } @@ -1030,14 +1030,16 @@ export default { if (this.multiple) { let selected = this.selected; this.selected = []; - - selected.forEach(function (select, index) { - if (this.sorted_options.find(option => option.key == select)) { - this.selected.push(select); - } else { - this.selected = []; - } - }, this); + + if (selected !== undefined) { + selected.forEach(function (select, index) { + if (this.sorted_options.find(option => option.key == select)) { + this.selected.push(select); + } else { + this.selected = []; + } + }, this); + } } else { if (! options.find(option => option == this.selected)) { this.selected = []; From 3cab2fee8bfa18d05f5c2b969ab70ded72daf12c Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Thu, 6 Oct 2022 12:35:06 +0300 Subject: [PATCH 05/18] refactoring --- .../assets/js/components/AkauntingSelect.vue | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 5cfd6e5cd..61f344968 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -107,7 +107,7 @@ {{ addNew.new_text }} - @@ -355,7 +355,6 @@ export default { } else { this.sorted_options.sort(this.sortBy(this.option_sortable)); } - return this.sorted_options; }, }, @@ -959,7 +958,7 @@ export default { if (this.group) { // Option set sort_option data - if (!Array.isArray(options)) { + if (! Array.isArray(options)) { for (const [index, _options] of Object.entries(options)) { let values = []; @@ -997,7 +996,7 @@ export default { } } else { // Option set sort_option data - if (!Array.isArray(options)) { + if (! Array.isArray(options)) { for (const [key, value] of Object.entries(options)) { this.sorted_options.push({ key: key.toString(), @@ -1025,31 +1024,26 @@ export default { }, this); } - if (this.selectedControl) { if (this.multiple) { - let selected = this.selected; + let selected = this.selected; this.selected = []; - - if (selected !== undefined) { - selected.forEach(function (select, index) { - if (this.sorted_options.find(option => option.key == select)) { - this.selected.push(select); - } else { - this.selected = []; - } - }, this); - } + + selected.forEach(function (select, index) { + if (this.sorted_options.find(option => option.key == select)) { + this.selected.push(select); + } + }, this); } else { if (! options.find(option => option == this.selected)) { - this.selected = []; + this.selected = null; } } } else { if (this.multiple) { this.selected = []; } else { - this.selected = ''; + this.selected = null; } } } From fdd00f666c1cf42632e05f00778f00363db32587 Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Thu, 6 Oct 2022 14:36:44 +0300 Subject: [PATCH 06/18] dynamic options function refactoring --- .../assets/js/components/AkauntingSelect.vue | 50 ++++++++++--------- .../js/components/AkauntingSelectRemote.vue | 27 ++++++++++ .../components/form/group/select.blade.php | 8 +-- 3 files changed, 58 insertions(+), 27 deletions(-) diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 61f344968..2fa5c21a0 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -300,7 +300,7 @@ export default { description: "Selectbox input search placeholder text" }, - selectedControl: { + dynamicOptionsValueCheck: { type: [Boolean, String], default: false, }, @@ -869,6 +869,31 @@ export default { this.setSortedOptions(); } }, + + dynamicOptionsValue(options) { + if (this.dynamicOptionsValueCheck) { + if (this.multiple) { + let selected = this.selected; + this.selected = []; + + selected.forEach(function (select, index) { + if (this.sorted_options.find((option) => option.key == select)) { + this.selected.push(select); + } + }, this); + } else { + if (!options.find((option) => option == this.selected)) { + this.selected = null; + } + } + } else { + if (this.multiple) { + this.selected = []; + } else { + this.selected = null; + } + } + } }, watch: { @@ -1024,28 +1049,7 @@ export default { }, this); } - if (this.selectedControl) { - if (this.multiple) { - let selected = this.selected; - this.selected = []; - - selected.forEach(function (select, index) { - if (this.sorted_options.find(option => option.key == select)) { - this.selected.push(select); - } - }, this); - } else { - if (! options.find(option => option == this.selected)) { - this.selected = null; - } - } - } else { - if (this.multiple) { - this.selected = []; - } else { - this.selected = null; - } - } + this.dynamicOptionsValue(options); } }, }, diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue index 56414fa39..f7e389477 100644 --- a/resources/assets/js/components/AkauntingSelectRemote.vue +++ b/resources/assets/js/components/AkauntingSelectRemote.vue @@ -1089,6 +1089,31 @@ export default { }, }, + dynamicOptionsValue(options) { + if (this.dynamicOptionsValueCheck) { + if (this.multiple) { + let selected = this.selected; + this.selected = []; + + selected.forEach(function (select, index) { + if (this.sorted_options.find((option) => option.key == select)) { + this.selected.push(select); + } + }, this); + } else { + if (!options.find((option) => option == this.selected)) { + this.selected = null; + } + } + } else { + if (this.multiple) { + this.selected = []; + } else { + this.selected = null; + } + } + }, + watch: { selected: function (selected) { if (!this.multiple) { @@ -1237,6 +1262,8 @@ export default { } }, this); } + + this.dynamicOptionsValue(options); } }, }, diff --git a/resources/views/components/form/group/select.blade.php b/resources/views/components/form/group/select.blade.php index be60b9a8d..52460a915 100644 --- a/resources/views/components/form/group/select.blade.php +++ b/resources/views/components/form/group/select.blade.php @@ -65,10 +65,10 @@ search-text="{{ $searchText }}" @endif - @if (! empty($attributes['selected-control'])) - selected-control - @elseif (! empty($selectedControl)) - selected-control + @if (! empty($attributes['dynamic-options-value-check'])) + dynamic-options-value-check + @elseif (! empty($dynamicOptionsValueCheck)) + dynamic-options-value-check @endif @if (empty($multiple)) From b96f9fd1a31e144e516119bb6714cac8a3a484e0 Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Thu, 6 Oct 2022 14:46:56 +0300 Subject: [PATCH 07/18] refactoring --- resources/assets/js/components/AkauntingSelectRemote.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue index f7e389477..c2c5f23d5 100644 --- a/resources/assets/js/components/AkauntingSelectRemote.vue +++ b/resources/assets/js/components/AkauntingSelectRemote.vue @@ -104,7 +104,7 @@ {{ addNew.new_text }} - From c402dfe5e70ef1f221e43b1f42697552c8f5a020 Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Fri, 7 Oct 2022 10:47:41 +0300 Subject: [PATCH 08/18] responsive control for search bar --- public/css/app.css | 16 ++++++++ .../assets/js/components/AkauntingSearch.vue | 40 ++++++++++--------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/public/css/app.css b/public/css/app.css index 0bbde2d20..b244363ae 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -49922,6 +49922,10 @@ body{ right: 6rem; } + .lg\:top-2{ + top: 0.5rem; + } + .lg\:col-span-5{ grid-column: span 5 / span 5; } @@ -49998,6 +50002,14 @@ body{ height: 1rem; } + .lg\:h-12{ + height: 3rem; + } + + .lg\:h-auto{ + height: auto; + } + .lg\:w-1\/2{ width: 50%; } @@ -50086,6 +50098,10 @@ body{ width: 75%; } + .lg\:w-auto{ + width: auto; + } + .lg\:max-w-7xl{ max-width: 80rem; } diff --git a/resources/assets/js/components/AkauntingSearch.vue b/resources/assets/js/components/AkauntingSearch.vue index da79705f0..dfdd14000 100644 --- a/resources/assets/js/components/AkauntingSearch.vue +++ b/resources/assets/js/components/AkauntingSearch.vue @@ -1,37 +1,39 @@