Update index file for flutter

This commit is contained in:
David Bomba 2020-07-07 08:35:28 +10:00
parent ec989582ce
commit 256deea92a
3 changed files with 96 additions and 4 deletions

View File

@ -181,6 +181,11 @@ class Company extends BaseModel
return $this->hasMany(Task::class)->withTrashed();
}
public function webhooks()
{
return $this->hasMany(Webhook::class);
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/

View File

@ -17,6 +17,7 @@ use App\Models\Client;
use App\Models\Company;
use App\Models\CompanyGateway;
use App\Models\CompanyLedger;
use App\Models\CompanyToken;
use App\Models\CompanyUser;
use App\Models\Credit;
use App\Models\Design;
@ -30,10 +31,13 @@ use App\Models\Quote;
use App\Models\Task;
use App\Models\TaxRate;
use App\Models\User;
use App\Models\Webhook;
use App\Transformers\CompanyLedgerTransformer;
use App\Transformers\CompanyTokenTransformer;
use App\Transformers\CreditTransformer;
use App\Transformers\PaymentTermTransformer;
use App\Transformers\TaskTransformer;
use App\Transformers\WebhookTransformer;
use App\Utils\Traits\MakesHash;
/**
@ -77,6 +81,8 @@ class CompanyTransformer extends EntityTransformer
'projects',
'tasks',
'ledger',
'webhooks',
'tokens'
];
@ -134,6 +140,20 @@ class CompanyTransformer extends EntityTransformer
return $this->includeItem($company->company_users->where('user_id', auth()->user()->id)->first(), $transformer, CompanyUser::class);
}
public function includeTokens(Company $company)
{
$transformer = new CompanyTokenTransformer($this->serializer);
return $this->includeCollection($company->tokens, $transformer, CompanyToken::class);
}
public function includeWebhooks(Company $company)
{
$transformer = new WebhookTransformer($this->serializer);
return $this->includeCollection($company->webhooks, $transformer, Webhook::class);
}
public function includeActivities(Company $company)
{
$transformer = new ActivityTransformer($this->serializer);

View File

@ -9,19 +9,86 @@
</head>
<body style="background-color:#888888;">
<style>
/* https://projects.lukehaas.me/css-loaders/ */
.loader,
.loader:before,
.loader:after {
border-radius: 50%;
width: 2.5em;
height: 2.5em;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation: load7 1.8s infinite ease-in-out;
animation: load7 1.8s infinite ease-in-out;
}
.loader {
color: #ffffff;
font-size: 10px;
margin: 80px auto;
position: relative;
text-indent: -9999em;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-animation-delay: -0.40s;
animation-delay: -0.40s;
}
.loader:before,
.loader:after {
content: '';
position: absolute;
top: 0;
}
.loader:before {
left: -3.5em;
-webkit-animation-delay: -0.80s;
animation-delay: -0.80s;
}
.loader:after {
left: 3.5em;
}
@-webkit-keyframes load7 {
0%,
80%,
100% {
box-shadow: 0 2.5em 0 -1.3em;
}
40% {
box-shadow: 0 2.5em 0 0;
}
}
@keyframes load7 {
0%,
80%,
100% {
box-shadow: 0 2.5em 0 -1.3em;
}
40% {
box-shadow: 0 2.5em 0 0;
}
}
</style>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/flutter_service_worker.js');
});
}
document.addEventListener('DOMContentLoaded', function(event) {
document.getElementById('loader').style.display = 'none';
});
</script>
<script src="main.dart.js?version={{ config('ninja.app_version') }}" type="application/javascript"></script>
<script defer src="main.dart.js?version={{ config('ninja.app_version') }}" type="application/javascript"></script>
<center style="font-family:Tahoma,Geneva,sans-serif;font-size:28px;color:white;padding-top:100px">
Loading...
<center style="padding-top: 150px" id="loader">
<div class="loader"></div>
</center>
</body>
</html>
</html>