-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '4.9.0' of https://github.com/wazuh/wazuh-kibana-app int…
…o bug/6867-flyout-of-the-inventory-tab-of-the-fim-module-the-bottom-of-the-dropdown-shows-a-different-grey-than-the-background
- Loading branch information
Showing
7 changed files
with
239 additions
and
195 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
## Link component | ||
|
||
To make the redirections we have to see if it is in the same application or in another application, depending on that it is necessary to make a type of redirection or another | ||
So this component was created to simplify the implementation and to be able to control everything in one place. | ||
|
||
The component needs as props the `appId` to go to and the `path` to navigate to. The component itself will know in which application it is located in order to display its respective link. | ||
|
||
#### Same application | ||
|
||
In this case we have to navigate with the React Router because the application does not recognise that we are navigating and does not navigate using the Opensearch Dashboard navigation. | ||
|
||
```tsx | ||
<EuiLink | ||
{...otherProps} | ||
onClick={() => { | ||
NavigationService.getInstance().navigate(path); | ||
}} | ||
> | ||
{children} | ||
</EuiLink> | ||
``` | ||
|
||
#### Diferent application | ||
|
||
When navigating between applications you can use Opensearch Dashboard navigation and have the path you are going to navigate to when you are over the link. | ||
|
||
```tsx | ||
<RedirectAppLinks application={getCore().application}> | ||
<EuiLink | ||
{...otherProps} | ||
href={NavigationService.getInstance().getUrlForApp(appId, { | ||
path: `#${path}`, | ||
})} | ||
> | ||
{children} | ||
</EuiLink> | ||
</RedirectAppLinks> | ||
``` | ||
|
||
### Implementation | ||
|
||
```tsx | ||
<WzLink | ||
appId={<Application-to-go-to>} | ||
path={<Path-to-navigate-to>} | ||
otherPropsForTheEuiLink | ||
> | ||
whatever you want to render in the link | ||
</WzLink> | ||
``` |
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.