Skip to content

Commit

Permalink
Issue 6625 - UI - fix next round of bugs
Browse files Browse the repository at this point in the history
Description:

This fixes the following issues:

- Subtrees field must not be mandatory If you configure the Attribute Uniqueness
  plug-in over object classes
- MemberOf configuration window you can select empty values for Subtree Scope
  and Exclude Subtree fields
- Database suffix field accepts dash symbol which ends in error
- Enable logs checkboxes do not display properly after changes
- Instance fails to load when DB backup directory doesn't exist
- Improvement for Create New Instance form
- Database Name is not validated
- Database Suffix is not validated properly
- Failing to update NDN cache size
- Import cache size is not easy to set
- Import cache autosize off/on fails
- Statistic about worker threads is incorrect
- Database index tablesearching does not work
- Schema attribute table searching does not work
- TimePicker compoment needs updating for PF5
- Fix Treeview appearance for browser Dark Mode
- Add attribute syntax oid name to table

Fixes: #6625

Reviewed by: ?
  • Loading branch information
mreynolds389 committed Feb 22, 2025
1 parent 435fae3 commit e360b00
Show file tree
Hide file tree
Showing 29 changed files with 801 additions and 303 deletions.
41 changes: 20 additions & 21 deletions ldap/servers/plugins/uiduniq/uid.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,17 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry)
slapi_pblock_get(pb, SLAPI_PLUGIN_ARGC, &argc);
if (argc == 0) {
/* This is new config style
* uniqueness-attribute-name: uid
* uniqueness-subtrees: dc=people,dc=example,dc=com
* uniqueness-subtrees: dc=sales, dc=example,dc=com
* uniqueness-across-all-subtrees: on
*
* or
*
* uniqueness-attribute-name: uid
* uniqueness-top-entry-oc: organizationalUnit
* uniqueness-subtree-entries-oc: person
*/
* uniqueness-attribute-name: uid
* uniqueness-subtrees: dc=people,dc=example,dc=com
* uniqueness-subtrees: dc=sales, dc=example,dc=com
* uniqueness-across-all-subtrees: on
*
* or
*
* uniqueness-attribute-name: uid
* uniqueness-top-entry-oc: organizationalUnit
* uniqueness-subtree-entries-oc: person
*/

/* Attribute name of the attribute we are going to check value uniqueness */
values = slapi_entry_attr_get_charray(config_entry, ATTR_UNIQUENESS_ATTRIBUTE_NAME);
Expand Down Expand Up @@ -293,16 +293,15 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry)
}
if (UNTAGGED_PARAMETER == result) {
/* This is
* nsslapd-pluginarg0: uid
* nsslapd-pluginarg1: dc=people,dc=example,dc=com
* nsslapd-pluginarg2: dc=sales, dc=example,dc=com
*
* config attribute are in argc/argv
*
* attrName is set
* markerObjectClass/requiredObjectClass are NOT set
*/

* nsslapd-pluginarg0: uid
* nsslapd-pluginarg1: dc=people,dc=example,dc=com
* nsslapd-pluginarg2: dc=sales, dc=example,dc=com
*
* config attribute are in argc/argv
*
* attrName is set
* markerObjectClass/requiredObjectClass are NOT set
*/
if (slapi_pblock_get(pb, SLAPI_PLUGIN_ARGC, &argc) || slapi_pblock_get(pb, SLAPI_PLUGIN_ARGV, &argv)) {
slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "uniqueness_entry_to_config - "
"Only attribute name is valid\n");
Expand Down
2 changes: 0 additions & 2 deletions src/cockpit/389-console/src/css/ds.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ td {

.ds-tree {
border: 1px solid #909090;
background-color: #f8f8f8;
width: 300px;
min-width: 300px;
min-height: 350px;
Expand All @@ -75,7 +74,6 @@ td {

.pf-theme-dark .ds-tree {
border: 1px solid #909090;
background-color: rgb(54 55 58);
width: 300px;
min-width: 300px;
min-height: 350px;
Expand Down
29 changes: 16 additions & 13 deletions src/cockpit/389-console/src/database.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cockpit from "cockpit";
import React from "react";
import { log_cmd, valid_dn } from "./lib/tools.jsx";
import { log_cmd, valid_dn, valid_db_name } from "./lib/tools.jsx";
import {
ChainingConfig,
ChainingDatabaseConfig
Expand All @@ -12,6 +12,7 @@ import { GlobalPwPolicy } from "./lib/database/globalPwp.jsx";
import { LocalPwPolicy } from "./lib/database/localPwp.jsx";
import {
Button,
Card,
Form,
FormGroup,
FormSelect,
Expand Down Expand Up @@ -749,7 +750,11 @@ export class Database extends React.Component {
} else if (e.target.id === "createSuffix" && !valid_dn(str)) {
valueErr = true;
createNotOK = true;
} else if (e.target.id === "createBeName" && !valid_db_name(str)) {
valueErr = true;
createNotOK = true;
}

// Check existing values
if (e.target.id !== "createSuffix") {
if (!valid_dn(this.state.createSuffix)) {
Expand All @@ -758,7 +763,7 @@ export class Database extends React.Component {
}
}
if (e.target.id !== "createBeName") {
if (this.state.createBeName === "") {
if (this.state.createBeName === "" || !valid_db_name(this.state.createBeName)) {
errObj.createBeName = true;
createNotOK = true;
}
Expand Down Expand Up @@ -1386,18 +1391,16 @@ export class Database extends React.Component {
}
body = (
<div className="ds-container">
<div>
<div className="ds-tree">
<div className={disabled} id="db-tree">
<TreeView
hasSelectableNodes
data={this.state.nodes}
activeItems={this.state.activeItems}
onSelect={this.handleTreeClick}
/>
</div>
<Card className="ds-tree">
<div className={disabled} id="db-tree">
<TreeView
hasSelectableNodes
data={this.state.nodes}
activeItems={this.state.activeItems}
onSelect={this.handleTreeClick}
/>
</div>
</div>
</Card>
<div className="ds-tree-content">
{db_element}
</div>
Expand Down
21 changes: 12 additions & 9 deletions src/cockpit/389-console/src/ds.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export class DSInstance extends React.Component {
wasActiveList: [this.state.activeTabKey]
},
() => {
this.loadBackups();
this.loadBackups(true);
}
);
if (action === "restart") {
Expand Down Expand Up @@ -305,7 +305,7 @@ export class DSInstance extends React.Component {
wasActiveList: []
},
() => {
this.loadBackups();
this.loadBackups(true);
}
);
}
Expand All @@ -329,7 +329,7 @@ export class DSInstance extends React.Component {
wasActiveList: []
},
() => {
this.loadBackups();
this.loadBackups(true);
}
);
}
Expand Down Expand Up @@ -371,7 +371,7 @@ export class DSInstance extends React.Component {
wasActiveList: []
},
() => {
this.loadBackups();
this.loadBackups(true);
}
);
}
Expand Down Expand Up @@ -448,7 +448,7 @@ export class DSInstance extends React.Component {
);
}

loadBackups() {
loadBackups(initializing) {
let cmd = ["dsctl", "-j", this.state.serverId, "backups"];
log_cmd("loadBackups", "Load Backups", cmd);
cockpit.spawn(cmd, { superuser: true, err: "message" })
Expand Down Expand Up @@ -479,10 +479,13 @@ export class DSInstance extends React.Component {
.fail(err => {
this.updateProgress(25);
const errMsg = JSON.parse(err);
this.addNotification(
"error",
cockpit.format(_("Load Backups operation failed - $0"), errMsg.desc)
);
if (!initializing) {
// Don't log an error when first initializing the UI
this.addNotification(
"error",
cockpit.format(_("Load Backups operation failed - $0"), errMsg.desc)
);
}
this.setState({
backupRows: [],
});
Expand Down
96 changes: 69 additions & 27 deletions src/cockpit/389-console/src/dsModals.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
FormHelperText,
FormSelect,
FormSelectOption,
HelperText,
HelperTextItem,
Grid,
GridItem,
Modal,
Expand Down Expand Up @@ -419,12 +421,18 @@ export class CreateInstanceModal extends React.Component {
}}
validated={errObj.createServerId ? ValidatedOptions.error : ValidatedOptions.default}
/>
<FormHelperText >
{this.state.createServerIdMsg}
</FormHelperText>
{errObj.createServerId &&
<FormHelperText>
<HelperText>
<HelperTextItem variant="error">
{this.state.createServerIdMsg}
</HelperTextItem>
</HelperText>
</FormHelperText>
}
</GridItem>
</Grid>
<Grid title={_("The server port number should be in the range of 0 to 65534.")}>
<Grid title={_("The server port number should be in the range of 0 to 65534")}>
<GridItem className="ds-label" span={4}>
{_("Port")}
</GridItem>
Expand All @@ -443,11 +451,15 @@ export class CreateInstanceModal extends React.Component {
widthChars={8}
/>
<FormHelperText className="ds-info-color" >
{_("Port 0 will disable non-TLS connections")}
<HelperText>
<HelperTextItem variant={"indeterminate"}>
{_("Port 0 will disable non-TLS connections")}
</HelperTextItem>
</HelperText>
</FormHelperText>
</GridItem>
</Grid>
<Grid title={_("The secure port number for TLS connections. It should be in the range of 1 to 65534.")}>
<Grid title={_("The secure port number for TLS connections. It should be in the range of 1 to 65534")}>
<GridItem className="ds-label" span={4}>
{_("Secure Port")}
</GridItem>
Expand All @@ -467,7 +479,7 @@ export class CreateInstanceModal extends React.Component {
/>
</GridItem>
</Grid>
<Grid title={_("Create a self-signed certificate database in /etc/dirsrc/ssca directory.")}>
<Grid title={_("Create a self-signed certificate database in /etc/dirsrc/ssca directory")}>
<GridItem className="ds-label-checkbox" span={4}>
{_("Create Self-Signed TLS Certificate")}
</GridItem>
Expand Down Expand Up @@ -497,12 +509,18 @@ export class CreateInstanceModal extends React.Component {
}}
validated={errObj.createDM ? ValidatedOptions.error : ValidatedOptions.default}
/>
<FormHelperText >
{_("Enter a valid DN")}
</FormHelperText>
{errObj.createDM &&
<FormHelperText>
<HelperText>
<HelperTextItem variant="error">
{_("Enter a valid DN")}
</HelperTextItem>
</HelperText>
</FormHelperText>
}
</GridItem>
</Grid>
<Grid title={_("Directory Manager password must be at least 8 characters in length.")}>
<Grid title={_("Directory Manager password must be at least 8 characters in length")}>
<GridItem className="ds-label" span={4}>
{_("Directory Manager Password")}
</GridItem>
Expand All @@ -518,12 +536,18 @@ export class CreateInstanceModal extends React.Component {
}}
validated={errObj.createDMPassword ? ValidatedOptions.error : ValidatedOptions.default}
/>
<FormHelperText >
{_("Password must be set and it must match the confirmation password.")}
</FormHelperText>
{errObj.createDMPassword &&
<FormHelperText>
<HelperText>
<HelperTextItem variant="error">
Password must be set with at least 8 characters, and it must match the confirmation password
</HelperTextItem>
</HelperText>
</FormHelperText>
}
</GridItem>
</Grid>
<Grid title={_("Confirm the previously entered password.")}>
<Grid title={_("Confirm the previously entered password")}>
<GridItem className="ds-label" span={4}>
{_("Confirm Password")}
</GridItem>
Expand All @@ -539,12 +563,18 @@ export class CreateInstanceModal extends React.Component {
}}
validated={errObj.createDMPasswordConfirm ? ValidatedOptions.error : ValidatedOptions.default}
/>
<FormHelperText >
{_("Confirmation password must be set and it must match the first password.")}
</FormHelperText>
{errObj.createDMPasswordConfirm &&
<FormHelperText>
<HelperText>
<HelperTextItem variant="error">
Confirmation password must be set with at least 8 characters, and it must match the first password
</HelperTextItem>
</HelperText>
</FormHelperText>
}
</GridItem>
</Grid>
<Grid className="ds-margin-top" title={_("Create a database during the installation.")}>
<Grid className="ds-margin-top" title={_("Create a database during the installation")}>
<Checkbox
id="createDBCheckbox"
label={_("Create Database")}
Expand Down Expand Up @@ -573,12 +603,18 @@ export class CreateInstanceModal extends React.Component {
}}
validated={errObj.createDBSuffix ? ValidatedOptions.error : ValidatedOptions.default}
/>
<FormHelperText >
{_("Value must be a valid DN")}
</FormHelperText>
{errObj.createDBSuffix &&
<FormHelperText>
<HelperText>
<HelperTextItem variant="error">
{_("Value must be a valid DN")}
</HelperTextItem>
</HelperText>
</FormHelperText>
}
</GridItem>
</Grid>
<Grid title={_("The name for the backend database, like 'userroot'. The name can be a combination of alphanumeric characters, dashes (-), and underscores (_). No other characters are allowed, and the name must be unique across all backends.")}>
<Grid className="ds-margin-top" title={_("The name for the backend database, like 'userroot'. The name can be a combination of alphanumeric characters, dashes (-), and underscores (_). No other characters are allowed, and the name must be unique across all backends")}>
<GridItem className="ds-label" offset={1} span={3}>
{_("Database Name")}
</GridItem>
Expand All @@ -596,12 +632,18 @@ export class CreateInstanceModal extends React.Component {
}}
validated={errObj.createDBName ? ValidatedOptions.error : ValidatedOptions.default}
/>
<FormHelperText >
{_("Name is required")}
</FormHelperText>
{errObj.createDBName &&
<FormHelperText >
<HelperText>
<HelperTextItem variant="error">
{_("Name is required")}
</HelperTextItem>
</HelperText>
</FormHelperText>
}
</GridItem>
</Grid>
<Grid>
<Grid className="ds-margin-top" >
<GridItem className="ds-label" offset={1} span={3}>
{_("Database Initialization")}
</GridItem>
Expand Down
Loading

0 comments on commit e360b00

Please sign in to comment.