Closed Bug 2075588 Opened 2 months ago Closed 2 days ago

[Console] "Set a value" enables Save and allows saving a Boolean policy with no parameters selected

Categories

(Enterprise Products :: Console, defect)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mcurtean, Assigned: julienw)

References

Details

Attachments

(1 file)

Found in
Sync policy example

Affected versions
commit "598d9605e794d0526e7105628d7aee05556af026"
version "v0.5.0"

Preconditions
A Company admin is logged into the Console.

Steps to reproduce

  1. From the console > Policy management> search for Sync> select Set a value.
  2. Click Save.

Expected result
The Save button should remain disabled, since selecting "Set a value" alone, with no parameter configured, is not a meaningful or complete change.

Actual result
Save succeeds without any validation or warning. The policy's sidebar entry updates to "SET." The policy is now saved with all parameters unset — see JSON editor.
In the browser, in about:policies, the policy is not showing, which is expected, but it appears as SET in the console.

Thanks for the bug. I'll have to check, this might be fixed by my change in https://github.com/mozilla/enterprise-console/pull/457 (hopefully :D ).

Note that the save button will stay enabled always (changed in https://github.com/mozilla/enterprise-console/pull/447), but still we should get an error and refuse to save.

Assignee: nobody → felash
Status: NEW → ASSIGNED

That PR doesn't fix it at the moment, because we special case the root value to allow this. Maybe we shouldn't?

But a better fix could be to add a minProperties: 1?

FYI, there is a custom form for the Sync policy currently in the works, that should resolve any problems around this policy. See bug 2079738.

The custom sync policy form has landed, closing this one. The minProperties: 1 suggestion still has a lot of weight as well, but out of scope here.

Status: ASSIGNED → RESOLVED
Closed: 2 days ago
Resolution: --- → FIXED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: