Fake import works, won't fire rules yet. also needs a state.

This commit is contained in:
James Cole
2018-05-03 18:17:59 +02:00
parent 6bddb63b45
commit 480d65fc1f
3 changed files with 15 additions and 3 deletions

View File

@@ -102,7 +102,17 @@ class JobStatusController extends Controller
'tag_name' => null === $importJob->tag_id ? null : $importJob->tag->tag, 'tag_name' => null === $importJob->tag_id ? null : $importJob->tag->tag,
'journals' => $extendedStatus['count'] ?? 0, 'journals' => $extendedStatus['count'] ?? 0,
'journals_text' => trans_choice('import.status_with_count', $extendedStatus['count'] ?? 0), 'journals_text' => trans_choice('import.status_with_count', $extendedStatus['count'] ?? 0),
'tag_text' => '',
]; ];
if (null !== $importJob->tag_id) {
$json['tag_text'] = trans(
'import.status_finished_job',
['count' => $extendedStatus['count'],
'link' => route('tags.show', [$importJob->tag_id]),
'tag' => $importJob->tag->tag,
]
);
}
return response()->json($json); return response()->json($json);
} }
@@ -230,8 +240,6 @@ class JobStatusController extends Controller
} }
} }
// /** // /**

View File

@@ -95,6 +95,9 @@ function showJobResults(data) {
// render the count: // render the count:
$('#import-status-more-info').append($('<span>').text(data.journals_text)); $('#import-status-more-info').append($('<span>').text(data.journals_text));
if(data.tag_id) {
$('#import-status-more-info').append($('<br>')).append($('<span>').html(data.tag_text));
}
// render relevant data from JSON thing. // render relevant data from JSON thing.
if (data.errors.length > 0) { if (data.errors.length > 0) {
@@ -182,7 +185,7 @@ function showProgressBox(status) {
// hide initial status box: // hide initial status box:
$('.status_initial').hide(); $('.status_initial').hide();
if(status === 'running') { if(status === 'running' || status === 'ready_to_run') {
$('#import-status-txt').text(langImportRunning); $('#import-status-txt').text(langImportRunning);
} else { } else {
$('#import-status-txt').text(langImportStoring); $('#import-status-txt').text(langImportStoring);

View File

@@ -49,6 +49,7 @@ return [
'status_errors_single' => 'An error has occurred during the import. It does not appear to be fatal.', 'status_errors_single' => 'An error has occurred during the import. It does not appear to be fatal.',
'status_errors_multi' => 'Some errors occurred during the import. These do not appear to be fatal.', 'status_errors_multi' => 'Some errors occurred during the import. These do not appear to be fatal.',
'status_with_count' => 'One transaction has been imported|:count transactions have been imported.', 'status_with_count' => 'One transaction has been imported|:count transactions have been imported.',
'job_status_breadcrumb' => 'Import job state',
'status_bread_crumb' => 'Import status', 'status_bread_crumb' => 'Import status',
'status_sub_title' => 'Import status', 'status_sub_title' => 'Import status',