Skip to content

Commit

Permalink
[Site] add import maps button and more query string (opensearch-proje…
Browse files Browse the repository at this point in the history
…ct#291)

Enables access to easily see the import custom maps.
Also added more query strings to easily set and build a link to
the test results page to be easily copied and shared.

Issue:
n/a

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
  • Loading branch information
kavilla authored Sep 28, 2022
1 parent e46486b commit 5605261
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
<div id="testResultsLinksDiv">
<h2>Useful Links:</h2>
<ul>
<li>
Link to this page: <a id="resultPageLink"></a>
</li>
<li>
<a id="testResultLink"></a>
</li>
Expand All @@ -130,6 +133,9 @@ <h2>Plugins:</h2>
<button id="anomalyDetectionDashboardsButton" onclick="getPluginLinks('anomaly-detection-dashboards-plugin')">
anomalyDetectionDashboards
</button>
<button id="customImportMapDashboardsButton" onclick="getPluginLinks('custom-import-map-dashboards')">
customImportMapDashboards
</button>
<button id="ganttChartDashboardsButton" onclick="getPluginLinks('gantt-chart-dashboards')">
ganttChartDashboards
</button>
Expand Down
32 changes: 32 additions & 0 deletions site/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const defaults = {
buildNumber: '3958',
testNumber: '1',
testJobName: 'integ-test-opensearch-dashboards',
platform: 'linux',
arch: 'x64',
type: 'tar',
};

const plugins = {
Expand Down Expand Up @@ -37,6 +40,12 @@ const plugins = {
],
},
},
'custom-import-map-dashboards': {
name: 'customImportMapDashboards',
default: {
videos: ['import_vector_map_tab.spec.js'],
},
},
'gantt-chart-dashboards': {
name: 'ganttChartDashboards',
default: { videos: ['gantt_ui.spec.js'] },
Expand Down Expand Up @@ -131,6 +140,20 @@ function getTestResults() {
document.getElementById('testResultsLinksDiv').style.display = 'block';

document.getElementById('securityDashboardsButton').hidden = !securityEnabled;

const resultPageUrl =
'https://opensearch-project.github.io/opensearch-dashboards-functional-test/site/?' +
`version=${version}&` +
`build_number=${buildNumber}&` +
`test_number=${testNumber}&` +
`platform=${platform}&` +
`arch=${arch}&` +
`type=${type}`;

var resultPageLink = document.getElementById('resultPageLink');
resultPageLink.textContent = resultPageUrl;
resultPageLink.href = resultPageUrl;

var testResultsLink = document.getElementById('testResultLink');
testResultsLink.textContent = testResultsUrl;
testResultsLink.href = testResultsUrl;
Expand Down Expand Up @@ -279,4 +302,13 @@ function setDefaultValues() {
document.getElementById('testNumber').value = params.get('test_number')
? params.get('test_number')
: defaults.testNumber;
document.getElementById('platform').value = params.get('platform')
? params.get('platform')
: defaults.platform;
document.getElementById('arch').value = params.get('arch')
? params.get('arch')
: defaults.arch;
document.getElementById('type').value = params.get('type')
? params.get('type')
: defaults.type;
}

0 comments on commit 5605261

Please sign in to comment.