diff --git a/app/Http/Controllers/IndexController.php b/app/Http/Controllers/IndexController.php index 2195412f..9786a8a5 100644 --- a/app/Http/Controllers/IndexController.php +++ b/app/Http/Controllers/IndexController.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace App\Http\Controllers; +use App\Exceptions\ImporterErrorException; use App\Services\Session\Constants; use App\Services\Shared\Authentication\SecretManager; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/TokenController.php b/app/Http/Controllers/TokenController.php index 2067de0d..e6ec2f4c 100644 --- a/app/Http/Controllers/TokenController.php +++ b/app/Http/Controllers/TokenController.php @@ -225,7 +225,12 @@ class TokenController extends Controller // Option 3: either is empty, ask for client ID and/or base URL: $clientId = 0 === $clientId ? '' : $clientId; - return view('token.client_id', compact('baseUrl', 'clientId', 'pageTitle')); + // if the vanity url is the same as the base url, just give this view an empty string + if($vanityUrl === $baseUrl) { + $vanityUrl = ''; + } + + return view('token.client_id', compact('baseUrl','vanityUrl', 'clientId', 'pageTitle')); } /** diff --git a/resources/js/v2/src/pages/index/index.js b/resources/js/v2/src/pages/index/index.js index f7b36010..68ae122f 100644 --- a/resources/js/v2/src/pages/index/index.js +++ b/resources/js/v2/src/pages/index/index.js @@ -53,6 +53,8 @@ let index = function () { let tokenPageUrl = './token'; window.axios.get(validateUrl).then((response) => { let message = response.data.result; + console.log('message is ', message) + if ('OK' === message) { this.loadingFunctions.file = false; this.importFunctions.file = true; @@ -68,7 +70,7 @@ let index = function () { this.importFunctions.spectre = false; this.pageProperties.connectionError = true; - this.pageProperties.connectionErrorMessage = data.message; + this.pageProperties.connectionErrorMessage = response.data.message; }).catch((error) => { this.loadingFunctions.file = false; this.loadingFunctions.gocardless = false; @@ -80,9 +82,12 @@ let index = function () { this.pageProperties.connectionError = true; this.pageProperties.connectionErrorMessage = error; }).finally(() => { - this.checkSpectreConnection(); - this.checkGoCardlessConnection(); + if(false === this.pageProperties.connectionError) { + this.checkSpectreConnection(); + this.checkGoCardlessConnection(); + } }); + }, checkSpectreConnection() { let validateUrl = './validate/spectre'; @@ -97,7 +102,9 @@ let index = function () { this.importFunctions.spectre = false; this.errors.spectre = 'The Spectre / Salt Edge API is configured incorrectly and cannot be used to import data.'; }).catch((error) => { - + this.loadingFunctions.spectre = false; + this.importFunctions.spectre = false; + this.errors.spectre = 'The Spectre / Salt Edge API is configured incorrectly and cannot be used to import data.'; }); }, checkGoCardlessConnection() { @@ -113,7 +120,9 @@ let index = function () { this.importFunctions.gocardless = false; this.errors.gocardless = 'The GoCardless API is configured incorrectly and cannot be used to import data.'; }).catch((error) => { - + this.loadingFunctions.gocardless = false; + this.importFunctions.gocardless = false; + this.errors.gocardless = 'The GoCardless API is configured incorrectly and cannot be used to import data.'; }); } } diff --git a/resources/js/v2/vite.config.js b/resources/js/v2/vite.config.js index ad0d2e9d..4d78cef6 100644 --- a/resources/js/v2/vite.config.js +++ b/resources/js/v2/vite.config.js @@ -48,19 +48,11 @@ export default defineConfig({ 'src/sass/app.scss', // index - 'src/pages/index/index.js', - - // configuration 'src/pages/configuration/index.js', - - // selection - 'src/pages/selection/gocardless.js', - - // conversion 'src/pages/conversion/index.js', - - // submission - 'src/pages/submission/index.js', + 'src/pages/index/index.js', + 'src/pages/selection/gocardless.js', + 'src/pages/submit/index.js', ], publicDirectory: '../../../public', refresh: true diff --git a/resources/views/v2/debug-table.blade.php b/resources/views/v2/debug-table.blade.php new file mode 100644 index 00000000..5498e8a7 --- /dev/null +++ b/resources/views/v2/debug-table.blade.php @@ -0,0 +1,78 @@ +
System information | +|
---|---|
Item | +Value | +
Version | +{{ config('importer.version') }} | +
Build | +#{{ $system['build'] }}, base #{{ $system['base_build'] }} | +
System | +PHP {{ $system['php_version'] }}, {{ $system['php_os'] }}, {{ $system['interface'] }} | +
App information | +|
---|---|
Item | +Value | +
Timezone | +{{ config('app.timezone') }}, [BrowserTZ] | +
Environment | +{{ config('app.env') }} | +
Debug mode | +{{ $app['debug'] }}, cache '{{ config('cache.default') }}' | +
Log level | +{{ config('logging.level') }}, {{ config('logging.default') }} | +
Display errors | +{{ $app['display_errors'] }}, {{ $app['reporting'] }} | +
BCscale | +{{ $app['bcscale'] }} | +
Trusted proxies | +{{ config('importer.trusted_proxies') }} | +
User information | +|
---|---|
Item | +Value | +
+ User agent + | ++ {{ $user['user_agent'] }} + | +
+ Firefly III data importer debug page +
++ Copy and paste the content of this textarea in your issue. Please do not add quotes or backticks, it breaks the table. +
+ + + ++ Back to index +
+ ++ Extra info. Do not share this lightly! +
+ + + ++ Back to index +
+ + + diff --git a/resources/views/v2/emails/import/report.blade.php b/resources/views/v2/emails/import/report.blade.php new file mode 100644 index 00000000..d509d01f --- /dev/null +++ b/resources/views/v2/emails/import/report.blade.php @@ -0,0 +1,52 @@ +@component('mail::message') +# Result of your import on {{ $time }} + ++ This should only take a few moments. If you had an import running, you may have to start over. My apologies. +
++ Please check back in a second! +
++ Sorry, the Firefly III Data Importer broke down. +
++ {{ $exception->getMessage() }} +
+
+ The error occurred in {{ $exception->getFile() }}:{{ $exception->getLine() }}
.
+
+ Please collect more information in the storage/logs
directory, where you will find log files.
+ If you're running Docker, use docker logs -f [container]
.
+ You can read more about collecting error information in the FAQ.
+
+ You're more than welcome to open a new issue on GitHub. +
+In order to import using + @if('nordigen' === $flow) + GoCardless, + @endif + @if('spectre' === $flow) + Spectre, + @endif + you must enter the authentication data you + received from this provider. + You can read how to get the necessary codes in the + documentation +
+{{ $error }}
+ @endif + + ++ CAMT files feature "layers", where each layer has its own content. + Your options per field may be limited. Firefly III will not be able to + store all content of a CAMT file. If you feel your choices are too limited, please + open an issue on GitHub. +
+Some error(s) occurred:
++ Welcome! This tool will help you import data into Firefly III. +
++ This tool is sparsely documented, you can find all the details you need + in the + documentation. Any links you see to the docs will open in a new window or tab. +
++ @if('' !== (string)$baseUrl) + In order to get access to your Firefly III installation at {{ $baseUrl }} + @if('' !== (string)$vanityUrl) + ({{ $vanityUrl }}) + @endif + , you will need to submit a valid Client ID. This is a number. + @else + In order to get access to your Firefly III installation, you will need to submit a valid Client ID. This is a number. + @endif +
++ @if('' !== (string)$baseUrl) + If you don't have one, you must create in your + profile under "OAuth". Make sure you + remove the checkbox under "Confidential". + @else + If you don't have one, you must create in your profile under "OAuth". Make sure you + remove the checkbox under "Confidential". + @endif +
+
+ The callback URL for this installation is
{{ route('token.callback') }}
+
{{ $error }}
+ @endforeach + + + ++ Start over +
+