diff --git a/app/Http/Controllers/Traits/VerifiesUserEmail.php b/app/Http/Controllers/Traits/VerifiesUserEmail.php index 02b7353de0b1..a161aa7cff9f 100644 --- a/app/Http/Controllers/Traits/VerifiesUserEmail.php +++ b/app/Http/Controllers/Traits/VerifiesUserEmail.php @@ -35,7 +35,10 @@ trait VerifiesUserEmail $user = User::where('confirmation_code', request()->confirmation_code)->first(); if (! $user) { - return $this->render('auth.confirmed', ['root' => 'themes', 'message' => ctrans('texts.wrong_confirmation')]); + return $this->render('auth.confirmed', [ + 'root' => 'themes', + 'message' => ctrans('texts.wrong_confirmation'), + 'redirect_url' => request()->has('react') ? config('ninja.react_url')."/#/" : url('/')]); } $user->email_verified_at = now(); @@ -46,16 +49,18 @@ trait VerifiesUserEmail return $this->render('auth.confirmed', [ 'root' => 'themes', 'message' => ctrans('texts.security_confirmation'), + 'redirect_url' => request()->has('react') ? config('ninja.react_url')."/#/" : url('/'), ]); } if (is_null($user->password) || empty($user->password) || Hash::check('', $user->password)) { - return $this->render('auth.confirmation_with_password', ['root' => 'themes', 'user_id' => $user->hashed_id]); + return $this->render('auth.confirmation_with_password', ['root' => 'themes', 'user_id' => $user->hashed_id, 'redirect_url' => request()->has('react') ? config('ninja.react_url')."/#/" : url('/')]); } return $this->render('auth.confirmed', [ 'root' => 'themes', 'message' => ctrans('texts.security_confirmation'), + 'redirect_url' => request()->has('react') ? config('ninja.react_url')."/#/" : url('/'), ]); } @@ -84,7 +89,7 @@ trait VerifiesUserEmail return $this->render('auth.confirmed', [ 'root' => 'themes', 'message' => ctrans('texts.security_confirmation'), - 'redirect_url' => request()->hasHeader('X-React') ? 'https://app.invoicing.co/#/' : url('/'), + 'redirect_url' => request()->has('react') ? config('ninja.react_url')."/#/" : url('/'), ]); } } diff --git a/app/Mail/Admin/VerifyUserObject.php b/app/Mail/Admin/VerifyUserObject.php index a55eccdd3a7e..1410a7eb50a6 100644 --- a/app/Mail/Admin/VerifyUserObject.php +++ b/app/Mail/Admin/VerifyUserObject.php @@ -42,10 +42,16 @@ class VerifyUserObject $this->user->confirmation_code = $this->createDbHash($this->company->db); $this->user->save(); + $react_redirect = ''; + + if(Ninja::isHosted()) { + $react_redirect = '?react=true'; + } + $data = [ 'title' => ctrans('texts.confirmation_subject'), 'message' => ctrans('texts.confirmation_message'), - 'url' => url("/user/confirm/{$this->user->confirmation_code}"), + 'url' => url("/user/confirm/{$this->user->confirmation_code}".$react_redirect), 'button' => ctrans('texts.button_confirmation_message'), 'settings' => $this->company->settings, 'logo' => $this->company->present()->logo(), diff --git a/app/Models/Client.php b/app/Models/Client.php index a5b635960722..5a4ec88f74b1 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -869,6 +869,6 @@ class Client extends BaseModel implements HasLocalePreference public function portalUrl(bool $use_react_url): string { - return $use_react_url ? config('ninja.react_url'). "/clients/{$this->hashed_id}": config('ninja.app_url'); + return $use_react_url ? config('ninja.react_url'). "/#/clients/{$this->hashed_id}": config('ninja.app_url'); } } diff --git a/app/Models/Payment.php b/app/Models/Payment.php index 346de07b85b9..5516d1d39b88 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -560,7 +560,7 @@ class Payment extends BaseModel public function portalUrl($use_react_url) { - return $use_react_url ? config('ninja.react_url')."/payments/{$this->hashed_id}/edit" : config('ninja.app_url'); + return $use_react_url ? config('ninja.react_url')."/#/payments/{$this->hashed_id}/edit" : config('ninja.app_url'); } } diff --git a/app/Models/Product.php b/app/Models/Product.php index fa9cc1f7a970..cff15a798e69 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -203,6 +203,6 @@ class Product extends BaseModel public function portalUrl($use_react_url): string { - return $use_react_url ? config('ninja.react_url') . "/products/{$this->hashed_id}/edit" : config('ninja.app_url'); + return $use_react_url ? config('ninja.react_url') . "/#/products/{$this->hashed_id}/edit" : config('ninja.app_url'); } } diff --git a/app/Models/PurchaseOrderInvitation.php b/app/Models/PurchaseOrderInvitation.php index 2e3b32828230..c41288d95924 100644 --- a/app/Models/PurchaseOrderInvitation.php +++ b/app/Models/PurchaseOrderInvitation.php @@ -203,7 +203,7 @@ class PurchaseOrderInvitation extends BaseModel { $entity_type = Str::snake(class_basename($this->entityType())); - return config('ninja.react_url')."/{$entity_type}s/{$this->{$entity_type}->hashed_id}/edit"; + return config('ninja.react_url')."/#/{$entity_type}s/{$this->{$entity_type}->hashed_id}/edit"; } } diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 51c58ce1c532..0ca138f12823 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -254,19 +254,6 @@ class Design extends BaseDesign return $elements; } - // $elements = [ - // ['element' => 'p', 'content' => ctrans('texts.shipping_address'), 'properties' => ['data-ref' => 'shipping_address-label', 'style' => 'font-weight: bold; text-transform: uppercase']], - // ['element' => 'p', 'content' => $this->client->name, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.name']], - // ['element' => 'p', 'content' => $this->client->shipping_address1, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.shipping_address1']], - // ['element' => 'p', 'content' => $this->client->shipping_address2, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.shipping_address2']], - // ['element' => 'p', 'show_empty' => false, 'elements' => [ - // ['element' => 'span', 'content' => "{$this->client->shipping_city} ", 'properties' => ['ref' => 'shipping_address-client.shipping_city']], - // ['element' => 'span', 'content' => "{$this->client->shipping_state} ", 'properties' => ['ref' => 'shipping_address-client.shipping_state']], - // ['element' => 'span', 'content' => "{$this->client->shipping_postal_code} ", 'properties' => ['ref' => 'shipping_address-client.shipping_postal_code']], - // ]], - // ['element' => 'p', 'content' => optional($this->client->shipping_country)->name, 'show_empty' => false], - // ]; - $address_variables = [ '$client.address1', '$client.address2', @@ -287,7 +274,11 @@ class Design extends BaseDesign })->toArray(); - return $elements; + $header = []; + $header[] = ['element' => 'p', 'content' => ctrans('texts.shipping_address'), 'properties' => ['data-ref' => 'shipping_address-label', 'style' => 'font-weight: bold; text-transform: uppercase']]; + return array_merge($header, $elements); + + // return $elements; } diff --git a/app/Utils/Traits/Inviteable.php b/app/Utils/Traits/Inviteable.php index 305fc5881fac..530c3f92c229 100644 --- a/app/Utils/Traits/Inviteable.php +++ b/app/Utils/Traits/Inviteable.php @@ -148,6 +148,6 @@ trait Inviteable { $entity_type = Str::snake(class_basename($this->entityType())); - return config('ninja.react_url')."/{$entity_type}s/{$this->{$entity_type}->hashed_id}/edit"; + return config('ninja.react_url')."/#/{$entity_type}s/{$this->{$entity_type}->hashed_id}/edit"; } }