Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test migration - Dev - Donation Flow - Typo - Search : Pg bugfix 0043 - June 19,2023 #231

Merged
merged 21 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ RUN apt-get update && apt-get install -y \
&& docker-php-ext-install -j$(nproc) gd



COPY --chown=www-data:www-data --from=composer /app /var/www/html


Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/Admin/FundSupportedPoolController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function index(Request $request)
{
if($request->ajax()) {

// store the filter
// store the filter
$filter = $request->except("draw", "columns", "order", "start", "length", "search", "_");
session(['settings_fund_supported_pools_filter' => $filter]);

Expand Down Expand Up @@ -106,12 +106,12 @@ public function index(Request $request)
->make(true);
}

// restore filter if required
// restore filter if required
$filter = [];
if (str_contains( url()->previous(), 'settings/fund-supported-pools')) {
$filter = session('settings_fund_supported_pools_filter');
} else {
$filter['effective_type']= 'C';
$filter['effective_type']= 'C';
}

$regions = Region::orderBy('name')->get();
Expand Down Expand Up @@ -601,7 +601,7 @@ public function destroy($id, Request $request)
if ($pool->hasPledge() && $pool->start_date < today()) {
return response()->json([
'title' => "Invalid delete!",
'message' => 'The Fund Support Pool "' . $pool->region->name . '" cannot be deleted, it is being referenced on pledge(s).'], 403);
'message' => 'The Fund Supported Pool "' . $pool->region->name . '" cannot be deleted, it is being referenced on pledge(s).'], 403);
}

// $validator = Validator::make(request()->all(), [
Expand Down
16 changes: 8 additions & 8 deletions app/Http/Controllers/Admin/RegionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function index(Request $request) {

return Datatables::of($regions)
->addColumn('action', function ($region) {
return '<a class="btn btn-info btn-sm show-region" data-id="'. $region->id .'" >Show</a>' .
'<a class="btn btn-primary btn-sm ml-2 edit-region" data-id="'. $region->id .'" >Edit</a>' .
return '<a class="btn btn-info btn-sm show-region" data-id="'. $region->id .'" >Show</a>' .
'<a class="btn btn-primary btn-sm ml-2 edit-region" data-id="'. $region->id .'" >Edit</a>' .
'<a class="btn btn-danger btn-sm ml-2 delete-region" data-id="'. $region->id .
'" data-code="'. $region->code . '">Delete</a>';
})
Expand Down Expand Up @@ -71,7 +71,7 @@ public function store(RegionRequest $request)

return response()->json($region);
}

}

/**
Expand All @@ -90,12 +90,12 @@ public function show(Request $request, $id)
$region->updated_by_name = $region->updated_by ? $region->updated_by->name : '';
$region->formatted_created_at = $region->created_at->format('Y-m-d H:i:s');
$region->formatted_updated_at = $region->updated_at->format('Y-m-d H:i:s');
// $region->updated_at = date_timezone_set($region->updated_at, timezone_open('America/Vancouver'));
// $region->updated_at = date_timezone_set($region->updated_at, timezone_open('America/Vancouver'));
unset($region->created_by );
unset($region->updated_by );
return response()->json($region);
}

}

/**
Expand Down Expand Up @@ -125,7 +125,7 @@ public function update(RegionRequest $request, $id)
$region = Region::where('id', $id)->first();
$region->fill( $request->all() );
$region->save();

return response()->json($region);
}
}
Expand All @@ -143,12 +143,12 @@ public function destroy(Request $request, $id)
if ($region->hasFSPool) {
return response()->json([
'title' => "Invalid delete!",
'message' => 'The Region "' . $region->code . ' - ' . $region->name . '" cannot be deleted, it is being referenced on the Fund Support Pool(s).'], 403);
'message' => 'The Region "' . $region->code . ' - ' . $region->name . '" cannot be deleted, it is being referenced on the Fund Supported Pool(s).'], 403);
}

$region->updated_by_id = Auth::Id();
$region->save();

$region->delete();

return response()->noContent();
Expand Down
1 change: 0 additions & 1 deletion openshift/app/pecsf-dc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ objects:
lifecycle:
postStart:
exec:

command: ["/bin/sh", "-c", "php /var/www/html/artisan queue:work --tries=3 --timeout=0 --memory=512 >> /var/www/html/storage/logs/queue-work.log & "]
restartPolicy: Always
imagePullPolicy: Always
Expand Down
76 changes: 38 additions & 38 deletions resources/views/admin-campaign/fund-supported-pools/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<div class="d-flex">
<div class="mr-2">
<x-button :href="route('settings.fund-supported-pools.create')">Add a New Value</x-button>
<x-button :href="route('settings.fund-supported-pools.create')">Add a New Value</x-button>
{{-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#region-create-modal">
Add a New Value
</button> --}}
Expand All @@ -24,7 +24,7 @@

<form id="fspool-filter-form" method="post">
<div class="card search-filter">

<div class="card-body pb-0 ">
<h2 class="text-primary">Search Criteria</h2>
<p>Enter any informartion you have and click Search. Leave fields blank for a list of all values.</p>
Expand All @@ -33,7 +33,7 @@
<div class="form-group col-md-2">
<label for="region_id">
Region
</label>
</label>
<select name="region_id" value="" class="form-control">
<option value="">All</option>
@foreach ($regions as $region)
Expand All @@ -48,10 +48,10 @@
<label for="start">
Start Date (>=)
</label>
<input type="date" name="start_date" class="form-control"
<input type="date" name="start_date" class="form-control"
value="{{ isset($filter['start_date']) ? $filter['start_date'] : '' }}" />
</div>

<div class="form-group col-md-2">
<label for="status">
Status
Expand All @@ -62,7 +62,7 @@
<option value="I" {{ isset($filter['status']) && $filter['status'] == 'I' ? 'selected' : '' }}>Inactive</option>
</select>
</div>

<div class="form-group col-md-2">
<label for="effective_type">
Effective Type
Expand All @@ -74,7 +74,7 @@
<option value="H" {{ isset($filter['effective_type']) && $filter['effective_type'] == 'H' ? 'selected' : '' }}>History</option>
</select>
</div>

<div class="form-group col-md-1">
<label for="search">
&nbsp;
Expand All @@ -87,10 +87,10 @@
</label>
<button type="button" id="reset-btn" value="Clear" class="form-control btn btn-secondary">Clear</button>
</div>
</div>
</div>

</div>

</div>
</div>
</form>

Expand All @@ -101,13 +101,13 @@

@if ($message = Session::get('success'))
<div class="alert alert-success alert-dismissible fade show" role="alert">
{{ $message }}
{{ $message }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
@endif

{{-- <div class="category-filter">
<select id="effectiveTypeFilter" class="form-control form-control-sm ml-1">
<option value="" selected>Show All</option>
Expand All @@ -131,10 +131,10 @@
</thead>
</table>



</div>
</div>

</div>
</div>

@include('admin-campaign.fund-supported-pools.partials.modal-duplicate')

Expand All @@ -143,7 +143,7 @@

@push('css')


<link href="https://cdn.datatables.net/1.11.4/css/dataTables.bootstrap4.min.css" rel="stylesheet">
<link href="{{ asset('vendor/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css') }}" rel="stylesheet">

Expand All @@ -155,7 +155,7 @@
#fspool-table_filter label {
text-align: right !important;
padding-right: 10px;
}
}
.dataTables_scrollBody {
margin-bottom: 10px;
}
Expand All @@ -175,26 +175,26 @@


@push('js')

<script src="https://cdn.datatables.net/1.11.4/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.11.4/js/dataTables.bootstrap4.min.js"></script>
<script src="{{ asset('vendor/sweetalert2/sweetalert2.min.js') }}" ></script>

<script>
window.setTimeout(function() {
$(".alert-success").fadeTo(500, 0).slideUp(500, function(){
$(this).remove();
$(this).remove();
});
}, 5000);


$(function() {

$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': '{{csrf_token()}}'
}
});
});

// Datatables
var oTable = $('#fspool-table').DataTable({
Expand All @@ -205,7 +205,7 @@
"language": {
processing: '<i class="fa fa-spinner fa-pulse fa-3x fa-fw text-info"></i><span class="sr-only">Loading...</span>'
},
stateSave: true,
stateSave: true,
serverSide: true,
select: true,
'order': [[0, 'asc'], [2, 'asc']],
Expand All @@ -214,20 +214,20 @@

@if (!(str_contains( url()->previous(), 'settings/fund-supported-pools')))
oTable.page( 'first' ).draw( 'page' );
@endif
@endif
},
ajax: {
url: '{!! route('settings.fund-supported-pools.index') !!}',
data: function (d) {
d.region_id = $("select[name='region_id']").val();
d.start_date = $("input[name='start_date']").val();
d.status = $("select[name='status']").val();
d.effective_type = $("select[name='effective_type']").val();
d.effective_type = $("select[name='effective_type']").val();
},
error: function(xhr, resp, text) {
if (xhr.status == 401) {
{ // session expired
window.location.href = '/login';
{ // session expired
window.location.href = '/login';
}
}
},
Expand Down Expand Up @@ -277,7 +277,7 @@
]
});

//
//
$(window).keydown(function(event){
if(event.keyCode == 13) {
event.preventDefault();
Expand Down Expand Up @@ -319,7 +319,7 @@
delete_start_date = $(this).attr('data-start-date');

Swal.fire( {
title: 'Are you sure you want to delete fund support pool "' + delete_region + '" with start date "' + delete_start_date + '" ?',
title: 'Are you sure you want to delete Fund Supported Pool "' + delete_region + '" with start date "' + delete_start_date + '" ?',
text: 'This action cannot be undone.',
// icon: 'question',
//showDenyButton: true,
Expand Down Expand Up @@ -348,8 +348,8 @@
},
error: function(xhr, resp, text) {
if (xhr.status == 401 || xhr.status == 419) {
{ // session expired
window.location.href = '/login';
{ // session expired
window.location.href = '/login';
}
} else {
Swal.fire({
Expand Down Expand Up @@ -383,7 +383,7 @@

$('#pool-duplicate-modal input[name="region"]').val( duplicate_region );
$('#pool-duplicate-modal input[name="old_start_date"]').val( duplicate_start_date );

$('#pool-duplicate-modal-button').attr('data-id', duplicate_id);

// Clean up a previous error message if exists
Expand All @@ -406,19 +406,19 @@
})

$(document).on("click", "#pool-duplicate-modal-button" , function(e) {

var fields = ['start_date'];
$.each( fields, function( index, field_name ) {
$('#pool-duplicate-modal').find('[name='+field_name+']').nextAll('span.text-danger').remove();
});


var form = $('#pool-duplicate-modal-form');
var id = $(this).attr('data-id');
var start_date = $('#pool-duplicate-modal-form input[name="start_date"]').val();

$.ajax({
url: '/settings/fund-supported-pools/duplicate/' + id,
url: '/settings/fund-supported-pools/duplicate/' + id,
method: 'post',
data: form.serialize(), // serializes the form's elements.
success: function(data)
Expand All @@ -430,7 +430,7 @@
// Display a message
Toast('Success', 'The Fund Supported Pool "' + duplicate_region + '" with Start date "' + start_date +
'" was successfully created.', 'bg-success m-3');

},
error: function(response) {
if (response.status == 422) {
Expand All @@ -447,7 +447,7 @@
});


function Toast( toast_title, toast_body, toast_class) {
function Toast( toast_title, toast_body, toast_class) {
// $(document).Toasts('create', {
// icon: 'fas fa-solid fa-check',
// class: toast_class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header bg-primary">
<h5 class="modal-title" id="poolModalLabel">Confirm to duplicate Fund Support Pool?</h5>
<h5 class="modal-title" id="poolModalLabel">Confirm to duplicate Fund Supported Pool?</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>

<div class="modal-body">

<form id="pool-duplicate-modal-form" action="" method="post">
<form id="pool-duplicate-modal-form" action="" method="post">
@csrf

<div class="alert alert-danger" role="alert">
Expand Down
Loading