diff --git a/src/PoliciesTable.jsx b/src/PoliciesTable.jsx
index bc5102b..26467a4 100644
--- a/src/PoliciesTable.jsx
+++ b/src/PoliciesTable.jsx
@@ -120,36 +120,20 @@ export class PoliciesTable extends Component {
});
}
- policySummary(p) {
+ policySummary(policies) {
+ let bits = [];
function isEmpty(obj) {
for (var key in obj) {
if (obj.hasOwnProperty(key))
return false;
}
-
return true;
}
-
- let bits = [];
- if (!isEmpty(p.policy.retention)) {
- bits.push(<>retention{' '}>);
- }
- if (!isEmpty(p.policy.files)) {
- bits.push(<>files{' '}>);
- }
- if (!isEmpty(p.policy.errorHandling)) {
- bits.push(<>errors{' '}>);
- }
- if (!isEmpty(p.policy.compression)) {
- bits.push(<>compression{' '}>);
- }
- if (!isEmpty(p.policy.scheduling)) {
- bits.push(<>scheduling{' '}>);
- }
- if (!isEmpty(p.policy.upload)) {
- bits.push(<>upload{' '}>);
+ for (let pol in policies.policy) {
+ if (!isEmpty(policies.policy[pol])) {
+ bits.push(<>{pol}>);
+ }
}
-
return bits;
}
@@ -213,16 +197,16 @@ export class PoliciesTable extends Component {
break;
};
- policies.sort((l,r) => {
- const hc = compare(l.target.host,r.target.host);
+ policies.sort((l, r) => {
+ const hc = compare(l.target.host, r.target.host);
if (hc) {
return hc;
}
- const uc = compare(l.target.userName,r.target.userName);
+ const uc = compare(l.target.userName, r.target.userName);
if (uc) {
return uc;
}
- return compare(l.target.path,r.target.path);
+ return compare(l.target.path, r.target.path);
});
@@ -273,8 +257,8 @@ export class PoliciesTable extends Component {
{(this.state.selectedOwner === localPolicies || this.state.selectedOwner === this.state.localSourceName || this.state.selectedOwner === applicablePolicies) ? <>
this.setState({ policyPath: p })}
- placeholder="enter directory to find or set policy"
- name="policyPath" value={this.state.policyPath} onChange={this.handleChange} />
+ placeholder="enter directory to find or set policy"
+ name="policyPath" value={this.state.policyPath} onChange={this.handleChange} />