Some code cleanup.

This commit is contained in:
James Cole 2017-07-08 06:28:44 +02:00
parent de9728895e
commit 5ef2067836
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
53 changed files with 597 additions and 449 deletions

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<browserconfig> <browserconfig>
<msapplication> <msapplication>
<tile> <tile>
<square150x150logo src="/mstile-150x150.png"/> <square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor> <TileColor>#da532c</TileColor>
</tile> </tile>
</msapplication> </msapplication>
</browserconfig> </browserconfig>

View File

@ -43,20 +43,20 @@ table.sortable span.arrow, span.reversed, th.arrow.down:after, th.reversedarrow.
margin-top: -2px; margin-top: -2px;
} }
table.sortable span.arrow.up, th.arrow.up:after { table.sortable span.arrow.up, th.arrow.up:after {
border-color: transparent transparent #ccc transparent; border-color: transparent transparent #ccc transparent;
margin-top: -7px; margin-top: -7px;
} }
table.sortable span.reversed, th.reversedarrow.down:after { table.sortable span.reversed, th.reversedarrow.down:after {
border-color: transparent transparent #ccc transparent; border-color: transparent transparent #ccc transparent;
margin-top: -7px; margin-top: -7px;
} }
table.sortable span.reversed.up, th.reversedarrow.up:after { table.sortable span.reversed.up, th.reversedarrow.up:after {
border-color: #ccc transparent transparent transparent; border-color: #ccc transparent transparent transparent;
margin-top: -2px; margin-top: -2px;
} }
table.sortable span.az:before, th.az.down:after { table.sortable span.az:before, th.az.down:after {
content: "a .. z"; content: "a .. z";
@ -94,17 +94,17 @@ table.sortable span.month.up:before, th.month.up:after {
content: "dec .. jan"; content: "dec .. jan";
} }
table.sortable>thead th:not([data-defaultsort=disabled]) { table.sortable > thead th:not([data-defaultsort=disabled]) {
cursor: pointer; cursor: pointer;
position: relative; position: relative;
top: 0; top: 0;
left: 0; left: 0;
} }
table.sortable>thead th:hover:not([data-defaultsort=disabled]) { table.sortable > thead th:hover:not([data-defaultsort=disabled]) {
background: #efefef; background: #efefef;
} }
table.sortable>thead th div.mozilla { table.sortable > thead th div.mozilla {
position: relative; position: relative;
} }

View File

@ -4,57 +4,67 @@
*/ */
.bootstrap-tagsinput { .bootstrap-tagsinput {
background-color: #fff; background-color: #fff;
border: 1px solid #ccc; border: 1px solid #ccc;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
display: inline-block; display: inline-block;
padding: 4px 6px; padding: 4px 6px;
color: #555; color: #555;
vertical-align: middle; vertical-align: middle;
border-radius: 4px; border-radius: 4px;
max-width: 100%; max-width: 100%;
line-height: 22px; line-height: 22px;
cursor: text; cursor: text;
} }
.bootstrap-tagsinput input { .bootstrap-tagsinput input {
border: none; border: none;
box-shadow: none; box-shadow: none;
outline: none; outline: none;
background-color: transparent; background-color: transparent;
padding: 0 6px; padding: 0 6px;
margin: 0; margin: 0;
width: auto; width: auto;
max-width: inherit; max-width: inherit;
} }
.bootstrap-tagsinput.form-control input::-moz-placeholder { .bootstrap-tagsinput.form-control input::-moz-placeholder {
color: #777; color: #777;
opacity: 1; opacity: 1;
} }
.bootstrap-tagsinput.form-control input:-ms-input-placeholder { .bootstrap-tagsinput.form-control input:-ms-input-placeholder {
color: #777; color: #777;
} }
.bootstrap-tagsinput.form-control input::-webkit-input-placeholder { .bootstrap-tagsinput.form-control input::-webkit-input-placeholder {
color: #777; color: #777;
} }
.bootstrap-tagsinput input:focus { .bootstrap-tagsinput input:focus {
border: none; border: none;
box-shadow: none; box-shadow: none;
} }
.bootstrap-tagsinput .tag { .bootstrap-tagsinput .tag {
margin-right: 2px; margin-right: 2px;
color: white; color: white;
} }
.bootstrap-tagsinput .tag [data-role="remove"] { .bootstrap-tagsinput .tag [data-role="remove"] {
margin-left: 8px; margin-left: 8px;
cursor: pointer; cursor: pointer;
} }
.bootstrap-tagsinput .tag [data-role="remove"]:after { .bootstrap-tagsinput .tag [data-role="remove"]:after {
content: "x"; content: "x";
padding: 0px 2px; padding: 0px 2px;
} }
.bootstrap-tagsinput .tag [data-role="remove"]:hover { .bootstrap-tagsinput .tag [data-role="remove"]:hover {
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
} }
.bootstrap-tagsinput .tag [data-role="remove"]:hover:active { .bootstrap-tagsinput .tag [data-role="remove"]:hover:active {
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
} }

View File

@ -1,141 +1,213 @@
.daterangepicker { .daterangepicker {
position: absolute; position: absolute;
color: inherit; color: inherit;
background: #fff; background: #fff;
border-radius: 4px; border-radius: 4px;
width: 278px; width: 278px;
padding: 4px; padding: 4px;
margin-top: 1px; margin-top: 1px;
top: 100px; top: 100px;
left: 20px; left: 20px;
/* Calendars */ } /* Calendars */
.daterangepicker:before, .daterangepicker:after { }
.daterangepicker:before, .daterangepicker:after {
position: absolute; position: absolute;
display: inline-block; display: inline-block;
border-bottom-color: rgba(0, 0, 0, 0.2); border-bottom-color: rgba(0, 0, 0, 0.2);
content: ''; } content: '';
.daterangepicker:before { }
.daterangepicker:before {
top: -7px; top: -7px;
border-right: 7px solid transparent; border-right: 7px solid transparent;
border-left: 7px solid transparent; border-left: 7px solid transparent;
border-bottom: 7px solid #ccc; } border-bottom: 7px solid #ccc;
.daterangepicker:after { }
.daterangepicker:after {
top: -6px; top: -6px;
border-right: 6px solid transparent; border-right: 6px solid transparent;
border-bottom: 6px solid #fff; border-bottom: 6px solid #fff;
border-left: 6px solid transparent; } border-left: 6px solid transparent;
.daterangepicker.opensleft:before { }
right: 9px; }
.daterangepicker.opensleft:after { .daterangepicker.opensleft:before {
right: 10px; } right: 9px;
.daterangepicker.openscenter:before { }
.daterangepicker.opensleft:after {
right: 10px;
}
.daterangepicker.openscenter:before {
left: 0; left: 0;
right: 0; right: 0;
width: 0; width: 0;
margin-left: auto; margin-left: auto;
margin-right: auto; } margin-right: auto;
.daterangepicker.openscenter:after { }
.daterangepicker.openscenter:after {
left: 0; left: 0;
right: 0; right: 0;
width: 0; width: 0;
margin-left: auto; margin-left: auto;
margin-right: auto; } margin-right: auto;
.daterangepicker.opensright:before { }
left: 9px; }
.daterangepicker.opensright:after { .daterangepicker.opensright:before {
left: 10px; } left: 9px;
.daterangepicker.dropup { }
margin-top: -5px; }
.daterangepicker.dropup:before { .daterangepicker.opensright:after {
top: initial; left: 10px;
bottom: -7px; }
border-bottom: initial;
border-top: 7px solid #ccc; } .daterangepicker.dropup {
.daterangepicker.dropup:after { margin-top: -5px;
top: initial; }
bottom: -6px;
border-bottom: initial; .daterangepicker.dropup:before {
border-top: 6px solid #fff; } top: initial;
.daterangepicker.dropdown-menu { bottom: -7px;
border-bottom: initial;
border-top: 7px solid #ccc;
}
.daterangepicker.dropup:after {
top: initial;
bottom: -6px;
border-bottom: initial;
border-top: 6px solid #fff;
}
.daterangepicker.dropdown-menu {
max-width: none; max-width: none;
z-index: 3001; } z-index: 3001;
.daterangepicker.single .ranges, .daterangepicker.single .calendar { }
float: none; }
.daterangepicker.show-calendar .calendar { .daterangepicker.single .ranges, .daterangepicker.single .calendar {
display: block; } float: none;
.daterangepicker .calendar { }
.daterangepicker.show-calendar .calendar {
display: block;
}
.daterangepicker .calendar {
display: none; display: none;
max-width: 270px; max-width: 270px;
margin: 4px; } margin: 4px;
.daterangepicker .calendar.single .calendar-table { }
border: none; }
.daterangepicker .calendar th, .daterangepicker .calendar td { .daterangepicker .calendar.single .calendar-table {
white-space: nowrap; border: none;
text-align: center; }
min-width: 32px; }
.daterangepicker .calendar-table { .daterangepicker .calendar th, .daterangepicker .calendar td {
white-space: nowrap;
text-align: center;
min-width: 32px;
}
.daterangepicker .calendar-table {
border: 1px solid #fff; border: 1px solid #fff;
padding: 4px; padding: 4px;
border-radius: 4px; border-radius: 4px;
background: #fff; } background: #fff;
.daterangepicker table { }
.daterangepicker table {
width: 100%; width: 100%;
margin: 0; } margin: 0;
.daterangepicker td, .daterangepicker th { }
.daterangepicker td, .daterangepicker th {
text-align: center; text-align: center;
width: 20px; width: 20px;
height: 20px; height: 20px;
border-radius: 4px; border-radius: 4px;
border: 1px solid transparent; border: 1px solid transparent;
white-space: nowrap; white-space: nowrap;
cursor: pointer; } cursor: pointer;
.daterangepicker td.available:hover, .daterangepicker th.available:hover { }
background-color: #eee;
border-color: transparent; .daterangepicker td.available:hover, .daterangepicker th.available:hover {
color: inherit; } background-color: #eee;
.daterangepicker td.week, .daterangepicker th.week { border-color: transparent;
font-size: 80%; color: inherit;
color: #ccc; } }
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
.daterangepicker td.week, .daterangepicker th.week {
font-size: 80%;
color: #ccc;
}
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
background-color: #fff; background-color: #fff;
border-color: transparent; border-color: transparent;
color: #999; } color: #999;
.daterangepicker td.in-range { }
.daterangepicker td.in-range {
background-color: #ebf4f8; background-color: #ebf4f8;
border-color: transparent; border-color: transparent;
color: #000; color: #000;
border-radius: 0; } border-radius: 0;
.daterangepicker td.start-date { }
border-radius: 4px 0 0 4px; }
.daterangepicker td.end-date { .daterangepicker td.start-date {
border-radius: 0 4px 4px 0; } border-radius: 4px 0 0 4px;
.daterangepicker td.start-date.end-date { }
border-radius: 4px; }
.daterangepicker td.active, .daterangepicker td.active:hover { .daterangepicker td.end-date {
border-radius: 0 4px 4px 0;
}
.daterangepicker td.start-date.end-date {
border-radius: 4px;
}
.daterangepicker td.active, .daterangepicker td.active:hover {
background-color: #357ebd; background-color: #357ebd;
border-color: transparent; border-color: transparent;
color: #fff; } color: #fff;
.daterangepicker th.month { }
width: auto; }
.daterangepicker td.disabled, .daterangepicker option.disabled { .daterangepicker th.month {
width: auto;
}
.daterangepicker td.disabled, .daterangepicker option.disabled {
color: #999; color: #999;
cursor: not-allowed; cursor: not-allowed;
text-decoration: line-through; } text-decoration: line-through;
.daterangepicker select.monthselect, .daterangepicker select.yearselect { }
.daterangepicker select.monthselect, .daterangepicker select.yearselect {
font-size: 12px; font-size: 12px;
padding: 1px; padding: 1px;
height: auto; height: auto;
margin: 0; margin: 0;
cursor: default; } cursor: default;
.daterangepicker select.monthselect { }
.daterangepicker select.monthselect {
margin-right: 2%; margin-right: 2%;
width: 56%; } width: 56%;
.daterangepicker select.yearselect { }
width: 40%; }
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect { .daterangepicker select.yearselect {
width: 40%;
}
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
width: 50px; width: 50px;
margin-bottom: 0; } margin-bottom: 0;
.daterangepicker .input-mini { }
.daterangepicker .input-mini {
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 4px; border-radius: 4px;
color: #555; color: #555;
@ -145,43 +217,62 @@
vertical-align: middle; vertical-align: middle;
margin: 0 0 5px 0; margin: 0 0 5px 0;
padding: 0 6px 0 28px; padding: 0 6px 0 28px;
width: 100%; } width: 100%;
.daterangepicker .input-mini.active { }
border: 1px solid #08c;
border-radius: 4px; } .daterangepicker .input-mini.active {
.daterangepicker .daterangepicker_input { border: 1px solid #08c;
position: relative; } border-radius: 4px;
.daterangepicker .daterangepicker_input i { }
position: absolute;
left: 8px; .daterangepicker .daterangepicker_input {
top: 8px; } position: relative;
.daterangepicker.rtl .input-mini { }
.daterangepicker .daterangepicker_input i {
position: absolute;
left: 8px;
top: 8px;
}
.daterangepicker.rtl .input-mini {
padding-right: 28px; padding-right: 28px;
padding-left: 6px; } padding-left: 6px;
.daterangepicker.rtl .daterangepicker_input i { }
.daterangepicker.rtl .daterangepicker_input i {
left: auto; left: auto;
right: 8px; } right: 8px;
.daterangepicker .calendar-time { }
.daterangepicker .calendar-time {
text-align: center; text-align: center;
margin: 5px auto; margin: 5px auto;
line-height: 30px; line-height: 30px;
position: relative; position: relative;
padding-left: 28px; } padding-left: 28px;
.daterangepicker .calendar-time select.disabled { }
color: #ccc;
cursor: not-allowed; } .daterangepicker .calendar-time select.disabled {
color: #ccc;
cursor: not-allowed;
}
.ranges { .ranges {
font-size: 11px; font-size: 11px;
float: none; float: none;
margin: 4px; margin: 4px;
text-align: left; } text-align: left;
.ranges ul { }
.ranges ul {
list-style: none; list-style: none;
margin: 0 auto; margin: 0 auto;
padding: 0; padding: 0;
width: 100%; } width: 100%;
.ranges li { }
.ranges li {
font-size: 13px; font-size: 13px;
background: #f5f5f5; background: #f5f5f5;
border: 1px solid #f5f5f5; border: 1px solid #f5f5f5;
@ -189,81 +280,139 @@
color: #08c; color: #08c;
padding: 3px 12px; padding: 3px 12px;
margin-bottom: 8px; margin-bottom: 8px;
cursor: pointer; } cursor: pointer;
.ranges li:hover { }
background: #08c;
border: 1px solid #08c; .ranges li:hover {
color: #fff; } background: #08c;
.ranges li.active { border: 1px solid #08c;
background: #08c; color: #fff;
border: 1px solid #08c; }
color: #fff; }
.ranges li.active {
background: #08c;
border: 1px solid #08c;
color: #fff;
}
/* Larger Screen Styling */ /* Larger Screen Styling */
@media (min-width: 564px) { @media (min-width: 564px) {
.daterangepicker { .daterangepicker {
width: auto; } width: auto;
}
.daterangepicker .ranges ul { .daterangepicker .ranges ul {
width: 160px; } width: 160px;
}
.daterangepicker.single .ranges ul { .daterangepicker.single .ranges ul {
width: 100%; } width: 100%;
}
.daterangepicker.single .calendar.left { .daterangepicker.single .calendar.left {
clear: none; } clear: none;
}
.daterangepicker.single.ltr .ranges, .daterangepicker.single.ltr .calendar { .daterangepicker.single.ltr .ranges, .daterangepicker.single.ltr .calendar {
float: left; } float: left;
}
.daterangepicker.single.rtl .ranges, .daterangepicker.single.rtl .calendar { .daterangepicker.single.rtl .ranges, .daterangepicker.single.rtl .calendar {
float: right; } float: right;
}
.daterangepicker.ltr { .daterangepicker.ltr {
direction: ltr; direction: ltr;
text-align: left; } text-align: left;
.daterangepicker.ltr .calendar.left { }
.daterangepicker.ltr .calendar.left {
clear: left; clear: left;
margin-right: 0; } margin-right: 0;
.daterangepicker.ltr .calendar.left .calendar-table { }
border-right: none;
border-top-right-radius: 0; .daterangepicker.ltr .calendar.left .calendar-table {
border-bottom-right-radius: 0; } border-right: none;
.daterangepicker.ltr .calendar.right { border-top-right-radius: 0;
margin-left: 0; } border-bottom-right-radius: 0;
.daterangepicker.ltr .calendar.right .calendar-table { }
border-left: none;
border-top-left-radius: 0; .daterangepicker.ltr .calendar.right {
border-bottom-left-radius: 0; } margin-left: 0;
.daterangepicker.ltr .left .daterangepicker_input { }
padding-right: 12px; }
.daterangepicker.ltr .calendar.left .calendar-table { .daterangepicker.ltr .calendar.right .calendar-table {
padding-right: 12px; } border-left: none;
.daterangepicker.ltr .ranges, .daterangepicker.ltr .calendar { border-top-left-radius: 0;
float: left; } border-bottom-left-radius: 0;
}
.daterangepicker.ltr .left .daterangepicker_input {
padding-right: 12px;
}
.daterangepicker.ltr .calendar.left .calendar-table {
padding-right: 12px;
}
.daterangepicker.ltr .ranges, .daterangepicker.ltr .calendar {
float: left;
}
.daterangepicker.rtl { .daterangepicker.rtl {
direction: rtl; direction: rtl;
text-align: right; }
.daterangepicker.rtl .calendar.left {
clear: right;
margin-left: 0; }
.daterangepicker.rtl .calendar.left .calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0; }
.daterangepicker.rtl .calendar.right {
margin-right: 0; }
.daterangepicker.rtl .calendar.right .calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
.daterangepicker.rtl .left .daterangepicker_input {
padding-left: 12px; }
.daterangepicker.rtl .calendar.left .calendar-table {
padding-left: 12px; }
.daterangepicker.rtl .ranges, .daterangepicker.rtl .calendar {
text-align: right; text-align: right;
float: right; } } }
.daterangepicker.rtl .calendar.left {
clear: right;
margin-left: 0;
}
.daterangepicker.rtl .calendar.left .calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.daterangepicker.rtl .calendar.right {
margin-right: 0;
}
.daterangepicker.rtl .calendar.right .calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.daterangepicker.rtl .left .daterangepicker_input {
padding-left: 12px;
}
.daterangepicker.rtl .calendar.left .calendar-table {
padding-left: 12px;
}
.daterangepicker.rtl .ranges, .daterangepicker.rtl .calendar {
text-align: right;
float: right;
}
}
@media (min-width: 730px) { @media (min-width: 730px) {
.daterangepicker .ranges { .daterangepicker .ranges {
width: auto; } width: auto;
.daterangepicker.ltr .ranges { }
float: left; }
.daterangepicker.rtl .ranges { .daterangepicker.ltr .ranges {
float: right; } float: left;
.daterangepicker .calendar.left { }
clear: none !important; } }
.daterangepicker.rtl .ranges {
float: right;
}
.daterangepicker .calendar.left {
clear: none !important;
}
}

View File

@ -9,7 +9,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -23,7 +23,7 @@ declare(strict_types = 1);
| |
*/ */
require __DIR__.'/../bootstrap/autoload.php'; require __DIR__ . '/../bootstrap/autoload.php';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -37,7 +37,7 @@ require __DIR__.'/../bootstrap/autoload.php';
| |
*/ */
$app = require_once __DIR__.'/../bootstrap/app.php'; $app = require_once __DIR__ . '/../bootstrap/app.php';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -69,13 +69,13 @@ function updateBudgetedAmounts(e) {
var spentAmount = parseFloat(spentCell.data('spent')); var spentAmount = parseFloat(spentCell.data('spent'));
var newAmountLeft = spentAmount + parseFloat(value); var newAmountLeft = spentAmount + parseFloat(value);
var amountLeftString = accounting.formatMoney(newAmountLeft); var amountLeftString = accounting.formatMoney(newAmountLeft);
if(newAmountLeft < 0) { if (newAmountLeft < 0) {
leftCell.html('<span class="text-danger">' + amountLeftString + '</span>'); leftCell.html('<span class="text-danger">' + amountLeftString + '</span>');
} }
if(newAmountLeft > 0) { if (newAmountLeft > 0) {
leftCell.html('<span class="text-success">' + amountLeftString + '</span>'); leftCell.html('<span class="text-success">' + amountLeftString + '</span>');
} }
if(newAmountLeft === 0.0) { if (newAmountLeft === 0.0) {
leftCell.html('<span style="color:#999">' + amountLeftString + '</span>'); leftCell.html('<span style="color:#999">' + amountLeftString + '</span>');
} }

View File

@ -25,6 +25,4 @@ $(function () {
pieChart(expenseExpenseUri, 'budget-expense-out'); pieChart(expenseExpenseUri, 'budget-expense-out');
}); });

View File

@ -122,7 +122,7 @@ function convertForeignToNative() {
function updateNativeAmount(data) { function updateNativeAmount(data) {
// if native amount is already filled in, even though we do this for the first time: // if native amount is already filled in, even though we do this for the first time:
// don't overrule it. // don't overrule it.
if(countConversions === 0 && $('#ffInput_native_amount').val().length > 0) { if (countConversions === 0 && $('#ffInput_native_amount').val().length > 0) {
countConversions++; countConversions++;
return; return;
} }

View File

@ -20,8 +20,8 @@ $(document).ready(function () {
$('#ffInput_amount').on('change', convertForeignToNative); $('#ffInput_amount').on('change', convertForeignToNative);
// respond to transfer changes: // respond to transfer changes:
$('#ffInput_source_account_id').on('change',validateCurrencyForTransfer); $('#ffInput_source_account_id').on('change', validateCurrencyForTransfer);
$('#ffInput_destination_account_id').on('change',validateCurrencyForTransfer); $('#ffInput_destination_account_id').on('change', validateCurrencyForTransfer);
// convert source currency to destination currency (slightly different routine for transfers) // convert source currency to destination currency (slightly different routine for transfers)
$('#ffInput_source_amount').on('change', convertSourceToDestination); $('#ffInput_source_amount').on('change', convertSourceToDestination);
@ -64,7 +64,6 @@ function updateInitialPage() {
} }
/** /**
* Get accountID based on some meta info. * Get accountID based on some meta info.
*/ */

View File

@ -139,10 +139,10 @@ function resetDivSplits() {
row.attr('data-split', i); row.attr('data-split', i);
// add or remove class with bg thing // add or remove class with bg thing
if(i % 2 === 0) { if (i % 2 === 0) {
row.removeClass('bg-gray-light'); row.removeClass('bg-gray-light');
} }
if(i % 2 === 1) { if (i % 2 === 1) {
row.addClass('bg-gray-light'); row.addClass('bg-gray-light');
} }

View File

@ -17,5 +17,4 @@
"display": "standalone", "display": "standalone",
"start_url": "/", "start_url": "/",
"orientation": "portrait" "orientation": "portrait"
} }

View File

@ -1,15 +1,15 @@
<?xml version="1.0" standalone="no"?> <?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" <svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000" width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000"
preserveAspectRatio="xMidYMid meet"> preserveAspectRatio="xMidYMid meet">
<metadata> <metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013 Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata> </metadata>
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)" <g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none"> fill="#000000" stroke="none">
<path d="M89 4009 c-17 -4 -43 -19 -58 -33 l-26 -26 -2 -1383 -3 -1383 28 -33 <path d="M89 4009 c-17 -4 -43 -19 -58 -33 l-26 -26 -2 -1383 -3 -1383 28 -33
c19 -23 39 -35 67 -39 22 -4 1144 -7 2493 -6 2449 0 2452 0 2480 21 15 11 33 c19 -23 39 -35 67 -39 22 -4 1144 -7 2493 -6 2449 0 2452 0 2480 21 15 11 33
31 39 44 10 19 13 325 13 1389 0 1064 -3 1370 -13 1389 -6 13 -24 33 -39 44 31 39 44 10 19 13 325 13 1389 0 1064 -3 1370 -13 1389 -6 13 -24 33 -39 44
-28 21 -31 21 -2487 21 -1353 1 -2474 -2 -2492 -5z m683 -218 c8 -1 -18 -100 -28 21 -31 21 -2487 21 -1353 1 -2474 -2 -2492 -5z m683 -218 c8 -1 -18 -100
@ -28,7 +28,7 @@ m-4527 -1947 c161 -65 301 -202 369 -359 21 -48 25 -61 36 -114 3 -14 7 -28
-7 c22 -4 67 -18 100 -31z m4539 -239 c0 -213 -3 -275 -12 -276 -18 -1 -499 -7 c22 -4 67 -18 100 -31z m4539 -239 c0 -213 -3 -275 -12 -276 -18 -1 -499
-1 -525 0 -21 1 -22 2 -9 46 8 25 12 45 10 45 -8 0 58 134 86 175 45 66 128 -1 -525 0 -21 1 -22 2 -9 46 8 25 12 45 10 45 -8 0 58 134 86 175 45 66 128
147 190 187 73 46 191 93 243 97 16 1 17 -18 17 -274z"/> 147 190 187 73 46 191 93 243 97 16 1 17 -18 17 -274z"/>
<path d="M1448 3348 c-46 -9 -74 -46 -82 -108 -17 -129 -102 -204 -239 -209 <path d="M1448 3348 c-46 -9 -74 -46 -82 -108 -17 -129 -102 -204 -239 -209
-10 -1 -32 -14 -48 -30 l-29 -29 0 -401 c0 -230 4 -410 10 -425 12 -34 46 -54 -10 -1 -32 -14 -48 -30 l-29 -29 0 -401 c0 -230 4 -410 10 -425 12 -34 46 -54
100 -61 106 -13 192 -94 205 -193 8 -64 19 -88 50 -108 25 -16 101 -18 1118 100 -61 106 -13 192 -94 205 -193 8 -64 19 -88 50 -108 25 -16 101 -18 1118
-18 601 -1 1109 2 1131 5 54 9 73 33 90 117 24 117 91 181 206 197 54 8 74 18 -18 601 -1 1109 2 1131 5 54 9 73 33 90 117 24 117 91 181 206 197 54 8 74 18
@ -39,14 +39,14 @@ m2125 -218 c48 -124 120 -204 229 -255 l73 -33 -2 -269 c-1 -147 -2 -275 -2
-1004 0 -14 35 c-46 116 -118 195 -220 242 -38 18 -70 35 -73 39 -4 6 -5 456 -1004 0 -14 35 c-46 116 -118 195 -220 242 -38 18 -70 35 -73 39 -4 6 -5 456
-1 545 1 15 15 26 56 43 30 12 72 36 94 51 49 36 114 120 137 180 10 25 21 47 -1 545 1 15 15 26 56 43 30 12 72 36 94 51 49 36 114 120 137 180 10 25 21 47
25 50 4 3 456 5 1005 5 l997 0 10 -25z"/> 25 50 4 3 456 5 1005 5 l997 0 10 -25z"/>
<path d="M2013 3012 c-34 -5 -73 -58 -73 -99 0 -52 55 -102 104 -94 4 1 16 -1 <path d="M2013 3012 c-34 -5 -73 -58 -73 -99 0 -52 55 -102 104 -94 4 1 16 -1
25 -4 16 -5 17 -32 17 -319 0 -242 3 -320 13 -339 35 -66 137 -65 172 0 10 19 25 -4 16 -5 17 -32 17 -319 0 -242 3 -320 13 -339 35 -66 137 -65 172 0 10 19
13 107 14 386 1 199 -3 378 -8 397 -14 57 -45 73 -151 74 -50 1 -101 0 -113 13 107 14 386 1 199 -3 378 -8 397 -14 57 -45 73 -151 74 -50 1 -101 0 -113
-2z"/> -2z"/>
<path d="M2608 3012 c-35 -9 -58 -28 -71 -56 -12 -25 -14 -101 -12 -406 1 <path d="M2608 3012 c-35 -9 -58 -28 -71 -56 -12 -25 -14 -101 -12 -406 1
-206 5 -383 9 -392 4 -9 20 -25 34 -34 24 -16 57 -18 276 -19 282 -1 302 3 -206 5 -383 9 -392 4 -9 20 -25 34 -34 24 -16 57 -18 276 -19 282 -1 302 3
322 65 15 45 17 731 3 777 -20 63 -37 67 -306 68 -132 0 -247 -1 -255 -3z 322 65 15 45 17 731 3 777 -20 63 -37 67 -306 68 -132 0 -247 -1 -255 -3z
m370 -453 l2 -256 -128 1 -129 0 -1 250 c0 138 1 253 3 256 2 4 59 6 127 6 m370 -453 l2 -256 -128 1 -129 0 -1 250 c0 138 1 253 3 256 2 4 59 6 127 6
l123 -1 3 -256z"/> l123 -1 3 -256z"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -9,9 +9,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
use Illuminate\Http\Request;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -9,7 +9,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -394,15 +394,12 @@ Route::group(
Route::post('start/{importJob}', ['uses' => 'ImportController@start', 'as' => 'start']); Route::post('start/{importJob}', ['uses' => 'ImportController@start', 'as' => 'start']);
//Route::get('settings/{importJob}', ['uses' => 'ImportController@settings', 'as' => 'settings']); //Route::get('settings/{importJob}', ['uses' => 'ImportController@settings', 'as' => 'settings']);
//Route::get('complete/{importJob}', ['uses' => 'ImportController@complete', 'as' => 'complete']); //Route::get('complete/{importJob}', ['uses' => 'ImportController@complete', 'as' => 'complete']);
//Route::get('finished/{importJob}', ['uses' => 'ImportController@finished', 'as' => 'finished']); //Route::get('finished/{importJob}', ['uses' => 'ImportController@finished', 'as' => 'finished']);
//Route::post('settings/{importJob}', ['uses' => 'ImportController@postSettings', 'as' => 'post-settings']); //Route::post('settings/{importJob}', ['uses' => 'ImportController@postSettings', 'as' => 'post-settings']);
} }
); );

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers\Admin; namespace Tests\Feature\Controllers\Admin;

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers\Admin; namespace Tests\Feature\Controllers\Admin;

View File

@ -81,9 +81,9 @@ class UserControllerTest extends TestCase
$repository = $this->mock(UserRepositoryInterface::class); $repository = $this->mock(UserRepositoryInterface::class);
$repository->shouldReceive('changePassword')->once(); $repository->shouldReceive('changePassword')->once();
$repository->shouldReceive('changeStatus')->once(); $repository->shouldReceive('changeStatus')->once();
$data = [ $data = [
'id' => 1, 'id' => 1,
'email' => 'test@example.com', 'email' => 'test@example.com',
'password' => 'james', 'password' => 'james',
'password_confirmation' => 'james', 'password_confirmation' => 'james',
'blocked_code' => 'blocked', 'blocked_code' => 'blocked',

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;

View File

@ -101,7 +101,7 @@ class TwoFactorControllerTest extends TestCase
*/ */
public function testPostIndex() public function testPostIndex()
{ {
$data = ['code' => '123456']; $data = ['code' => '123456'];
$google = $this->mock(Google2FA::class); $google = $this->mock(Google2FA::class);
$google->shouldReceive('verifyKey')->andReturn(true)->once(); $google->shouldReceive('verifyKey')->andReturn(true)->once();

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;
@ -126,6 +126,46 @@ class BudgetControllerTest extends TestCase
$response->assertSee('<ol class="breadcrumb">'); $response->assertSee('<ol class="breadcrumb">');
} }
/**
* @covers \FireflyIII\Http\Controllers\BudgetController::index
* @covers \FireflyIII\Http\Controllers\BudgetController::collectBudgetInformation
* @covers \FireflyIII\Http\Controllers\BudgetController::__construct
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testIndex(string $range)
{
// mock stuff
$budget = factory(Budget::class)->make();
$budgetLimit = factory(BudgetLimit::class)->make();
// set budget limit to current month:
$budgetLimit->start_date = Carbon::now()->startOfMonth();
$budgetLimit->end_date = Carbon::now()->endOfMonth();
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$repository = $this->mock(BudgetRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$accountRepos->shouldReceive('getAccountsByType')->andReturn(new Collection);
$repository->shouldReceive('cleanupBudgets');
$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]));
$repository->shouldReceive('getInactiveBudgets')->andReturn(new Collection);
$repository->shouldReceive('getAvailableBudget')->andReturn('100.123');
$repository->shouldReceive('spentInPeriod')->andReturn('-1');
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('budgets.index'));
$response->assertStatus(200);
// has bread crumb
$response->assertSee('<ol class="breadcrumb">');
}
/** /**
* @covers \FireflyIII\Http\Controllers\BudgetController::index * @covers \FireflyIII\Http\Controllers\BudgetController::index
* @covers \FireflyIII\Http\Controllers\BudgetController::collectBudgetInformation * @covers \FireflyIII\Http\Controllers\BudgetController::collectBudgetInformation
@ -206,46 +246,6 @@ class BudgetControllerTest extends TestCase
$response->assertSee('<ol class="breadcrumb">'); $response->assertSee('<ol class="breadcrumb">');
} }
/**
* @covers \FireflyIII\Http\Controllers\BudgetController::index
* @covers \FireflyIII\Http\Controllers\BudgetController::collectBudgetInformation
* @covers \FireflyIII\Http\Controllers\BudgetController::__construct
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testIndex(string $range)
{
// mock stuff
$budget = factory(Budget::class)->make();
$budgetLimit = factory(BudgetLimit::class)->make();
// set budget limit to current month:
$budgetLimit->start_date = Carbon::now()->startOfMonth();
$budgetLimit->end_date = Carbon::now()->endOfMonth();
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$repository = $this->mock(BudgetRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$accountRepos->shouldReceive('getAccountsByType')->andReturn(new Collection);
$repository->shouldReceive('cleanupBudgets');
$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]));
$repository->shouldReceive('getInactiveBudgets')->andReturn(new Collection);
$repository->shouldReceive('getAvailableBudget')->andReturn('100.123');
$repository->shouldReceive('spentInPeriod')->andReturn('-1');
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('budgets.index'));
$response->assertStatus(200);
// has bread crumb
$response->assertSee('<ol class="breadcrumb">');
}
/** /**
* @covers \FireflyIII\Http\Controllers\BudgetController::noBudget * @covers \FireflyIII\Http\Controllers\BudgetController::noBudget
* @covers \FireflyIII\Http\Controllers\BudgetController::getPeriodOverview * @covers \FireflyIII\Http\Controllers\BudgetController::getPeriodOverview

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;

View File

@ -327,7 +327,7 @@ class AccountControllerTest extends TestCase
*/ */
public function testRevenueAccounts(string $range) public function testRevenueAccounts(string $range)
{ {
$account = factory(Account::class)->make(); $account = factory(Account::class)->make();
$generator = $this->mock(GeneratorInterface::class); $generator = $this->mock(GeneratorInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class); $accountRepos = $this->mock(AccountRepositoryInterface::class);

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart; namespace Tests\Feature\Controllers\Chart;
@ -54,8 +54,8 @@ class BillControllerTest extends TestCase
public function testSingle() public function testSingle()
{ {
$transaction = factory(Transaction::class)->make(); $transaction = factory(Transaction::class)->make();
$generator = $this->mock(GeneratorInterface::class); $generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class); $collector = $this->mock(JournalCollectorInterface::class);
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once(); $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();
$collector->shouldReceive('setBills')->andReturnSelf()->once(); $collector->shouldReceive('setBills')->andReturnSelf()->once();

View File

@ -139,7 +139,7 @@ class BudgetControllerTest extends TestCase
$accountRepos = $this->mock(AccountRepositoryInterface::class); $accountRepos = $this->mock(AccountRepositoryInterface::class);
$transactions = factory(Transaction::class, 10)->make(); $transactions = factory(Transaction::class, 10)->make();
$categories = factory(Category::class, 10)->make(); $categories = factory(Category::class, 10)->make();
$collector->shouldReceive('setAllAssetAccounts')->once()->andReturnSelf(); $collector->shouldReceive('setAllAssetAccounts')->once()->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->once()->andReturnSelf(); $collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL]])->once()->andReturnSelf();

View File

@ -35,8 +35,8 @@ class BudgetReportControllerTest extends TestCase
*/ */
public function testAccountExpense() public function testAccountExpense()
{ {
$generator = $this->mock(GeneratorInterface::class); $generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class); $pieChart = $this->mock(MetaPieChartInterface::class);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf(); $pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setBudgets')->once()->andReturnSelf(); $pieChart->shouldReceive('setBudgets')->once()->andReturnSelf();
@ -56,8 +56,8 @@ class BudgetReportControllerTest extends TestCase
*/ */
public function testBudgetExpense() public function testBudgetExpense()
{ {
$generator = $this->mock(GeneratorInterface::class); $generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class); $pieChart = $this->mock(MetaPieChartInterface::class);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf(); $pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setBudgets')->once()->andReturnSelf(); $pieChart->shouldReceive('setBudgets')->once()->andReturnSelf();

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart; namespace Tests\Feature\Controllers\Chart;

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart; namespace Tests\Feature\Controllers\Chart;

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;
@ -27,6 +27,24 @@ use Tests\TestCase;
class CurrencyControllerTest extends TestCase class CurrencyControllerTest extends TestCase
{ {
/**
* @covers \FireflyIII\Http\Controllers\CurrencyController::create
*/
public function testCannotCreate()
{
// mock stuff
$userRepos = $this->mock(UserRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$userRepos->shouldReceive('hasRole')->once()->andReturn(false);
$this->be($this->user());
$response = $this->get(route('currencies.create'));
$response->assertStatus(302);
$response->assertSessionHas('error');
}
/** /**
* @covers \FireflyIII\Http\Controllers\CurrencyController::delete * @covers \FireflyIII\Http\Controllers\CurrencyController::delete
*/ */
@ -70,24 +88,6 @@ class CurrencyControllerTest extends TestCase
$response->assertSessionHas('error'); $response->assertSessionHas('error');
} }
/**
* @covers \FireflyIII\Http\Controllers\CurrencyController::create
*/
public function testCannotCreate()
{
// mock stuff
$userRepos = $this->mock(UserRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$userRepos->shouldReceive('hasRole')->once()->andReturn(false);
$this->be($this->user());
$response = $this->get(route('currencies.create'));
$response->assertStatus(302);
$response->assertSessionHas('error');
}
/** /**
* @covers \FireflyIII\Http\Controllers\CurrencyController::create * @covers \FireflyIII\Http\Controllers\CurrencyController::create
*/ */
@ -236,7 +236,7 @@ class CurrencyControllerTest extends TestCase
/** /**
* @covers \FireflyIII\Http\Controllers\CurrencyController::store * @covers \FireflyIII\Http\Controllers\CurrencyController::store
*/ */
public function testStoreNoRights() public function testStore()
{ {
// mock stuff // mock stuff
$repository = $this->mock(CurrencyRepositoryInterface::class); $repository = $this->mock(CurrencyRepositoryInterface::class);
@ -263,7 +263,7 @@ class CurrencyControllerTest extends TestCase
/** /**
* @covers \FireflyIII\Http\Controllers\CurrencyController::store * @covers \FireflyIII\Http\Controllers\CurrencyController::store
*/ */
public function testStore() public function testStoreNoRights()
{ {
// mock stuff // mock stuff
$repository = $this->mock(CurrencyRepositoryInterface::class); $repository = $this->mock(CurrencyRepositoryInterface::class);

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;

View File

@ -188,8 +188,9 @@ class ImportControllerTest extends TestCase
$response = $this->post(route('import.start', ['running'])); $response = $this->post(route('import.start', ['running']));
$response->assertStatus(200); $response->assertStatus(200);
} }
/** /**
* @covers \FireflyIII\Http\Controllers\ImportController::start * @covers \FireflyIII\Http\Controllers\ImportController::start
* @expectedExceptionMessage Job did not complete succesfully. * @expectedExceptionMessage Job did not complete succesfully.
*/ */
public function testStartFailed() public function testStartFailed()

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;
@ -26,20 +26,6 @@ use Tests\TestCase;
*/ */
class JavascriptControllerTest extends TestCase class JavascriptControllerTest extends TestCase
{ {
/**
* @covers \FireflyIII\Http\Controllers\JavascriptController::currencies
*/
public function testCurrencies()
{
$repository = $this->mock(CurrencyRepositoryInterface::class);
$currency = factory(TransactionCurrency::class)->make();
$repository->shouldReceive('get')->andReturn(new Collection([$currency]));
$this->be($this->user());
$response = $this->get(route('javascript.currencies'));
$response->assertStatus(200);
}
/** /**
* @covers \FireflyIII\Http\Controllers\JavascriptController::accounts * @covers \FireflyIII\Http\Controllers\JavascriptController::accounts
*/ */
@ -58,6 +44,20 @@ class JavascriptControllerTest extends TestCase
$response->assertStatus(200); $response->assertStatus(200);
} }
/**
* @covers \FireflyIII\Http\Controllers\JavascriptController::currencies
*/
public function testCurrencies()
{
$repository = $this->mock(CurrencyRepositoryInterface::class);
$currency = factory(TransactionCurrency::class)->make();
$repository->shouldReceive('get')->andReturn(new Collection([$currency]));
$this->be($this->user());
$response = $this->get(route('javascript.currencies'));
$response->assertStatus(200);
}
/** /**
* @covers \FireflyIII\Http\Controllers\JavascriptController::variables * @covers \FireflyIII\Http\Controllers\JavascriptController::variables
* @covers \FireflyIII\Http\Controllers\JavascriptController::getDateRangePicker * @covers \FireflyIII\Http\Controllers\JavascriptController::getDateRangePicker

View File

@ -94,7 +94,7 @@ class JsonControllerTest extends TestCase
$billRepos->shouldReceive('getBillsPaidInRange')->andReturn('-100'); $billRepos->shouldReceive('getBillsPaidInRange')->andReturn('-100');
$this->be($this->user()); $this->be($this->user());
$currency = Amount::getDefaultCurrency(); $currency = Amount::getDefaultCurrency();
$response = $this->get(route('json.box.paid')); $response = $this->get(route('json.box.paid'));
$response->assertStatus(200); $response->assertStatus(200);
$response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'bills-paid']); $response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'bills-paid']);
@ -114,7 +114,7 @@ class JsonControllerTest extends TestCase
$this->be($this->user()); $this->be($this->user());
$currency = Amount::getDefaultCurrency(); $currency = Amount::getDefaultCurrency();
$response = $this->get(route('json.box.unpaid')); $response = $this->get(route('json.box.unpaid'));
$response->assertStatus(200); $response->assertStatus(200);
$response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'bills-unpaid']); $response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'bills-unpaid']);
@ -141,7 +141,7 @@ class JsonControllerTest extends TestCase
$this->be($this->user()); $this->be($this->user());
$currency = Amount::getDefaultCurrency(); $currency = Amount::getDefaultCurrency();
$response = $this->get(route('json.box.in')); $response = $this->get(route('json.box.in'));
$response->assertStatus(200); $response->assertStatus(200);
$response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'in']); $response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'in']);
@ -167,7 +167,7 @@ class JsonControllerTest extends TestCase
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->once(); $collector->shouldReceive('withOpposingAccount')->andReturnSelf()->once();
$this->be($this->user()); $this->be($this->user());
$currency = Amount::getDefaultCurrency(); $currency = Amount::getDefaultCurrency();
$response = $this->get(route('json.box.out')); $response = $this->get(route('json.box.out'));
$response->assertStatus(200); $response->assertStatus(200);
$response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'out']); $response->assertExactJson(['amount' => Amount::formatAnything($currency, '100', false), 'amount_raw' => '100', 'box' => 'out']);

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;
@ -159,10 +159,10 @@ class PiggyBankControllerTest extends TestCase
public function testIndex() public function testIndex()
{ {
// mock stuff // mock stuff
$repository = $this->mock(PiggyBankRepositoryInterface::class); $repository = $this->mock(PiggyBankRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class); $journalRepos = $this->mock(JournalRepositoryInterface::class);
$one = factory(PiggyBank::class)->make(); $one = factory(PiggyBank::class)->make();
$two = factory(PiggyBank::class)->make(); $two = factory(PiggyBank::class)->make();
$two->account_id = $one->account_id; $two->account_id = $one->account_id;
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal); $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('getPiggyBanks')->andReturn(new Collection([$one, $two])); $repository->shouldReceive('getPiggyBanks')->andReturn(new Collection([$one, $two]));

View File

@ -13,13 +13,10 @@ namespace Tests\Feature\Controllers\Popup;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Helpers\Report\PopupReportInterface; use FireflyIII\Helpers\Report\PopupReportInterface;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\Budget; use FireflyIII\Models\Budget;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\Models\Tag;
use FireflyIII\Models\Transaction;
use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
@ -165,8 +162,8 @@ class ReportControllerTest extends TestCase
$popupHelper = $this->mock(PopupReportInterface::class); $popupHelper = $this->mock(PopupReportInterface::class);
$budget = factory(Budget::class)->make(); $budget = factory(Budget::class)->make();
$account = factory(Account::class)->make(); $account = factory(Account::class)->make();
$budgetRepos->shouldReceive('find')->andReturn($budget)->once()->withArgs([1]); $budgetRepos->shouldReceive('find')->andReturn($budget)->once()->withArgs([1]);
$accountRepos->shouldReceive('find')->andReturn($account)->once()->withArgs([1]); $accountRepos->shouldReceive('find')->andReturn($account)->once()->withArgs([1]);

View File

@ -166,7 +166,7 @@ class ProfileControllerTest extends TestCase
// mock stuff // mock stuff
$journalRepos = $this->mock(JournalRepositoryInterface::class); $journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal); $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$data = [ $data = [
'password' => 'james2', 'password' => 'james2',
]; ];
$this->be($this->user()); $this->be($this->user());

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers\Report; namespace Tests\Feature\Controllers\Report;

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers\Report; namespace Tests\Feature\Controllers\Report;

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers\Report; namespace Tests\Feature\Controllers\Report;

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers\Report; namespace Tests\Feature\Controllers\Report;

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers\Report; namespace Tests\Feature\Controllers\Report;

View File

@ -274,22 +274,6 @@ class RuleControllerTest extends TestCase
$response->assertSessionHas('success'); $response->assertSessionHas('success');
} }
/**
* This actually hits an error and not the actually code but OK.
*
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
* @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList
*/
public function testTestTriggersError()
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$uri = route('rules.test-triggers');
$response = $this->get($uri);
$response->assertStatus(200);
}
/** /**
* *
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers * @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
@ -314,7 +298,24 @@ class RuleControllerTest extends TestCase
$matcher->shouldReceive('findMatchingTransactions')->andReturn(new Collection); $matcher->shouldReceive('findMatchingTransactions')->andReturn(new Collection);
$this->be($this->user()); $this->be($this->user());
$uri = route('rules.test-triggers') . '?' . http_build_query($data); $uri = route('rules.test-triggers') . '?' . http_build_query($data);
$response = $this->get($uri);
$response->assertStatus(200);
}
/**
* This actually hits an error and not the actually code but OK.
*
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
* @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList
*/
public function testTestTriggersError()
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$uri = route('rules.test-triggers');
$response = $this->get($uri); $response = $this->get($uri);
$response->assertStatus(200); $response->assertStatus(200);
} }
@ -330,7 +331,7 @@ class RuleControllerTest extends TestCase
'rule-trigger-value' => ['Bla bla'], 'rule-trigger-value' => ['Bla bla'],
'rule-trigger-stop' => ['1'], 'rule-trigger-stop' => ['1'],
]; ];
$set = factory(Transaction::class, 10)->make(); $set = factory(Transaction::class, 10)->make();
// mock stuff // mock stuff
$matcher = $this->mock(TransactionMatcher::class); $matcher = $this->mock(TransactionMatcher::class);
@ -343,7 +344,7 @@ class RuleControllerTest extends TestCase
$matcher->shouldReceive('findMatchingTransactions')->andReturn($set); $matcher->shouldReceive('findMatchingTransactions')->andReturn($set);
$this->be($this->user()); $this->be($this->user());
$uri = route('rules.test-triggers') . '?' . http_build_query($data); $uri = route('rules.test-triggers') . '?' . http_build_query($data);
$response = $this->get($uri); $response = $this->get($uri);
$response->assertStatus(200); $response->assertStatus(200);
} }

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;
@ -177,7 +177,6 @@ class RuleGroupControllerTest extends TestCase
]; ];
$this->be($this->user()); $this->be($this->user());
$response = $this->post(route('rule-groups.store', [1]), $data); $response = $this->post(route('rule-groups.store', [1]), $data);
$response->assertStatus(302); $response->assertStatus(302);

View File

@ -7,7 +7,7 @@
* See the LICENSE file for details. * See the LICENSE file for details.
*/ */
declare(strict_types = 1); declare(strict_types=1);
namespace Tests\Feature\Controllers; namespace Tests\Feature\Controllers;

View File

@ -151,6 +151,37 @@ class TagControllerTest extends TestCase
$response->assertSee('<ol class="breadcrumb">'); $response->assertSee('<ol class="breadcrumb">');
} }
/**
* @covers \FireflyIII\Http\Controllers\TagController::show
*/
public function testShowAll()
{
// mock stuff
$repository = $this->mock(TagRepositoryInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('firstUseDate')->andReturn(new Carbon)->once();
$collector->shouldReceive('removeFilter')->andReturnSelf()->times(3);
$repository->shouldReceive('sumOfTag')->andReturn('1')->once();
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->times(3);
$collector->shouldReceive('setLimit')->andReturnSelf()->times(3);
$collector->shouldReceive('setPage')->andReturnSelf()->times(3);
$collector->shouldReceive('setTag')->andReturnSelf()->times(3);
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->times(3);
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('setRange')->andReturnSelf()->times(3);
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->times(3);
$this->be($this->user());
$response = $this->get(route('tags.show', [1, 'all']));
$response->assertStatus(200);
$response->assertSee('<ol class="breadcrumb">');
}
/** /**
* @covers \FireflyIII\Http\Controllers\TagController::show * @covers \FireflyIII\Http\Controllers\TagController::show
*/ */
@ -185,37 +216,6 @@ class TagControllerTest extends TestCase
$response->assertSee('<ol class="breadcrumb">'); $response->assertSee('<ol class="breadcrumb">');
} }
/**
* @covers \FireflyIII\Http\Controllers\TagController::show
*/
public function testShowAll()
{
// mock stuff
$repository = $this->mock(TagRepositoryInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('firstUseDate')->andReturn(new Carbon)->once();
$collector->shouldReceive('removeFilter')->andReturnSelf()->times(3);
$repository->shouldReceive('sumOfTag')->andReturn('1')->once();
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->times(3);
$collector->shouldReceive('setLimit')->andReturnSelf()->times(3);
$collector->shouldReceive('setPage')->andReturnSelf()->times(3);
$collector->shouldReceive('setTag')->andReturnSelf()->times(3);
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->times(3);
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('setRange')->andReturnSelf()->times(3);
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->times(3);
$this->be($this->user());
$response = $this->get(route('tags.show', [1, 'all']));
$response->assertStatus(200);
$response->assertSee('<ol class="breadcrumb">');
}
/** /**
* @covers \FireflyIII\Http\Controllers\TagController::store * @covers \FireflyIII\Http\Controllers\TagController::store
*/ */

View File

@ -15,8 +15,8 @@ namespace Tests\Unit\Handlers\Events;
use FireflyIII\Events\RegisteredUser; use FireflyIII\Events\RegisteredUser;
use FireflyIII\Events\RequestedNewPassword; use FireflyIII\Events\RequestedNewPassword;
use FireflyIII\Handlers\Events\UserEventHandler; use FireflyIII\Handlers\Events\UserEventHandler;
use FireflyIII\Mail\RequestedNewPassword as RequestedNewPasswordMail;
use FireflyIII\Mail\RegisteredUser as RegisteredUserMail; use FireflyIII\Mail\RegisteredUser as RegisteredUserMail;
use FireflyIII\Mail\RequestedNewPassword as RequestedNewPasswordMail;
use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
use Tests\TestCase; use Tests\TestCase;
@ -67,10 +67,11 @@ class UserEventHandlerTest extends TestCase
* @covers \FireflyIII\Handlers\Events\UserEventHandler::sendRegistrationMail * @covers \FireflyIII\Handlers\Events\UserEventHandler::sendRegistrationMail
* @covers \FireflyIII\Events\RegisteredUser * @covers \FireflyIII\Events\RegisteredUser
*/ */
public function testSendRegistrationMail() { public function testSendRegistrationMail()
{
Mail::fake(); Mail::fake();
$user = $this->emptyUser(); $user = $this->emptyUser();
$event = new RegisteredUser($user, '127.0.0.1'); $event = new RegisteredUser($user, '127.0.0.1');
$listener = new UserEventHandler; $listener = new UserEventHandler;
$listener->sendRegistrationMail($event); $listener->sendRegistrationMail($event);

View File

@ -153,7 +153,6 @@ class MetaPieChartTest extends TestCase
$this->assertTrue(true); $this->assertTrue(true);
} }
private function fakeOthers(): Collection private function fakeOthers(): Collection