This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.0
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.0 by this push:
new a14dd18 Issue 50534 - CLI change schema edit subcommand to replace
a14dd18 is described below
commit a14dd18abc8f6f65507e3ebb8967650bbd9d9a2c
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Wed Aug 7 12:36:33 2019 -0400
Issue 50534 - CLI change schema edit subcommand to replace
Description: The way the CLI currently edits an attribute or objectclass
is that it deletes it, and then adds the new attribute using
only the params specified in "edit". So the subcommand
"edit"
is misleading as previous/untouched values will get overwritten,
it should be "replace" instead to avoid confusion.
relates:
https://pagure.io/389-ds-base/issue/50534
Reviewed by: spichugi(Thanks!)
---
src/cockpit/389-console/src/schema.html | 5 -----
src/cockpit/389-console/src/schema.js | 9 +++------
src/lib389/lib389/cli_conf/schema.py | 4 ++--
3 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/src/cockpit/389-console/src/schema.html
b/src/cockpit/389-console/src/schema.html
index 449f3a2..35fcdfc 100644
--- a/src/cockpit/389-console/src/schema.html
+++ b/src/cockpit/389-console/src/schema.html
@@ -228,11 +228,6 @@
</select>
</div>
</div>
- <div>
- <label for="oc-x-origin"
class="ds-config-label-lrg"
- title="The objectClass X-ORIGIN (keep 'user defined'
if it's a non-standard objectClass)"><b
- >ObjectClass X-ORIGIN</b></label><input
class="ds-input" type="text" id="oc-x-origin"
size="40"/>
- </div>
</div>
</form>
<div id="save-oc-spinner" class="ds-center" hidden>
diff --git a/src/cockpit/389-console/src/schema.js
b/src/cockpit/389-console/src/schema.js
index c2073fc..94cebe5 100644
--- a/src/cockpit/389-console/src/schema.js
+++ b/src/cockpit/389-console/src/schema.js
@@ -84,7 +84,6 @@ function clear_oc_form() {
$("#schema-list").prop('selectedIndex',-1);
$('#oc-required-list').find('option').remove();
$('#oc-allowed-list').find('option').remove();
- $("#oc-x-origin").val("");
$("#save-oc-button").attr('disabled', false);
}
@@ -106,7 +105,6 @@ function clear_attr_form() {
$("#attr-eq-mr-select").prop('selectedIndex',0);
$("#attr-order-mr-select").prop('selectedIndex',0);
$("#attr-sub-mr-select").prop('selectedIndex',0);
- $("#attr-x-origin").val("");
$("#save-attr-button").attr('disabled', false);
}
@@ -410,7 +408,7 @@ $(document).ready( function() {
var oc_parent = $("#oc-parent").val();
var oc_kind = $("#oc-kind").val();
var oc_desc = $("#oc-desc").val();
- var oc_x_origin = $("#oc-x-origin").val();
+ var oc_x_origin = "user defined";
var oc_required_list = $('#oc-required-list option').map(function() {
return $(this).val(); }).get();
var oc_allowed_list = $('#oc-allowed-list option').map(function() { return
$(this).val(); }).get();
@@ -418,7 +416,7 @@ $(document).ready( function() {
var edit = false;
if ( $("#add-edit-oc-header").text().indexOf("Edit
Objectclass") != -1){
edit = true;
- action = 'edit';
+ action = 'replace';
}
if (oc_name == '') {
report_err($("#oc-name"), 'You must provide an objectClass
name');
@@ -584,7 +582,7 @@ $(document).ready( function() {
var edit = false;
if ( $("#add-edit-attr-header").text().indexOf("Edit
Attribute") != -1){
edit = true;
- action = 'edit';
+ action = 'replace';
}
if (attr_name == '') {
@@ -804,7 +802,6 @@ $(document).ready( function() {
$("#oc-oid").val(edit_oc_oid);
$("#oc-kind")[0].value = edit_oc_kind;
$("#oc-desc").val(edit_oc_desc);
- $("#oc-x-origin").val(edit_oc_x_origin);
$("#oc-parent")[0].value = edit_oc_parent;
$.each(edit_oc_required, function (i, item) {
if (item) {
diff --git a/src/lib389/lib389/cli_conf/schema.py b/src/lib389/lib389/cli_conf/schema.py
index d5d2011..7764356 100644
--- a/src/lib389/lib389/cli_conf/schema.py
+++ b/src/lib389/lib389/cli_conf/schema.py
@@ -326,7 +326,7 @@ def create_parser(subparsers):
at_add_parser.set_defaults(func=add_attributetype)
_add_parser_args(at_add_parser, 'attributetypes')
at_add_parser.add_argument('--syntax', required=True, help='OID of the
LDAP syntax assigned to the attribute')
- at_edit_parser = attributetypes_subcommands.add_parser('edit', help='Edit
an attribute type on this system')
+ at_edit_parser = attributetypes_subcommands.add_parser('replace',
help='Replace an attribute type on this system')
at_edit_parser.set_defaults(func=edit_attributetype)
_add_parser_args(at_edit_parser, 'attributetypes')
at_edit_parser.add_argument('--syntax', help='OID of the LDAP syntax
assigned to the attribute')
@@ -344,7 +344,7 @@ def create_parser(subparsers):
oc_add_parser = objectclasses_subcommands.add_parser('add', help='Add an
objectClass to this system')
oc_add_parser.set_defaults(func=add_objectclass)
_add_parser_args(oc_add_parser, 'objectclasses')
- oc_edit_parser = objectclasses_subcommands.add_parser('edit', help='Edit
an objectClass on this system')
+ oc_edit_parser = objectclasses_subcommands.add_parser('replace',
help='Replace an objectClass on this system')
oc_edit_parser.set_defaults(func=edit_objectclass)
_add_parser_args(oc_edit_parser, 'objectclasses')
oc_remove_parser = objectclasses_subcommands.add_parser('remove',
help='Remove an objectClass on this system')
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.