Skip to content

Commit

Permalink
dashboard: update keyboard shortcuts scripts
Browse files Browse the repository at this point in the history
add a new script to info view in order to keep shortcuts
working and switch boot option to test view.

Signed-off-by: Alexandra Pereira <[email protected]>
  • Loading branch information
Alexandra Pereira authored and gctucker committed Jun 14, 2021
1 parent d65936d commit 0b419ed
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/dashboard/static/js/app/utils/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ define([
}

function setHotKeys() {
var goToBoot,
goToBuild,
var goToBuild,
goToCompare,
goToHome,
goToInfo,
goToJob,
goToSoc,
goToTest,
selectSearch,
selectTableLength,
showHelp;
Expand All @@ -78,8 +78,8 @@ define([
window.location = document.getElementById('build-l').href;
};

goToBoot = function() {
window.location = document.getElementById('boot-l').href;
goToTest = function() {
window.location = document.getElementById('tests-l').href;
};

goToSoc = function() {
Expand Down Expand Up @@ -114,7 +114,7 @@ define([
$.mapHotKeys.createSequence('g', 'o', $(document), goToHome),
$.mapHotKeys.createSequence('g', 'j', $(document), goToJob),
$.mapHotKeys.createSequence('g', 'b', $(document), goToBuild),
$.mapHotKeys.createSequence('g', 't', $(document), goToBoot),
$.mapHotKeys.createSequence('g', 't', $(document), goToTest),
$.mapHotKeys.createSequence('g', 's', $(document), goToSoc),
$.mapHotKeys.createSequence('g', 'c', $(document), goToCompare),
$.mapHotKeys.createSequence('g', 'i', $(document), goToInfo)
Expand Down
3 changes: 3 additions & 0 deletions app/dashboard/static/js/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
'app/view-builds-job-kernel-defconfig': 'app/view-builds-job-kernel-defconfig.2017.3.3',
'app/view-builds-job-kernel-defconfig-logs': 'app/view-builds-job-kernel-defconfig-logs.2020.6',
'app/view-index': 'app/view-index.2017.3.3',
'app/view-info': 'app/view-info.2021.03',
'app/view-jobs-all': 'app/view-jobs-all.2020.10',
'app/view-jobs-job': 'app/view-jobs-job.2020.10',
'app/view-jobs-job-branch': 'app/view-jobs-job-branch.2020.10',
Expand Down Expand Up @@ -102,6 +103,7 @@
{name: 'app/view-builds-job-kernel-defconfig-logs.2020.6'},
{name: 'app/view-builds-job-kernel-defconfig.2017.3.3'},
{name: 'app/view-index.2017.3.3'},
{name: 'app/view-info.2021.03'},
{name: 'app/view-jobs-all.2020.10'},
{name: 'app/view-jobs-job-branch.2020.10'},
{name: 'app/view-jobs-job.2020.10'},
Expand All @@ -121,6 +123,7 @@
{name: 'kci-builds-job-kernel-defconfig'},
{name: 'kci-builds-job-kernel-defconfig-logs'},
{name: 'kci-index'},
{name: 'kci-info'},
{name: 'kci-jobs-all'},
{name: 'kci-jobs-job'},
{name: 'kci-jobs-job-branch'},
Expand Down
1 change: 1 addition & 0 deletions app/dashboard/static/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ require.config({
'app/view-builds-job-kernel-defconfig': 'app/view-builds-job-kernel-defconfig.2017.3.3',
'app/view-builds-job-kernel-defconfig-logs': 'app/view-builds-job-kernel-defconfig-logs.2020.6',
'app/view-index': 'app/view-index.2017.3.3',
'app/view-info': 'app/view-info.2021.03',
'app/view-jobs-all': 'app/view-jobs-all.2020.10',
'app/view-jobs-job': 'app/view-jobs-job.2020.10',
'app/view-jobs-job-branch': 'app/view-jobs-job-branch.2020.10',
Expand Down
24 changes: 24 additions & 0 deletions app/dashboard/static/js/kci-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*!
* kernelci dashboard.
*
* Copyright (C) 2014, 2015, 2016, 2017 Linaro Ltd.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

require(['common'], function() {
'use strict';
require(['app/view-info']);
});
3 changes: 3 additions & 0 deletions app/dashboard/templates/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ <h4>Keyboard shortcuts</h4>
</p>
</div>
{% endblock %}
{%- block scripts %}
<script data-main="/static/js/kci-info" src="/static/js/lib/require.js"></script>
{%- endblock %}

0 comments on commit 0b419ed

Please sign in to comment.