-
Notifications
You must be signed in to change notification settings - Fork 202
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
[GEN-1841]: refactor "card-details" and "container-details" into "data-card" #1898
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
merge main
This pull request includes several changes to improve the handling of action types in the `CreateAction` and `UpdateAction` resolvers, as well as the addition of a new update function for `AddClusterInfo` actions. The most important changes involve refactoring action type strings into constants and implementing the `UpdateAddClusterInfo` function. ### Refactoring action types: * [`frontend/graph/schema.resolvers.go`](diffhunk://#diff-8e6e95029056db2c0301fc338e0ca5a04356ce5d45ee9514bbd167f2d85bae70L560-R560): Replaced hardcoded action type strings with constants from `actionservices` for better maintainability. [[1]](diffhunk://#diff-8e6e95029056db2c0301fc338e0ca5a04356ce5d45ee9514bbd167f2d85bae70L560-R560) [[2]](diffhunk://#diff-8e6e95029056db2c0301fc338e0ca5a04356ce5d45ee9514bbd167f2d85bae70L569-R569) ### New update functionality: * [`frontend/graph/schema.resolvers.go`](diffhunk://#diff-8e6e95029056db2c0301fc338e0ca5a04356ce5d45ee9514bbd167f2d85bae70L582-R599): Implemented the `UpdateAction` resolver to handle updating `AddClusterInfo` actions. * [`frontend/services/actions/addclusterinfo.go`](diffhunk://#diff-c2da2861415e61f772e3b44d22810aa34b4eba6070f744709c4b1b6b919a3f09L70-R137): Added the `UpdateAddClusterInfo` function to update existing `AddClusterInfo` actions in Kubernetes. ### Constants definition: * [`frontend/services/actions/constants.go`](diffhunk://#diff-377602090c56364ea3a4d6cdadda1ad9b1c6ba9e122f882e5a1f640b1e62acf8R1-R7): Added constants for action types `ActionTypeAddClusterInfo` and `ActionTypeDeleteAttribute`.
This pull request introduces changes to the `DeleteAction` functionality in the `frontend/graph` package, adding support for an `actionType` parameter. This enhancement allows for more specific handling of different action types during deletion. Key changes include: ### GraphQL Schema and Resolvers * [`frontend/graph/schema.graphqls`](diffhunk://#diff-bc07b91dedd1782d9ddbbb6374ad97c7604f9a267de5174645723d863c732f80L314-R314): Updated the `deleteAction` mutation to include an `actionType` parameter. * [`frontend/graph/schema.resolvers.go`](diffhunk://#diff-8e6e95029056db2c0301fc338e0ca5a04356ce5d45ee9514bbd167f2d85bae70L603-R620): Modified the `DeleteAction` resolver to handle different action types based on the `actionType` parameter. ### Generated Code * [`frontend/graph/generated.go`](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L200-R200): Updated the `DeleteAction` method signatures and complexity calculations to include the `actionType` parameter. [[1]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L200-R200) [[2]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L266-R266) [[3]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L911-R911) [[4]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2R1342-R1350) [[5]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L5793-R5802) ### Action Services * [`frontend/services/actions/addclusterinfo.go`](diffhunk://#diff-c2da2861415e61f772e3b44d22810aa34b4eba6070f744709c4b1b6b919a3f09R148-R162): Added the `DeleteAddClusterInfo` function to handle the deletion of `AddClusterInfo` actions. * [`frontend/services/actions/addclusterinfo.go`](diffhunk://#diff-c2da2861415e61f772e3b44d22810aa34b4eba6070f744709c4b1b6b919a3f09R13): Imported `apierrors` for error handling in the new deletion function.
[GEN-1515]: fix stringify for graphql (odigos-io#1615)
This pull request introduces a new `ProbabilisticSamplerAction` to the codebase, along with the necessary updates to support its creation, update, and deletion. The key changes include adding the new action type, updating the GraphQL schema, and implementing the corresponding service functions. ### Addition of `ProbabilisticSamplerAction`: * [`frontend/graph/model/models_gen.go`](diffhunk://#diff-642ccd7ed71fdfa394bd7f7fd99c9c33e20ff18c876a91cb989d379a44390469R311-R337): Added the `ProbabilisticSamplerAction` struct and its methods to the model. * [`frontend/graph/schema.graphqls`](diffhunk://#diff-bc07b91dedd1782d9ddbbb6374ad97c7604f9a267de5174645723d863c732f80R309-R318): Updated the GraphQL schema to include the `ProbabilisticSamplerAction` type. ### Resolver Updates: * [`frontend/graph/schema.resolvers.go`](diffhunk://#diff-8e6e95029056db2c0301fc338e0ca5a04356ce5d45ee9514bbd167f2d85bae70L568-R571): Updated the `CreateAction`, `UpdateAction`, and `DeleteAction` resolvers to handle the new `ProbabilisticSamplerAction` type. [[1]](diffhunk://#diff-8e6e95029056db2c0301fc338e0ca5a04356ce5d45ee9514bbd167f2d85bae70L568-R571) [[2]](diffhunk://#diff-8e6e95029056db2c0301fc338e0ca5a04356ce5d45ee9514bbd167f2d85bae70L586-R591) [[3]](diffhunk://#diff-8e6e95029056db2c0301fc338e0ca5a04356ce5d45ee9514bbd167f2d85bae70L617-R630) ### Constants Update: * [`frontend/services/actions/constants.go`](diffhunk://#diff-377602090c56364ea3a4d6cdadda1ad9b1c6ba9e122f882e5a1f640b1e62acf8L8-R9): Added `ActionTypeProbabilisticSampler` and corrected the naming of `ActionTypeLatencySampler`. ### Service Implementation: * [`frontend/services/actions/probabilisticsampler.go`](diffhunk://#diff-2f6dc14f04b67e0a11a5b999216a0e08f575927294c5033187b84f1179fb5624R1-R139): Implemented the service functions `CreateProbabilisticSampler`, `UpdateProbabilisticSampler`, and `DeleteProbabilisticSampler` to manage `ProbabilisticSamplerAction` in Kubernetes.
alonkeyval
reviewed
Dec 2, 2024
alonkeyval
reviewed
Dec 2, 2024
frontend/webapp/reuseable-components/data-card/data-card-fields/index.tsx
Outdated
Show resolved
Hide resolved
alonkeyval
reviewed
Dec 2, 2024
frontend/webapp/reuseable-components/data-card/data-card-fields/index.tsx
Outdated
Show resolved
Hide resolved
alonkeyval
reviewed
Dec 2, 2024
frontend/webapp/reuseable-components/data-card/data-card-fields/index.tsx
Outdated
Show resolved
Hide resolved
alonkeyval
reviewed
Dec 2, 2024
frontend/webapp/reuseable-components/data-card/data-card-fields/index.tsx
Outdated
Show resolved
Hide resolved
Took care of the comments 👍 |
alonkeyval
reviewed
Dec 2, 2024
frontend/webapp/containers/main/sources/source-drawer-container/index.tsx
Outdated
Show resolved
Hide resolved
alonkeyval
reviewed
Dec 2, 2024
frontend/webapp/reuseable-components/data-card/data-card-fields/index.tsx
Outdated
Show resolved
Hide resolved
alonkeyval
reviewed
Dec 2, 2024
frontend/webapp/containers/main/instrumentation-rules/rule-drawer/build-card.ts
Outdated
Show resolved
Hide resolved
alonkeyval
reviewed
Dec 2, 2024
frontend/webapp/containers/main/sources/source-drawer-container/index.tsx
Outdated
Show resolved
Hide resolved
alonkeyval
reviewed
Dec 2, 2024
frontend/webapp/containers/main/instrumentation-rules/rule-drawer/index.tsx
Outdated
Show resolved
Hide resolved
alonkeyval
reviewed
Dec 2, 2024
frontend/webapp/containers/main/actions/action-drawer/index.tsx
Outdated
Show resolved
Hide resolved
alonkeyval
reviewed
Dec 2, 2024
{ title: 'Name', value: actionName }, | ||
{ title: 'Notes', value: notes }, | ||
{ type: 'divider' }, | ||
{ title: 'Status', type: 'active-status', value: String(!disabled) }, |
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.
second look at this file made me think that this file is getting a bit complex with repeated logic and a long function body. it might be worth re struct it
alonkeyval
reviewed
Dec 2, 2024
frontend/webapp/containers/main/actions/action-drawer/build-card.ts
Outdated
Show resolved
Hide resolved
Closed
alonkeyval
approved these changes
Dec 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request focuses on replacing the
CardDetails
andConfiguredFields
components with the newDataCard
andDataCardFields
components across various parts of the application. The changes involve updating the imports, modifying the structure of data passed to these components, and ensuring consistency in the display of card details.Key changes include:
Component Replacement:
frontend/webapp/components/common/card-details/index.tsx
: Removed theCardDetails
component.frontend/webapp/components/common/configured-fields/index.tsx
: Removed theConfiguredFields
component.frontend/webapp/containers/main/actions/action-drawer/index.tsx
: ReplacedCardDetails
withDataCard
.frontend/webapp/containers/main/destinations/destination-drawer/index.tsx
: ReplacedCardDetails
withDataCard
.frontend/webapp/containers/main/instrumentation-rules/rule-drawer/index.tsx
: ReplacedCardDetails
withDataCard
.Data Structure Updates:
frontend/webapp/containers/main/actions/action-drawer/build-card.ts
: Updated the data structure to useDataCardRow
andDataCardFieldTypes
.frontend/webapp/containers/main/destinations/destination-drawer/build-card.ts
: Updated the data structure to useDataCardRow
andDataCardFieldTypes
.frontend/webapp/containers/main/instrumentation-rules/rule-drawer/build-card.ts
: Updated the data structure to useDataCardRow
andDataCardFieldTypes
.frontend/webapp/containers/main/sources/source-drawer-container/build-card.ts
: Updated the data structure to useDataCardRow
.Miscellaneous Changes:
frontend/webapp/containers/main/overview/overview-drawer/drawer-header/index.tsx
: Added text overflow handling for the title.frontend/webapp/containers/main/destinations/add-destination/configured-destinations-list/index.tsx
: Updated the layout and replacedConfiguredFields
withDataCardFields
.frontend/webapp/containers/main/sources/source-drawer-container/index.tsx
: Added handling for container data usingDataCard
.