1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #7478 from turbo124/v5-develop

Change output of activities for react app
This commit is contained in:
David Bomba 2022-05-29 11:24:47 +10:00 committed by GitHub
commit a25a90d3d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 13 deletions

View File

@ -50,6 +50,7 @@ jobs:
cp -r dist/react/* ../public/react
cd ..
rm -rf ui
php artisan ninja:react
- name: Prepare JS/CSS assets
run: |

View File

@ -97,18 +97,21 @@ class ActivityController extends BaseController
$data = $activities->cursor()->map(function ($activity) use($system){
return ctrans('texts.activity_'.$activity->activity_type_id,[
'client' => $activity->client ? $activity->client->present()->name() : $system,
'contact' => $activity->contact ? $activity->contact->first_name . " " .$activity->contact->last_name : $system,
'quote' => $activity->quote ? $activity->quote->number : $system,
'user' => $activity->user ? $activity->user->present()->name() : $system,
'expense' => $activity->expense ? $activity->expense->number : $system,
'invoice' => $activity->invoice ? $activity->invoice->number : $system,
'recurring_invoice' => $activity->recurring_invoice ? $activity->recurring_invoice->number : $system,
'payment' => $activity->payment ? $activity->payment->number : $system,
'credit' => $activity->credit ? $activity->credit->number : $system,
'task' => $activity->task ? $activity->task->number : $system,
]);
$arr=
[
'client' => $activity->client ? $activity->client : '',
'contact' => $activity->contact ? $activity->contact : '',
'quote' => $activity->quote ? $activity->quote : '',
'user' => $activity->user ? $activity->user : '',
'expense' => $activity->expense ? $activity->expense : '',
'invoice' => $activity->invoice ? $activity->invoice : '',
'recurring_invoice' => $activity->recurring_invoice ? $activity->recurring_invoice : '',
'payment' => $activity->payment ? $activity->payment : '',
'credit' => $activity->credit ? $activity->credit : '',
'task' => $activity->task ? $activity->task : '',
];
return array_merge($arr, $activity->toArray());
});