Fix policy example values in ADML writer
The example value formatting code in ADML writer only depends on the
example value itself right now. However, depending on the UI the user
is shown, example values should be shown in different ways. In
particular, it depends if the user is shown a listbox, or a textbox.
This CL shows different example values in different ways,
depending on the UI that the user is shown. Details follow:
If the user needs to input the following list of dicts:
[
{"key1": "value1" },
{"key2": "value2" },
{"key3": "value3" }
]
Then that is exactly what they should type if they are shown a
textbox. But if they are shown a listbox, they should instead type:
{"key1": "value1" }
{"key2": "value2" }
{"key3": "value3" }
And each entry should be in its own listbox field. In other words,
when a user uses a listbox, they don't need to describe the outermost
list because the listbox takes care of it. So, we don't need to show
it in the example value either.
Similarly if the user needs to input the following list of strings:
[
"value1",
"value2",
"value3"
]
They would also type that into a textbox, but would only need to
type the following into a listbox:
value1
value2
value3
So the string quotes are also made unnecessary by the listbox, and
so also should not be shown in the example value.
Bug: 829329
Change-Id: Iea994c219f1399d83a64af86f3679f991e46f5a6
Reviewed-on: https://chromium-review.googlesource.com/1090918
Commit-Queue: A Olsen <olsen@chromium.org>
Reviewed-by:
Lutz Justen <ljusten@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565614}
Showing
Please register or sign in to comment