Skip to content

Commit

Permalink
Issue 51169 - UI - attr uniqueness - selecting empty subtree crashes …
Browse files Browse the repository at this point in the history
…cockpit

Description:  When processing the typeAheadChange we need to check for a empty
              string before treating the array like a list of objects.

              Also updated README with contribution instructions

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

Reviewed by: spichugi(Thanks!)

Improve handling of typeAhead values.

In some cases its an array of strings, and in some cases it's array of objects
  • Loading branch information
mreynolds389 committed Jun 23, 2020
1 parent 16203a1 commit 0e28409
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 53 deletions.
67 changes: 15 additions & 52 deletions src/cockpit/389-console/README.md
Expand Up @@ -8,7 +8,6 @@ title: "Cockpit UI Design"
The main layout consists of as tabbed panel for the following categories:

- Server Configuration
- Security
- Database
- Replication
- Schema
Expand All @@ -30,17 +29,12 @@ This is the welcome page(panel). You select which local instance you want to co

- 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.
Expand All @@ -53,7 +47,7 @@ This is the welcome page(panel). You select which local instance you want to co
- Referrals
- Indexes
- Attr encryption
- Suffix Tree Node - right click:
- Suffix Tree Node - right click:
- Import/Export
- Backup/Restore
- Reindex
Expand All @@ -64,9 +58,9 @@ This is the welcome page(panel). You select which local instance you want to co

## 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)?

Expand Down Expand Up @@ -161,53 +155,22 @@ List:
"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.
1 change: 1 addition & 0 deletions src/cockpit/389-console/buildAndRun.sh
Expand Up @@ -27,6 +27,7 @@ while (( "$#" )); do
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
Expand Down
Expand Up @@ -96,7 +96,12 @@ class AttributeUniqueness extends React.Component {
// 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
Expand Down

0 comments on commit 0e28409

Please sign in to comment.