-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bumping up the opensearch dashboards versions Signed-off-by: Riya Saxena <[email protected]> * manual backport MDS support Signed-off-by: Riya Saxena <[email protected]> * fixed email tests due to a merge conflict in backport Signed-off-by: Riya Saxena <[email protected]> * fixed email tests due to a merge conflict in backport Signed-off-by: Riya Saxena <[email protected]> --------- Signed-off-by: Riya Saxena <[email protected]> Signed-off-by: Riya <[email protected]>
- Loading branch information
1 parent
dada2bf
commit 0954519
Showing
32 changed files
with
1,304 additions
and
756 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
export class MDSEnabledClientService { | ||
static getClient(request, context, dataSourceEnabled) { | ||
const { dataSourceId = "" } = (request.query || {}) as { dataSourceId?: string }; | ||
if (dataSourceEnabled && dataSourceId && dataSourceId.trim().length != 0) { | ||
return context.dataSource.opensearch.legacy.getClient(dataSourceId.toString()).callAPI; | ||
} else { | ||
// fall back to default local cluster | ||
return context.notificationsContext.notificationsClient.asScoped( | ||
request, | ||
).callAsCurrentUser; | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -34,4 +34,4 @@ | |
"tough-cookie": "^4.1.3", | ||
"@cypress/request": "^3.0.0" | ||
} | ||
} | ||
} |
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
34 changes: 34 additions & 0 deletions
34
public/components/MDSEnabledComponent/MDSEnabledComponent.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,34 @@ | ||
import React, { useContext, useEffect } from "react"; | ||
import { DataSourceMenuContext, DataSourceMenuProperties } from "../../services/DataSourceMenuContext"; | ||
import { useHistory } from "react-router"; | ||
import queryString from "query-string"; | ||
import { MainContext } from '../../pages/Main/Main'; | ||
|
||
export default class MDSEnabledComponent< | ||
Props extends DataSourceMenuProperties, | ||
State extends DataSourceMenuProperties | ||
> extends React.Component<Props, State> { | ||
constructor(props: Props) { | ||
super(props); | ||
this.state = { | ||
dataSourceId: props.dataSourceId, | ||
multiDataSourceEnabled: props.multiDataSourceEnabled, | ||
} as State; | ||
} | ||
} | ||
|
||
export function isDataSourceChanged(prevProps, currentProps) { | ||
if ( | ||
prevProps.notificationService?.multiDataSourceEnabled && | ||
currentProps.notificationService?.multiDataSourceEnabled | ||
) { | ||
const prevDataSourceId = prevProps.notificationService.dataSourceId; | ||
const currDataSourceId = currentProps.notificationService.dataSourceId; | ||
if (!_.isEqual(prevDataSourceId, currDataSourceId)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
|
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
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
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 |
---|---|---|
|
@@ -530,3 +530,4 @@ export function CreateChannel(props: CreateChannelsProps) { | |
</> | ||
); | ||
} | ||
|
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.