Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Add an optional prompt field in XML, and if it is defined, show the prompt string instead of name string in the ConfigEdiror UI tool #350

Closed
MarcChen46 opened this issue May 20, 2024 · 0 comments · Fixed by #351
Labels
state:needs-maintainer-feedback Needs more information from a maintainer to determine next steps state:needs-owner Needs an issue owner to be assigned state:needs-triage Needs to triaged to determine next steps type:feature-request A new feature proposal urgency:low Little to no impact

Comments

@MarcChen46
Copy link
Contributor

Feature Overview

For the ConfigEditor.py tool, currently what it show up in the UI is the "name" field in the XML, which is also used for generating profile header file that will be consumed by C code, so the naming must follow the C coding rules, but from the user point of view, sometimes the variable name is hard to understand.

For providing more flexibility about the string show up in the tool, it would be better to support the ConfigKnob show up as a string that support white space. ex "Boot Option 1" instead of "BootOption1"

Solution Overview

Add one more field called "Prompt", then in the XML, it would like below example.

For the ConfigEditor.py.

  • If there is a prompt field of a item, then the tool UI would use the prompt string to show up.
  • For backward compatible reason, if the XML does not have the prompt field, it would still follow original behavior that use name field to show up in the tool UI.
<ConfigSchema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="configschema.xsd">
	<Enums>
		<Enum name="BOOT_OPTION" help="Boot Option Type">
			<Value prompt="USB Device" name="USB" value="0" help="Usb Device" />
			<Value prompt="Hard Disk" name="HDD" value="1" help="Hard Disk" />
			<Value prompt="NVMe device" name="NVME" value="2" help="Nvme" />
			<Value prompt="CD/DVD" name="ODD" value="3" help="Cd/Dvd" />
			<Value prompt="SD/EMMC" name="SD" value="4" help="Sd/Emmc" />
			<Value prompt="Network Device" name="NETWORK" value="5" help="Network" />
			<Value prompt="Ramdisk" name="RAMDISK" value="6" help="Ramdisk" />
			<Value prompt="Disabled" name="Disabled" value="8" help="Disabled" />
		</Enum>
	</Enums>
	<Structs>
		<Struct name="BOOT_CFG_DATA" help="Boot Config Data">
			<Member prompt="Boot Option 1" name="BootOption1" type="BOOT_OPTION" default="USB" />
			<Member prompt="Boot Option 2" name="BootOption2" type="BOOT_OPTION" default="NETWORK" />
			<Member prompt="Boot Option 3" name="BootOption3" type="BOOT_OPTION" default="HDD" />
			<Member prompt="Boot Option 4" name="BootOption4" type="BOOT_OPTION" default="NVME" />
			<Member prompt="Boot Option 5" name="BootOption5" type="BOOT_OPTION" default="ODD" />
			<Member prompt="Boot Option 6" name="BootOption6" type="BOOT_OPTION" default="SD" />
		</Struct>
	</Structs>
	<Knobs namespace="{D7ADABDD-B9CA-4E1D-87B6-9FA985D8AC69}">
		<Knob prompt="Boot Configuration" type="BOOT_CFG_DATA" name="BootConfiguration" />
	</Knobs>
</ConfigSchema>

Alternatives Considered

No response

Urgency

Low

Are you going to implement the feature request?

Someone else needs to implement the feature

Do you need maintainer feedback?

Maintainer feedback requested

Anything else?

[email protected] would be the one to study and create PR for review.

@MarcChen46 MarcChen46 added state:needs-triage Needs to triaged to determine next steps type:feature-request A new feature proposal labels May 20, 2024
@github-actions github-actions bot added state:needs-maintainer-feedback Needs more information from a maintainer to determine next steps state:needs-owner Needs an issue owner to be assigned urgency:low Little to no impact labels May 20, 2024
@os-d os-d mentioned this issue May 20, 2024
5 tasks
@apop5 apop5 linked a pull request May 22, 2024 that will close this issue
5 tasks
@os-d os-d closed this as completed in #351 May 22, 2024
os-d added a commit that referenced this issue May 22, 2024
## Description

Add a pretty name field to the XML knobs to allow an easier time to read
the configuration knobs per feature request #350 .

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Tested with the updated sampleschema.xml

## Integration Instructions

If desired, the prettyname field can be added to existing XMLs. This
will not break existing XMLs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:needs-maintainer-feedback Needs more information from a maintainer to determine next steps state:needs-owner Needs an issue owner to be assigned state:needs-triage Needs to triaged to determine next steps type:feature-request A new feature proposal urgency:low Little to no impact
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant