From eed345cff6d6185f31ef0e23b1ca14c569962da5 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 9 Nov 2015 13:46:53 +0200 Subject: [PATCH] Bug fixes --- app/Ninja/Transformers/ClientTransformer.php | 25 +++++++++++++++++-- public/css/built.css | 6 +---- public/css/style.css | 6 +---- resources/views/invoices/edit.blade.php | 3 ++- resources/views/invoices/knockout.blade.php | 10 ++++---- .../views/vendor/swaggervel/index.blade.php | 2 ++ 6 files changed, 34 insertions(+), 18 deletions(-) diff --git a/app/Ninja/Transformers/ClientTransformer.php b/app/Ninja/Transformers/ClientTransformer.php index 4b2e950921d4..3f03ed7e2bc2 100644 --- a/app/Ninja/Transformers/ClientTransformer.php +++ b/app/Ninja/Transformers/ClientTransformer.php @@ -15,6 +15,29 @@ class ClientTransformer extends EntityTransformer * @SWG\Property(property="id", type="integer", example=1, readOnly=true) * @SWG\Property(property="balance", type="float", example=10, readOnly=true) * @SWG\Property(property="paid_to_date", type="float", example=10, readOnly=true) + * @SWG\Property(property="user_id", type="integer", example=1) + * @SWG\Property(property="account_key", type="string", example="123456") + * @SWG\Property(property="updated_at", type="date-time", example="2016-01-01 12:10:00") + * @SWG\Property(property="deleted_at", type="date-time", example="2016-01-01 12:10:00") + * @SWG\Property(property="address1", type="string", example="10 Main St.") + * @SWG\Property(property="address2", type="string", example="1st Floor") + * @SWG\Property(property="city", type="string", example="New York") + * @SWG\Property(property="state", type="string", example="NY") + * @SWG\Property(property="postal_code", type="string", example=10010) + * @SWG\Property(property="country_id", type="integer", example=840) + * @SWG\Property(property="work_phone", type="string", example="(212) 555-1212") + * @SWG\Property(property="private_notes", type="string", example="Notes...") + * @SWG\Property(property="last_login", type="date-time", example="2016-01-01 12:10:00") + * @SWG\Property(property="website", type="string", example="http://www.example.com") + * @SWG\Property(property="industry_id", type="integer", example=1) + * @SWG\Property(property="size_id", type="integer", example=1) + * @SWG\Property(property="is_deleted", type="boolean", example=false) + * @SWG\Property(property="payment_terms", type="", example=30) + * @SWG\Property(property="custom_value1", type="string", example="Value") + * @SWG\Property(property="custom_value2", type="string", example="Value") + * @SWG\Property(property="vat_number", type="string", example="123456") + * @SWG\Property(property="id_number", type="string", example="123456") + * @SWG\Property(property="language_id", type="integer", example=1) */ protected $defaultIncludes = [ @@ -57,8 +80,6 @@ class ClientTransformer extends EntityTransformer 'country_id' => (int) $client->country_id, 'work_phone' => $client->work_phone, 'private_notes' => $client->private_notes, - 'balance' => (float) $client->balance, - 'paid_to_date' => $client->paid_to_date, 'last_login' => $client->last_login, 'website' => $client->website, 'industry_id' => (int) $client->industry_id, diff --git a/public/css/built.css b/public/css/built.css index 816fafacb28a..10af8e73e106 100644 --- a/public/css/built.css +++ b/public/css/built.css @@ -2354,7 +2354,7 @@ body { background: #f8f8f8 !important; font-size: 15px; } html { - overflow-y: scroll; + /* overflow-y: scroll; */ } .bold { font-weight: 700; } a {color:#0b4d78;} @@ -3377,8 +3377,4 @@ ul.user-accounts a:hover div.remove { width: 2px; content: ""; background-color: #e37329; -} - -.gitter-open-chat-button { - background-color: #0b4d78 !important; } \ No newline at end of file diff --git a/public/css/style.css b/public/css/style.css index 35480c54911f..7f0aca5307d5 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -3,7 +3,7 @@ body { background: #f8f8f8 !important; font-size: 15px; } html { - overflow-y: scroll; + /* overflow-y: scroll; */ } .bold { font-weight: 700; } a {color:#0b4d78;} @@ -1026,8 +1026,4 @@ ul.user-accounts a:hover div.remove { width: 2px; content: ""; background-color: #e37329; -} - -.gitter-open-chat-button { - background-color: #0b4d78 !important; } \ No newline at end of file diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index 9971420de615..fa751c0128ed 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -497,7 +497,8 @@ {!! Former::text('last_name')->data_bind("value: last_name, valueUpdate: 'afterkeydown', attr: {name: 'client[contacts][' + \$index() + '][last_name]'}") !!} {!! Former::text('email')->data_bind("value: email, valueUpdate: 'afterkeydown', - attr: {name: 'client[contacts][' + \$index() + '][email]', id:'email'+\$index()}") !!} + attr: {name: 'client[contacts][' + \$index() + '][email]', id:'email'+\$index()}") + ->addClass('client-email') !!} {!! Former::text('phone')->data_bind("value: phone, valueUpdate: 'afterkeydown', attr: {name: 'client[contacts][' + \$index() + '][phone]'}") !!} diff --git a/resources/views/invoices/knockout.blade.php b/resources/views/invoices/knockout.blade.php index ae7bd45f3052..4bf11e84cc8f 100644 --- a/resources/views/invoices/knockout.blade.php +++ b/resources/views/invoices/knockout.blade.php @@ -125,9 +125,9 @@ function ViewModel(data) { self.clientFormComplete = function() { trackEvent('/activity', '/save_client_form'); - var email = $('#email0').val(); - var firstName = $('#first_name').val(); - var lastName = $('#last_name').val(); + var email = $("[name='client[contacts][0][email]']").val(); + var firstName = $("[name='client[contacts][0][first_name]']").val(); + var lastName = $("[name='client[contacts][0][last_name]']").val(); var name = $('#name').val(); if (name) { @@ -139,10 +139,10 @@ function ViewModel(data) { } var isValid = true; - $("input[name='email']").each(function(item, value) { + $('input.client-email').each(function(item, value) { var email = $(value).val(); if (!name && (!email || !isValidEmailAddress(email))) { - isValid = false; + isValid = false; } }); diff --git a/resources/views/vendor/swaggervel/index.blade.php b/resources/views/vendor/swaggervel/index.blade.php index 09d91916a84e..a9c0d1a67e25 100644 --- a/resources/views/vendor/swaggervel/index.blade.php +++ b/resources/views/vendor/swaggervel/index.blade.php @@ -91,6 +91,8 @@ header("Access-Control-Allow-Headers: X-Requested-With"); if (key && key.trim() != "") { var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("X-Ninja-Token", key, "header"); window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth); + var ajaxRequest = new SwaggerClient.ApiKeyAuthorization("X-Requested-With", "XMLHttpRequest", "header"); + window.swaggerUi.api.clientAuthorizations.add("ajax", ajaxRequest); log("added key " + key); } }