-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
[GEN-2222]: add instrumentation-rule for code attributes (#2239)
Following-up with a UI update in response to PR #2230 --- This pull request introduces the `CodeAttributes` feature to the instrumentation rules in the frontend. The changes span across multiple files, including model definitions, GraphQL schema, service functions, and the web application interface. The most important changes are summarized below: ### Model and Schema Updates: * Added `CodeAttributes` and `CodeAttributesInput` types to the `models_gen.go` file and integrated them into the `InstrumentationRule` and `InstrumentationRuleInput` structs. [[1]](diffhunk://#diff-642ccd7ed71fdfa394bd7f7fd99c9c33e20ff18c876a91cb989d379a44390469R82-R99) [[2]](diffhunk://#diff-642ccd7ed71fdfa394bd7f7fd99c9c33e20ff18c876a91cb989d379a44390469R315) [[3]](diffhunk://#diff-642ccd7ed71fdfa394bd7f7fd99c9c33e20ff18c876a91cb989d379a44390469R325) * Updated the GraphQL schema to include `CodeAttributes` and `CodeAttributesInput` in the `InstrumentationRule` and `InstrumentationRuleInput` types. [[1]](diffhunk://#diff-bc07b91dedd1782d9ddbbb6374ad97c7604f9a267de5174645723d863c732f80R125) [[2]](diffhunk://#diff-bc07b91dedd1782d9ddbbb6374ad97c7604f9a267de5174645723d863c732f80R135) [[3]](diffhunk://#diff-bc07b91dedd1782d9ddbbb6374ad97c7604f9a267de5174645723d863c732f80R196-R213) ### Service Layer Changes: * Modified the `ListInstrumentationRules`, `UpdateInstrumentationRule`, and `CreateInstrumentationRule` functions to handle the new `CodeAttributes` field. [[1]](diffhunk://#diff-d474e63d96bb8a180ea1f9d7687b2b6a0d78c2b04d32d8cdfd82874ad187eb56R44) [[2]](diffhunk://#diff-d474e63d96bb8a180ea1f9d7687b2b6a0d78c2b04d32d8cdfd82874ad187eb56L114-L122) [[3]](diffhunk://#diff-d474e63d96bb8a180ea1f9d7687b2b6a0d78c2b04d32d8cdfd82874ad187eb56R130-R157) [[4]](diffhunk://#diff-d474e63d96bb8a180ea1f9d7687b2b6a0d78c2b04d32d8cdfd82874ad187eb56R172) [[5]](diffhunk://#diff-d474e63d96bb8a180ea1f9d7687b2b6a0d78c2b04d32d8cdfd82874ad187eb56L199-R260) [[6]](diffhunk://#diff-d474e63d96bb8a180ea1f9d7687b2b6a0d78c2b04d32d8cdfd82874ad187eb56R273) ### Web Application Updates: * Added a new `CodeAttributesIcon` component and exported it for use in the application. [[1]](diffhunk://#diff-d0b5eb65b321f5856c062964a4f4f62f74624377a892b0d35507e93f7c9c6ab7R1-R17) [[2]](diffhunk://#diff-e803ff39252ca5c7f9bb70dbc44e3041209deac4fa03d3f4f4147b1a79890749R1) * Updated the `ActionModal` component to autofocus only when no action type is selected. * Enhanced the `build-drawer-item` function to include `codeAttributes` in the drawer item construction. [[1]](diffhunk://#diff-9c7e3ececb1f95abdfc76cb505f5cd2fd726dc111b2d9f407671b89197b6e0f0L2-R5) [[2]](diffhunk://#diff-9c7e3ececb1f95abdfc76cb505f5cd2fd726dc111b2d9f407671b89197b6e0f0L16-R31) * Introduced a new `CodeAttributes` component for the rule form body, allowing users to select which code attributes to collect. [[1]](diffhunk://#diff-651451ffd4d870846d3bca69fced174591c5f20ffaaa26a4f684185e029cc182R1-R139) [[2]](diffhunk://#diff-79f8ef3b764df919457768e658fa2f90a2d5c2f794a78c90877532e0603d0ba1R2) [[3]](diffhunk://#diff-79f8ef3b764df919457768e658fa2f90a2d5c2f794a78c90877532e0603d0ba1R23) * Fixed an issue in the `PayloadCollection` component to handle cases where `payloadCollection` might be undefined. * Updated the `RuleModal` component to start with no pre-selected rule option.
- v1.0.156
- v1.0.155
- v1.0.154
- v1.0.153
- v1.0.152
- v1.0.151
- v1.0.150
- v1.0.149
- v1.0.148
- v1.0.147
- v1.0.146
- v1.0.145
- v1.0.144
- profiles/v1.0.156
- profiles/v1.0.155
- profiles/v1.0.154
- profiles/v1.0.153
- profiles/v1.0.152
- profiles/v1.0.151
- profiles/v1.0.150
- profiles/v1.0.149
- profiles/v1.0.148
- profiles/v1.0.147
- profiles/v1.0.146
- profiles/v1.0.145
- profiles/v1.0.144
- procdiscovery/v1.0.156
- procdiscovery/v1.0.155
- procdiscovery/v1.0.154
- procdiscovery/v1.0.153
- procdiscovery/v1.0.152
- procdiscovery/v1.0.151
- procdiscovery/v1.0.150
- procdiscovery/v1.0.149
- procdiscovery/v1.0.148
- procdiscovery/v1.0.147
- procdiscovery/v1.0.146
- procdiscovery/v1.0.145
- procdiscovery/v1.0.144
- opampserver/v1.0.156
- opampserver/v1.0.155
- opampserver/v1.0.154
- opampserver/v1.0.153
- opampserver/v1.0.152
- opampserver/v1.0.151
- opampserver/v1.0.150
- opampserver/v1.0.149
- opampserver/v1.0.148
- opampserver/v1.0.147
- opampserver/v1.0.146
- opampserver/v1.0.145
- opampserver/v1.0.144
- odiglet/v1.0.156
- odiglet/v1.0.155
- odiglet/v1.0.154
- odiglet/v1.0.153
- odiglet/v1.0.152
- odiglet/v1.0.151
- odiglet/v1.0.150
- odiglet/v1.0.149
- odiglet/v1.0.148
- odiglet/v1.0.147
- odiglet/v1.0.146
- odiglet/v1.0.145
- odiglet/v1.0.144
- k8sutils/v1.0.156
- k8sutils/v1.0.155
- k8sutils/v1.0.154
- k8sutils/v1.0.153
- k8sutils/v1.0.152
- k8sutils/v1.0.151
- k8sutils/v1.0.150
- k8sutils/v1.0.149
- k8sutils/v1.0.148
- k8sutils/v1.0.147
- k8sutils/v1.0.146
- k8sutils/v1.0.145
- k8sutils/v1.0.144
- instrumentor/v1.0.156
- instrumentor/v1.0.155
- instrumentor/v1.0.154
- instrumentation/v1.0.156
- instrumentation/v1.0.155
- instrumentation/v1.0.154
- instrumentation/v1.0.153
- instrumentation/v1.0.152
- instrumentation/v1.0.151
- instrumentation/v1.0.150
- instrumentation/v1.0.149
- instrumentation/v1.0.148
- instrumentation/v1.0.147
- instrumentation/v1.0.146
- instrumentation/v1.0.145
- instrumentation/v1.0.144
- distros/v1.0.156
- distros/v1.0.155
- distros/v1.0.154
- distros/v1.0.153
- distros/v1.0.152
- distros/v1.0.151
- distros/v1.0.150
- distros/v1.0.149
- distros/v1.0.148
- common/v1.0.156
- common/v1.0.155
- common/v1.0.154
- common/v1.0.153
- common/v1.0.152
- common/v1.0.151
- common/v1.0.150
- common/v1.0.149
- common/v1.0.148
- common/v1.0.147
- common/v1.0.146
- common/v1.0.145
- common/v1.0.144
- api/v1.0.156
- api/v1.0.155
- api/v1.0.154
- api/v1.0.153
- api/v1.0.152
- api/v1.0.151
- api/v1.0.150
- api/v1.0.149
- api/v1.0.148
- api/v1.0.147
- api/v1.0.146
- api/v1.0.145
- api/v1.0.144
1 parent
42076d5
commit 3c05d6c
Showing
30 changed files
with
1,126 additions
and
176 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
17 changes: 17 additions & 0 deletions
17
frontend/webapp/assets/icons/rules/code-attributes-icon.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import { SVG } from '@/assets'; | ||
import theme from '@/styles/theme'; | ||
|
||
export const CodeAttributesIcon: SVG = ({ size = 16, fill = theme.text.info, rotate = 0, onClick }) => { | ||
return ( | ||
<svg width={size} height={size} viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' style={{ transform: `rotate(${rotate}deg)` }} onClick={onClick}> | ||
<path | ||
stroke={fill} | ||
strokeWidth='1.5' | ||
strokeLinecap='round' | ||
strokeLinejoin='round' | ||
d='M8 4C6.34315 4 5 5.19391 5 6.66667V9.33333C5 10.8061 3.65685 12 2 12C3.65685 12 5 13.1939 5 14.6667V17.3333C5 18.8061 6.34315 20 8 20M16 4C17.6569 4 19 5.19391 19 6.66667V9.33333C19 10.8061 20.3431 12 22 12C20.3431 12 19 13.1939 19 14.6667V17.3333C19 18.8061 17.6569 20 16 20M12.001 12H12M15.001 12H15M9.001 12H9' | ||
/> | ||
</svg> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './code-attributes-icon'; | ||
export * from './payload-collection-icon'; |
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
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
Oops, something went wrong.