-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: implement auth attributes directly at the child level #344
feat: implement auth attributes directly at the child level #344
Conversation
Branches seem out of sync. I think feature/auth-binding-in-child-components needs to be rebased on develop. |
I'd rebase against the q1-release tagged release branch instead, since that's where I assume we'll be pushing these. |
Codecov Report
@@ Coverage Diff @@
## feature/auth-binding-in-child-components #344 +/- ##
============================================================================
- Coverage 93.81% 93.80% -0.02%
============================================================================
Files 36 36
Lines 1277 1291 +14
Branches 287 290 +3
============================================================================
+ Hits 1198 1211 +13
- Misses 77 78 +1
Partials 2 2
Continue to review full report at Codecov.
|
91413b1
to
608db54
Compare
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.
Overall looking good! Just a few minor comments.
if (hasAuthProperty(component)) { | ||
return true; | ||
} | ||
if (component.children && component.children.length > 0) { |
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.
Length check here is probably not required.
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.
Good point, Removed
export function isAuthProperty(prop: ComponentPropertyValueTypes): prop is StudioComponentAuthProperty { | ||
return 'userAttribute' in prop; | ||
} | ||
|
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 you want to push this up to the renderHelper, since you basically reimplement this check in renderer-helper inside the hasAuth
check.
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.
Good suggestion, but more changes/refactor but I too feel its worth doing it now so its helpful in future :)
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.
Done
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 this needs to move to renderer-helper class, codegen-ui doesn't depend on codegen-ui-react, so I'm not sure how this'll build as-is.
"bindingProperties": { | ||
"property": "customUserAttributeIcecream" | ||
} | ||
"userAttribute": "customUserAttributeIcecream" |
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.
Could you leave this as custom:favorite_icecream (this is the actual format which a custom attribute takes from cognito.
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.
Done
Done |
67ba67a
to
922d24d
Compare
922d24d
to
8485844
Compare
* chore: upgrade to follow-redirects@1.14.7 (#337) resolves dependabot warning * feat: expose renderThemeJson method to generating themes in studio ui (#340) (#346) * feat: implement auth attributes directly at the child level (#344) Moved auth attribute usage to child components to avoid creating top-level auth statements. Co-authored-by: Dane Pilcher <dppilche@amazon.com> Co-authored-by: Al Harris <91494052+alharris-at@users.noreply.github.com>
* chore: upgrade to follow-redirects@1.14.7 (#337) resolves dependabot warning * feat: expose renderThemeJson method to generating themes in studio ui (#340) (#346) * feat: implement auth attributes directly at the child level (#344) Moved auth attribute usage to child components to avoid creating top-level auth statements. Co-authored-by: Dane Pilcher <dppilche@amazon.com> Co-authored-by: Al Harris <91494052+alharris-at@users.noreply.github.com>
* chore: upgrade to follow-redirects@1.14.7 (#337) resolves dependabot warning * feat: expose renderThemeJson method to generating themes in studio ui (#340) (#346) * feat: implement auth attributes directly at the child level (#344) Moved auth attribute usage to child components to avoid creating top-level auth statements. Co-authored-by: Dane Pilcher <dppilche@amazon.com> Co-authored-by: Al Harris <91494052+alharris-at@users.noreply.github.com>
* chore: upgrade to follow-redirects@1.14.7 (#337) resolves dependabot warning * feat: expose renderThemeJson method to generating themes in studio ui (#340) (#346) * feat: implement auth attributes directly at the child level (#344) Moved auth attribute usage to child components to avoid creating top-level auth statements. Co-authored-by: Dane Pilcher <dppilche@amazon.com> Co-authored-by: Al Harris <91494052+alharris-at@users.noreply.github.com>
* chore: upgrade to follow-redirects@1.14.7 (#337) resolves dependabot warning * feat: expose renderThemeJson method to generating themes in studio ui (#340) (#346) * feat: implement auth attributes directly at the child level (#344) Moved auth attribute usage to child components to avoid creating top-level auth statements. Co-authored-by: Dane Pilcher <dppilche@amazon.com> Co-authored-by: Al Harris <91494052+alharris-at@users.noreply.github.com>
Issue #, if available:
Description of changes:
Moving auth attribute usage to child components to avoid creating top-level auth statement.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.