Skip to content

Firefly III: a personal finances manager

New views and pages

Sander Dorigocacfca2ba095
diff --git a/config/translations.php b/config/translations.php
index c659a2ea85..4b579d6729 100644
--- a/config/translations.php
+++ b/config/translations.php
@@ -39,6 +39,8 @@ return [
'drag_and_drop',
'active',
'name',
+ 'responds_when',
+ 'responds_with',
'type',
'number',
'liability_type',
@@ -158,6 +160,7 @@ return [
'administration_currency_form_help',
'administrations_page_edit_sub_title_js',
'table',
+ 'hide',
'welcome_back',
'flash_error',
'flash_warning',
diff --git a/resources/assets/v3/js/pages/webhooks/index.js b/resources/assets/v3/js/pages/webhooks/index.js
index fd12d2a360..9cec8a9119 100644
--- a/resources/assets/v3/js/pages/webhooks/index.js
+++ b/resources/assets/v3/js/pages/webhooks/index.js
@@ -27,6 +27,7 @@ import i18next from "i18next";
let index = function () {
return {
webhooks: [],
+ loading: false,
triggers: {
},
responses: {
@@ -35,11 +36,10 @@ let index = function () {
},
init() {
- console.log('init');
+ this.loading = true;
this.getOptions();
},
getWebhooks: function () {
- console.log('getWebhooks');
this.webhooks = [];
this.downloadWebhooks(1);
},
@@ -73,6 +73,8 @@ let index = function () {
if (response.data.meta.pagination.current_page < response.data.meta.pagination.total_pages) {
this.downloadWebhooks(response.data.meta.pagination.current_page + 1);
+ } else {
+ this.loading = false;
}
});
},
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index 8a3e1198a3..5fa1a6691b 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -293,6 +293,7 @@ return [
'reset_webhook_secret' => 'Reset webhook secret',
'webhook_stored_link' => '<a href="webhooks/show/{ID}">Webhook #{ID} ("{title}")</a> has been stored.',
'webhook_updated_link' => '<a href="webhooks/show/{ID}">Webhook #{ID}</a> ("{title}") has been updated.',
+ 'no_webhooks' => 'You have no webhooks. Please create one. Webhooks can be used to make external systems respond to Firefly III events, like newly created transactions or updated budgets.',
// API access
'authorization_request' => 'Firefly III v:version Authorization Request',
@@ -2068,6 +2069,7 @@ return [
'reconcile_this_account' => 'Reconcile this account',
'reconcile' => 'Reconcile',
'show' => 'Show',
+ 'hide' => 'Hide',
'confirm_reconciliation' => 'Confirm reconciliation',
'submitted_start_balance' => 'Submitted start balance',
'selected_transactions' => 'Selected transactions (:count)',
diff --git a/resources/lang/en_US/list.php b/resources/lang/en_US/list.php
index 4deda2c9ef..600ccb54cf 100644
--- a/resources/lang/en_US/list.php
+++ b/resources/lang/en_US/list.php
@@ -26,8 +26,9 @@ return [
'buttons' => 'Buttons',
'icon' => 'Icon',
'id' => 'ID',
- 'hide' => 'Hide',
'create_date' => 'Created at',
+ 'responds_when' => 'Responds when',
+ 'responds_with' => 'Responds with',
'primary_currency' => 'Primary currency',
'update_date' => 'Updated at',
'updated_at' => 'Updated at',
diff --git a/resources/views/webhooks/index.blade.php b/resources/views/webhooks/index.blade.php
index 2caa8adfb8..8151498205 100644
--- a/resources/views/webhooks/index.blade.php
+++ b/resources/views/webhooks/index.blade.php
@@ -5,7 +5,24 @@
<div class="card">
<x-elements.card-header-with-menu :cardTitle="trans('firefly.webhooks')" :route="route('webhooks.create')" :linkTitle="__('firefly.create_new_webhook')"/>
<div class="card-body p-0">
- <template x-if="webhooks.length > 0">
+ <template x-if="0 === webhooks.length && loading">
+ <div class="d-flex justify-content-center m-2">
+ <div class="spinner-border" role="status">
+ <span class="visually-hidden">Loading...</span>
+ </div>
+ </div>
+ </template>
+ <template x-if="0 === webhooks.length && !loading">
+ <div>
+ <div class="d-flex justify-content-center m-2">
+ <em class="bi bi-battery"></em>
+ </div>
+ <div class="d-flex justify-content-center m-2">
+ <p>{{ __('firefly.no_webhooks') }}</p>
+ </div>
+ </div>
+ </template>
+ <template x-if="webhooks.length > 0 && !loading">
<table class="table table-responsive table-hover" aria-label="A table.">
<thead>
<tr>
@@ -71,16 +88,16 @@
</td>
<td class="hidden-sm hidden-xs">
- <div class="btn-group btn-group-xs pull-right">
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
- aria-haspopup="true" aria-expanded="false">
- {{ __('firefly.actions') }} <span class="caret"></span></button>
- <ul class="dropdown-menu dropdown-menu-right" role="menu">
- <li><a :href="'webhooks/show/' + webhook.id"><span
+ <div class="dropdown">
+ <button class="btn btn-sm btn-secondary-outline dropdown-toggle" type="button" :id="'webhook_menu_' + webhook.id" data-bs-toggle="dropdown" aria-expanded="false">
+ {{ __('firefly.actions') }}
+ </button>
+ <ul class="dropdown-menu" :aria-labelledby="'webhook_menu_' + webhook.id">
+ <li><a class="dropdown-item" :href="'webhooks/show/' + webhook.id"><span
class="bi bi-search"></span> {{ __('firefly.inspect') }}</a></li>
- <li><a :href="'webhooks/edit/' + webhook.id"><span
+ <li><a class="dropdown-item" :href="'webhooks/edit/' + webhook.id"><span
class="bi bi-pencil"></span> {{ __('firefly.edit') }}</a></li>
- <li><a :href="'webhooks/delete/' + webhook.id"><span
+ <li><a class="dropdown-item" :href="'webhooks/delete/' + webhook.id"><span
class="bi bi-trash"></span> {{ __('firefly.delete') }}</a></li>
</ul>
</div>