]> _ Git - psq.git/commitdiff
test new pushish file
authorLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 21 Sep 2020 08:22:04 +0000 (10:22 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 21 Sep 2020 08:22:04 +0000 (10:22 +0200)
app/Events/FileProcessingUpdate.php
app/Http/Controllers/Admin/PublishController.php
app/Http/Controllers/Auth/RegisterController.php
app/Http/Controllers/ContactController.php
public/admin/js/admin.js
public/js/app.js
resources/js/components/Publish/Step1UploadFile.vue
routes/admin.php

index 968d1d99d9d4246b2981621271359148edcd195f..93e8397c2f36cadb89a13290354105e0763edba4 100644 (file)
@@ -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)
         ];
     }
 
index f7330ece911b2051b7f9acec920771ef532cb29d..0e8e311f355ce28cd038e5737173ba9bd5a65a79 100644 (file)
@@ -52,6 +52,10 @@ class PublishController extends Controller
         return ['data' => $batch->id];
     }
 
+    public function file(Request $request, PdfFile $file)
+    {
+        return response()->json($file);
+    }
 
 
 
index 16a46a5111bd1ebb5fa5f274ece82dc73b9f035b..64a7661358d1f4e744058fd281e20f1c35aaeeb5 100644 (file)
@@ -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.
      *
index a8959659f4b857fd4bab0e3925b9629278287f4a..f017df7fb8844fdcff8060145ee5ae2112ea6229 100644 (file)
@@ -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']);
     }
 
 
index 13d1cdf9f0f8ca3866c8f2c1e6ff4a7e21f2b5de..6eb3767700bfeec475c54316bce5c5b2a1a1d400 100644 (file)
@@ -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;
         }
       });
     });
index bbc5ce6b50e069af20ebd4659bc216d24fbecaa7..c2ce1afd151f8a273cb3cbc4e7147c60e4e5d768 100644 (file)
@@ -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;
         }
       });
     });
index 713b01a61acfecc7a920467ec50223062ad3cc70..90ae82ac0d0c5fafa5cf219d17e5487460dbde47 100644 (file)
                 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});
+                    })
+
                 }
 
 
index 2e5187cd8d3b14ff2f1abcd99cec39996e3b9351..16143fbc06a41600a5ca9cf360da70c534130d6e 100644 (file)
@@ -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');