Update Client Portal Packages

This commit is contained in:
2022-08-26 10:45:38 +07:00
parent be31b6f764
commit 10f99bfb9a
37 changed files with 2233 additions and 1668 deletions

View File

View File

@@ -0,0 +1,5 @@
<?php
return [
'name' => 'Client'
];

View File

View File

View File

@@ -0,0 +1,21 @@
<?php
namespace Modules\Client\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class ClientDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call("OthersTableSeeder");
}
}

View File

View File

View File

@@ -0,0 +1,79 @@
<?php
namespace Modules\Client\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
class ClientController extends Controller
{
/**
* Display a listing of the resource.
* @return Renderable
*/
public function index()
{
return view('client::index');
}
/**
* Show the form for creating a new resource.
* @return Renderable
*/
public function create()
{
return view('client::create');
}
/**
* Store a newly created resource in storage.
* @param Request $request
* @return Renderable
*/
public function store(Request $request)
{
//
}
/**
* Show the specified resource.
* @param int $id
* @return Renderable
*/
public function show($id)
{
return view('client::show');
}
/**
* Show the form for editing the specified resource.
* @param int $id
* @return Renderable
*/
public function edit($id)
{
return view('client::edit');
}
/**
* Update the specified resource in storage.
* @param Request $request
* @param int $id
* @return Renderable
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
* @param int $id
* @return Renderable
*/
public function destroy($id)
{
//
}
}

View File

View File

View File

View File

@@ -0,0 +1,112 @@
<?php
namespace Modules\Client\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Factory;
class ClientServiceProvider extends ServiceProvider
{
/**
* @var string $moduleName
*/
protected $moduleName = 'Client';
/**
* @var string $moduleNameLower
*/
protected $moduleNameLower = 'client';
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->register(RouteServiceProvider::class);
}
/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([
module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'),
], 'config');
$this->mergeConfigFrom(
module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower
);
}
/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'Resources/views');
$this->publishes([
$sourcePath => $viewPath
], ['views', $this->moduleNameLower . '-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (\Config::get('view.paths') as $path) {
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
$paths[] = $path . '/modules/' . $this->moduleNameLower;
}
}
return $paths;
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace Modules\Client\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* The module namespace to assume when generating URLs to actions.
*
* @var string
*/
protected $moduleNamespace = 'Modules\Client\Http\Controllers';
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*
* @return void
*/
public function boot()
{
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->moduleNamespace)
->group(module_path('Client', '/Routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->moduleNamespace)
->group(module_path('Client', '/Routes/api.php'));
}
}

View File

View File

View File

View File

@@ -0,0 +1,9 @@
@extends('client::layouts.master')
@section('content')
<h1>Hello World</h1>
<p>
This view is loaded from module: {!! config('client.name') !!}
</p>
@endsection

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Module Client</title>
{{-- Laravel Mix - CSS File --}}
{{-- <link rel="stylesheet" href="{{ mix('css/client.css') }}"> --}}
</head>
<body>
@yield('content')
{{-- Laravel Mix - JS File --}}
{{-- <script src="{{ mix('js/client.js') }}"></script> --}}
</body>
</html>

View File

View File

@@ -0,0 +1,18 @@
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::middleware('auth:api')->get('/client', function (Request $request) {
return $request->user();
});

View File

@@ -0,0 +1,16 @@
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::prefix('client')->group(function() {
Route::get('/', 'ClientController@index');
});

View File

View File

View File

@@ -0,0 +1,23 @@
{
"name": "nwidart/client",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\Client\\": ""
}
}
}

View File

@@ -0,0 +1,13 @@
{
"name": "Client",
"alias": "client",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\Client\\Providers\\ClientServiceProvider"
],
"aliases": {},
"files": [],
"requires": []
}

View File

@@ -0,0 +1,21 @@
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"axios": "^0.21.4",
"dotenv": "^10.0.0",
"dotenv-expand": "^5.1.0",
"laravel-mix": "^6.0.31",
"laravel-mix-merge-manifest": "^2.0.0",
"lodash": "^4.17.21",
"postcss": "^8.3.7"
}
}

View File

@@ -0,0 +1,14 @@
const dotenvExpand = require('dotenv-expand');
dotenvExpand(require('dotenv').config({ path: '../../.env'/*, debug: true*/}));
const mix = require('laravel-mix');
require('laravel-mix-merge-manifest');
mix.setPublicPath('../../public').mergeManifest();
mix.js(__dirname + '/Resources/assets/js/app.js', 'js/client.js')
.sass( __dirname + '/Resources/assets/sass/app.scss', 'css/client.css');
if (mix.inProduction()) {
mix.version();
}

View File

@@ -24,7 +24,7 @@ class CorporateFormulariumController extends Controller
$formulariums = $formulariums->whereDoesntHave('corporateFormulariums');
} else if (!empty($request->status) && $request->status == 'all') {
} else {
} else { // Active or Default
$formulariums->whereHas('corporateFormulariums', function ($corporateFormularium) use ($corporate_id){
$corporateFormularium->where('corporate_id', $corporate_id);
});

View File

@@ -4,4 +4,4 @@ PORT=8083
REACT_APP_HOST_API_URL="http://localhost:8000"
VITE_API_URL="http://localhost:8000/api"
VITE_API_URL="http://localhost:8000/api/client"

View File

@@ -1,3 +1,3 @@
GENERATE_SOURCEMAP=false
VITE_API_URL="https://aso-api.linksehat.dev/api"
VITE_API_URL="https://aso-api.linksehat.dev/api/client"

View File

@@ -7,7 +7,7 @@
"scripts": {
"lint": "eslint --ext .ts,.tsx ./src",
"lint:fix": "eslint --fix --ext .ts,.tsx ./src",
"start": "vite",
"start": "vite --port=3000",
"build": "vite build --mode production && cp .htaccess build/.htaccess && rm -f -r ../../public/client-portal && cp -r build ../../public/client-portal",
"serve": "vite preview",
"clear-all": "rm -rf build node_modules",
@@ -37,58 +37,63 @@
]
},
"dependencies": {
"@emotion/cache": "^11.7.1",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@hookform/resolvers": "^2.8.8",
"@iconify/react": "^3.2.1",
"@date-io/date-fns": "^2.15.0",
"@emotion/cache": "^11.10.3",
"@emotion/react": "^11.10.0",
"@emotion/styled": "^11.10.0",
"@hookform/resolvers": "^2.9.7",
"@iconify/react": "^3.2.2",
"@mui/icons-material": "^5.10.2",
"@mui/lab": "5.0.0-alpha.80",
"@mui/material": "^5.6.4",
"@mui/icons-material": "^5.8.0",
"@mui/system": "^5.6.4",
"@mui/x-data-grid": "^5.10.0",
"@mui/material": "^5.10.2",
"@mui/system": "^5.10.2",
"@mui/x-data-grid": "^5.16.0",
"@mui/x-date-pickers": "5.0.0-beta.2",
"@vitejs/plugin-react": "^1.3.2",
"axios": "^0.27.2",
"change-case": "^4.1.2",
"date-fns": "^2.28.0",
"framer-motion": "^6.3.3",
"csstype": "^3.1.0",
"date-fns": "^2.29.2",
"framer-motion": "^6.5.1",
"highlight.js": "^11.6.0",
"history": "^5.3.0",
"jsx-runtime": "^1.2.0",
"lodash": "^4.17.21",
"notistack": "^2.0.4",
"notistack": "^3.0.0-alpha.7",
"nprogress": "^0.2.0",
"numeral": "^2.0.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-dropzone": "^14.2.1",
"react-dropzone": "^14.2.2",
"react-helmet-async": "^1.3.0",
"react-hook-form": "^7.30.0",
"react-hook-form": "^7.34.2",
"react-intersection-observer": "^8.34.0",
"react-lazy-load-image-component": "^1.5.4",
"react-quill": "^1.3.5",
"react-lazy-load-image-component": "^1.5.5",
"react-quill": "2.0.0-beta.4",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"simplebar": "^5.3.6",
"simplebar-react": "^2.3.7",
"simplebar": "^5.3.8",
"simplebar-react": "^2.4.1",
"stylis": "^4.1.1",
"stylis-plugin-rtl": "^2.1.1",
"vite": "^2.9.8",
"vite-plugin-svgr": "^2.1.0",
"vite": "^3.0.9",
"vite-plugin-svgr": "^2.2.1",
"yup": "^0.32.11"
},
"devDependencies": {
"@babel/core": "^7.17.10",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-syntax-flow": "^7.16.7",
"@babel/plugin-transform-react-jsx": "^7.17.3",
"@babel/core": "^7.18.13",
"@babel/eslint-parser": "^7.18.9",
"@babel/plugin-syntax-flow": "^7.18.6",
"@babel/plugin-transform-react-jsx": "^7.18.10",
"@types/lodash": "^4.14.184",
"@types/nprogress": "^0.2.0",
"@types/react": "^17.0.44",
"@types/react-dom": "^17.0.16",
"@types/react": "^17.0.48",
"@types/react-dom": "^17.0.17",
"@types/react-lazy-load-image-component": "^1.5.2",
"@types/stylis": "^4.0.2",
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0",
"eslint": "^8.14.0",
"@typescript-eslint/eslint-plugin": "^5.35.1",
"@typescript-eslint/parser": "^5.35.1",
"eslint": "^8.22.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "^16.2.0",
"eslint-config-prettier": "^8.5.0",
@@ -97,11 +102,11 @@
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.0",
"eslint-plugin-react-hooks": "4.3.0",
"prettier": "^2.6.2",
"typescript": "^4.6.4",
"vite-plugin-pwa": "^0.12.0"
"prettier": "^2.7.1",
"typescript": "^4.8.2",
"vite-plugin-pwa": "^0.12.3"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,4 @@
{
"Internal": true
"Internal": true,
"Client": true
}