forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to not use EMS so it works out of the box. Related to: opensearch-project#221 Fails linter and should problem write more unit tests but working with smoke tests. Signed-off-by: Kawika Avilla <[email protected]>
- Loading branch information
Showing
10 changed files
with
220 additions
and
31 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
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
35 changes: 35 additions & 0 deletions
35
src/plugins/maps_legacy/public/common/opensearch_maps_client.js
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,35 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
import { EMSClient } from '@elastic/ems-client'; | ||
|
||
export class OpenSearchMapsClient extends EMSClient { | ||
constructor({ kbnVersion, manifestServiceUrl, language, landingPageUrl, fetchFunction }) { | ||
super({ kbnVersion, manifestServiceUrl, language, landingPageUrl, fetchFunction }); | ||
this._queryParams = { | ||
kbn_version: kbnVersion, | ||
opensearch_tos_agree: true, | ||
}; | ||
this._manifestServiceUrl = manifestServiceUrl; | ||
} | ||
|
||
async isEnabled() { | ||
let result; | ||
try { | ||
result = await this._fetchWithTimeout(this._manifestServiceUrl); | ||
} catch (e) { | ||
// silently ignoring the exception and returning false. | ||
return false; | ||
} | ||
if (result.ok) { | ||
const resultJson = await result.json(); | ||
return resultJson.enabled; | ||
} | ||
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