From 2095c18871d22647ff025a002cc0e29792275d38 Mon Sep 17 00:00:00 2001 From: glovetleong Date: Sun, 22 Aug 2021 13:55:51 +0800 Subject: [PATCH 001/127] cross login --- .../forms/CrossPlatformLoginFormComponent.vue | 48 +++++++++++++++++++ .../views/pages/accounts/login.blade.php | 1 + 2 files changed, 49 insertions(+) create mode 100644 resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue diff --git a/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue b/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue new file mode 100644 index 00000000..93634ed4 --- /dev/null +++ b/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue @@ -0,0 +1,48 @@ + + \ No newline at end of file diff --git a/resources/views/pages/accounts/login.blade.php b/resources/views/pages/accounts/login.blade.php index 789d3a68..863e7523 100644 --- a/resources/views/pages/accounts/login.blade.php +++ b/resources/views/pages/accounts/login.blade.php @@ -26,6 +26,7 @@
+
From 2d49f4aabf8dcf180b4197fc3ad3e30e2a81d1cf Mon Sep 17 00:00:00 2001 From: glovetleong Date: Wed, 25 Aug 2021 10:01:32 +0800 Subject: [PATCH 002/127] cross login --- .../accounts/forms/CrossPlatformLoginFormComponent.vue | 4 ++-- routes/web.php | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue b/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue index 93634ed4..6cd0b199 100644 --- a/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue +++ b/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue @@ -12,7 +12,7 @@
- +
@@ -36,7 +36,7 @@ }, methods:{ iframeEvent(event) { - if(event.origin !== 'http://unity.test') return; + if(event.origin !== 'http://exchange-2.0.test') return; console.log(event.data); } }, diff --git a/routes/web.php b/routes/web.php index da4792e8..6781c3f3 100644 --- a/routes/web.php +++ b/routes/web.php @@ -64,6 +64,4 @@ Route::get('/customer/{marking}', function ($marking) { return view('pages.customers.profile', ['id' => $id]); })->name('customer.profile'); -Route::get('/order/{id}/download', 'Orders\DownloadOrderQrPdfController@download')->name('order.qr.download'); - -Route::get('/test', 'TestController@test')->name('test'); \ No newline at end of file +Route::get('/order/{id}/download', 'Orders\DownloadOrderQrPdfController@download')->name('order.qr.download'); \ No newline at end of file From 0554cc895f29d33b32c2a1990a39bf14040e6101 Mon Sep 17 00:00:00 2001 From: glovetleong Date: Sun, 5 Sep 2021 12:55:11 +0800 Subject: [PATCH 003/127] checkout --- .../CrossAuthenticateUserLogic.php | 44 ++++++++++++ .../CrossAuthenticationCredentialsObject.php | 43 ++++++++++++ .../CrossAuthenticationProcessor.php | 70 +++++++++++++++++++ .../Services/CrossAuthenticatesUser.php | 44 ++++++++++++ .../Rules/CanCrossAuthenticateUser.php | 54 ++++++++++++++ .../UserCrossAuthenticationValidation.php | 43 ++++++++++++ .../ValueObjects/Constants/PlatformType.php | 9 +++ .../UserCrossAuthenticationController.php | 21 ++++++ app/Models/UserSocialAccount.php | 11 +++ ...2235_create_user_social_accounts_table.php | 35 ++++++++++ database/seeders/DatabaseSeeder.php | 4 +- .../forms/CrossPlatformLoginFormComponent.vue | 5 +- routes/account.php | 5 ++ 13 files changed, 385 insertions(+), 3 deletions(-) create mode 100644 app/Classes/Modules/Accounts/ControllersLogic/CrossAuthenticateUserLogic.php create mode 100644 app/Classes/Modules/Accounts/DataTransferObjects/CrossAuthenticationCredentialsObject.php create mode 100644 app/Classes/Modules/Accounts/Processors/CrossAuthenticationProcessor.php create mode 100644 app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php create mode 100644 app/Classes/Modules/Accounts/Standards/Rules/CanCrossAuthenticateUser.php create mode 100644 app/Classes/Modules/Accounts/Standards/Validators/UserCrossAuthenticationValidation.php create mode 100644 app/Classes/ValueObjects/Constants/PlatformType.php create mode 100644 app/Http/Controllers/Accounts/UserCrossAuthenticationController.php create mode 100644 app/Models/UserSocialAccount.php create mode 100644 database/migrations/2021_09_01_212235_create_user_social_accounts_table.php diff --git a/app/Classes/Modules/Accounts/ControllersLogic/CrossAuthenticateUserLogic.php b/app/Classes/Modules/Accounts/ControllersLogic/CrossAuthenticateUserLogic.php new file mode 100644 index 00000000..5819a4f0 --- /dev/null +++ b/app/Classes/Modules/Accounts/ControllersLogic/CrossAuthenticateUserLogic.php @@ -0,0 +1,44 @@ + 'Cross Authentication', + 'message' => 'You have successfully logged in to your account' + ]; + } + + /** @var CrossAuthenticationProcessor */ + private $cressAuthenticationProcessor; + + + /** + * CrossAuthenticateUserLogic constructor. + * @param CrossAuthenticationProcessor $authenticationProcessor + */ + public function __construct(CrossAuthenticationProcessor $cressAuthenticationProcessor) + { + $this->cressAuthenticationProcessor = $cressAuthenticationProcessor; + } + + /** + * @param Request $request + * @return JsonResponse + * @throws \App\Classes\Exceptions\AccessForbiddenException + * @throws \App\Classes\Exceptions\AccessUnauthorisedException + * @throws \App\Classes\Exceptions\RequestValidationException + */ + protected function logic(Request $request): JsonResponse { + return $this->response($this->cressAuthenticationProcessor->execute($request)); + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/DataTransferObjects/CrossAuthenticationCredentialsObject.php b/app/Classes/Modules/Accounts/DataTransferObjects/CrossAuthenticationCredentialsObject.php new file mode 100644 index 00000000..67abf905 --- /dev/null +++ b/app/Classes/Modules/Accounts/DataTransferObjects/CrossAuthenticationCredentialsObject.php @@ -0,0 +1,43 @@ +access_token = $access_token; + $this->platform = $platform; + } + + /** + * @return string + */ + public function getAccessToken(): string + { + return $this->access_token; + } + + /** + * @return string + */ + public function getPlatform(): int + { + return $this->platform; + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Processors/CrossAuthenticationProcessor.php b/app/Classes/Modules/Accounts/Processors/CrossAuthenticationProcessor.php new file mode 100644 index 00000000..1f976a42 --- /dev/null +++ b/app/Classes/Modules/Accounts/Processors/CrossAuthenticationProcessor.php @@ -0,0 +1,70 @@ +canCrossAuthenticateUser = $canCrossAuthenticateUser; + $this->crossAuthenticatesUser = $crossAuthenticatesUser; + $this->generatesAuthenticationToken = $generatesAuthenticationToken; + $this->fetchesUser = $fetchesUser; + $this->authenticationRedirect = $authenticationRedirect; + } + + + /** + * @param Request $request + * @return array + * @throws \App\Classes\Exceptions\AccessForbiddenException + * @throws \App\Classes\Exceptions\AccessUnauthorisedException + * @throws \App\Classes\Exceptions\RequestValidationException + */ + public function execute(Request $request): array { + + $object = new CrossAuthenticationCredentialsObject($request->input('access_token'), $request->input('platform')); + + $this->canCrossAuthenticateUser->passes($object); + + $this->crossAuthenticatesUser->execute($object); + + $user = $this->fetchesUser->execute(['email' => $object->getEmail()]); + + return ['access_token' => $this->generatesAuthenticationToken->execute($user), 'redirect_url' => $this->authenticationRedirect->url($user)]; + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php b/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php new file mode 100644 index 00000000..e76b9197 --- /dev/null +++ b/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php @@ -0,0 +1,44 @@ +getPlatform() == PlatformType::EXCHANGE) { + + // $headers = [ + // 'Content-Type' => 'application/json', + // 'Authorization' => 'Bearer ' . $object->getAccessToken(), + // ]; + // $client = new \GuzzleHttp\Client(['headers' => $headers]); + + // $response = $client->get('http://exchange-2.0.test/api/v1/account/user/list'); + + $response = Http::withToken($object->getAccessToken())->get('http://shipping-portal.test/api/v1/account/user/list')->object(); + dd($response); + + } + + if (! auth()->validate(['email' => $object->getEmail(), 'password' => $object->getPassword()])) { + throw new AccessUnauthorisedException('These credentials do not match our records.'); + } + + return true; + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Standards/Rules/CanCrossAuthenticateUser.php b/app/Classes/Modules/Accounts/Standards/Rules/CanCrossAuthenticateUser.php new file mode 100644 index 00000000..115a7ea6 --- /dev/null +++ b/app/Classes/Modules/Accounts/Standards/Rules/CanCrossAuthenticateUser.php @@ -0,0 +1,54 @@ +userCrossAuthenticationValidation = $userCrossAuthenticationValidation; + } + + /** + * @return bool + */ + protected function authorized(): bool + { + return true; + + } + + + /** + * @param AuthenticationCredentialsObject $object + * @return bool + * @throws RequestValidationException + */ + protected function validators($object): bool + { + return $this->userCrossAuthenticationValidation->validate($object); + } + + /** + * @param AuthenticationCredentialsObject $object + * @return bool + */ + protected function criteria($object): bool + { + return true; + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Standards/Validators/UserCrossAuthenticationValidation.php b/app/Classes/Modules/Accounts/Standards/Validators/UserCrossAuthenticationValidation.php new file mode 100644 index 00000000..ec170dc7 --- /dev/null +++ b/app/Classes/Modules/Accounts/Standards/Validators/UserCrossAuthenticationValidation.php @@ -0,0 +1,43 @@ + $object->getAccesstoken(), + 'platform' => $object->getPlatform() + ]; + } + + /** + * @return array + */ + protected function rules(): array { + return [ + 'access_token' => 'required', + 'platform' => 'required' + ]; + } + + /** + * @return array + */ + protected function messages(): array { + return []; + } + + + + +} \ No newline at end of file diff --git a/app/Classes/ValueObjects/Constants/PlatformType.php b/app/Classes/ValueObjects/Constants/PlatformType.php new file mode 100644 index 00000000..d9ddd0e3 --- /dev/null +++ b/app/Classes/ValueObjects/Constants/PlatformType.php @@ -0,0 +1,9 @@ +execute($request); + } + +} diff --git a/app/Models/UserSocialAccount.php b/app/Models/UserSocialAccount.php new file mode 100644 index 00000000..b8f01866 --- /dev/null +++ b/app/Models/UserSocialAccount.php @@ -0,0 +1,11 @@ +id(); + $table->foreignId('user_id'); + $table->string('app_id')->nullable(); + $table->integer('platform')->default(0); + $table->softDeletes(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('user_social_accounts'); + } +} diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index bba317e6..983c7aad 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -23,7 +23,7 @@ class DatabaseSeeder extends Seeder $this->call(CountriesTableSeeder::class); $this->call(CurrenciesTableSeeder::class); - $this->call(CompaniesTableSeeder::class); - $this->call(OrdersTableSeeder::class); + // $this->call(CompaniesTableSeeder::class); + // $this->call(OrdersTableSeeder::class); } } \ No newline at end of file diff --git a/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue b/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue index 6cd0b199..6b44f6ba 100644 --- a/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue +++ b/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue @@ -37,7 +37,10 @@ methods:{ iframeEvent(event) { if(event.origin !== 'http://exchange-2.0.test') return; - console.log(event.data); + if (event.data.data) { + console.log(event.data.data.payload.access_token); + + } } }, mounted() { diff --git a/routes/account.php b/routes/account.php index 7a9e08df..cd4e33ae 100644 --- a/routes/account.php +++ b/routes/account.php @@ -6,9 +6,14 @@ Route::group(['prefix' => 'account', 'namespace' => 'Accounts', 'as' => 'account Route::post('/registration', 'CreateCustomerController@create')->name('registration.register'); + + Route::group(['prefix' => 'authentication', 'as' => 'authentication.'], function () { Route::group(['prefix' => 'login', 'as' => 'authenticate.'], function () { Route::post('/attempt', 'UserAuthenticationController@authenticate')->name('attempt'); + + Route::post('/cross-attempt', 'UserCrossAuthenticationController@authenticate')->name('cross.attempt'); + Route::post('/check_email', 'CheckEmailController@check')->name('email.check'); }); From f3854078042bfa925260babda0c5c9e6570cf4d4 Mon Sep 17 00:00:00 2001 From: glovetleong Date: Tue, 28 Sep 2021 12:07:05 +0800 Subject: [PATCH 004/127] debug --- .../Accounts/Services/CrossAuthenticatesUser.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php b/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php index e76b9197..acf1f15e 100644 --- a/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php +++ b/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php @@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Http; use App\Classes\Exceptions\AccessUnauthorisedException; use App\Classes\Modules\Accounts\DataTransferObjects\CrossAuthenticationCredentialsObject; use App\Classes\ValueObjects\Constants\PlatformType; + use Tymon\JWTAuth\Facades\JWTAuth; class CrossAuthenticatesUser { @@ -20,16 +21,12 @@ class CrossAuthenticatesUser if ($object->getPlatform() == PlatformType::EXCHANGE) { - // $headers = [ - // 'Content-Type' => 'application/json', - // 'Authorization' => 'Bearer ' . $object->getAccessToken(), - // ]; - // $client = new \GuzzleHttp\Client(['headers' => $headers]); - // $response = $client->get('http://exchange-2.0.test/api/v1/account/user/list'); - $response = Http::withToken($object->getAccessToken())->get('http://shipping-portal.test/api/v1/account/user/list')->object(); - dd($response); + $response = Http::withToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9leGNoYW5nZS0yLjAudGVzdFwvYXBpXC92MVwvYWNjb3VudFwvYXV0aGVudGljYXRpb25cL2xvZ2luXC9hdHRlbXB0IiwiaWF0IjoxNjMyODAwMzE1LCJleHAiOjk5NjA2MDAzMjE1LCJuYmYiOjE2MzI4MDAzMTUsImp0aSI6Ilo2cGpNMExRbWM5Q1BQQ0YiLCJ1c2VyIjp7ImlkIjo3LCJuYW1lIjoiTGVvbmcgQ2hlZSBTaW9uZyIsImVtYWlsIjoiZ2xvdmV0bGVvbmdAZ21haWwuY29tIiwidHlwZSI6Mywic3RhdHVzIjoyLCJjb21wYW55X2lkIjo5fSwic3ViIjo3LCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.j_Zr9r6W7gE7zM66NQQk9eHbzHPIz-BYbsVOE7ARukI')->get('http://exchange-2.0.test/api/v1/account/user/list')->object(); + + + dd($response, $object->getAccessToken()); } From 5d34201579db23cc54b0d2477c4cf230e2a16588 Mon Sep 17 00:00:00 2001 From: glovetleong Date: Tue, 28 Sep 2021 22:07:19 +0800 Subject: [PATCH 005/127] pull --- .../Services/CrossAuthenticatesUser.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php b/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php index acf1f15e..e80bef3d 100644 --- a/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php +++ b/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php @@ -6,7 +6,6 @@ use Illuminate\Support\Facades\Http; use App\Classes\Exceptions\AccessUnauthorisedException; use App\Classes\Modules\Accounts\DataTransferObjects\CrossAuthenticationCredentialsObject; use App\Classes\ValueObjects\Constants\PlatformType; - use Tymon\JWTAuth\Facades\JWTAuth; class CrossAuthenticatesUser { @@ -21,20 +20,21 @@ class CrossAuthenticatesUser if ($object->getPlatform() == PlatformType::EXCHANGE) { + $token = $object->getAccessToken(); + $tokenParts = explode(".", $token); + $tokenHeader = base64_decode($tokenParts[0]); + $tokenPayload = base64_decode($tokenParts[1]); + $jwtHeader = json_decode($tokenHeader); + $jwtPayload = json_decode($tokenPayload); + dd($jwtPayload); - $response = Http::withToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9leGNoYW5nZS0yLjAudGVzdFwvYXBpXC92MVwvYWNjb3VudFwvYXV0aGVudGljYXRpb25cL2xvZ2luXC9hdHRlbXB0IiwiaWF0IjoxNjMyODAwMzE1LCJleHAiOjk5NjA2MDAzMjE1LCJuYmYiOjE2MzI4MDAzMTUsImp0aSI6Ilo2cGpNMExRbWM5Q1BQQ0YiLCJ1c2VyIjp7ImlkIjo3LCJuYW1lIjoiTGVvbmcgQ2hlZSBTaW9uZyIsImVtYWlsIjoiZ2xvdmV0bGVvbmdAZ21haWwuY29tIiwidHlwZSI6Mywic3RhdHVzIjoyLCJjb21wYW55X2lkIjo5fSwic3ViIjo3LCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.j_Zr9r6W7gE7zM66NQQk9eHbzHPIz-BYbsVOE7ARukI')->get('http://exchange-2.0.test/api/v1/account/user/list')->object(); - + $response = Http::withToken($object->getAccessToken())->post('https://dev.exchange.cief-malaysia.com/api/v1/account/authentication/user/show')->object(); dd($response, $object->getAccessToken()); - } - if (! auth()->validate(['email' => $object->getEmail(), 'password' => $object->getPassword()])) { - throw new AccessUnauthorisedException('These credentials do not match our records.'); - } - - return true; + return $response; } From ee87443ca45b08cb1bd26e2325c9da35d5b61ea2 Mon Sep 17 00:00:00 2001 From: glovetleong Date: Tue, 28 Sep 2021 22:23:51 +0800 Subject: [PATCH 006/127] pull --- .../accounts/forms/CrossPlatformLoginFormComponent.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue b/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue index 6b44f6ba..6eb111db 100644 --- a/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue +++ b/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue @@ -31,6 +31,10 @@ export default { data(){ return { + parameters: { + access_token: this.email, + platform: 1 + }, loading: false } }, @@ -38,8 +42,8 @@ iframeEvent(event) { if(event.origin !== 'http://exchange-2.0.test') return; if (event.data.data) { - console.log(event.data.data.payload.access_token); - + this.parameters.access_token = event.data.data.payload.access_token; + this.submit(this.route('api.account.authentication.authenticate.cross.attempt'), 'post', this.section, false, false) } } }, From ee77fd236ab717ed39cc4e79c55e9ca46e072d37 Mon Sep 17 00:00:00 2001 From: glovetleong Date: Wed, 29 Sep 2021 14:23:50 +0800 Subject: [PATCH 007/127] cross login --- .../Accounts/Processors/CrossAuthenticationProcessor.php | 7 ++----- .../Modules/Accounts/Services/CrossAuthenticatesUser.php | 7 +------ .../accounts/forms/CrossPlatformLoginFormComponent.vue | 5 +++-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/app/Classes/Modules/Accounts/Processors/CrossAuthenticationProcessor.php b/app/Classes/Modules/Accounts/Processors/CrossAuthenticationProcessor.php index 1f976a42..7d77aa05 100644 --- a/app/Classes/Modules/Accounts/Processors/CrossAuthenticationProcessor.php +++ b/app/Classes/Modules/Accounts/Processors/CrossAuthenticationProcessor.php @@ -59,12 +59,9 @@ class CrossAuthenticationProcessor $this->canCrossAuthenticateUser->passes($object); - $this->crossAuthenticatesUser->execute($object); - - $user = $this->fetchesUser->execute(['email' => $object->getEmail()]); + $cross = $this->crossAuthenticatesUser->execute($object); + dd($cross); return ['access_token' => $this->generatesAuthenticationToken->execute($user), 'redirect_url' => $this->authenticationRedirect->url($user)]; - } - } \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php b/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php index e80bef3d..93b2b200 100644 --- a/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php +++ b/app/Classes/Modules/Accounts/Services/CrossAuthenticatesUser.php @@ -23,15 +23,10 @@ class CrossAuthenticatesUser $token = $object->getAccessToken(); $tokenParts = explode(".", $token); - $tokenHeader = base64_decode($tokenParts[0]); $tokenPayload = base64_decode($tokenParts[1]); - $jwtHeader = json_decode($tokenHeader); $jwtPayload = json_decode($tokenPayload); - dd($jwtPayload); - $response = Http::withToken($object->getAccessToken())->post('https://dev.exchange.cief-malaysia.com/api/v1/account/authentication/user/show')->object(); - - dd($response, $object->getAccessToken()); + $response = Http::withToken($object->getAccessToken())->get(env('EXCHANGE_URL') . 'api/v1/company/' . $jwtPayload->user->company_id . '/show')->object(); } return $response; diff --git a/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue b/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue index 6eb111db..e9a38a4f 100644 --- a/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue +++ b/resources/assets/vue/components/accounts/forms/CrossPlatformLoginFormComponent.vue @@ -12,7 +12,7 @@
- +
@@ -35,12 +35,13 @@ access_token: this.email, platform: 1 }, + exchange_url: process.env.MIX_EXCHANGE_URL, loading: false } }, methods:{ iframeEvent(event) { - if(event.origin !== 'http://exchange-2.0.test') return; + if(event.origin !== this.exchange_url) return; if (event.data.data) { this.parameters.access_token = event.data.data.payload.access_token; this.submit(this.route('api.account.authentication.authenticate.cross.attempt'), 'post', this.section, false, false) From 592e8c489b29543c96f841f5b5f57129233f19c4 Mon Sep 17 00:00:00 2001 From: glovetleong Date: Wed, 29 Sep 2021 14:24:37 +0800 Subject: [PATCH 008/127] env --- .env.example | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.env.example b/.env.example index 696b7171..a75778c8 100644 --- a/.env.example +++ b/.env.example @@ -51,3 +51,5 @@ MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" UNITY_APP_URL="https://unity.izyim.com" +EXCHANGE_URL=https://dev.exchange.cief-malaysia.com/ +MIX_EXCHANGE_URL="${EXCHANGE_URL}" From 6d0e7dd51de8c208d570cf16342d94aefb9c350e Mon Sep 17 00:00:00 2001 From: edmondlang Date: Tue, 5 Oct 2021 17:00:00 +0800 Subject: [PATCH 009/127] delivery-packing-list-ui --- .../assets/sass/modules/_typography.scss | 2 +- .../ContainerProfileSectionComponent.vue | 333 ++++++++++++------ ...CreateDeliveryPackinglistFormComponent.vue | 241 +++++++++++++ .../elements/ListPackagelistFormComponent.vue | 59 ++++ .../CreateLoadContainerFormComponent.vue | 2 +- 5 files changed, 531 insertions(+), 106 deletions(-) create mode 100644 resources/assets/vue/components/containers/elements/CreateDeliveryPackinglistFormComponent.vue create mode 100644 resources/assets/vue/components/containers/elements/ListPackagelistFormComponent.vue diff --git a/resources/assets/sass/modules/_typography.scss b/resources/assets/sass/modules/_typography.scss index f72c91ce..dbc80e6f 100644 --- a/resources/assets/sass/modules/_typography.scss +++ b/resources/assets/sass/modules/_typography.scss @@ -231,7 +231,7 @@ hr{ font-weight: normal; } .semi-bold { - font-weight: 400 !important; + font-weight: 600 !important; } .bold { font-weight: bold !important; diff --git a/resources/assets/vue/components/containers/elements/ContainerProfileSectionComponent.vue b/resources/assets/vue/components/containers/elements/ContainerProfileSectionComponent.vue index e4859da8..a6c22ef1 100644 --- a/resources/assets/vue/components/containers/elements/ContainerProfileSectionComponent.vue +++ b/resources/assets/vue/components/containers/elements/ContainerProfileSectionComponent.vue @@ -420,122 +420,238 @@ + +
+
+
Create Delivery Packing List
+
+
+
+
+
+
+
+
+
+
+ +
+
+
Order No
+
+
+
Customer Marking
+
+
+
No. Packgaes
+
+
+
CBM
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
Next
+
+
+
+ +
+ +
+ +
+
+
+
+
+
Summary
+
+
+
+
+
{{selectedPackageList.length}} Packing List Selected
+
+
+
+
+
+
+
{{selectedPackageList.order.reference}}
+
+
+
noPackages
+
+
+
Total Cbm
+
+
+
+
+
+
Total Packages
+
+
+
RM 212.15
+
+
+
+
+
Total Address
+
+
+
RM 41.25
+
+
+
+
+
Total Cbm
+
+
+
RM 0.00
+
+
+
+
+
+
Total Payments
+
+
+
RM 3300.00
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
Activity Timeline
-
-
-
Comments
+
+
+
Activity Timeline
+
+
+
Comments
+
+
+
+
+
+
+
    +
  • +
    +
    +

    Item Returned

    +
    +
    +

    5 September 2021

    +
    +
    +

    Item has been returned due to mismatch

    +
  • +
  • +
    +
    +

    Client Report

    +
    +
    +

    21 August 2021

    +
    +
    +

    Client report order number #012AS12W

    +
  • +
  • +
    +
    +

    Item Cancelled

    +
    +
    +

    8 May 2021

    +
    +
    +

    Item has been cancelled by clients number #012ASJ21

    +
  • +
  • +
    +
    +

    Item Cancelled

    +
    +
    +

    8 May 2021

    +
    +
    +

    Item has been cancelled by clients number #012ASJ21

    +
  • +
  • +
    +
    +

    Client Report

    +
    +
    +

    21 August 2021

    +
    +
    +

    Client report order number #012AS12W

    +
  • +
-
-
-
+
+
+
-
    -
  • -
    -
    -

    Item Returned

    -
    -
    -

    5 September 2021

    -
    -
    -

    Item has been returned due to mismatch

    -
  • -
  • -
    -
    -

    Client Report

    -
    -
    -

    21 August 2021

    -
    -
    -

    Client report order number #012AS12W

    -
  • -
  • -
    -
    -

    Item Cancelled

    -
    -
    -

    8 May 2021

    -
    -
    -

    Item has been cancelled by clients number #012ASJ21

    -
  • -
  • -
    -
    -

    Item Cancelled

    -
    -
    -

    8 May 2021

    -
    -
    -

    Item has been cancelled by clients number #012ASJ21

    -
  • -
  • -
    -
    -

    Client Report

    -
    -
    -

    21 August 2021

    -
    -
    -

    Client report order number #012AS12W

    -
  • -
+
+
+ +
+
+

Jacob Arlington

+
+
+
+
+

Adipisicing occaecat pariatur id sunt ullamco quis laborum irure ea excepteur enim dolore est. Deserunt do consectetur ex in dolor labore ad reprehenderit velit laboris officia ut.

+
+
-
+
-
+
+
+ +
-
-
- -
-
-

Jacob Arlington

-
-
-
-
-

Adipisicing occaecat pariatur id sunt ullamco quis laborum irure ea excepteur enim dolore est. Deserunt do consectetur ex in dolor labore ad reprehenderit velit laboris officia ut.

-
-
+

Jacob Arlington

-
+
-
-
- -
-
-

Jacob Arlington

-
-
-
-
-

Adipisicing occaecat pariatur id sunt ullamco quis laborum irure ea excepteur enim dolore est. Deserunt do consectetur ex in dolor labore ad reprehenderit velit laboris officia ut.

-
-
+

Adipisicing occaecat pariatur id sunt ullamco quis laborum irure ea excepteur enim dolore est. Deserunt do consectetur ex in dolor labore ad reprehenderit velit laboris officia ut.

- -
+
-
+ +
@@ -545,9 +661,9 @@
\ No newline at end of file diff --git a/resources/assets/vue/components/containers/elements/CreateDeliveryPackinglistFormComponent.vue b/resources/assets/vue/components/containers/elements/CreateDeliveryPackinglistFormComponent.vue new file mode 100644 index 00000000..95437774 --- /dev/null +++ b/resources/assets/vue/components/containers/elements/CreateDeliveryPackinglistFormComponent.vue @@ -0,0 +1,241 @@ + + \ No newline at end of file diff --git a/resources/assets/vue/components/containers/elements/ListPackagelistFormComponent.vue b/resources/assets/vue/components/containers/elements/ListPackagelistFormComponent.vue new file mode 100644 index 00000000..7f7722d0 --- /dev/null +++ b/resources/assets/vue/components/containers/elements/ListPackagelistFormComponent.vue @@ -0,0 +1,59 @@ + + diff --git a/resources/assets/vue/components/containers/forms/CreateLoadContainerFormComponent.vue b/resources/assets/vue/components/containers/forms/CreateLoadContainerFormComponent.vue index d3f03b07..f4ecee0d 100644 --- a/resources/assets/vue/components/containers/forms/CreateLoadContainerFormComponent.vue +++ b/resources/assets/vue/components/containers/forms/CreateLoadContainerFormComponent.vue @@ -81,7 +81,7 @@
-
+
Cancel
From 0d53a61f187703fba3bd5ac901a390b57ff184d3 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Tue, 5 Oct 2021 20:40:48 +0800 Subject: [PATCH 010/127] update select all packing list funtion --- .../elements/ContainerProfileSectionComponent.vue | 8 ++++++-- .../containers/elements/ListPackagelistFormComponent.vue | 9 +-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/resources/assets/vue/components/containers/elements/ContainerProfileSectionComponent.vue b/resources/assets/vue/components/containers/elements/ContainerProfileSectionComponent.vue index a6c22ef1..e63f607d 100644 --- a/resources/assets/vue/components/containers/elements/ContainerProfileSectionComponent.vue +++ b/resources/assets/vue/components/containers/elements/ContainerProfileSectionComponent.vue @@ -150,7 +150,7 @@ }