From 279d7769f5cbbe4f5ce10ff4895a9599f9538204 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 18 Dec 2016 09:27:27 +0100 Subject: [PATCH] This fixes #470 --- app/Http/Controllers/ImportController.php | 5 ++++- resources/lang/en_US/firefly.php | 3 +++ resources/seeds/seed.testing.json | 2 +- resources/views/import/finished.twig | 13 ++++++++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ImportController.php b/app/Http/Controllers/ImportController.php index d854f141d9..270afe99d1 100644 --- a/app/Http/Controllers/ImportController.php +++ b/app/Http/Controllers/ImportController.php @@ -145,10 +145,13 @@ class ImportController extends Controller return $this->redirectToCorrectStep($job); } + // if there is a tag (there might not be), we can link to it: + $tagId = $job->extended_status['importTag'] ?? 0; + $subTitle = trans('firefly.import_finished'); $subTitleIcon = 'fa-star'; - return view('import.finished', compact('job', 'subTitle', 'subTitleIcon')); + return view('import.finished', compact('job', 'subTitle', 'subTitleIcon', 'tagId')); } /** diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 2dd05190e8..226834da8a 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -937,4 +937,7 @@ return [ 'bread_crumb_import_complete' => 'Import ":key" complete', 'bread_crumb_configure_import' => 'Configure import ":key"', 'bread_crumb_import_finished' => 'Import ":key" finished', + 'import_finished_intro' => 'The import has finished! You can now see the new transactions in Firefly.', + 'import_finished_text_without_link' => 'It seems there is no tag that points to all your imported transactions. Please look for your imported data in the menu on the left, under "Transactions".', + 'import_finished_text_with_link' => 'You can find a list of your imported transactions on the page of the tag that was created for this import.', ]; diff --git a/resources/seeds/seed.testing.json b/resources/seeds/seed.testing.json index 5411ed03a1..5ec4e900f2 100644 --- a/resources/seeds/seed.testing.json +++ b/resources/seeds/seed.testing.json @@ -1161,7 +1161,7 @@ "total_steps": 0, "errors": [], "import_count": 0, - "importTag": 0 + "importTag": 1 }, "configuration": { } diff --git a/resources/views/import/finished.twig b/resources/views/import/finished.twig index 63e5b450fc..aa4066385e 100644 --- a/resources/views/import/finished.twig +++ b/resources/views/import/finished.twig @@ -11,7 +11,18 @@

{{ 'import_finished'|_ }}

- This import has beeen done. Link to tag or set of transactions. +

+ {{ 'import_finished_intro'|_ }} +

+ {% if tagId > 0 %} +

+ {{ trans('firefly.import_finished_text_with_link', {tag: tagId})|raw }} +

+ {% else %} +

+ {{ 'import_finished_text_without_link'|_ }} +

+ {% endif %}

{{ 'import_share_configuration'|_ }}