From: Louis Jeckel Date: Mon, 21 Sep 2020 08:22:04 +0000 (+0200) Subject: test new pushish file X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=03327a55bd735db9cc22350e7deae8941583fd2e;p=psq.git test new pushish file --- diff --git a/app/Events/FileProcessingUpdate.php b/app/Events/FileProcessingUpdate.php index 968d1d9..93e8397 100644 --- a/app/Events/FileProcessingUpdate.php +++ b/app/Events/FileProcessingUpdate.php @@ -28,7 +28,7 @@ class FileProcessingUpdate implements ShouldBroadcast $this->file = $file; $this->data = [ 'status' => $status, - 'data' => array_merge(['file' => $file], $data) + 'data' => array_merge(['file_id' => $file->id], $data) ]; } diff --git a/app/Http/Controllers/Admin/PublishController.php b/app/Http/Controllers/Admin/PublishController.php index f7330ec..0e8e311 100644 --- a/app/Http/Controllers/Admin/PublishController.php +++ b/app/Http/Controllers/Admin/PublishController.php @@ -52,6 +52,10 @@ class PublishController extends Controller return ['data' => $batch->id]; } + public function file(Request $request, PdfFile $file) + { + return response()->json($file); + } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 16a46a5..64a7661 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -44,6 +44,16 @@ class RegisterController extends Controller $this->middleware('guest'); } + + /** + * @return string + */ + public function redirectTo() + { + return route('home', ['register' => 'success']); + } + + /** * Get a validator for an incoming registration request. * diff --git a/app/Http/Controllers/ContactController.php b/app/Http/Controllers/ContactController.php index a895965..f017df7 100644 --- a/app/Http/Controllers/ContactController.php +++ b/app/Http/Controllers/ContactController.php @@ -35,7 +35,7 @@ class ContactController extends Controller ->notify(new \App\Notifications\ContactRequest($contactRequest)); \Session::flash('message', "Votre demande a bien été prise en compte, nous reviendrons vers vous dans les plus brefs délais. Merci de l'intérêt que vous portez à Prescription Santé - Le Quotidien !"); - return redirect()->route('home'); + return redirect()->route('home', ['contact' => 'success']); } diff --git a/public/admin/js/admin.js b/public/admin/js/admin.js index 13d1cdf..6eb3767 100644 --- a/public/admin/js/admin.js +++ b/public/admin/js/admin.js @@ -3209,15 +3209,20 @@ __webpack_require__.r(__webpack_exports__); }, methods: { processStatusUpdate: function processStatusUpdate(e) { + var _this = this; + e = e.data; if (e.status === 'done') { this.progressMode = 'determinate'; - this.$root.publishState.file = e.data.file; this.links = e.data.links; - this.status = 'done'; - this.$emit('can-continue', { - value: true + axios.get('/publish/file/' + e.data.file_id).then(function (data) { + _this.$root.publishState.file = data.data; + _this.status = 'done'; + + _this.$emit('can-continue', { + value: true + }); }); } }, @@ -3246,11 +3251,11 @@ __webpack_require__.r(__webpack_exports__); } }, mounted: function mounted() { - var _this = this; + var _this2 = this; axios.get('/publish/collections').then(function (d) { - _this.collections = d.data.data; - _this.file_ref = _this.getNextRef(1); + _this2.collections = d.data.data; + _this2.file_ref = _this2.getNextRef(1); }); axios.get('/publish/tags').then(function (d) { var tags = d.data.data; @@ -3262,7 +3267,7 @@ __webpack_require__.r(__webpack_exports__); options: tags, plugins: ['remove_button'], onChange: function onChange(v) { - return _this.tags = v; + return _this2.tags = v; } }); }); diff --git a/public/js/app.js b/public/js/app.js index bbc5ce6..c2ce1af 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -8404,15 +8404,20 @@ __webpack_require__.r(__webpack_exports__); }, methods: { processStatusUpdate: function processStatusUpdate(e) { + var _this = this; + e = e.data; if (e.status === 'done') { this.progressMode = 'determinate'; - this.$root.publishState.file = e.data.file; this.links = e.data.links; - this.status = 'done'; - this.$emit('can-continue', { - value: true + axios.get('/publish/file/' + e.data.file_id).then(function (data) { + _this.$root.publishState.file = data.data; + _this.status = 'done'; + + _this.$emit('can-continue', { + value: true + }); }); } }, @@ -8441,11 +8446,11 @@ __webpack_require__.r(__webpack_exports__); } }, mounted: function mounted() { - var _this = this; + var _this2 = this; axios.get('/publish/collections').then(function (d) { - _this.collections = d.data.data; - _this.file_ref = _this.getNextRef(1); + _this2.collections = d.data.data; + _this2.file_ref = _this2.getNextRef(1); }); axios.get('/publish/tags').then(function (d) { var tags = d.data.data; @@ -8457,7 +8462,7 @@ __webpack_require__.r(__webpack_exports__); options: tags, plugins: ['remove_button'], onChange: function onChange(v) { - return _this.tags = v; + return _this2.tags = v; } }); }); diff --git a/resources/js/components/Publish/Step1UploadFile.vue b/resources/js/components/Publish/Step1UploadFile.vue index 713b01a..90ae82a 100644 --- a/resources/js/components/Publish/Step1UploadFile.vue +++ b/resources/js/components/Publish/Step1UploadFile.vue @@ -207,11 +207,15 @@ if(e.status === 'done'){ this.progressMode = 'determinate'; - this.$root.publishState.file = e.data.file; this.links = e.data.links; - this.status = 'done'; - this.$emit('can-continue', {value: true}); + axios.get('/publish/file/'+e.data.file_id).then(data => { + + this.$root.publishState.file = data.data; + this.status = 'done'; + this.$emit('can-continue', {value: true}); + }) + } diff --git a/routes/admin.php b/routes/admin.php index 2e5187c..16143fb 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -41,7 +41,7 @@ Route::prefix('otherContent')->group(function () { Route::prefix('publish')->group(function() { Route::get('', 'PublishController@letter')->name('publish.letter'); Route::post('', 'PublishController@publish'); - + Route::get('file/{file}', 'PublishController@file'); Route::post('upload-file', 'PublishController@uploadFile'); Route::post('preview', 'PublishController@previewEmail'); Route::get('collections', 'PublishController@collections');