From f4cc55993190847fd0f09dc3542de591b6fa3fbd Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 25 Apr 2025 17:21:12 +1000 Subject: [PATCH] Dynamically work out objectclasses on the current entry, this fixes usage issues between adding objectclasses and adding attribute that are now available from new objectclasses, as well as determining that they are not dynamic --- .../views/components/attribute/widget/options.blade.php | 3 +++ resources/views/frames/create.blade.php | 5 +++-- resources/views/frames/dn.blade.php | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/resources/views/components/attribute/widget/options.blade.php b/resources/views/components/attribute/widget/options.blade.php index 5fad0b42..e3cde68a 100644 --- a/resources/views/components/attribute/widget/options.blade.php +++ b/resources/views/components/attribute/widget/options.blade.php @@ -54,6 +54,9 @@ var rendered = false; var newadded = []; + var oc = $('attribute#objectClass input[type=text]') + .map((key,item)=>{return $(item).val()}).toArray(); + if (newadded.length) process_oc(); diff --git a/resources/views/frames/create.blade.php b/resources/views/frames/create.blade.php index 1f8c2ad4..dbd4ac68 100644 --- a/resources/views/frames/create.blade.php +++ b/resources/views/frames/create.blade.php @@ -103,9 +103,10 @@ $(document).ready(function() { @if($step === 2) - var oc = {!! $o->getObject('objectclass')->values !!}; - $('#newattr').on('change',function(item) { + var oc = $('attribute#objectClass input[type=text]') + .map((key,item)=>{return $(item).val()}).toArray(); + $.ajax({ type: 'POST', url: '{{ url('entry/attr/add') }}/'+item.target.value, diff --git a/resources/views/frames/dn.blade.php b/resources/views/frames/dn.blade.php index 6648beb3..260a64bf 100644 --- a/resources/views/frames/dn.blade.php +++ b/resources/views/frames/dn.blade.php @@ -174,7 +174,6 @@ @section('page-scripts')