mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-04 12:01:57 +00:00
Merge pull request #6864 from firefly-iii/update-build-2
Update build 2
This commit is contained in:
@@ -104,6 +104,7 @@ class DeleteController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function destroy(TransactionGroup $group): RedirectResponse
|
public function destroy(TransactionGroup $group): RedirectResponse
|
||||||
{
|
{
|
||||||
|
Log::debug(sprintf('Now in %s(#%d).', __METHOD__, $group->id));
|
||||||
if (!$this->isEditableGroup($group)) {
|
if (!$this->isEditableGroup($group)) {
|
||||||
return $this->redirectGroupToAccount($group);
|
return $this->redirectGroupToAccount($group);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,17 +98,23 @@ class MassController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function destroy(MassDeleteJournalRequest $request)
|
public function destroy(MassDeleteJournalRequest $request)
|
||||||
{
|
{
|
||||||
|
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||||
$ids = $request->get('confirm_mass_delete');
|
$ids = $request->get('confirm_mass_delete');
|
||||||
$count = 0;
|
$count = 0;
|
||||||
if (is_array($ids)) {
|
if (is_array($ids)) {
|
||||||
|
Log::debug('Array of IDs', $ids);
|
||||||
/** @var string $journalId */
|
/** @var string $journalId */
|
||||||
foreach ($ids as $journalId) {
|
foreach ($ids as $journalId) {
|
||||||
|
Log::debug(sprintf('Searching for ID #%d', $journalId));
|
||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
$journal = $this->repository->find((int)$journalId);
|
$journal = $this->repository->find((int)$journalId);
|
||||||
if (null !== $journal && (int)$journalId === $journal->id) {
|
if (null !== $journal && (int)$journalId === (int) $journal->id) {
|
||||||
$this->repository->destroyJournal($journal);
|
$this->repository->destroyJournal($journal);
|
||||||
++$count;
|
++$count;
|
||||||
|
Log::debug(sprintf('Deleted transaction journal #%d', $journalId));
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
Log::debug(sprintf('Could not find transaction journal #%d', $journalId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
|||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Database\Query\Builder;
|
use Illuminate\Database\Query\Builder;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,18 +95,22 @@ class TransactionGroup extends Model
|
|||||||
*/
|
*/
|
||||||
public static function routeBinder(string $value): TransactionGroup
|
public static function routeBinder(string $value): TransactionGroup
|
||||||
{
|
{
|
||||||
|
Log::debug(sprintf('Now in %s("%s")', __METHOD__, $value));
|
||||||
if (auth()->check()) {
|
if (auth()->check()) {
|
||||||
$groupId = (int)$value;
|
$groupId = (int)$value;
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
Log::debug(sprintf('User authenticated as %s', $user->email));
|
||||||
/** @var TransactionGroup $group */
|
/** @var TransactionGroup $group */
|
||||||
$group = $user->transactionGroups()
|
$group = $user->transactionGroups()
|
||||||
->with(['transactionJournals', 'transactionJournals.transactions'])
|
->with(['transactionJournals', 'transactionJournals.transactions'])
|
||||||
->where('transaction_groups.id', $groupId)->first(['transaction_groups.*']);
|
->where('transaction_groups.id', $groupId)->first(['transaction_groups.*']);
|
||||||
if (null !== $group) {
|
if (null !== $group) {
|
||||||
|
Log::debug(sprintf('Found group #%d.', $group->id));
|
||||||
return $group;
|
return $group;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Log::debug('Found no group.');
|
||||||
|
|
||||||
throw new NotFoundHttpException();
|
throw new NotFoundHttpException();
|
||||||
}
|
}
|
||||||
|
|||||||
2
public/v1/js/create_transaction.js
vendored
2
public/v1/js/create_transaction.js
vendored
File diff suppressed because one or more lines are too long
2
public/v1/js/webhooks/create.js
vendored
2
public/v1/js/webhooks/create.js
vendored
File diff suppressed because one or more lines are too long
2
public/v1/js/webhooks/edit.js
vendored
2
public/v1/js/webhooks/edit.js
vendored
File diff suppressed because one or more lines are too long
2
public/v1/js/webhooks/show.js
vendored
2
public/v1/js/webhooks/show.js
vendored
File diff suppressed because one or more lines are too long
@@ -529,7 +529,7 @@ export default {
|
|||||||
// if count is 0, send user onwards.
|
// if count is 0, send user onwards.
|
||||||
if (this.createAnother) {
|
if (this.createAnother) {
|
||||||
// do message:
|
// do message:
|
||||||
this.success_message = this.$t('firefly.transaction_stored_link', {ID: groupId, title: title});
|
this.success_message = this.$t('firefly.transaction_stored_link', {ID: groupId, title: $(title).text()});
|
||||||
this.error_message = '';
|
this.error_message = '';
|
||||||
if (this.resetFormAfter) {
|
if (this.resetFormAfter) {
|
||||||
// also clear form.
|
// also clear form.
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ export default {
|
|||||||
|
|
||||||
// post!
|
// post!
|
||||||
axios.post('./api/v1/webhooks', data).then((response) => {
|
axios.post('./api/v1/webhooks', data).then((response) => {
|
||||||
this.success_message = response.data.message;
|
this.success_message = $.text(response.data.message);
|
||||||
// console.log('Will now go to redirectUser()');
|
// console.log('Will now go to redirectUser()');
|
||||||
let webhookId = response.data.data.id;
|
let webhookId = response.data.data.id;
|
||||||
window.location.href = window.previousUrl + '?webhook_id=' + webhookId + '&message=created';
|
window.location.href = window.previousUrl + '?webhook_id=' + webhookId + '&message=created';
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ export default {
|
|||||||
|
|
||||||
// post!
|
// post!
|
||||||
axios.put('./api/v1/webhooks/' + this.id, data).then((response) => {
|
axios.put('./api/v1/webhooks/' + this.id, data).then((response) => {
|
||||||
this.success_message = response.data.message;
|
this.success_message = $.text(response.data.message);
|
||||||
// console.log('Will now go to redirectUser()');
|
// console.log('Will now go to redirectUser()');
|
||||||
let webhookId = response.data.data.id;
|
let webhookId = response.data.data.id;
|
||||||
window.location.href = window.previousUrl + '?webhook_id=' + webhookId + '&message=updated';
|
window.location.href = window.previousUrl + '?webhook_id=' + webhookId + '&message=updated';
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ export default {
|
|||||||
let button = $('#triggerButton');
|
let button = $('#triggerButton');
|
||||||
button.prop('disabled', true).addClass('disabled');
|
button.prop('disabled', true).addClass('disabled');
|
||||||
|
|
||||||
this.success_message = this.$t('firefly.webhook_was_triggered');
|
this.success_message = $.text(this.$t('firefly.webhook_was_triggered'));
|
||||||
// TODO actually trigger the webhook.
|
// TODO actually trigger the webhook.
|
||||||
axios.post('./api/v1/webhooks/' + this.id + '/trigger-transaction/' + journalId, {});
|
axios.post('./api/v1/webhooks/' + this.id + '/trigger-transaction/' + journalId, {});
|
||||||
button.prop('disabled', false).removeClass('disabled');
|
button.prop('disabled', false).removeClass('disabled');
|
||||||
|
|||||||
Reference in New Issue
Block a user