Compare commits

..

21 commits

Author SHA1 Message Date
Jérémy Munsch
99cc669a79
Fix InstaGetTopMediasJob forgotten truncate table 2023-04-21 16:24:28 +02:00
Jérémy Munsch
b0e95ab875
remove putain de sanctum de merde 2023-04-17 18:27:21 +02:00
Jérémy Munsch
76b8e23bb8
Fix gitlabci file 2023-04-17 18:20:43 +02:00
Jérémy Munsch
163b159330
Version fonctionnelle 1 2023-04-17 18:19:09 +02:00
Jérémy Munsch
b388e496c4
Fix error pages 2023-04-14 17:11:22 +02:00
Jérémy Munsch
696c7dad3c
Fix HtmlSanitizer 2023-04-14 15:04:40 +02:00
Jérémy Munsch
6f03353040
Set laravel base project missing elements 2023-04-14 15:00:47 +02:00
Jérémy Munsch
1727b832f1
Fix Vite asset compilation and usage for default mail template 2023-04-14 12:43:19 +02:00
Jérémy Munsch
9843463dcc
Fix vendor error page layouts to use vite 2023-04-14 12:09:09 +02:00
Jérémy Munsch
ad5d0f8adb
ckEditorContent scss fix 2023-04-14 12:07:40 +02:00
Jérémy Munsch
84fc5cc617
Readme.md Add todo list 2023-04-14 12:07:23 +02:00
Jérémy Munsch
323c91e842
remove FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_LIMIT and set dynamic limit to api calls 2023-04-14 11:45:39 +02:00
Jérémy Munsch
745602c647
InstaGetTopMediasJob Truncate data before inserting new results 2023-04-14 11:39:30 +02:00
Jérémy Munsch
ab725fa9b1
InstaMedia Model add AsStringable casts to caption and permalink 2023-04-14 11:38:25 +02:00
Jérémy Munsch
81a4ffec24
Rework and optimize database columns + add descriptions 2023-04-14 10:58:06 +02:00
Jérémy Munsch
39be89f10f
- Better refactorisation using Customized api response objects
- Replace Raw Guzzle usage with Illuminate Http Client
2023-04-14 10:30:27 +02:00
Jérémy Munsch
87ec0d7f6f
Make Insta top Media fields static as columns in DB are static 2023-04-14 09:37:04 +02:00
Jérémy Munsch
fa6cc38aa1
Rewrite IG Job first draw 2023-04-13 17:48:13 +02:00
Jérémy Munsch
d0b7b40568
Gitlab CI 2023-04-13 14:39:52 +02:00
Jérémy Munsch
88922caa29
Fix and Bump ckeditor to 0.1.0 (37.0.1) 2023-04-13 14:34:53 +02:00
Jérémy Munsch
552fc442f8
Correctly bump to laravel 10 2023-04-13 14:34:09 +02:00
11 changed files with 59 additions and 77 deletions

View file

@ -1,2 +0,0 @@
.git
*.md

View file

@ -18,7 +18,7 @@ DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
@ -32,10 +32,7 @@ MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
FACEBOOK_GRAPH_ACCESS_TOKEN=""
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_HASHTAGID=
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_IGHASHTAGID=
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_USERID=
# The amount of media to acquire
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_NBMEDIA=
# Sentry
SENTRY_LARAVEL_DSN=

View file

@ -11,9 +11,14 @@ include:
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'test/test.yml'
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'deploy/deploy.yml'
stages:
- lint
- security
- build
- test
- deploy

View file

@ -1,7 +0,0 @@
FROM registry.s-web.fr/ldc-web/projets/ldc-web-images-docker/ldcweb-production-8.2:latest
COPY --chown=www-data:www-data . /app/srcs
COPY --chown=www-data:www-data ./public/build /app/srcs/public/build
COPY --chown=www-data:www-data ./vendor /app/srcs/vendor
USER root
RUN chmod -R 755 /app/srcs/storage
USER www-data

View file

@ -12,12 +12,15 @@ php artisan migrate
.env
```
FACEBOOK_GRAPH_ACCESS_TOKEN=""
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_HASHTAGID=
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_IGHASHTAGID=
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_USERID=
# The amount of media to acquire
FACEBOOK_GRAPH_ENDPOINT_IG_TOPMEDIA_NBMEDIA=
```
Commande :
```
php artisan insta:get-top-medias
```
cette commande appelle le Job : InstaGetTopMediasJob
### TODO:
- Permettre la recherche d'un hashtag et d'utiliser son id pour topMediaList
- Refresh le token en automatique si detection expired

View file

@ -40,9 +40,6 @@ class Handler extends ExceptionHandler
public function register()
{
$this->reportable(function (Throwable $e) {
if (app()->bound('sentry')) {
app('sentry')->captureException($e);
}
});
}
}

View file

@ -41,7 +41,9 @@ class TopMediaController extends Controller
);
} //end if
$this->sortQuery($topMediaList);
$searchFields = trans('Id Instagram, Participant, Lien');
$topMediaList->orderBy('updated_at', 'DESC');
$topMediaList = $topMediaList->paginate();
return \view('bo.pages.top-media.index', \compact('topMediaList', 'searchFields', 'ranking'));

View file

@ -3,16 +3,17 @@
namespace App\Http\Controllers\Fo;
use App\Http\Controllers\Controller;
use Illuminate\Contracts\View\View;
class HomeController extends Controller
{
/**
* Redirect to BO
* Display a listing of the resource.
*
* @return \Illuminate\Http\RedirectResponse
* @return \Illuminate\Contracts\View\View
*/
public function index(): \Illuminate\Http\RedirectResponse
public function index(): View
{
return \redirect()->route('bo.dashboard');
return view('fo.pages.home');
}
}

View file

@ -126,22 +126,6 @@ return [
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
'stdout' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDOUT_FORMATTER'),
'with' => [
'stream' => 'php://stdout',
],
],
'k8s' => [
'driver' => 'stack',
'channels' => ['daily', 'stdout'],
'ignore_exceptions' => false,
],
],
];

View file

@ -1,2 +1,2 @@
User-agent: *
Disallow: /
Disallow:

View file

@ -2,46 +2,48 @@
<table class="table fix-action">
<thead>
@php
$cols = [
'id' => __('Classement'),
'username' => __('Participant'),
'timestamp' => __('Date de création du post')];
$routeName = request()->route()->getName();
$rst = !is_null(request()->rst) || !Session::has("$routeName.sorted");
$noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
$noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
$cols = [
'id' => __('Classement'),
'username' => __('Participant'),
'timestamp' => __('Date de création du post')];
$routeName = request()->route()->getName();
$rst = !is_null(request()->rst) || !Session::has("$routeName.sorted");
$noOrder = Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
$noOrder = Session::get("$routeName.sort_col") !== '' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way"));
@endphp
<th>Classement</th>
<th>Participant</th>
<th>Date de création du post</th>
<th></th>
@include('modules.table-col-sorter', [
'cols' => $cols,
'ignore' => ['total', 'timeslot_date', 'shop'],
'mobileHide' => ['shop'],
])
</thead>
<tbody>
@if ($topMediaList->count())
@foreach ($topMediaList as $topMediaModel)
<tr>
<td>
<strong class="fs-{{ $ranking->get($topMediaModel->insta_id) + 1 }}">#{{ $ranking->get($topMediaModel->insta_id) + 1 }}</strong>
</td>
<td>{{ $topMediaModel->username }}</td>
<td>
{{ $topMediaModel->timestamp->isoFormat('LLLL') }}
</td>
<td>
<a href="{{ $topMediaModel->permalink }}" title="{{ __('Voir le media sur instagram') }}" target="_blank" data-bs-toggle="tooltip">
<i class="fa-solid fa-arrow-up-right-from-square"></i>
</a>
</td>
</tr>
@endforeach
@foreach ($topMediaList as $topMediaModel)
<tr>
<td>
<strong class="fs-{{ $ranking->get($topMediaModel->insta_id) + 1 }}">#{{ $ranking->get($topMediaModel->insta_id) + 1 }}</strong>
</td>
<td>{{ $topMediaModel->username }}</td>
<td>
{{ $topMediaModel->timestamp->isoFormat('LLLL') }}
</td>
<td>
<a href="{{ $topMediaModel->permalink }}" title="{{ __('Voir le media sur instagram') }}" target="_blank" data-bs-toggle="tooltip">
<i class="fa-solid fa-arrow-up-right-from-square"></i>
</a>
</td>
</tr>
@endforeach
@else
<tr>
<td colspan="11" class="text-center">
<span class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.insta_media')]) }}
</span>
</td>
</tr>
<tr>
<td colspan="11" class="text-center">
<span
class="h3">{{ __('Aucun résultat pour les :models', ['models' => __('models.classes.insta_media')]) }}
</span>
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>