Skip to content

Commit

Permalink
Merge pull request #8818 from turbo124/v5-develop
Browse files Browse the repository at this point in the history
Changes for react build
  • Loading branch information
turbo124 committed Sep 20, 2023
2 parents c3db97a + d65ee08 commit d41ad24
Show file tree
Hide file tree
Showing 41 changed files with 507 additions and 440 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,7 @@ jobs:
npm i
npm run build
for file in dist/react/* ; do
filename=$(basename -- "$file")
extension="${filename##*.}"
filename="${filename%.*}"
version=${{ github.event.release.tag_name }}
cp $file ../public/react/$filename"."$version"."$extension
done
cp -r dist/react/* ../public/react/${{ github.event.release.tag_name }}/
mkdir -p ../public/tinymce_6.4.2/tinymce/js/
cp -r node_modules/tinymce ../public/tinymce_6.4.2/tinymce/js/
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.7.18
5.7.19
10 changes: 5 additions & 5 deletions app/Console/Commands/ReactBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ public function handle()
$directoryIterator = new \RecursiveDirectoryIterator(public_path('react'), \RecursiveDirectoryIterator::SKIP_DOTS);

foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) {
if ($file->getExtension() == 'js' && stripos($file->getFileName(), config('ninja.app_version')) !== false) {
if ($file->getExtension() == 'js') {
if (str_contains($file->getFileName(), 'index-')) {
$includes .= '<script type="module" crossorigin src="/react/'.$file->getFileName().'"></script>'."\n";
$includes .= '<script type="module" crossorigin src="/react/'.config('ninja.app_version').'/'.$file->getFileName().'"></script>'."\n";
} else {
$includes .= '<link rel="modulepreload" href="/react/'.$file->getFileName().'">'."\n";
$includes .= '<link rel="modulepreload" href="/react/'.config('ninja.app_version').'/'.$file->getFileName().'">'."\n";
}
}

if (str_contains($file->getFileName(), '.css' && stripos($file->getFileName(), config('ninja.app_version')) !== false)) {
$includes .= '<link rel="stylesheet" href="/react/'.$file->getFileName().'">'."\n";
if (str_contains($file->getFileName(), '.css')) {
$includes .= '<link rel="stylesheet" href="/react/'.config('ninja.app_version').'/'.$file->getFileName().'">'."\n";
}
}

Expand Down
19 changes: 9 additions & 10 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ private function handleMicrosoftOauth()
if ($user) {
$account = request()->input('account');

$email = $user->getUserPrincipalName() ?: $user->getMail();
$email = $user->getUserPrincipalName() ?? false;

$query = [
'oauth_user_id' => $user->getId(),
Expand All @@ -438,17 +438,16 @@ private function handleMicrosoftOauth()
return $this->existingOauthUser($existing_user);
}

//If this is a result user/email combo - lets add their OAuth details details
// if ($existing_login_user = MultiDB::hasUser(['email' => $email])) {
// if (!$existing_login_user->account) {
// return response()->json(['message' => 'User exists, but not attached to any companies! Orphaned user!'], 400);
// }

// Auth::login($existing_login_user, true);
// If this is a result user/email combo - lets add their OAuth details details
if ($email && $existing_login_user = MultiDB::hasUser(['email' => $email])) {
if (!$existing_login_user->account) {
return response()->json(['message' => 'User exists, but not attached to any companies! Orphaned user!'], 400);
}

// return $this->existingLoginUser($user->getId(), 'microsoft');
// }
Auth::login($existing_login_user, true);

return $this->existingLoginUser($user->getId(), 'microsoft');
}

// Signup!
if (request()->has('create') && request()->input('create') == 'true') {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ConnectedAccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private function handleMicrosoftOauth($request)
->execute();

if ($user) {
$email = $user->getMail() ?: $user->getUserPrincipalName();
$email = $user->getUserPrincipalName() ?? false;

nlog("microsoft");
nlog($email);
Expand Down
4 changes: 2 additions & 2 deletions config/ninja.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => env('APP_VERSION','5.7.18'),
'app_tag' => env('APP_TAG','5.7.18'),
'app_version' => env('APP_VERSION','5.7.19'),
'app_tag' => env('APP_TAG','5.7.19'),
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''),
Expand Down
18 changes: 14 additions & 4 deletions lang/ar/texts.php
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,6 @@
'created_by_invoice' => 'تم إنشاؤه بواسطة :invoice',
'primary_user' => 'المستخدم الأساسي',
'help' => 'يساعد',
'customize_help' => '<p style=";text-align:right;direction:rtl">نستخدم :pdfmake_link لتعريف تصميمات الفواتير بشكل إعلاني. يوفر pdfmake :playground_link طريقة رائعة لمشاهدة المكتبة أثناء العمل.</p><p style=";text-align:right;direction:rtl"> إذا كنت بحاجة إلى مساعدة في اكتشاف شيء ما ، فقم بإرسال سؤال إلى :forum_link بالتصميم الذي تستخدمه.</p>',
'playground' => 'ملعب',
'support_forum' => 'Support Forums',
'invoice_due_date' => 'تاريخ الاستحقاق',
Expand Down Expand Up @@ -1796,15 +1795,13 @@
'bot_emailed_notify_paid' => 'سأرسل لك بريدًا إلكترونيًا عندما يتم الدفع.',
'add_product_to_invoice' => 'أضف 1 :product',
'not_authorized' => 'أنك غير مخول',
'bot_get_email' => 'أهلاً! (موجة)<br/> نشكرك على تجربة Invoice Ninja Bot.<br/> تحتاج إلى إنشاء حساب مجاني لاستخدام هذا الروبوت.<br/> أرسل لي عنوان البريد الإلكتروني لحسابك للبدء.',
'bot_get_code' => 'شكرًا! لقد أرسلت إليك بريدًا إلكترونيًا يحتوي على رمز الأمان الخاص بك.',
'bot_welcome' => 'هذا كل شيء ، تم التحقق من حسابك.<br/>',
'email_not_found' => 'لم أتمكن من العثور على حساب متاح لـ :email',
'invalid_code' => 'الكود غير صحيح',
'security_code_email_subject' => 'رمز الحماية لـ Invoice Ninja Bot',
'security_code_email_line1' => 'هذا هو رمز أمان Invoice Ninja Bot الخاص بك.',
'security_code_email_line2' => 'ملحوظة: ستنتهي في غضون 10 دقائق.',
'bot_help_message' => 'أنا حاليا أدعم:<br/> • إنشاء \ تحديث \ فاتورة بالبريد الإلكتروني<br/> • قائمة المنتجات<br/> على سبيل المثال:<br/> <i>فاتورة bob لتذكرتين ، حدد تاريخ الاستحقاق ليوم الخميس التالي والخصم على 10 بالمائة</i>',
'list_products' => 'قائمة المنتجات',

'include_item_taxes_inline' => 'قم بتضمين <b>ضرائب البند في إجمالي السطر</b>',
Expand All @@ -1817,7 +1814,6 @@
'update_invoiceninja_warning' => 'قبل البدء في ترقية Invoice Ninja ، قم بإنشاء نسخة احتياطية من قاعدة البيانات والملفات الخاصة بك!',
'update_invoiceninja_available' => 'يتوفر إصدار جديد من Invoice Ninja.',
'update_invoiceninja_unavailable' => 'لا يتوفر إصدار جديد من Invoice Ninja.',
'update_invoiceninja_instructions' => 'الرجاء تثبيت الإصدار الجديد <strong>:version</strong> بالنقر فوق الزر <em>&quot;تحديث الآن&quot;</em> أدناه. بعد ذلك ستتم إعادة توجيهك إلى لوحة القيادة.',
'update_invoiceninja_update_start' => 'تحديث الان',
'update_invoiceninja_download_start' => 'تنزيل :version',
'create_new' => 'خلق جديد إبداع جديد',
Expand Down Expand Up @@ -5132,6 +5128,20 @@
'unlinked_transaction' => 'Successfully unlinked transaction',
'view_dashboard_permission' => 'Allow user to access the dashboard, data is limited to available permissions',
'marked_sent_credits' => 'Successfully marked credits sent',
'show_document_preview' => 'Show Document Preview',
'cash_accounting' => 'Cash accounting',
'click_or_drop_files_here' => 'Click or drop files here',
'set_public' => 'Set public',
'set_private' => 'Set private',
'individual' => 'Individual',
'business' => 'Business',
'partnership' => 'partnership',
'trust' => 'Trust',
'charity' => 'Charity',
'government' => 'Government',
'in_stock_quantity' => 'Stock quantity',
'vendor_contact' => 'Vendor Contact',

);

return $LANG;
Expand Down
19 changes: 14 additions & 5 deletions lang/bg/texts.php
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,6 @@
'created_by_invoice' => 'Създадено от :invoice',
'primary_user' => 'Основен потребител',
'help' => 'Помощ',
'customize_help' => '<p>Ние използваме :pdfmake_link за декларативно дефиниране на дизайна на фактурите. Инструментът pdfmake :playground_link осигурява чудесен начин да видите библиотеката в действие.</p>
<p>Ако се нуждаете от помощ, задайте въпрос в нашия :forum_link с дизайна, който използвайте.</p>',
'playground' => 'playground',
'support_forum' => 'Support Forums',
'invoice_due_date' => 'Падеж',
Expand Down Expand Up @@ -1823,15 +1821,13 @@
'bot_emailed_notify_paid' => 'Ще се свържа с Вас по имейл, когато е платено.',
'add_product_to_invoice' => 'Добавяне на 1 :product',
'not_authorized' => 'Нямате оторизация',
'bot_get_email' => 'Здравейтеi! (wave)<br/>Благодарим, че тествахте Invoice Ninja Bot.<br/>Трябва да създадете безплатен акаунт, за да използвате този bot.<br/>За начало ми изпратете имейл адреса на своя акаунт.',
'bot_get_code' => 'Благодарим! Изпратихме Ви имейл с Вашия код за сигурност.',
'bot_welcome' => 'Готово! Профилът Ви е потвърден.',
'email_not_found' => 'Не успях да открия профил на :email',
'invalid_code' => 'Кодът е некоректен',
'security_code_email_subject' => 'Код за сигурност за Invoice Ninja Bot',
'security_code_email_line1' => 'Това е Вашият код за сигурност за Invoice Ninja Bot.',
'security_code_email_line2' => 'Забележка: Той ще изтече след 10 минути.',
'bot_help_message' => 'I currently support:<br/>• Create\update\email an invoice<br/>• List products<br/>For example:<br/><i>invoice bob for 2 tickets, set the due date to next thursday and the discount to 10 percent</i>',
'list_products' => 'Списък продукти',

'include_item_taxes_inline' => 'Включване на <b>данъка по редове в стойността на реда</b>',
Expand All @@ -1844,7 +1840,6 @@
'update_invoiceninja_warning' => 'Преди да стартирате актуализация на Invoice Ninja направете архив на своята база данни и фалове!',
'update_invoiceninja_available' => 'Налична е нова версия на Invoice Ninja.',
'update_invoiceninja_unavailable' => 'Няма по-нова версия на Invoice Ninja.',
'update_invoiceninja_instructions' => 'Моля, инсталирайте новата версия <strong>:version</strong> като използвате бутона <em>Актуализирай сега</em>. След това ще бъдете прехвърлени към таблото.',
'update_invoiceninja_update_start' => 'Актуализирай сега',
'update_invoiceninja_download_start' => 'Изтегляне на :version',
'create_new' => 'Нов',
Expand Down Expand Up @@ -5159,6 +5154,20 @@
'unlinked_transaction' => 'Successfully unlinked transaction',
'view_dashboard_permission' => 'Allow user to access the dashboard, data is limited to available permissions',
'marked_sent_credits' => 'Successfully marked credits sent',
'show_document_preview' => 'Show Document Preview',
'cash_accounting' => 'Cash accounting',
'click_or_drop_files_here' => 'Click or drop files here',
'set_public' => 'Set public',
'set_private' => 'Set private',
'individual' => 'Individual',
'business' => 'Business',
'partnership' => 'partnership',
'trust' => 'Trust',
'charity' => 'Charity',
'government' => 'Government',
'in_stock_quantity' => 'Stock quantity',
'vendor_contact' => 'Vendor Contact',

);

return $LANG;
Expand Down
19 changes: 14 additions & 5 deletions lang/ca/texts.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,6 @@
'created_by_invoice' => 'Created by :invoice',
'primary_user' => 'Primary User',
'help' => 'Help',
'customize_help' => '<p>We use :pdfmake_link to define the invoice designs declaratively. The pdfmake :playground_link provides a great way to see the library in action.</p>
<p>If you need help figuring something out post a question to our :forum_link with the design you\'re using.</p>',
'playground' => 'playground',
'support_forum' => 'Support Forums',
'invoice_due_date' => 'Data de venciment',
Expand Down Expand Up @@ -1822,15 +1820,13 @@
'bot_emailed_notify_paid' => 'I\'ll email you when it\'s paid.',
'add_product_to_invoice' => 'Add 1 :product',
'not_authorized' => 'You are not authorized',
'bot_get_email' => 'Hi! (wave)<br/>Thanks for trying the Invoice Ninja Bot.<br/>You need to create a free account to use this bot.<br/>Send me your account email address to get started.',
'bot_get_code' => 'Thanks! I\'ve sent a you an email with your security code.',
'bot_welcome' => 'That\'s it, your account is verified.<br/>',
'email_not_found' => 'I wasn\'t able to find an available account for :email',
'invalid_code' => 'The code is not correct',
'security_code_email_subject' => 'Security code for Invoice Ninja Bot',
'security_code_email_line1' => 'This is your Invoice Ninja Bot security code.',
'security_code_email_line2' => 'Note: it will expire in 10 minutes.',
'bot_help_message' => 'I currently support:<br/>• Create\update\email an invoice<br/>• List products<br/>For example:<br/><i>invoice bob for 2 tickets, set the due date to next thursday and the discount to 10 percent</i>',
'list_products' => 'List Products',

'include_item_taxes_inline' => 'Include <b>line item taxes in line total</b>',
Expand All @@ -1843,7 +1839,6 @@
'update_invoiceninja_warning' => 'Before start upgrading Invoice Ninja create a backup of your database and files!',
'update_invoiceninja_available' => 'A new version of Invoice Ninja is available.',
'update_invoiceninja_unavailable' => 'No new version of Invoice Ninja available.',
'update_invoiceninja_instructions' => 'Please install the new version <strong>:version</strong> by clicking the <em>Update now</em> button below. Afterwards you\'ll be redirected to the dashboard.',
'update_invoiceninja_update_start' => 'Update now',
'update_invoiceninja_download_start' => 'Download :version',
'create_new' => 'Create New',
Expand Down Expand Up @@ -5158,6 +5153,20 @@
'unlinked_transaction' => 'Successfully unlinked transaction',
'view_dashboard_permission' => 'Allow user to access the dashboard, data is limited to available permissions',
'marked_sent_credits' => 'Successfully marked credits sent',
'show_document_preview' => 'Show Document Preview',
'cash_accounting' => 'Cash accounting',
'click_or_drop_files_here' => 'Click or drop files here',
'set_public' => 'Set public',
'set_private' => 'Set private',
'individual' => 'Individual',
'business' => 'Business',
'partnership' => 'partnership',
'trust' => 'Trust',
'charity' => 'Charity',
'government' => 'Government',
'in_stock_quantity' => 'Stock quantity',
'vendor_contact' => 'Vendor Contact',

);

return $LANG;
Expand Down
19 changes: 14 additions & 5 deletions lang/cs/texts.php
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,6 @@
'created_by_invoice' => 'Vytvořeno :invoice',
'primary_user' => 'Primární uživatel',
'help' => 'Pomoc',
'customize_help' => '<p>We use :pdfmake_link to define the invoice designs declaratively. The pdfmake :playground_link provides a great way to see the library in action.</p>
<p>If you need help figuring something out post a question to our :forum_link with the design you\'re using.</p>',
'playground' => 'pískoviště',
'support_forum' => 'Support Forums',
'invoice_due_date' => 'Datum splatnosti',
Expand Down Expand Up @@ -1822,15 +1820,13 @@
'bot_emailed_notify_paid' => 'I\'ll email you when it\'s paid.',
'add_product_to_invoice' => 'Add 1 :product',
'not_authorized' => 'You are not authorized',
'bot_get_email' => 'Hi! (wave)<br/>Thanks for trying the Invoice Ninja Bot.<br/>You need to create a free account to use this bot.<br/>Send me your account email address to get started.',
'bot_get_code' => 'Thanks! I\'ve sent a you an email with your security code.',
'bot_welcome' => 'That\'s it, your account is verified.<br/>',
'email_not_found' => 'I wasn\'t able to find an available account for :email',
'invalid_code' => 'The code is not correct',
'security_code_email_subject' => 'Security code for Invoice Ninja Bot',
'security_code_email_line1' => 'This is your Invoice Ninja Bot security code.',
'security_code_email_line2' => 'Note: it will expire in 10 minutes.',
'bot_help_message' => 'I currently support:<br/>• Create\update\email an invoice<br/>• List products<br/>For example:<br/><i>invoice bob for 2 tickets, set the due date to next thursday and the discount to 10 percent</i>',
'list_products' => 'List Products',

'include_item_taxes_inline' => 'Include <b>line item taxes in line total</b>',
Expand All @@ -1843,7 +1839,6 @@
'update_invoiceninja_warning' => 'Before start upgrading Invoice Ninja create a backup of your database and files!',
'update_invoiceninja_available' => 'A new version of Invoice Ninja is available.',
'update_invoiceninja_unavailable' => 'No new version of Invoice Ninja available.',
'update_invoiceninja_instructions' => 'Nainstalujte novou verzi <strong>:version</strong> kliknutím na <em>aktualizovat</em> tlačítko níže. Poté budete přesměrováni na hlavní panel.',
'update_invoiceninja_update_start' => 'Update now',
'update_invoiceninja_download_start' => 'Download :version',
'create_new' => 'Create New',
Expand Down Expand Up @@ -5158,6 +5153,20 @@
'unlinked_transaction' => 'Successfully unlinked transaction',
'view_dashboard_permission' => 'Allow user to access the dashboard, data is limited to available permissions',
'marked_sent_credits' => 'Successfully marked credits sent',
'show_document_preview' => 'Show Document Preview',
'cash_accounting' => 'Cash accounting',
'click_or_drop_files_here' => 'Click or drop files here',
'set_public' => 'Set public',
'set_private' => 'Set private',
'individual' => 'Individual',
'business' => 'Business',
'partnership' => 'partnership',
'trust' => 'Trust',
'charity' => 'Charity',
'government' => 'Government',
'in_stock_quantity' => 'Stock quantity',
'vendor_contact' => 'Vendor Contact',

);

return $LANG;
Expand Down

0 comments on commit d41ad24

Please sign in to comment.