Clear some javascript @todos: fancytree options, optionclass processing
All checks were successful
Create Docker Image / Test Application (x86_64) (push) Successful in 3m27s
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 1m25s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 4m35s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s
All checks were successful
Create Docker Image / Test Application (x86_64) (push) Successful in 3m27s
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 1m25s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 4m35s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s
This commit is contained in:
parent
dc623b18ae
commit
c588e13bd8
@ -241,6 +241,7 @@ class Attribute implements \Countable, \ArrayAccess, \Iterator
|
||||
// @todo
|
||||
|
||||
// objectClasses requiring this attribute
|
||||
// @todo limit this to this DNs objectclasses
|
||||
// eg: $result->put('required','Required by objectClasses: a,b');
|
||||
if ($this->required_by->count())
|
||||
$result->put(__('required'),sprintf('%s: %s',__('Required Attribute by ObjectClass(es)'),$this->required_by->join(',')));
|
||||
|
@ -96,7 +96,7 @@ class HomeController extends Controller
|
||||
*/
|
||||
public function entry_attr_add(Request $request,string $id): string
|
||||
{
|
||||
$xx = new \stdClass();
|
||||
$xx = new \stdClass;
|
||||
$xx->index = 0;
|
||||
|
||||
$x = $request->noheader
|
||||
|
6
public/css/fixes.css
vendored
6
public/css/fixes.css
vendored
@ -69,10 +69,6 @@ table.dataTable thead .sorting {
|
||||
*/
|
||||
|
||||
/** Fancy Tree Fixes **/
|
||||
/*
|
||||
@todo The unopened lazy branches off the tree are off by 5px. see *-cdl. below
|
||||
@todo The last node is missing some dots, connecting to the previous node
|
||||
*/
|
||||
/* So our tree can be longer than the frame */
|
||||
.scrollbar-sidebar {
|
||||
overflow: auto;
|
||||
@ -117,7 +113,7 @@ ul.fancytree-container ul {
|
||||
}
|
||||
.fancytree-node.fancytree-exp-n span.fancytree-expander,
|
||||
.fancytree-node.fancytree-exp-n span.fancytree-expander:hover { /* node */
|
||||
margin-top: 4px;
|
||||
margin-top: 3px;
|
||||
background-position: 0 -63px;
|
||||
}
|
||||
.fancytree-node.fancytree-exp-nl span.fancytree-expander { /* node last */
|
||||
|
12
public/js/custom.js
vendored
12
public/js/custom.js
vendored
@ -64,18 +64,14 @@ $(document).ready(function() {
|
||||
// and pass the tree options as an argument to the fancytree() function:
|
||||
$('#tree').fancytree({
|
||||
clickFolderMode: 3,
|
||||
extensions: ['glyph','persist'],
|
||||
extensions: ['persist'],
|
||||
autoCollapse: true, // Automatically collapse all siblings, when a node is expanded.
|
||||
autoScroll: true, // Automatically scroll nodes into visible area.
|
||||
focusOnSelect: true, // Set focus when node is checked by a mouse click
|
||||
glyph: {
|
||||
preset: 'bootstrap3', // @todo look at changing this to awesome5
|
||||
map: {}
|
||||
},
|
||||
persist: {
|
||||
// Available options with their default:
|
||||
cookieDelimiter: '~', // character used to join key strings
|
||||
cookiePrefix: undefined, // 'fancytree-<treeId>-' by default
|
||||
cookiePrefix: 'pla-<treeId>-', // 'fancytree-<treeId>-' by default
|
||||
cookie: { // settings passed to jquery.cookie plugin
|
||||
raw: false,
|
||||
expires: '',
|
||||
@ -85,14 +81,14 @@ $(document).ready(function() {
|
||||
},
|
||||
expandLazy: true, // true: recursively expand and load lazy nodes
|
||||
expandOpts: undefined, // optional `opts` argument passed to setExpanded()
|
||||
fireActivate: false, //
|
||||
overrideSource: true, // true: cookie takes precedence over `source` data attributes.
|
||||
store: 'auto', // 'cookie': use cookie, 'local': use localStore, 'session': use sessionStore
|
||||
types: 'active expanded focus selected' // which status types to store
|
||||
},
|
||||
click: function(event,data) {
|
||||
if (data.targetType == 'title') {
|
||||
if (data.targetType === 'title')
|
||||
getNode(data.node.data.item);
|
||||
}
|
||||
},
|
||||
source: sources,
|
||||
lazyLoad: function(event,data) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<!-- $o=Attribute::class -->
|
||||
<x-attribute.layout :edit="$edit" :new="$new" :o="$o">
|
||||
@foreach (old($o->name_lc,$o->values) as $value)
|
||||
@foreach(old($o->name_lc,$o->values) as $value)
|
||||
@if ($edit)
|
||||
<x-attribute.widget.objectclass :o="$o" :edit="$edit" :new="$new" :loop="$loop" :value="$value"/>
|
||||
@else
|
||||
|
@ -27,9 +27,6 @@
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-bs-dismiss="modal">Next</button>
|
||||
{{--
|
||||
<button type="button" class="btn btn-sm btn-primary" data-bs-dismiss="modal"><i class="fas fa-fw fa-spinner fa-spin d-none"></i> Next</button>
|
||||
--}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -45,12 +42,12 @@
|
||||
$('#new_objectclass-modal').on('shown.bs.modal',function() {
|
||||
if (! rendered)
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
method: 'POST',
|
||||
url: '{{ url('entry/objectclass/add') }}',
|
||||
data: {
|
||||
oc: oc,
|
||||
},
|
||||
cache: false,
|
||||
success: function(data) {
|
||||
$('select#newoc').select2({
|
||||
dropdownParent: $('#new_objectclass-modal'),
|
||||
@ -60,7 +57,7 @@
|
||||
});
|
||||
},
|
||||
error: function(e) {
|
||||
if (e.status != 412)
|
||||
if (e.status !== 412)
|
||||
alert('That didnt work? Please try again....');
|
||||
},
|
||||
});
|
||||
@ -70,11 +67,10 @@
|
||||
|
||||
// When the ObjectClass modal is closed, process what was selected
|
||||
$('#new_objectclass-modal').on('hide.bs.modal',function() {
|
||||
var c = {{ $o->values->count() }}; // @todo do we need this?
|
||||
var newadded = $('select#newoc').val();
|
||||
|
||||
// If nothing selected, we dont have anything to do
|
||||
if (added_oc.sort().join('|') == newadded.sort().join('|'))
|
||||
if (added_oc.sort().join('|') === newadded.sort().join('|'))
|
||||
return;
|
||||
|
||||
// Find out what was selected, and add them
|
||||
@ -84,50 +80,47 @@
|
||||
|
||||
// Add attribute to the page
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
beforeSend: function() {},
|
||||
success: function(data) {
|
||||
$('#{{ $o->name }}').append(data);
|
||||
},
|
||||
error: function(e) {
|
||||
if (e.status != 412)
|
||||
alert('That didnt work? Please try again....');
|
||||
},
|
||||
method: 'POST',
|
||||
url: '{{ url('entry/attr/add',[$o->name_lc]) }}',
|
||||
data: {
|
||||
noheader: true,
|
||||
value: item,
|
||||
objectclasses: oc,
|
||||
loop: c++, // @todo can we omit loop and c
|
||||
},
|
||||
cache: false
|
||||
cache: false,
|
||||
success: function(data) {
|
||||
$('#{{ $o->name }}').append(data);
|
||||
},
|
||||
error: function(e) {
|
||||
if (e.status !== 412)
|
||||
alert('That didnt work? Please try again....');
|
||||
},
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
beforeSend: function() {},
|
||||
method: 'POST',
|
||||
url: '{{ url('api/schema/objectclass/attrs') }}/'+item,
|
||||
cache: false,
|
||||
success: function(data) {
|
||||
// Render any must attributes
|
||||
if (data.must.length) {
|
||||
data.must.forEach(function(item) {
|
||||
// Add attribute to the page
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
beforeSend: function() {},
|
||||
success: function(data) {
|
||||
$('#newattrs').append(data);
|
||||
},
|
||||
error: function(e) {
|
||||
if (e.status != 412)
|
||||
alert('That didnt work? Please try again....');
|
||||
},
|
||||
method: 'POST',
|
||||
url: '{{ url('entry/attr/add') }}/'+item,
|
||||
data: {
|
||||
value: item,
|
||||
objectclasses: oc,
|
||||
loop: c++, // @todo can we omit loop and c
|
||||
},
|
||||
cache: false
|
||||
cache: false,
|
||||
success: function(data) {
|
||||
$('#newattrs').append(data);
|
||||
},
|
||||
error: function(e) {
|
||||
if (e.status !== 412)
|
||||
alert('That didnt work? Please try again....');
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
@ -135,19 +128,29 @@
|
||||
// Add attributes to "Add new Attribute" that are now available
|
||||
if (data.may.length) {
|
||||
var newattr = $('select#newattr');
|
||||
var oldoptions = $('select#newattr option').map((i,o)=>o.value).get();
|
||||
|
||||
// @todo It might be nice to re-sort these options
|
||||
data.may.forEach(function(item) {
|
||||
if (! oldoptions.includes(item))
|
||||
newattr.append(new Option(item,item,false,false));
|
||||
});
|
||||
|
||||
// Sort the attributes
|
||||
newattr
|
||||
.append($('select#newattr option')
|
||||
.remove()
|
||||
.sort(function (a,b) {
|
||||
let at = $(a).text(),
|
||||
bt = $(b).text();
|
||||
return (at > bt) ? 1 : ((at < bt) ? -1 : 0);
|
||||
}))
|
||||
.val('');
|
||||
}
|
||||
},
|
||||
error: function(e) {
|
||||
if (e.status != 412)
|
||||
if (e.status !== 412)
|
||||
alert('That didnt work? Please try again....');
|
||||
},
|
||||
url: '{{ url('api/schema/objectclass/attrs') }}/'+item,
|
||||
cache: false
|
||||
});
|
||||
});
|
||||
|
||||
@ -156,10 +159,10 @@
|
||||
if (newadded.indexOf(item) === -1) {
|
||||
$('span#objectclass_'+item).empty();
|
||||
|
||||
// @todo Remove attributes from "Add new Attribute" that are no longer available
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
beforeSend: function() {},
|
||||
method: 'POST',
|
||||
url: '{{ url('api/schema/objectclass/attrs') }}/'+item,
|
||||
cache: false,
|
||||
success: function(data) {
|
||||
var attrs = [];
|
||||
|
||||
@ -183,17 +186,11 @@
|
||||
|
||||
x.css('background-color','#f0c0c0').attr('readonly',true).attr('placeholder',x.val()).val('');
|
||||
});
|
||||
|
||||
// remove the Add Values box
|
||||
// Remove any keyed in values
|
||||
// @todo remove any required attributes that are no longer defined as a result of removing this OC
|
||||
},
|
||||
error: function(e) {
|
||||
if (e.status != 412)
|
||||
if (e.status !== 412)
|
||||
alert('That didnt work? Please try again....');
|
||||
},
|
||||
url: '{{ url('api/schema/objectclass/attrs') }}/'+item,
|
||||
cache: false
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user