#51170 Issue 51169 - UI - attr uniqueness - selecting empty subtree crashes cockpit
Closed 2 years ago by spichugi. Opened 2 years ago by mreynolds.
mreynolds/389-ds-base ui_fixes  into  master

@@ -8,7 +8,6 @@ 

  The main layout consists of as tabbed panel for the following categories:

  

  - Server Configuration

- - Security

  - Database

  - Replication

  - Schema
@@ -30,17 +29,12 @@ 

  

  - General Configuration: port, hostname, LDAPI, various config settings under cn=config

  - SASL:  SSL Settings and Mappings

+ - Security: Managed security settings and certificates

  - Password Policy: all things password related

  - Logs:  access, error, audit/auditfail settings

  - Tasks: backups/restore, Create/delete instances, etc

  - Tuning and resource limits: size/time limits, max threads per conn, etc

  

- ## Security

- 

- - Enable Security and configuration settings

- - Manage Certificate Database

- - Manage ciphers

- 

  ## Database

  

  - Mapping tree and backend are "linked".  They are seen as a single object in the UI.  If you create a new suffix, it creates the mapping tree entry and the backend entry.  Delete removes both as well.
@@ -53,7 +47,7 @@ 

      - Referrals

      - Indexes

      - Attr encryption

- - Suffix Tree Node - right click: 

+ - Suffix Tree Node - right click:

      - Import/Export

      - Backup/Restore

      - Reindex
@@ -64,9 +58,9 @@ 

  

  ## Replication

  

- Setup replication configuration, changelog, and agreements.  Keep agmt setup wizard simple.  Build in some simple monitoring and agreement status info.  Save the real replication monitoring for the monitor tab panel. 

+ Setup replication configuration, changelog, and agreements.  Keep agmt setup wizard simple.  Build in some simple monitoring and agreement status info.  Save the real replication monitoring for the monitor tab panel.

  

- - Build in cleanallruv task (and the abort task), and cleanallruv task monitoring!

+ -  Build in cleanallruv task (and the abort task), and cleanallruv task monitoring

  - "Reinit all agmts" option??

  - "test replication" operation (already exists in lib389) - monitoring page, or agreement dropdown(+1)?

  
@@ -161,53 +155,22 @@ 

      "items": []

    }

  

- # Misc

- ---------------------

- 

- No RESET buttons?  Not yet at least...

- 

- 

- LIB389 Requirements:

- 

- - Consistent JSON representation of entries

- - Retrieve schema: standard and custom (user-defined)

- - Retrieve plugins

- - Get attr syntaxes

- - retreive indexes

- - Retreive config (cn=config and friends)

- - SASL mapping/priority

- - Retrieve cleanAllRUV(and abort) tasks

- - Get all user/subtree password policies

- - Get SSL ciphers

- - Get certificates:

-     - Get Trust Attrs

-     - Get CA certs: expireation dates

-     - Get Server Certs, exp dates, issue to, issued by

-     - Get Revoked Certs: isssued by, effective date, Next Update, Type

-     

- 

- 

- 

- # To Do

- -------------------------------------

- 

- ## wizard forms(modals)

- 

- - Edit plugin (generic)

- - Edit plugin (RI plugin)

- - Edit plugin (Member Of)

- - Edit plugin ...

- - Add/edit SASL Mapiing

- - Import/Export Certification (file location)

- - All the cert stuff

- 

- 

- 

+ # Contributing

+ -------------------------

  

+ To test changes to the 389-console plugin, you can set up links from your workspace to a user's home directory

  

+ - Create cockpit directory under user's home directory

  

+     mkdir ~/.local/share/cockpit/389-console

  

+ - Link your workspace directory

  

+     ln -s /home/USERNAME/source/389-ds-base/src/cockpit/389-console/dist  ~/.local/share/cockpit/389-console

  

+ - Then run the build & watch script.  This builds the UI and "watches" it for changes

  

+     cd /home/USERNAME/source/389-ds-base/src/cockpit/389-console/

+     ./buildAndRun.sh

  

+ - All changes to the source code will be reflected in the UI without having to reinstall any packages.  You just need to reload the browser to see the changes.

@@ -27,6 +27,7 @@ 

  done

  

  printf "\nCleaning and installing npm packages ...\n\n"

+ rm -rf dist/*

  make -f node_modules.mk clean > /dev/null

  make -f node_modules.mk install > /dev/null

  if [ $? != 0 ]; then

@@ -96,7 +96,12 @@ 

          // instead of string.  Grab the "label" in this case

          let new_values = [];

          for (let val of values) {

-             new_values.push(val.label);

+             if (val != "") {

+                 if (typeof val === 'object') {

+                     val = val.label;

+                 }

+                 new_values.push(val);

+             }

          }

          this.setState({

              subtrees: new_values

Description:

The JS code was still using an outdated format for typeAheadvalues that treated the value as an Object with keys, when it was just an array of values.

relates: https://pagure.io/389-ds-base/issue/51169

When I try to edit the existing attributeUniqueness config, I get an error because the this.state.subtrees has a wrong value (item 15):

0: "dsconf"
1: "-j"
2: "ldapi://%2fvar%2frun%2fslapd-localhost.socket"
3: "plugin"
4: "attr-uniq"
5: "set"
6: "attribute uniqueness"
7: "--enabled"
8: "off"
9: "--across-all-subtrees"
10: "off"
11: "--attr-name"
12: "uid"
13: "--subtree"
14: "dc=example,dc=com"
15: {customOption: true, id: "new-id-14", label: "o=redat"}
16: "--top-entry-oc"
17: "account"
18: "--subtree-entries-oc"
19: "accountpolicy"

rebased onto 316c55d20c2d1c0bec4776e7b4534832067ea96f

2 years ago

rebased onto ec7f142e5c56b07956c204425242a8509312428d

2 years ago

rebased onto 1f2b4ba11fb8985ad56e32d96a2843d7d2375a3a

2 years ago

It fails for me on a fresh instance (where attributeUniqueness has a config already):

  1. Install a fresh instance with a suffix;
  2. Go to Plugins tab -> Attribute Uniqueness plugin -> Edit the existing config;
  3. See that we already have 'dc=example,dc=con' subtree there (this.state.subtrees == ['dc=example,dc=com']);
  4. Add one more subtree to the field;

When we click on Add in the typeahead field - the browser crashes.

1 new commit added

  • Improve handling of typeAhead values.
2 years ago

Everything should be fixed now...

rebased onto a99cd7c

2 years ago

Pull-Request has been merged by mreynolds

2 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/4223

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

2 years ago