-
Notifications
You must be signed in to change notification settings - Fork 73
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
[Custom Policies] Show full schema info on form preview #712
Conversation
9f037b5
to
b6ca6ed
Compare
name: '[Name of the policy]', | ||
summary: '[A brief description of what it does.]', | ||
version: '[0.0.1]', | ||
name: 'Name of the policy', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is good to leave those brackets. As we validate those fields, if the user does not edit them they will be invalid and the policy cannot be saved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the apicast manifest fails to validate the version, the regex doesn't expects those brackets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that is what I am saying, so the customer will not save this by inadvertence.
Or if you can make them as placeholder and not real values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thing is the form will fail to render by default. This way it will be shown and communicating the user the right way to do it.
b6ca6ed
to
c74c873
Compare
Codecov Report
@@ Coverage Diff @@
## master #712 +/- ##
==========================================
+ Coverage 92.84% 92.84% +<.01%
==========================================
Files 2387 2388 +1
Lines 77549 77579 +30
==========================================
+ Hits 71999 72030 +31
+ Misses 5550 5549 -1
Continue to review full report at Codecov.
|
'summary': '[A brief description of what it does.]', | ||
'version': '[0.0.1]', | ||
'name': 'Name of the policy', | ||
'summary': 'A brief description of what it does.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'summary': 'A brief description of what it does.', | |
'summary': 'A one-line summary of what this policy does.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be less than 75 characters. Probably good to add this indication
'version': '[0.0.1]', | ||
'name': 'Name of the policy', | ||
'summary': 'A brief description of what it does.', | ||
'description': 'A description of what it does.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A complete description of what this policy does.
@@ -117,24 +62,35 @@ function CustomPolicyForm ({policy, onChange}: {policy: Policy, onChange: OnChan | |||
) | |||
} | |||
|
|||
function Form ({initialPolicy}: {initialPolicy: Policy}): React.Node { | |||
function CustomPolicyEditor ({initialPolicy}: {initialPolicy: Policy}): React.Node { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type React.Node
is not mandatory. In some files we are using it, in others we aren't. We should agree in using it or not. At a glance, most files don't have it, so we could follow that way, unless you have a reason to explicitly include it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, then less is better
4221516
to
8ec8dec
Compare
</div> | ||
) | ||
} | ||
|
||
function CustomPolicyForm ({policy, onChange}: {policy: Policy, onChange: OnChange}): React.Node { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You missed this one React.Node
8ec8dec
to
3bda674
Compare
* Resides on a separate component * Does specific schema validation * Better error communication
* Better naming * Reflects the schema missing parts on preview * Tested
3bda674
to
b3451ea
Compare
What this PR does / why we need it:
When editing the policy schema, the form was only displaying the configuration, but not the rest of the attributes (name, version, etc)
Which issue(s) this PR fixes
fixes https://issues.jboss.org/browse/THREESCALE-2098
Verification steps
Go to Custom Policies and you now should see the full schema reflected on the preview.
Special notes for your reviewer: