]> _ Git - pmi.git/commitdiff
wait #5788 @9:00 correctifs import, page mes commandes, message erreur connexion...
authorsoufiane <soufiane@cubedesigners.com>
Wed, 30 Aug 2023 09:52:00 +0000 (11:52 +0200)
committersoufiane <soufiane@cubedesigners.com>
Wed, 30 Aug 2023 09:52:00 +0000 (11:52 +0200)
app/Http/Controllers/Admin/ProductBaseController.php
app/Http/Controllers/AjaxController.php
e2e/connexion-exist.spec.js [new file with mode: 0644]
resources/js/app.js
resources/lang/fr/auth.php
resources/views/components/item-cart-order.blade.php
resources/views/pages/product-detail.blade.php

index 9d719d0f9a424e97f6f6125e4739f6c86c901aef..3460b9d88b6d206c27cff9cc6c948cb9c76ee1d8 100644 (file)
@@ -69,8 +69,10 @@ class ProductBaseController extends CubistMagicController {
                 // Parse product sheets
                 $ids = [];
                 foreach ($excel[$filename] as $sheet => $rows) {
-                    $options = array_splice($rows, 9);
-                    $emptyRef = array_filter($options, function($n) { return empty($n[6]); });
+                    $_rows = $rows;
+                    $options = array_splice($_rows, 9);
+                    $emptyRef = array_filter($options, function($n) { return $this->isEmpty($n[6]); });
+
                     if($emptyRef) {
                         $contentMail["details"][$filename][$sheet] = "[ERREUR] Référence option manquante";
                         continue;
@@ -87,7 +89,6 @@ class ProductBaseController extends CubistMagicController {
 
 
                     // Parse rows of sheet
-
                     foreach ($rows as $row => $columns) {
                         if ($row < 8) {
                             foreach ($fields as $key => $field) {
@@ -142,7 +143,7 @@ class ProductBaseController extends CubistMagicController {
                     ->toArray();
 
                 foreach ($ids as $sheet => $id) {
-                    if ($product[$id]) {
+                    if (array_key_exists($id, $product)) {
                         $changes = $this->storeAndReturnChanges($data);
 
                         // Remove empty array from the changes
@@ -239,7 +240,12 @@ class ProductBaseController extends CubistMagicController {
             $message->sender(config('mail.from.address'), config('mail.from.name'));
             $message->to(config('mail.to'));
             $message->bcc('test+pmi@cubedesigners.com');
+            $message->bcc('contact@pm-instrumentation.com');
             $message->subject("[PMI] Import des fiches produits");
         });
     }
+
+    public function isEmpty($v) {
+        return null===$v || $v===false || $v==='';
+    }
 }
index d32b86b8ae17d27f7ccf2cca36772bd23358ab9d..8896aa355110551f6fb66d58040d823c41f4f8d0 100644 (file)
@@ -125,7 +125,7 @@ class AjaxController extends CubistFrontController
         Mail::raw(implode("\r\n", $contents), function ($message) use ($validatedData, $page, $subject_,$recipient) {
             $message->from(config('mail.from.address'), config('mail.from.name'));
             $message->sender(config('mail.from.address'), config('mail.from.name'));
-            //$message->to('soufiane@cubedesigners.com');
+            $message->to('soufiane@cubedesigners.com');
             $message->bcc('test+pmi@cubedesigners.com');
             if($recipient) {
                 $message->to($recipient);
diff --git a/e2e/connexion-exist.spec.js b/e2e/connexion-exist.spec.js
new file mode 100644 (file)
index 0000000..61e173a
--- /dev/null
@@ -0,0 +1,13 @@
+import { test, expect } from '@playwright/test';
+
+test('email exist', async ({ page }) => {
+    await page.goto('https://dev.pm-instrumentation.com/', {waitUntil: 'domcontentloaded'});
+
+    await page.getByRole('link', { name: 'Se connecter' }).click();
+
+    await page.getByRole('textbox').fill('example value');
+
+    await page.getByText('Connexion').click();
+
+    console.log(page.waitForResponse());
+});
index 110253ddc952c769e7e304389b2782b5317ce75c..69921c8e2b5d5b7fc01892f9d1eb1f1a71f7b699 100644 (file)
@@ -99,7 +99,6 @@ const app = new Vue({
     },
 
     mounted() {
-
         eventBus.$on('add-item', data => {
             data.action = 'add';
             data.ref = data.ref !== "" ? data.ref : this.ref;
@@ -126,7 +125,9 @@ const app = new Vue({
         this.discount = this.$refs.discount ?.dataset.value
         this.validateAction = this.$refs.forgotpwd ?.dataset.status //specific code for the forgot password confirmation
 
-        console.log(this.cartData)
+        let option = this.$refs.optionsExist?.dataset.val;
+        this.statusConfig = !option && this.price ? true : false
+        console.log("option",option)
     },
 
     watch: {
index d2e3c2cd120b55399cd3aa3833a505b350ffd1c7..e9cd362b92cdb359c3b66f1564abbb9f778298aa 100644 (file)
@@ -13,6 +13,6 @@ return [
     |
     */
 
-    'failed' => 'Ces identifiants s',
+    'failed' => 'Ces identifiants sont incorrects',
     'throttle' => 'Trop de tentatives. Veuillez patienter :seconds secondes.',
 ];
index 8b06bf3607ad78b6c5ef37ad68563ccceaa77d9b..b9ec1a03916cc12ab4edba5e3343c7823c40523c 100644 (file)
                     </div>
                     <div class="product-infos flex sm:flex-col justify-between sm:items-start items-center">
                         <div>
-                            <p class="no-m">{{ $product['reference'].'|'.$product['ref'] }}</p>
+                            <p class="no-m">
+                                {{ $product['reference'] }}
+                                @if($product['ref'])
+                                    {{ '|'. (is_array($product['ref']) ? implode("",$product['ref']) : $product['ref']) }}
+                                @endif
+                            </p>
                             <p class="no-m text-navy">{{ $product['name'] }}</p>
                             @if(isset($product['discount']) && $product['discount'] !== 0)
                                 @if(floatval($product['basic_selling_price']))
index 87378aeed89b3c3745785fd36298684bc0ce4e11..28530ec0326f15483e0de3e2f82042f9eb487255 100644 (file)
                                     <span ref="optprice" v-cloak data-default="{{ $product->basic_selling_price }}">@{{ price }}</span>{{ "€ ".__('HT') }}
                                 @endif
                             </div>
+                            @if($options)
                             <div class="opt-statut">{{ __('Statut') }} :
                                 <span v-cloak :class="{ 'text-green' : statusConfig }" ref="statusConfig" data-incomplete="{{ __('La configuration est incomplète') }}" data-completed="{{ __('La configuration est complète') }}">
                                     @{{ statusText }}
                                 </span>
                             </div>
+                            @endif
+                            <input type="hidden" ref="optionsExist" data-val="{{$options}}">
                         </div>
                     @endif
                 @endauth