Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions app/Http/Controllers/Assets/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,9 @@ public function index(Request $request): View
->orderBy('name')
->get();*/

$predefined_filter_edit_modal_open = $request->input('predefinedFilterEditModalOpen');
// $predefined_filter_edit_modal_open = $request->input('predefinedFilterEditModalOpen');
$predefined_filter_id = $request->input('predefinedFilterId');

if ($predefined_filter_edit_modal_open === null) {
$predefined_filter_edit_modal_open = false;
}

if ($predefined_filter_edit_modal_open !== 'true' && $predefined_filter_edit_modal_open !== 'false' && $predefined_filter_edit_modal_open != null) {
throw new InvalidArgumentException("You provided an invalid parameter for predefinedFilterModalOpen (must be true or false).");
} else {
// Convert string to boolean
$predefined_filter_edit_modal_open = $predefined_filter_edit_modal_open == 'true' ? true : false;
}

// Validate if it's a valid integer
if (filter_var($predefined_filter_id, FILTER_VALIDATE_INT) === false && $predefined_filter_id != null) {
throw new InvalidArgumentException('You provided an invalid parameter for predefinedFilterId (must be an integer).');
Expand All @@ -101,7 +90,7 @@ public function index(Request $request): View


// TODO maybe switch later to user / role based view
return view('hardware/index')->with('company', $company)->with('predefined_filter_edit_modal_open', $predefined_filter_edit_modal_open)->with('predefined_filter_id', $predefined_filter_id);
return view('hardware/index')->with('company', $company)/*->with('predefined_filter_edit_modal_open', $predefined_filter_edit_modal_open)*/->with('predefined_filter_id', $predefined_filter_id);
}

/**
Expand Down
5 changes: 5 additions & 0 deletions public/css/dist/filterInputs.css
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ When .hide is applied, the filter section is hidden.
box-sizing: border-box;
}

.select2-container--open {
width: unset;
box-sizing: border-box;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
height: 38px;
Expand Down
2 changes: 1 addition & 1 deletion public/css/dist/filterInputs.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"/css/dist/advanced-search.min.css": "/css/dist/advanced-search.min.css?id=2a854b83e82e229aba501f329c060fe0",
"/css/dist/modal.css": "/css/dist/modal.css?id=52cec51e3f1db875dd7cc586f7ed5593",
"/css/dist/modal.min.css": "/css/dist/modal.min.css?id=52cec51e3f1db875dd7cc586f7ed5593",
"/css/dist/filterInputs.css": "/css/dist/filterInputs.css?id=f4f1d563934f4d5b952f01a63dfdb259",
"/css/dist/filterInputs.min.css": "/css/dist/filterInputs.min.css?id=f4f1d563934f4d5b952f01a63dfdb259",
"/css/dist/filterInputs.css": "/css/dist/filterInputs.css?id=ff5cc49deb56a56997a9424367555838",
"/css/dist/filterInputs.min.css": "/css/dist/filterInputs.min.css?id=ff5cc49deb56a56997a9424367555838",
"/js/dist/floating-buttons.js": "/js/dist/floating-buttons.js?id=5d571b93e0e3b820cbc76ef91295b18d",
"/js/dist/floating-buttons.min.js": "/js/dist/floating-buttons.min.js?id=5d571b93e0e3b820cbc76ef91295b18d",
"/js/dist/apiService.js": "/js/dist/apiService.js?id=fcaa03a7b041bdfbfb064f093ec69c8e",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ When .hide is applied, the filter section is hidden.
box-sizing: border-box;
}

.select2-container--open {
width: unset;
box-sizing: border-box;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
height: 38px;
Expand Down
1 change: 0 additions & 1 deletion resources/views/hardware/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
<!-- Filter Section -->
<div class="filter-section hide" id="filterSection">
@include('partials.advanced-search.advanced-search', [
'predefined_filter_edit_modal_open' => $predefined_filter_edit_modal_open,
'predefined_filter_id' => $predefined_filter_id,
])
</div>
Expand Down
22 changes: 11 additions & 11 deletions resources/views/partials/advanced-search/advanced-search.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,6 @@ class FilterUIController {
controller.bindEvents();


(async () => {
setTimeout(async () => {
const filterSection = document.getElementById('filterSection');
filterSection.classList.remove('hide');
container.resolve("filterFormManager").clearAll();

await new Promise(resolve => setTimeout(resolve, 0));
filterSection.classList.add('hide');
}, 0);
})();


@if(isset($predefined_filter_id))
controller.updateFilterWithPredefined(null, {{ $predefined_filter_id }});
Expand All @@ -243,6 +232,17 @@ class FilterUIController {
});
});
@endif
@else
(async () => {
setTimeout(async () => {
const filterSection = document.getElementById('filterSection');
filterSection.classList.remove('hide');
container.resolve("filterFormManager").clearAll();

await new Promise(resolve => setTimeout(resolve, 0));
filterSection.classList.add('hide');
}, 0);
})();
@endif
});

Expand Down
2 changes: 1 addition & 1 deletion resources/views/partials/bootstrap-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ function assetSerialLinkFormatter(value, row) {
// this Links to '/hardware' with the filter id
function predefinedFiltersLinkFormatter(value, row){
if (value && row.id){
return `<a href="{{ config('app.url') }}/hardware?predefinedFilterEditModalOpen=false&predefinedFilterId=${row.id}">${value}</a>`;
return `<a href="{{ config('app.url') }}/hardware?predefinedFilterId=${row.id}">${value}</a>`;
}
}

Expand Down