-
Notifications
You must be signed in to change notification settings - Fork 250
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
Add feature checkbox #97
Conversation
lib/screens/home_page/editor_pane/details_card/request_pane/request_params.dart
Outdated
Show resolved
Hide resolved
This is working well @DenserMeerkat |
Thanks for the review @ashitaprasad |
lib/codegen/dart/http.dart
Outdated
@@ -111,9 +111,9 @@ void main() async { | |||
} |
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.
enabled params are not being passed/used in http codegen.
rows = [ | ||
kNameValueEmptyModel, | ||
]; | ||
rows = [kNameValueEmptyModel]; |
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.
Add ,
after the first item for singleton lists.
rows = [ | ||
kNameValueEmptyModel, | ||
]; | ||
rows = [kNameValueEmptyModel]; |
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.
Add ,
after the first item for singleton lists.
kNameValueEmptyModel, | ||
]; | ||
rows = [kNameValueEmptyModel]; | ||
isRowEnabledList = [true]; |
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.
Add ,
after the first item for singleton lists.
lib/utils/har_utils.dart
Outdated
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.
Do not directly use enabledRequestParams
or enabledRequestHeaders
in requestModelToHARJsonRequest
as it is also used for data export purposes and these should only be used in code gens.
Just like exportMode
add a new parameter bool useEnabled
and by default it should be false
.
The flag should be turned on only when this function is called via code generators.
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.
If it is true
, only then enabled fields should be used.
@@ -127,4 +127,39 @@ Easily manipulate and play around with request inputs like headers, query parame | |||
expect(padMultilineString(text1, 10), text1FirstLineNotPaddedExpected); | |||
}); | |||
}); | |||
|
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.
These tests are only for getEnabledRows
, you will need to add more tests to test the added functionality in more detail.
You need to define 3-4 new models in test/request_models.dart
that have list of enabled headers and params (separate & mix of both) and add relevant expected codes in the test/codegen
files to ensure the generated codes are correct.
Hi @DenserMeerkat, |
test/request_models.dart
Outdated
@@ -180,3 +180,91 @@ const requestModelDelete2 = RequestModel( | |||
}""", | |||
requestBodyContentType: ContentType.json, | |||
); | |||
|
|||
/// Request model with enabled params | |||
const requestModelEnabledParams = RequestModel( |
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.
GET request models are named requestModelGet9
..10
..
The id should also be get9
..10
..
In the comments above the model we write the purpose.
Same goes for all the below models.
Also, they should be positioned where the last get request model ends.
test/request_models.dart
Outdated
], | ||
); | ||
|
||
/// Request model with enabled rows |
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.
Instead of rows
write some enabled headers & URL parameters
test/request_models.dart
Outdated
], | ||
); | ||
|
||
/// Request model with disabled rows |
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.
Instead of with disabled rows
write where all headers & URL parameters are disabled
@@ -100,6 +100,7 @@ void main() { | |||
expect(curlCodeGen.getCode(requestModelPost3, "https"), expectedCode); |
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.
For all tests cases .. as they are of GET request .. position them correctly.
Hi @DenserMeerkat I have added my comments above. Thanks! |
Thanks @ashitaprasad |
Thank you for the PR @DenserMeerkat 🥳 |
Checkbox for Headers and Parameters #58