-
Notifications
You must be signed in to change notification settings - Fork 114
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
Reuse shared components in API Policies #536
Conversation
...isher/src/main/webapp/source/src/app/components/Apis/Details/Policies/AttachedPolicyList.tsx
Outdated
Show resolved
Hide resolved
handlePolicyDownload={handlePolicyDownload} | ||
handleDelete={handleDelete} | ||
setDrawerOpen={setDrawerOpen} | ||
PolicyConfigurationEditDrawer={PolicyConfigurationEditDrawer} |
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.
Why are we passing down a component here? Can't we simply import the required component within the shared component itself (i.e. within AttachedPolicyCardShared
)
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.
We cannot do that as the shared component is shared by two different features. Since those have different data contexts and different funtionalities, we cannot import them as a common identical one in the shared component. By passing them down to components, we do not need seperate implementations to identify the compoenent's feature.
...isher/src/main/webapp/source/src/app/components/Apis/Details/Policies/AttachedPolicyList.tsx
Show resolved
Hide resolved
...lisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/PoliciesExpansion.tsx
Show resolved
Hide resolved
...publisher/src/main/webapp/source/src/app/components/Apis/Details/Policies/PolicyDropzone.tsx
Show resolved
Hide resolved
currentFlow={currentFlow} | ||
policyList={policyList} | ||
fetchPolicies={fetchPolicies} | ||
DraggablePolicyCard={DraggablePolicyCard} |
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.
Here too. Also, shall we move out the components such as FlowArrow.tsx
files to the shared folder?
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 have used a FlowArrow.tsx shared file in the shared folder and reused them in both features. Eventhough it has only direction as a data (Which is not a problem for resuing in both features) I kept the file structure as it is for the readability. Becase if so, the only file missing will be that and I thought it will confuse people. If we need, we can completely remove it from both features as it's in the bottom of the react components of both features.
$Subject