Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #369 from HospitalRun/remove-sub-nav
Browse files Browse the repository at this point in the history
Removed all the subActions (sub nav links) and updated styling to match
  • Loading branch information
Joel Glovier committed Mar 18, 2016
2 parents 66f5ba3 + 5f4d48f commit 6504ef3
Show file tree
Hide file tree
Showing 16 changed files with 7 additions and 106 deletions.
20 changes: 0 additions & 20 deletions app/admin/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,6 @@ export default AbstractModuleRoute.extend({
allowSearch: false,
moduleName: 'admin',
sectionTitle: 'Admin',
subActions: function() {
var options = [{
text: this.get('i18n').t('admin.address_options'),
linkTo: 'admin.address'
}, {
text: this.get('i18n').t('admin.lookup_lists'),
linkTo: 'admin.lookup'
}];
if (this.currentUserCan('load_db')) {
options.push({
text: this.get('i18n').t('admin.load_db'),
linkTo: 'admin.loaddb'
});
}
options.push({
text: this.get('i18n').t('admin.users'),
linkTo: 'users.index'
});
return options;
}.property(),

editPath: function() {
return 'users.edit';
Expand Down
11 changes: 0 additions & 11 deletions app/appointments/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,5 @@ export default AbstractModuleRoute.extend(UserSession, {
}, {
name: 'visitTypesList',
findArgs: ['lookup', 'visit_types']
}],

subActions: [{
text: 'This Week',
linkTo: 'appointments.index'
}, {
text: 'Today',
linkTo: 'appointments.today'
}, {
text: 'Search',
linkTo: 'appointments.search'
}]
});
15 changes: 1 addition & 14 deletions app/imaging/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,5 @@ export default AbstractModuleRoute.extend({
allowSearch: false,
moduleName: 'imaging',
newButtonText: t('imaging.buttons.new_button'),
sectionTitle: t('imaging.section_title'),
subActions: function() {
let i18n = this.get('i18n');

return [{
text: i18n.t('labels.requests'),
linkTo: 'imaging.index'
}, {
text: i18n.t('labels.completed'),
linkTo: 'imaging.completed'
}];

}.property()

sectionTitle: t('imaging.section_title')
});
10 changes: 0 additions & 10 deletions app/inventory/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ export default AbstractModuleRoute.extend(FulfillRequest, InventoryId, Inventory
moduleName: 'inventory',

newButtonText: '+ new request',
subActions: [{
text: 'Requests',
linkTo: 'inventory.index'
}, {
text: 'Items',
linkTo: 'inventory.listing'
}, {
text: 'Reports',
linkTo: 'inventory.reports'
}],
sectionTitle: 'Inventory',

actions: {
Expand Down
9 changes: 1 addition & 8 deletions app/labs/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,5 @@ export default AbstractModuleRoute.extend({
allowSearch: false,
moduleName: 'labs',
newButtonText: '+ new lab',
sectionTitle: 'Labs',
subActions: [{
text: 'Requests',
linkTo: 'labs.index'
}, {
text: 'Completed',
linkTo: 'labs.completed'
}]
sectionTitle: 'Labs'
});
11 changes: 0 additions & 11 deletions app/medication/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ export default AbstractModuleRoute.extend({
findArgs: ['lookup', 'warehouse_list']
}],

subActions: function() {
let i18n = this.get('i18n');
return [{
text: i18n.t('labels.requests'),
linkTo: 'medication.index'
}, {
text: i18n.t('labels.completed'),
linkTo: 'medication.completed'
}];
}.property(),

actions: {
dispenseMedication: function() {
if (this.currentUserCan('fulfill_medication')) {
Expand Down
13 changes: 1 addition & 12 deletions app/patients/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ export default AbstractModuleRoute.extend(PatientId, {
}.bind(this));
}
},
moduleName: 'patients',
newButtonText: '+ new patient',
sectionTitle: 'Patients',
subActions: [{
text: 'Patient listing',
linkTo: 'patients.index'
}, {
text: 'Admitted patients',
linkTo: 'patients.admitted'
}, {
text: 'Reports',
linkTo: 'patients.reports'
}]
moduleName: 'patients'
});
2 changes: 0 additions & 2 deletions app/styles/_bootstrap-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@
padding: 0;
color: $navy;
}

.panel-body { padding-top: 0; }
}
}

Expand Down
1 change: 1 addition & 0 deletions app/styles/_variables_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ $view_sub_nav: #6784a2;
font-size: 28px;
line-height: 55px;
margin: 0;
float: left;
}

// layout
Expand Down
6 changes: 2 additions & 4 deletions app/templates/section.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

<div class="view-top-bar">
<h1 class="view-current-title">{{currentScreenTitle}}</h1>
</div>

<div class="view-sub-bar">

<div class="view-action-buttons">
{{#if newButtonAction}}
<button class="btn btn-primary" {{action newButtonAction}}>{{newButtonText}}</button>
Expand All @@ -20,7 +16,9 @@
{{/each}}
{{/if}}
</div>
</div>

<div class="view-sub-bar">
<ul class="nav nav-pills view-sub-nav">
{{#each subActions as |subAction|}}
{{#if subAction.statusQuery}}
Expand Down
3 changes: 0 additions & 3 deletions tests/acceptance/appointments-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ test('visiting /appointments', function(assert) {
visit('/appointments');
andThen(function() {
assert.equal(currentURL(), '/appointments');
findWithAssert('a:contains(This Week)');
findWithAssert('a:contains(Today)');
findWithAssert('a:contains(Search)');
findWithAssert('button:contains(new appointment)');
findWithAssert('.table-header');
});
Expand Down
2 changes: 0 additions & 2 deletions tests/acceptance/imaging-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ test('visiting /imaging', function(assert) {

andThen(() => {
assert.equal(currentURL(), '/imaging');
assert.equal(find('li a:contains(Requests)').length, 1, 'Requests link is visible');
assert.equal(find('li a:contains(Completed)').length, 1, 'Completed link is visible');
let newImagingButton = find('button:contains(new imaging)');
assert.equal(newImagingButton.length, 1, 'New Imaging button is visible');
findWithAssert('p:contains(No items found. )');
Expand Down
4 changes: 1 addition & 3 deletions tests/acceptance/inventory-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ test('visiting /inventory', function(assert) {

andThen(function() {
assert.equal(currentURL(), '/inventory');
findWithAssert('li a:contains(Requests)');
findWithAssert('li a:contains(Items)');
findWithAssert('li a:contains(Reports)');
findWithAssert('button:contains(new request)');
findWithAssert('button:contains(inventory received)');
findWithAssert('p:contains(No requests found. )');
findWithAssert('a:contains(Create a new request?)');
});
Expand Down
2 changes: 0 additions & 2 deletions tests/acceptance/labs-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ test('visiting /labs', function(assert) {

andThen(function() {
assert.equal(currentURL(), '/labs');
findWithAssert('a:contains(Requests)');
findWithAssert('a:contains(Completed)');
findWithAssert('a:contains(Create a new record?)');
findWithAssert('button:contains(new lab)');
});
Expand Down
2 changes: 0 additions & 2 deletions tests/acceptance/medication-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ test('visiting /medication', function(assert) {

andThen(function() {
assert.equal(currentURL(), '/medication');
assert.equal(find('li a:contains(Requests)').length, 1, 'Requests link is visible');
assert.equal(find('li a:contains(Completed)').length, 1, 'Completed link is visible');
findWithAssert('button:contains(new request)');
findWithAssert('button:contains(dispense medication)');
findWithAssert('button:contains(return medication)');
Expand Down
2 changes: 0 additions & 2 deletions tests/acceptance/patients-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ test('visiting /patients route', function(assert) {
assert.equal(noPatientsFound.text().trim(), 'No patients found. Create a new patient record?', 'no records found');
const newPatientButton = find('button:contains(+ new patient)');
assert.equal(newPatientButton.length, 1, 'Add new patient button is visible');
assert.equal(find('.nav-pills li:contains(Patient listing)').length, 1, 'Patient listing link is visible');
assert.equal(find('.nav-pills li:contains(Reports)').length, 1, 'Reports link is visible');
});
click('button:contains(+ new patient)');
andThen(function() {
Expand Down

0 comments on commit 6504ef3

Please sign in to comment.