From d662bdb6cac6227bbb07436525edf10fc0ca4d6e Mon Sep 17 00:00:00 2001 From: Venba Date: Sat, 30 Mar 2024 06:55:20 +0000 Subject: [PATCH 1/6] CHANGE_PIPELINE_STEP1 --- bitbucket-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 8288ba2e..e905c2b3 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -12,7 +12,6 @@ pipelines: - step: name: Test script: - - composer install - apt-get update - apt-get -qq install git-ftp - git ftp push -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL From c32e2a6c135070f2e0aafa2cdbc50ad3d0729c6f Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Sat, 30 Mar 2024 14:54:31 +0530 Subject: [PATCH 2/6] FIX_CLIENT_BRANCH_SHOW_MULTI : RV --- app/Views/client_branch.php | 38 ++++++--- app/Views/insurer_branch.php | 145 ++++++++++++++++++----------------- app/Views/layout/header.php | 3 + app/Views/tpa_branch.php | 7 +- 4 files changed, 108 insertions(+), 85 deletions(-) diff --git a/app/Views/client_branch.php b/app/Views/client_branch.php index f56d9d42..c788731c 100644 --- a/app/Views/client_branch.php +++ b/app/Views/client_branch.php @@ -172,6 +172,11 @@ $(document).ready(function () { $('.ac').css('display', 'block'); contactCount = 1 + var addButton = document.getElementById('add'); + if (addButton.style.display === 'none') { + addButton.style.display = 'block'; + } + var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || []; for (var i = 0; i < buttonIds.length; i++) { var firstElement = buttonIds[i].split('_')[0]; @@ -205,12 +210,7 @@ $(document).ready(function () { $('#branch_form')[0].reset(); $('.ac').css('display', 'block'); $('.parsley-errors-list').remove(); - $('#branch_form').parsley().reset(); - - - - contactCount = 1 var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || []; @@ -282,14 +282,14 @@ $(document).ready(function () { var branchTableInsert = '' $.each(res.data, function(index, item) { branchTableInsert += ` - - ${item.branch_name} - ${item.branch_code} - + + ${item.branch_name} + ${item.branch_code} + - - + + `; }); $('#branch_list').append(branchTableInsert); @@ -311,6 +311,22 @@ $(document).ready(function () { $('body').on('click', '.btnBranchEdit', function () { + var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || []; + for (var i = 0; i < buttonIds.length; i++) { + var firstElement = buttonIds[i].split('_')[0]; + console.log(firstElement); + + // Find the element by its ID + var elementToRemove = document.getElementById(firstElement); + console.log(elementToRemove); + + if (elementToRemove) { + console.log(elementToRemove); + elementToRemove.parentNode.removeChild(elementToRemove); + } + localStorage.removeItem('buttonIds') + } + contactCount = 1 $('.loader').fadeIn(); $('.loader-mask').fadeIn(); diff --git a/app/Views/insurer_branch.php b/app/Views/insurer_branch.php index 8170f321..dd2e5a6f 100644 --- a/app/Views/insurer_branch.php +++ b/app/Views/insurer_branch.php @@ -132,71 +132,7 @@ insurer_Branch_PrimaryKey = $('#insurer_id_branch').val(); $('#add_branch').hide(); - $('.btnBack').hide(); - - - $('#btnBranchAdd').click(function(){ - - insurer_branch_form_action = ''; - - $('#add_branch').show(); - $('#branch_table').hide(); - $('.btnBack').show(); - $('#btnBranchAdd').hide(); - - $('#branch_name').val(''); - $('#branch_code').val(''); - $('#state').val(''); - $('#district').val(''); - $('#branch_city').val(''); - - $('#name').val(''); - $('#email').val(''); - $('#mobile').val(''); - $('#designation').val(''); - - - contactCount = 1 - - - var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || []; - for (var i = 0; i < buttonIds.length; i++) { - var firstElement = buttonIds[i].split('_')[0]; - console.log(firstElement); - - // Find the element by its ID - var elementToRemove = document.getElementById(firstElement); - console.log(elementToRemove); - - if (elementToRemove) { - console.log(elementToRemove); - elementToRemove.parentNode.removeChild(elementToRemove); - } - localStorage.removeItem('buttonIds') - } - }) - - $('.btnBack').click(function(){ - - $('#add_branch').hide(); - $('#branch_table').show(); - $('.btnBack').hide(); - $('#btnBranchAdd').show(); - - $('#branch_name').val(''); - $('#branch_code').val(''); - $('#state').val(''); - $('#district').val(''); - $('#branch_city').val(''); - - $('#name').val(''); - $('#email').val(''); - $('#mobile').val(''); - $('#designation').val(''); - - - }) - + $('.btnBack').hide(); if(insurer_Branch_PrimaryKey !== ''){ @@ -204,12 +140,12 @@ var data = ; $.each(data, function(index, item) { branchTable += ` - + ${item.branch_name} ${item.branch_code} - - + + `; @@ -220,6 +156,73 @@ }); + $('#btnBranchAdd').click(function(){ + + $("#insurer_branch_form")[0].reset(); + contactCount = 1 + insurer_branch_form_action = ''; + $('#add_branch').show(); + $('#branch_table').hide(); + $('.btnBack').show(); + $('#btnBranchAdd').hide(); + + $('#branch_name').val(''); + $('#branch_code').val(''); + $('#state').val(''); + $('#district').val(''); + $('#branch_city').val(''); + + $('#name').val(''); + $('#email').val(''); + $('#mobile').val(''); + $('#designation').val(''); + contactCount = 1 + + var addButton = document.getElementById('add'); + if (addButton.style.display === 'none') { + addButton.style.display = 'block'; + } + + var buttonIds = JSON.parse(localStorage.getItem('buttonIds')) || []; + for (var i = 0; i < buttonIds.length; i++) { + var firstElement = buttonIds[i].split('_')[0]; + console.log(firstElement); + + // Find the element by its ID + var elementToRemove = document.getElementById(firstElement); + console.log(elementToRemove); + + if (elementToRemove) { + console.log(elementToRemove); + elementToRemove.parentNode.removeChild(elementToRemove); + } + localStorage.removeItem('buttonIds') + } + }) + + $('.btnBack').click(function(){ + + $("#insurer_branch_form")[0].reset(); + contactCount = 1 + $('#add_branch').hide(); + $('#branch_table').show(); + $('.btnBack').hide(); + $('#btnBranchAdd').show(); + + $('#branch_name').val(''); + $('#branch_code').val(''); + $('#state').val(''); + $('#district').val(''); + $('#branch_city').val(''); + + $('#name').val(''); + $('#email').val(''); + $('#mobile').val(''); + $('#designation').val(''); + + }) + + $("#insurer_branch_form").submit(function(events) { console.log(1, insurer_branch_form_action); events.preventDefault(); @@ -238,6 +241,7 @@ processData: false, contentType: false, success: function(res) { + $("#insurer_branch_form")[0].reset(); setTimeout(function() { $('.loader').fadeOut(); $('.loader-mask').delay(350).fadeOut('slow'); @@ -254,7 +258,6 @@ - `; }); @@ -284,7 +287,7 @@ $('body').on('click', '.btnBranchEdit', function () { $('#container').html(""); - contactCount =1; + contactCount = 1; var branch_id = $(this).attr('data-id'); $('#insurer_Branch_PrimaryKey').val(branch_id); @@ -469,8 +472,6 @@ } - - function removeInsurerBranch(element) { var id = element.getAttribute('data-id'); var form_action = '' + id; diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index af40c828..e3998fbe 100644 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -554,6 +554,9 @@
  • Upload +
  • +
  • + Endorsement List
  • diff --git a/app/Views/tpa_branch.php b/app/Views/tpa_branch.php index 5104ae67..1015d36e 100644 --- a/app/Views/tpa_branch.php +++ b/app/Views/tpa_branch.php @@ -153,7 +153,10 @@ $(document).ready(function () { $('#mobile').val(''); $('#designation').val(''); - + var addButton = document.getElementById('add'); + if (addButton.style.display === 'none') { + addButton.style.display = 'block'; + } contactCount = 1 @@ -407,7 +410,7 @@ var html = `
    - +
    From 2f70084e837bbce124c2735cd4be5de18c3bcdf8 Mon Sep 17 00:00:00 2001 From: velz Date: Sat, 30 Mar 2024 15:17:04 +0530 Subject: [PATCH 3/6] CHANGE_TEMP_QUEUE_ENABLED --- app/Controllers/EmployeeServiceController.php | 6 ++++- app/Controllers/JobWorker.php | 23 ++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php index ed5c0a4b..92bad796 100644 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -17,6 +17,7 @@ use App\Models\FileModel; use App\Models\EmpEndorsementModel; use App\Controllers\Jobs ; +use App\Controllers\JobWorker ; use PhpOffice\PhpSpreadsheet\Spreadsheet; use Kint\Kint; @@ -266,8 +267,9 @@ class EmployeeServiceController extends AdminController { //proceed next data level validation in JOB queue $job_details = new Jobs(); - $r = Jobs::addJob(['job_name' => 'excelFileDataValidation','payload' => ['file_id' => $file_id]]); + $jobWorker = new JobWorker(); + JobWorker::processJob($r); } return $result; @@ -438,6 +440,8 @@ class EmployeeServiceController extends AdminController $job_details = new Jobs(); $r = Jobs::addJob(['job_name' => 'employeesOnboardPreprocess','payload' => ['file_id' => $file_id]]); + $jobWorker = new JobWorker(); + JobWorker::processJob($r); } return $result; diff --git a/app/Controllers/JobWorker.php b/app/Controllers/JobWorker.php index 964d365a..4499d36b 100644 --- a/app/Controllers/JobWorker.php +++ b/app/Controllers/JobWorker.php @@ -27,6 +27,14 @@ class JobWorker extends AdminController // } } + public static function streamOutput($data) + { + ob_implicit_flush(true); + // try { ob_end_flush(); } catch(Exception $e) { echo $e->getMessage(); } + echo $data; + flush(); + } + public static function processJobs(array $jobdata = []) { // echo 'listen';//die(); @@ -49,6 +57,7 @@ class JobWorker extends AdminController //sleep(1); SELF::processjob(['id' => $job->id,'uuid' => $job->uuid]); + usleep( 500000 ); } } } @@ -86,8 +95,15 @@ class JobWorker extends AdminController { $job = $job[0]; - echo "\nProcessing job id - " . $job->id . "\n"; - echo "Job name - " . $job->name . "\n"; + + + // echo "\nProcessing job id - " . $job->id . "\n"; + SELF::streamOutput("\nProcessing job id - " . $job->id . "\n"); + // sleep(5); + // echo "Job name - " . $job->name . "\n"; + SELF::streamOutput("Job name - " . $job->name . "\n"); + // sleep(5); + // print_r(SELF::$event_class_mapping); // echo array_key_exists($job->name,SELF::$event_class_mapping) ? 'mapped' : 'notmapped'; // die(); @@ -173,7 +189,8 @@ class JobWorker extends AdminController ]); // echo "Job $job->id $job_status. Response - $response \n"; - echo "Job $job->id $job_status \n"; + // echo "Job $job->id $job_status \n"; + SELF::streamOutput("Job $job->id $job_status \n"); return true; } else From 3b5e726fb6a5390a84d890257fb8bd32f7cfe98c Mon Sep 17 00:00:00 2001 From: Venba Date: Sat, 30 Mar 2024 11:45:28 +0000 Subject: [PATCH 4/6] CHANGE_CICD_DOCKER_IMG --- bitbucket-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index e905c2b3..d6dc568c 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -3,7 +3,7 @@ # This template allows you to validate your PHP application. # The workflow allows running tests and code linting on the default branch. -image: composer:2.0 +image: php:8.2-cli pipelines: From 0a2e97f2a5a55c77323a33a7b3630d375c4f9423 Mon Sep 17 00:00:00 2001 From: Venba Date: Sat, 30 Mar 2024 12:34:53 +0000 Subject: [PATCH 5/6] CHANGE_CICD_SCRIPT1 --- bitbucket-pipelines.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index d6dc568c..d922751c 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -10,10 +10,18 @@ pipelines: default: - parallel: - step: - name: Test + name: Initialize Git FTP + script: + - apt-get update + - apt-get -qq install git-ftp + - git ftp init -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL + caches: + - composer + - step: + name: Deploy using Git FTP script: - apt-get update - apt-get -qq install git-ftp - git ftp push -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL caches: - - composer \ No newline at end of file + - composer From 47659c4fa6aaf1977a8cc28912d863a53a7e4db0 Mon Sep 17 00:00:00 2001 From: Venba Date: Sat, 30 Mar 2024 12:39:22 +0000 Subject: [PATCH 6/6] CHANGE_CICD_SCRIPT2 --- bitbucket-pipelines.yml | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index d922751c..321823d4 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -8,20 +8,12 @@ image: php:8.2-cli pipelines: default: - - parallel: - - step: - name: Initialize Git FTP - script: - - apt-get update - - apt-get -qq install git-ftp - - git ftp init -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL - caches: - - composer - - step: - name: Deploy using Git FTP - script: - - apt-get update - - apt-get -qq install git-ftp - - git ftp push -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL - caches: - - composer + - step: + name: Initialize and Deploy using Git FTP + script: + - apt-get update + - apt-get -qq install git-ftp + - git ftp init -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL + - git ftp push -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL + caches: + - composer