Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions remoteappmanager/static/js/home/views/application_list_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,17 @@ define([
var ApplicationListView = Vue.extend({
template:
'<section class="sidebar">' +

'<!-- Search form -->' +
'<form action="#" method="get" class="sidebar-form">' +
' <div class="input-group">' +
' <input type="text" name="q" class="form-control" placeholder="Search...">' +
' <span class="input-group-btn">' +
' <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>' +
' </button>' +
' </span>' +
' </div>' +
'<form action="#" class="sidebar-form">' +
' <input type="text" name="q" class="form-control" placeholder="Search..." v-model="search_input">' +
'</form>' +

'<!-- Sidebar Menu -->' +
'<ul id="applistentries" class="sidebar-menu">' +
'<ul class="sidebar-menu">' +
' <li class="header">APPLICATIONS</li>' +
'</ul>' +

'<ul id="applistentries" class="sidebar-menu">' +
' <li v-show="!model.loading && model.app_list.length === 0">' +
' <a href="#">No applications found</a>' +
' </li>' +
Expand All @@ -35,7 +30,7 @@ define([
' </li>' +

' <!-- Application list -->' +
' <li v-for="(app, index) in model.app_list"' +
' <li v-for="(app, index) in visible_list"' +
' :class="{ active: index === model.selected_index }"' +
' @click="model.selected_index = index; $(\'iframe\').focus();">' +

Expand All @@ -51,14 +46,26 @@ define([
' :disabled="app.is_stopping()">' +
' <i class="fa fa-times"></i>' +
' </button>' +

' <span>{{ app.app_data.image | app_name }}</span>' +
' </a>' +
' </li>' +
'</ul>' +
'<!-- /.sidebar-menu -->' +
'</section>' +
'<!-- /.sidebar -->'
'<!-- /.sidebar -->',

data: function() {
return { 'search_input': '' };
},

computed: {
visible_list: function() {
return this.model.app_list.filter(function(app) {
var app_name = this.$options.filters.app_name(app.app_data.image).toLowerCase();
return app_name.includes(this.search_input.toLowerCase());
}.bind(this));
}
}
});

return {
Expand Down
23 changes: 23 additions & 0 deletions selenium_tests/test_hide_application.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
from selenium_tests.selenium_test_base import SeleniumTestBase


class TestHideApplication(SeleniumTestBase):
def test_hide_application(self):
driver = self.driver
with self.login():
self.wait_for(
lambda:
driver.find_element_by_css_selector(
"#applistentries > li > a > span").text != "Loading")

# Click on the search box
search_box = driver.find_element_by_name("q")
search_box.clear()
search_box.send_keys('foobarheho')

self.wait_for(
lambda:
driver.find_element_by_css_selector(
"#applistentries > li").value_of_css_property(
'display') == "none")