upcoming: [DI-27317] - Onboarding Object Storage service to Alerts UI#12910
Conversation
|
This PR may contains some changes that were introduced in previous ACLP PRs. Please prioritize these PRs before this PR is merged: Some of the code changes in this PR might be dependent on future PRs for Metrics-Object Storage Onboarding, Alerts - Object Storage Dimension Filters, etc |
| type: AlertFilterKey | ||
| ) => void; | ||
| } | ||
|
|
There was a problem hiding this comment.
| interface EndpointOption { | |
| label: string; | |
| } |
| (props: AlertsEndpointFilterProps) => { | ||
| const { handleFilterChange: handleSelection, endpointOptions } = props; | ||
| const [selectedEndpoints, setSelectedEndpoints] = React.useState< | ||
| { label: string }[] |
There was a problem hiding this comment.
| { label: string }[] | |
| EndpointOption[] |
| })); | ||
|
|
||
| const handleFilterSelection = React.useCallback( | ||
| (_: React.SyntheticEvent, endpoints: { label: string }[]) => { |
There was a problem hiding this comment.
| (_: React.SyntheticEvent, endpoints: { label: string }[]) => { | |
| (_: React.SyntheticEvent, endpoints: EndpointOption[]) => { |
| const [selectedEndpoints, setSelectedEndpoints] = React.useState< | ||
| { label: string }[] | ||
| >([]); | ||
| const endpointBuiltOptions = endpointOptions.map((option) => ({ |
There was a problem hiding this comment.
| const endpointBuiltOptions = endpointOptions.map((option) => ({ | |
| const endpointBuiltOptions: EndpointOption[] = endpointOptions.map((option) => ({ |
| ) => void; | ||
| } | ||
|
|
||
| export const AlertsEndpointFilter = React.memo( |
There was a problem hiding this comment.
are we not handling any error state in this component?
There was a problem hiding this comment.
@nikhagra-akamai , We are creating the endpoints from the buckets API call in AlertsResources. If we receive error AlertsResources component will show the error state.
| queryFn: () => getAllBuckets(), | ||
| queryKey: [ | ||
| ...objectStorageQueries.endpoints.queryKey, | ||
| objectStorageQueries.buckets.queryKey[1], |
There was a problem hiding this comment.
This is a bit confusing -- objectStorageQueries.buckets.queryKey is null?
There was a problem hiding this comment.
@dwiley-akamai , Yeah it is confusing. In the queryKeyFactory they are keeping both the queryFn and queryKey as null. But in useObjectStorageBuckets hook. They are passing objectStorageQueryies.buckets.queryKey as the queryKey.
So we also are using the similar approach.
As shown in the screenshot here, the key value is as expected.
Cloud Manager UI test results🔺 1 failing test on test run #7 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/linodes/clone-linode.spec.ts" |
|||||||||||||||||
Description 📝
Object storage service integration for Alerts UI
Changes 🔄
List any change(s) relevant to the reviewer.
Scope 🚢
Upon production release, changes in this PR will be visible to:
Target release date 🗓️
October 1st
Preview 📷
ObjectStorage-Alert-UI.mp4
ObjectStorage-Alert-ShowDetails.mp4
ObjectStorage-Alert-Edit.mp4
Object Storage Alert Creation Payload
How to test 🧪
Prerequisites
(How to setup test environment)
Object Storage - testingalert in the Alerts List . Click on Show-Details/Edit to test the show-details and edit flow respectively.The current mocks only mock the serviceType, endpoints and buckets API Calls. The metric-definitions call for object-storage is not updated in mocks, it will be done in the upcoming object-storage related PRs.
Reproduction steps
(How to reproduce the issue, if applicable)
Verification steps
(How to verify changes)
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅