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
7 changes: 6 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
SimPhoNy Remote CHANGELOG
=========================

What's new in SimPhoNy Remote 0.9.0
What's new in SimPhoNy Remote 1.1.0
-----------------------------------

- Fix: incorrect user name in top header for admin Accounting panel (#348)

What's new in SimPhoNy Remote 0.9.0/1.0.0
-----------------------------------------

Summary
~~~~~~~

Expand Down
8 changes: 4 additions & 4 deletions remoteappmanager/handlers/admin/accounting_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ def get(self, id):
id = int(id)

db = self.application.db
user = db.get_user(id=id)
acc_user = db.get_user(id=id)

if user is None:
if acc_user is None:
raise web.HTTPError(404)

apps = db.get_apps_for_user(user)
apps = db.get_apps_for_user(acc_user)

info = [{"mapping_id": mapping_id,
"app": app,
Expand All @@ -25,5 +25,5 @@ def get(self, id):

self.render('admin/accounting.html',
info=info,
user=user,
acc_user=acc_user,
tab="users")
4 changes: 2 additions & 2 deletions remoteappmanager/templates/admin/accounting.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "admin/page.html" %}

{% block main_box_title %}User applications - {{ user.name }}{% endblock %}
{% block main_box_title %}User applications - {{ acc_user.name }}{% endblock %}
{% block main_box_body %}
<div class="pull-right">
<button class="btn btn-primary createnew"
Expand Down Expand Up @@ -33,7 +33,7 @@
{% endcall %}
{% call macros.modal_dlg('Create New Policy', btn_label='OK', btn_class="btn-primary", buttons_dismiss=false) %}
<form>
<input type="hidden" id="user_name" value="{{ user.name }}">
<input type="hidden" id="user_name" value="{{ acc_user.name }}">
<div class="form-group">
<label for="image_name">App image name</label>
<input type="text" class="form-control" id="image_name">
Expand Down
67 changes: 67 additions & 0 deletions selenium_tests/IDE/admin_check_name_in_header_bug_348.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="https://127.0.0.1:8000/" />
<title>admin_check_name_in_header_bug_348</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">admin_check_name_in_header_bug_348</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/hub/login</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=username_input</td>
<td>admin</td>
</tr>
<tr>
<td>type</td>
<td>id=password_input</td>
<td>admin</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=login_submit</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Users</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>xpath=(//a[contains(text(),'Show')])[2]</td>
<td></td>
</tr>
<tr>
<td>waitForText</td>
<td>css=span.hidden-xs</td>
<td>admin</td>
</tr>
<tr>
<td>click</td>
<td>css=span.hidden-xs</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=i.fa.fa-sign-out</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=password_input</td>
<td>admin</td>
</tr>

</tbody></table>
</body>
</html>
25 changes: 25 additions & 0 deletions selenium_tests/test_admin_name_header_bug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from selenium_tests.selenium_test_base import SeleniumTestBase


class TestAdminNameHeaderBug(SeleniumTestBase):
def test_admin_name_header_bug(self):
driver = self.driver
driver.get(self.base_url + "/hub/login")
driver.find_element_by_id("username_input").clear()
driver.find_element_by_id("username_input").send_keys("admin")
driver.find_element_by_id("password_input").clear()
driver.find_element_by_id("password_input").send_keys("admin")
driver.find_element_by_id("login_submit").click()
driver.find_element_by_link_text("Users").click()
driver.find_element_by_link_text("Show").click()
self.wait_for(lambda:
"admin" == driver.find_element_by_css_selector(
"span.hidden-xs").text
)
driver.find_element_by_css_selector("span.hidden-xs").click()
driver.find_element_by_css_selector("i.fa.fa-sign-out").click()
driver.find_element_by_id("password_input").clear()
driver.find_element_by_id("password_input").send_keys("admin")

if __name__ == "__main__":
unittest.main()