-
-
Notifications
You must be signed in to change notification settings - Fork 366
Json rpc plugin setting control #657
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
Conversation
It's currently a simple proposal. Only key/value is supported. Bool value use |
githubs-form-schema is a good YAML example. ---
name: Account Recovery
description: Initiate an account recovery due to lost 2FA or inability to access email address
title: Account recovery request
labels: account-recovery
body:
- type: markdown
attributes:
value: |
**Request for account recovery.**
- type: input
attributes:
label: PyPI Username
description: >-
Enter your PyPI `username` wrapped with single backticks
validations:
required: true
- type: textarea
attributes:
label: Reason for request
description: |
State the reason for your request
- Lost access to email address
- Lost 2FA authentication app or security token
validations:
required: true
- type: checkboxes
attributes:
label: Code of Conduct
description: |
Read the [PSF Code of Conduct][CoC] first.
[CoC]: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
options:
- label: I agree to follow the PSF Code of Conduct
required: true
- type: checkboxes
attributes:
label: Acknowledgement
description: |
By their nature account recovery issues are labor intensive. The PyPI team has limited resources available for their completion.
There may be a delay of a week or more between responses for these issues.
options:
- label: I understand that it may take a significant amount of time to process my account recovery request.
required: true
... |
…nRPCPluginSettingControl
Current Proposal
Configuration Syntax (almost equal to github one but with small modification - type: textarea/input
attributes:
label: Label to be displayed before the control
description: Not yet implemented (probably tooltip)
placeholder: Not yet implemented
name: identifier of the control
defaultValue: Default Value of the control
- type: password
attributes:
label: Label to be displayed before the control
description: Not yet implemented (probably tooltip)
placeholder: Not yet implemented
name: identifier of the control
defaultValue: Default Value of the control
passwordChar: char to mask the actual input
- type: dropdown
attributes:
label: Version
description: What version of our software are you running?
multiple: false
options:
- label: 1.0.2 (Default)
- label: 1.0.3 (Edge)
validations:
required: true
- type: checkbox
attributes:
label: Code of Conduct
description: The Code of Conduct helps create a safe space for everyone. We require
that everyone agrees to it.
defaultValue: true |
has this been tested, can you provide a screenshot of an example output please. |
It is usable. Though some communication detail is still under discussion. |
shall we mark it as draft then? |
It depends. The functionality is complete, so plugin is able to create setting via the yaml. The left thing is how we want plugin to change the content in the setting, and how they should access the setting. |
during start up, jsonrpc call to plugin to load the settings and then create the settings in flow's settings window based on the callback. when user changes the setting in the settings window, do a jsonrpc call to let the plugin know?
you mean plugin will change the settings contents in the settings window? can you give me an example |
Well the current implementation is a template file (in the plugin root directory) will be used to create the settings file and the controls. Plugins may get the place of the setting file, but they currently don't have access to the content changed by user. I am thinking about to pass the whole setting json as part of the query to the plugin, and receive a diff new setting json from plugin when calling back (to modify the setting). Sometimes we would like to change the setting via query such as we can add path to quickaccesspath in explorer plugin. I think that's reasonable for jsonrpc plugin to do. |
…nRPCPluginSettingControl
After some testing retrieving settings works, the templating works as well.
Also we should make sure a malformed template file doesn't crash Flow. |
Co-authored-by: Jeremy Wu <jeremy24wu@gmail.com>
close #814
TODO: