[Incident Management] Add page attachment modal #231186
[Incident Management] Add page attachment modal #231186dominiqueclarke merged 41 commits intoelastic:mainfrom
Conversation
d4c19d7 to
5bab651
Compare
author Dominique Belcher <dominique.clarke@elastic.co> 1749583346 -0400 committer Dominique Belcher <dominique.clarke@elastic.co> 1754678113 -0400 parent 6f8bb90 author Dominique Belcher <dominique.clarke@elastic.co> 1749583346 -0400 committer Dominique Belcher <dominique.clarke@elastic.co> 1754678081 -0400 parent 6f8bb90 author Dominique Belcher <dominique.clarke@elastic.co> 1749583346 -0400 committer Dominique Belcher <dominique.clarke@elastic.co> 1754678047 -0400 parent 6f8bb90 author Dominique Belcher <dominique.clarke@elastic.co> 1749583346 -0400 committer Dominique Belcher <dominique.clarke@elastic.co> 1754677385 -0400 parent 6f8bb90 author Dominique Belcher <dominique.clarke@elastic.co> 1749583346 -0400 committer Dominique Belcher <dominique.clarke@elastic.co> 1754677363 -0400 add link attachment type remove dashboard dependency from triggers actions ui [CI] Auto-commit changed files from 'node scripts/yarn_deduplicate' integrate screenshot adjust types quick checks remove unnecessary dashboard dependency add actions split and merge screenshot images remove screenshot functionality adjust rendered component adjust types and linting adjust types adjust test adjust types adjust tests adjust types remove dashboard implementation add attachment type to observability remove attachment type from cases adjust license Update use_dashboard_menu_items.tsx Update use_dashboard_menu_items.tsx remove additional references in cases adjust test adjust tests add "add to case" button to Synthetics monitor details adjust types adjust security start plugin adjust import adjust import Update assignees.test.tsx adjust tests add feature flag [CI] Auto-commit changed files from 'node scripts/styled_components_mapping' adjust import add ai summary add summary to attachment children set modal to closed adjust tests remove page attachment references from observability-schema adjust plugin setup adjust observability schema package add page attachment modal add tests adjust types and remove unnecessary test [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' [CI] Auto-commit changed files from 'node scripts/telemetry_check' adjust type persist the screen context adjust isObsAIAssistantEnabled and add tests adjust tests improve prompt adjust types remove ai elements remove useScreenContext delete unnecessary fixes remove useMonitorScreenContext remove unncessary change
bec0d20 to
9b0da85
Compare
|
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
…urce-definitions/scripts/fix-location-collection.ts'
…:dominiqueclarke/kibana into feat/observability-page-attachment-modal
…:dominiqueclarke/kibana into feat/observability-page-attachment-modal
...ed/public/components/add_page_attachment_to_case_modal/add_page_attachment_to_case_modal.tsx
Outdated
Show resolved
Hide resolved
...ed/public/components/add_page_attachment_to_case_modal/add_page_attachment_to_case_modal.tsx
Outdated
Show resolved
Hide resolved
...blic/components/add_page_attachment_to_case_modal/add_page_attachment_to_case_modal_lazy.tsx
Outdated
Show resolved
Hide resolved
...ed/public/components/add_page_attachment_to_case_modal/add_page_attachment_to_case_modal.tsx
Outdated
Show resolved
Hide resolved
...servability/plugins/synthetics/public/apps/synthetics/components/monitor_details/actions.tsx
Show resolved
Hide resolved
...s/observability/plugins/observability_shared/public/components/add_to_case_comment/index.tsx
Outdated
Show resolved
Hide resolved
...ed/public/components/add_page_attachment_to_case_modal/add_page_attachment_to_case_modal.tsx
Outdated
Show resolved
Hide resolved
...ed/public/components/add_page_attachment_to_case_modal/add_page_attachment_to_case_modal.tsx
Outdated
Show resolved
Hide resolved
.../observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_detail_locator.ts
Outdated
Show resolved
Hide resolved
.../plugins/synthetics/public/apps/synthetics/components/monitor_details/add_to_case_action.tsx
Outdated
Show resolved
Hide resolved
| pageAttachmentState={pageState} | ||
| cases={cases} | ||
| onCloseModal={onCloseModal} | ||
| notifications={notifications} |
There was a problem hiding this comment.
I think it'd be better not to pass notifications at all, we can get it where needed from useKibana().services, right?
There was a problem hiding this comment.
Notifications is a core component, which is available globally, so you technically you are right. However, let me explain this pattern a bit more to give you context of why I chose to pass the dependency rather than use useKibana.
Shared components often need dependencies. To fetch dependencies, we often use useKibana. However, those dependencies are dictated by the consuming plugin.
Let's pretend for a second I wasn't passing notifications. Let's instead pretend I was passing observabilityAIAssistant. (I mentioned before I split this off from a larger ticket, which did pass observabilityAIAssistant).
If I use useKibana within the shared component to fetch that dependency, but it's not available from the consuming plugin, I'm likely to get a big fat reference issue. This is a typical pattern and bug we see in things like the alerts flyout, where the flyout code can be called from multiple different plugins. It's also the same issue that caused the bug Justin is working on in this PR.
By having shared components explicitly define their dependencies rather than hiding the dependency and fetching it via useKibana, we avoid that class of bug and explicitly notify the calling component of which dependencies are needed to utilize this shared component. The plugin can then include those dependencies if they wish to use that shared component.
There was a problem hiding this comment.
Got it!
We had a short conversation in private but I think the summary could be: if it's a new shared component we should not use this pattern, the plugin integrating the component will have to make sure to have the required services in their Kibana context.
The problem comes when adding a required service to a shared component that is already being used in different plugins, in that case we'll get an error if one of the plugins does not have the required service available in their context.
Please correct me if I'm wrong.
There was a problem hiding this comment.
yes that is correct, and we've had this class of bugs come up many, many times before.
There was a problem hiding this comment.
Are we keeping notifications as a parameter even if it's a new shared component?
…:dominiqueclarke/kibana into feat/observability-page-attachment-modal
…:dominiqueclarke/kibana into feat/observability-page-attachment-modal
x-pack/solutions/observability/plugins/observability_shared/kibana.jsonc
Outdated
Show resolved
Hide resolved
Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
…bana.jsonc Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
…:dominiqueclarke/kibana into feat/observability-page-attachment-modal
| schema-utils "^3.0.0" | ||
|
|
||
| "string-width-cjs@npm:string-width@^4.2.0": | ||
| "string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: |
There was a problem hiding this comment.
Why there are changes to yarn.lock?
There was a problem hiding this comment.
I think it's possible someone didn't merge their yarn.lock in a PR that went into main, cause these are the changes that are being generated via yarn kbn bootstrap.
| > | ||
| <AddToCaseButtonContent | ||
| pageAttachmentState={pageAttachmentState} | ||
| notifications={notifications} |
There was a problem hiding this comment.
| notifications={notifications} |
There was a problem hiding this comment.
This notifications is indeed in use, it is used to show a notification if you do not have proper privileges.
There was a problem hiding this comment.
I don't see notifications used in AddToCaseButtonContent
There was a problem hiding this comment.
Commit pushed.
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
Total ESLint disabled count
History
|
## Summary Summarize your PR. If it involves visual changes include a screenshot or gif. [https___google.com - Monitors - Synthetics - Observability - Elastic (2).webm](https://github.com/user-attachments/assets/1927f666-c9ca-49ad-a3fe-9e0ac8cadeb9) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Francesco Fagnani <fagnani.francesco@gmail.com> Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
…)" This reverts commit 807b177.
…)" This reverts commit 807b177.
…)" This reverts commit 807b177.
…)" (elastic#237064) This reverts commit 807b177.
Summary
Summarize your PR. If it involves visual changes include a screenshot or gif.
https___google.com.-.Monitors.-.Synthetics.-.Observability.-.Elastic.2.webm