Skip to content

Commit

Permalink
Merge pull request #916 from owlchester/attributes-max-fields
Browse files Browse the repository at this point in the history
Removed old code
  • Loading branch information
ilestis authored Jul 12, 2024
2 parents 951df87 + b1ca0c7 commit f09e8db
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
18 changes: 0 additions & 18 deletions resources/js/attributes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
let maxFields = false;
const maxFieldAlert = document.querySelector('.alert-too-many-fields');

let liveEditURL, liveEditModal;

const init = () => {
Expand All @@ -15,22 +13,6 @@ const init = () => {
}
};

const initAddAttribute = () => {
if (maxFields !== false) {
// Todo: migrate to vue and vanila js.
// This is also wrong, as it looks for all form inputs (search, logout, bulk) instead of the current form)
const fieldCount = $('form :input').length + 4;
//console.log('checking', fieldCount, 'vs', maxFields);
if (fieldCount > maxFields) {
maxFieldAlert.classList.remove('hidden');
return;
} else {
maxFieldAlert.classList.add('hidden');
}
}
};


const initLiveAttributes = () => {
const config = document.querySelector('[name="live-attribute-config"]');
if (!config) {
Expand Down
6 changes: 0 additions & 6 deletions resources/views/cruds/forms/attributes/_buttons.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@
{{ __('entities/attributes.actions.remove_all') }}
</button>
</div>

<x-alert type="warning" class="alert-too-many-fields mt-6" :hidden="true">
{!! __('entities/attributes.errors.too_many', [
'max' => number_format(ini_get('max_input_vars'))
]) !!}
</x-alert>
<!-- Modal -->


Expand Down
7 changes: 0 additions & 7 deletions resources/views/entities/pages/attributes/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ class="entity-form flex flex-col gap-5"
<attributes-manager api="{{ route('attributes.api-entity', [$campaign, $entity]) }}" />
</div>

<x-alert type="warning" class="alert-too-many-fields mt-6" :hidden="true">
{!! __('entities/attributes.errors.too_many', [
'max' => number_format(ini_get('max_input_vars'))
]) !!}
</x-alert>


@if (auth()->user()->isAdmin() && $entity->is_attributes_private)
@php
$role = \App\Facades\CampaignCache::adminRole();
Expand Down

0 comments on commit f09e8db

Please sign in to comment.