-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Rules migration] Add possibility to navigate to a specific migration (#11264) #201597
[Rules migration] Add possibility to navigate to a specific migration (#11264) #201597
Conversation
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
# Conflicts: # x-pack/plugins/security_solution/public/siem_migrations/rules/pages/index.tsx
💚 Build Succeeded
Metrics [docs]Async chunks
History
cc @e40pud |
import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
import * as i18n from './translations'; | ||
|
||
const UnknownMigrationComponent = () => { |
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.
Could we export the memo component directly everywhere? It's shorter and it makes it easier to find the references in the IDE.
export const UnknownMigration = React.memo(() => {
// [...]
});
UnknownMigration.displayName = 'UnknownMigration';
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.
Sounds good, will update our components in one of the next PRs.
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.
LGTM
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/12027790276 |
…elastic#11264) (elastic#201597) ## Summary [Internal link](elastic/security-team#10820) to the feature details With these changes we: * allow user to navigate to a specific migration by its id * handle different possible states on migrations rules page: * `no migrations`: if there are no existing migrations we will redirect user to the landing page * `unknown selected migration`: if unknown migration id is specified in the URL, then "Unknown Migration" page will be shown * `no selected migration`: if user lands on the root "SIEM migrations rules" page, then most recent migration will be shown * `show existing migration`: selected migration will be shown ### Screenshots **Unknown migration** <img width="1312" alt="Screenshot 2024-11-25 at 14 46 56" src="https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769"> **Show existing migration** <img width="1312" alt="Screenshot 2024-11-25 at 15 03 53" src="https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156"> (cherry picked from commit 17410c3)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ration (#11264) (#201597) (#201735) # Backport This will backport the following commits from `main` to `8.x`: - [[Rules migration] Add possibility to navigate to a specific migration (#11264) (#201597)](#201597) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ievgen Sorokopud","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-26T09:39:17Z","message":"[Rules migration] Add possibility to navigate to a specific migration (#11264) (#201597)\n\n## Summary\r\n\r\n[Internal link](https://github.com/elastic/security-team/issues/10820)\r\nto the feature details\r\n\r\nWith these changes we:\r\n* allow user to navigate to a specific migration by its id\r\n* handle different possible states on migrations rules page:\r\n* `no migrations`: if there are no existing migrations we will redirect\r\nuser to the landing page\r\n* `unknown selected migration`: if unknown migration id is specified in\r\nthe URL, then \"Unknown Migration\" page will be shown\r\n* `no selected migration`: if user lands on the root \"SIEM migrations\r\nrules\" page, then most recent migration will be shown\r\n * `show existing migration`: selected migration will be shown\r\n\r\n### Screenshots\r\n\r\n**Unknown migration**\r\n\r\n<img width=\"1312\" alt=\"Screenshot 2024-11-25 at 14 46 56\"\r\nsrc=\"https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769\">\r\n\r\n**Show existing migration**\r\n\r\n<img width=\"1312\" alt=\"Screenshot 2024-11-25 at 15 03 53\"\r\nsrc=\"https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156\">","sha":"17410c39279fcca551d3af7299b04d1ccf8ceefa","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat Hunting","Team: SecuritySolution","backport:prev-minor"],"title":"[Rules migration] Add possibility to navigate to a specific migration (#11264)","number":201597,"url":"https://github.com/elastic/kibana/pull/201597","mergeCommit":{"message":"[Rules migration] Add possibility to navigate to a specific migration (#11264) (#201597)\n\n## Summary\r\n\r\n[Internal link](https://github.com/elastic/security-team/issues/10820)\r\nto the feature details\r\n\r\nWith these changes we:\r\n* allow user to navigate to a specific migration by its id\r\n* handle different possible states on migrations rules page:\r\n* `no migrations`: if there are no existing migrations we will redirect\r\nuser to the landing page\r\n* `unknown selected migration`: if unknown migration id is specified in\r\nthe URL, then \"Unknown Migration\" page will be shown\r\n* `no selected migration`: if user lands on the root \"SIEM migrations\r\nrules\" page, then most recent migration will be shown\r\n * `show existing migration`: selected migration will be shown\r\n\r\n### Screenshots\r\n\r\n**Unknown migration**\r\n\r\n<img width=\"1312\" alt=\"Screenshot 2024-11-25 at 14 46 56\"\r\nsrc=\"https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769\">\r\n\r\n**Show existing migration**\r\n\r\n<img width=\"1312\" alt=\"Screenshot 2024-11-25 at 15 03 53\"\r\nsrc=\"https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156\">","sha":"17410c39279fcca551d3af7299b04d1ccf8ceefa"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201597","number":201597,"mergeCommit":{"message":"[Rules migration] Add possibility to navigate to a specific migration (#11264) (#201597)\n\n## Summary\r\n\r\n[Internal link](https://github.com/elastic/security-team/issues/10820)\r\nto the feature details\r\n\r\nWith these changes we:\r\n* allow user to navigate to a specific migration by its id\r\n* handle different possible states on migrations rules page:\r\n* `no migrations`: if there are no existing migrations we will redirect\r\nuser to the landing page\r\n* `unknown selected migration`: if unknown migration id is specified in\r\nthe URL, then \"Unknown Migration\" page will be shown\r\n* `no selected migration`: if user lands on the root \"SIEM migrations\r\nrules\" page, then most recent migration will be shown\r\n * `show existing migration`: selected migration will be shown\r\n\r\n### Screenshots\r\n\r\n**Unknown migration**\r\n\r\n<img width=\"1312\" alt=\"Screenshot 2024-11-25 at 14 46 56\"\r\nsrc=\"https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769\">\r\n\r\n**Show existing migration**\r\n\r\n<img width=\"1312\" alt=\"Screenshot 2024-11-25 at 15 03 53\"\r\nsrc=\"https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156\">","sha":"17410c39279fcca551d3af7299b04d1ccf8ceefa"}}]}] BACKPORT--> Co-authored-by: Ievgen Sorokopud <[email protected]>
…elastic#11264) (elastic#201597) ## Summary [Internal link](elastic/security-team#10820) to the feature details With these changes we: * allow user to navigate to a specific migration by its id * handle different possible states on migrations rules page: * `no migrations`: if there are no existing migrations we will redirect user to the landing page * `unknown selected migration`: if unknown migration id is specified in the URL, then "Unknown Migration" page will be shown * `no selected migration`: if user lands on the root "SIEM migrations rules" page, then most recent migration will be shown * `show existing migration`: selected migration will be shown ### Screenshots **Unknown migration** <img width="1312" alt="Screenshot 2024-11-25 at 14 46 56" src="https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769"> **Show existing migration** <img width="1312" alt="Screenshot 2024-11-25 at 15 03 53" src="https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156">
## Summary These are the followup updated to address feedback from my previous PRs: * Make sure to use descriptive names specific to the `siem_migrations` subdomain ([comment](#200978 (review))): > Make sure you use descriptive names specific to the siem_migrations subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way too generic and conflict with the rule management terminology, which would make code search more difficult. * Export the memo component directly everywhere ([comment](#201597 (comment))): > Could we export the memo component directly everywhere? It's shorter and it makes it easier to find the references in the IDE. * Use one hook to access APIs instead of two ([comment](#202494 (comment))): > I see that for every API request we have to implement 2 separate hooks. Why don't we add error handling to the same hook that does the useQuery? so we have everything in one hook. Or is there a reason to have them separate?
## Summary These are the followup updated to address feedback from my previous PRs: * Make sure to use descriptive names specific to the `siem_migrations` subdomain ([comment](elastic#200978 (review))): > Make sure you use descriptive names specific to the siem_migrations subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way too generic and conflict with the rule management terminology, which would make code search more difficult. * Export the memo component directly everywhere ([comment](elastic#201597 (comment))): > Could we export the memo component directly everywhere? It's shorter and it makes it easier to find the references in the IDE. * Use one hook to access APIs instead of two ([comment](elastic#202494 (comment))): > I see that for every API request we have to implement 2 separate hooks. Why don't we add error handling to the same hook that does the useQuery? so we have everything in one hook. Or is there a reason to have them separate? (cherry picked from commit 4d8f711)
## Summary These are the followup updated to address feedback from my previous PRs: * Make sure to use descriptive names specific to the `siem_migrations` subdomain ([comment](elastic#200978 (review))): > Make sure you use descriptive names specific to the siem_migrations subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way too generic and conflict with the rule management terminology, which would make code search more difficult. * Export the memo component directly everywhere ([comment](elastic#201597 (comment))): > Could we export the memo component directly everywhere? It's shorter and it makes it easier to find the references in the IDE. * Use one hook to access APIs instead of two ([comment](elastic#202494 (comment))): > I see that for every API request we have to implement 2 separate hooks. Why don't we add error handling to the same hook that does the useQuery? so we have everything in one hook. Or is there a reason to have them separate?
## Summary These are the followup updated to address feedback from my previous PRs: * Make sure to use descriptive names specific to the `siem_migrations` subdomain ([comment](elastic#200978 (review))): > Make sure you use descriptive names specific to the siem_migrations subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way too generic and conflict with the rule management terminology, which would make code search more difficult. * Export the memo component directly everywhere ([comment](elastic#201597 (comment))): > Could we export the memo component directly everywhere? It's shorter and it makes it easier to find the references in the IDE. * Use one hook to access APIs instead of two ([comment](elastic#202494 (comment))): > I see that for every API request we have to implement 2 separate hooks. Why don't we add error handling to the same hook that does the useQuery? so we have everything in one hook. Or is there a reason to have them separate?
## Summary These are the followup updated to address feedback from my previous PRs: * Make sure to use descriptive names specific to the `siem_migrations` subdomain ([comment](elastic#200978 (review))): > Make sure you use descriptive names specific to the siem_migrations subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way too generic and conflict with the rule management terminology, which would make code search more difficult. * Export the memo component directly everywhere ([comment](elastic#201597 (comment))): > Could we export the memo component directly everywhere? It's shorter and it makes it easier to find the references in the IDE. * Use one hook to access APIs instead of two ([comment](elastic#202494 (comment))): > I see that for every API request we have to implement 2 separate hooks. Why don't we add error handling to the same hook that does the useQuery? so we have everything in one hook. Or is there a reason to have them separate?
## Summary These are the followup updated to address feedback from my previous PRs: * Make sure to use descriptive names specific to the `siem_migrations` subdomain ([comment](elastic#200978 (review))): > Make sure you use descriptive names specific to the siem_migrations subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way too generic and conflict with the rule management terminology, which would make code search more difficult. * Export the memo component directly everywhere ([comment](elastic#201597 (comment))): > Could we export the memo component directly everywhere? It's shorter and it makes it easier to find the references in the IDE. * Use one hook to access APIs instead of two ([comment](elastic#202494 (comment))): > I see that for every API request we have to implement 2 separate hooks. Why don't we add error handling to the same hook that does the useQuery? so we have everything in one hook. Or is there a reason to have them separate?
…elastic#11264) (elastic#201597) ## Summary [Internal link](elastic/security-team#10820) to the feature details With these changes we: * allow user to navigate to a specific migration by its id * handle different possible states on migrations rules page: * `no migrations`: if there are no existing migrations we will redirect user to the landing page * `unknown selected migration`: if unknown migration id is specified in the URL, then "Unknown Migration" page will be shown * `no selected migration`: if user lands on the root "SIEM migrations rules" page, then most recent migration will be shown * `show existing migration`: selected migration will be shown ### Screenshots **Unknown migration** <img width="1312" alt="Screenshot 2024-11-25 at 14 46 56" src="https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769"> **Show existing migration** <img width="1312" alt="Screenshot 2024-11-25 at 15 03 53" src="https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156">
## Summary These are the followup updated to address feedback from my previous PRs: * Make sure to use descriptive names specific to the `siem_migrations` subdomain ([comment](elastic#200978 (review))): > Make sure you use descriptive names specific to the siem_migrations subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way too generic and conflict with the rule management terminology, which would make code search more difficult. * Export the memo component directly everywhere ([comment](elastic#201597 (comment))): > Could we export the memo component directly everywhere? It's shorter and it makes it easier to find the references in the IDE. * Use one hook to access APIs instead of two ([comment](elastic#202494 (comment))): > I see that for every API request we have to implement 2 separate hooks. Why don't we add error handling to the same hook that does the useQuery? so we have everything in one hook. Or is there a reason to have them separate?
Summary
Internal link to the feature details
With these changes we:
no migrations
: if there are no existing migrations we will redirect user to the landing pageunknown selected migration
: if unknown migration id is specified in the URL, then "Unknown Migration" page will be shownno selected migration
: if user lands on the root "SIEM migrations rules" page, then most recent migration will be shownshow existing migration
: selected migration will be shownScreenshots
Unknown migration
Show existing migration