Skip to content

Commit

Permalink
Update image in Dockerfile
Browse files Browse the repository at this point in the history
Add backpack pro;
  • Loading branch information
yugen committed Dec 11, 2023
1 parent 244f242 commit 0be314d
Show file tree
Hide file tree
Showing 86 changed files with 46,799 additions and 54 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/clingen-data-model/cgwi-php-11.7-8.0:v1.1.4
FROM ghcr.io/clingen-data-model/cgwi-php-11.7-8.2:v1.1.6

LABEL maintainer="UNC ClinGen Infrastructure Team" \
io.openshift.tags="gene-tracker:v1" \
Expand Down
8 changes: 7 additions & 1 deletion app/Actions/SurveyDataExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ public function handle($class, $limit = null)
{
$responses = $class::with('volunteer')->get();
$rows = $this->getRows($responses);


$filepath = storage_path('app/reports/'.Str::snake(preg_replace('/\\\/', '', $class)).'_'.Carbon::now()->format('Y-m-d').'.csv');

$fh = fopen($filepath, 'w');

if (count($rows) == 0) {
fputcsv($fh, ['No followup survey data to export.']);
return $filepath;
}

fputcsv($fh, array_keys($rows[0]));
foreach ($rows as $idx => $row) {
if ($limit && $idx+1 > $limit) {
Expand Down
8 changes: 3 additions & 5 deletions app/Http/Controllers/Admin/CurationGroupCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public function setup()

$this->crud->modifyField('curation_activity_id', [
'label' => 'Curation Activity',
'type' => 'select',
'entity' => 'curationActivity',
'type' => 'select2',
'name' => 'curation_activity_id',
'attribute' => 'name',
'model' => CurationActivity::class,
Expand All @@ -63,12 +62,11 @@ public function setup()
]);

$this->crud->modifyField('working_group_id', [
'label' => 'Working Group',
'type' => 'select2',
'name' => 'working_group_id',
'entity' => 'workingGroup',
'attribute' => 'name',
'label' => 'Working Group',
'model' => WorkingGroup::class,
'attribute' => 'name',
]);

$this->crud->with('curationActivity');
Expand Down
8 changes: 3 additions & 5 deletions app/Http/Controllers/Admin/CustomSurveyCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,19 @@ protected function setupCreateOperation()
* - CRUD::field('price')->type('number');
* - CRUD::addField(['name' => 'price', 'type' => 'number']));
*/
CRUD::modifyField('curation_group_id', [
$this->crud->modifyField('curation_group_id', [
'type' => 'select2',
'label' => 'Curation Group',
'name' => 'curation_group_id',
'model' => CurationGroup::class,
'attribute' => 'name',
'entity' => 'curationGroup'
]);
CRUD::modifyField('volunteer_type_id', [
$this->crud->modifyField('volunteer_type_id', [
'type' => 'select2',
'name' => 'volunteer_type_id',
'model' => VolunteerType::class,
'entity' => 'volunteerType',
'attribute' => 'name',
'relation_type' => 'belongsTo'
'lable' => 'Volunteer Type'
]);
}

Expand Down
4 changes: 0 additions & 4 deletions app/Http/Controllers/Admin/FaqCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Faq;
use App\Http\Requests\FaqRequest as StoreRequest;
// VALIDATION: change the requests to match your own file names if you need form validation
use App\Http\Requests\FaqRequest as UpdateRequest;
use Backpack\CRUD\app\Http\Controllers\CrudController;
use Backpack\CRUD\app\Http\Controllers\Operations\ReorderOperation;
Expand Down Expand Up @@ -63,9 +62,6 @@ public function setup()

$this->crud->modifyField('answer', [
'type' => 'ckeditor',
'options' => [
'removePlugins' => 'image,maximize,oembed',
],
]);

$this->crud->removeColumn('screenshots');
Expand Down
6 changes: 2 additions & 4 deletions app/Http/Controllers/Admin/UserCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ function ($value) {
'label' => 'Roles',
'type' => 'select2_multiple',
'name' => 'roles',
'entity' => 'roles',
'attribute' => 'name',
'model' => Role::class,
'pivot' => true,
Expand All @@ -102,7 +101,6 @@ function ($value) {
'label' => 'Additonal Permissions',
'type' => 'select2_multiple',
'name' => 'permissions',
'entity' => 'Permissions',
'attribute' => 'name',
'model' => Permission::class,
'pivot' => true,
Expand Down Expand Up @@ -176,11 +174,11 @@ function ($value) {

protected function setupCreateOperation()
{
$this->crud->setValidation(StoreRequest::class);
// $this->crud->setValidation(StoreRequest::class);
}

protected function setupUpdateOperation()
{
$this->crud->setValidation(UpdateRequest::class);
// $this->crud->setValidation(UpdateRequest::class);
}
}
39 changes: 20 additions & 19 deletions app/Http/Controllers/Admin/VolunteerCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ public function setup()
$this->crud->setRoute(config('backpack.base.route_prefix').'/volunteer');
$this->crud->setEntityNameStrings('volunteer', 'volunteers');

$this->crud->allowAccess(['list', 'create', 'delete', 'show']);
$this->crud->denyAccess(['update']);

/*
|--------------------------------------------------------------------------
| CrudPanel Configuration
Expand All @@ -55,30 +52,31 @@ public function setup()
$this->crud->setRequiredFields(StoreRequest::class, 'create');
$this->crud->setRequiredFields(UpdateRequest::class, 'edit');

$this->crud->modifyField('volunteer_type_id',[
'label' => 'Volunteer Type',
'type' => 'select2',
'name' => 'volunteer_type_id',
'entity' => 'volunteerType',
'model' => VolunteerType::class,
'attribute' => 'name',
]);

$this->crud->field('volunteer_type_id')
->type('relationship')
->label('Volunteer Type');

$this->crud->modifyField('volunteer_type_id', [
'type' => 'select2',
'name' => 'volunteer_type_id',
'model' => VolunteerType::class,
'label' => "Volunteer Type",
'attribute' => 'name'
]);
$this->crud->modifyField('volunteer_status_id', [
'label' => 'Volunteer Status',
'type' => 'select2',
'name' => 'volunteer_status_id',
'entity' => 'volunteerStatus',
'model' => VolunteerStatus::class,
'attribute' => 'name',
'type' => 'select2',
'model' => VolunteerStatus::class,
'label' => 'Volunteer Status',
'name' => 'volunteerStatus',
'attribute' => 'name',
]);

$this->crud->modifyField(
'country_id',
[
'type' => 'select2',
'name' => 'country_id',
'entity' => 'country',
'attribute' => 'name',
'model' => Country::class,
]
Expand Down Expand Up @@ -106,6 +104,7 @@ public function setup()
$this->crud->removeFields(['password', 'last_logged_in_at', 'last_logged_out_at']);

$this->crud->with('roles');

}

protected function setupCreateOperation()
Expand Down Expand Up @@ -170,12 +169,14 @@ public function setupListOperation()
[
'label' => 'Type',
'type' => 'relationship',
'name' => 'volunteerType',
'name' => 'VolunteerType',
'relation_type' => 'bleongsTo',
],
[
'label' => 'Status',
'type' => 'relationship',
'name' => 'volunteerStatus',
'relation_type' => 'bleongsTo',
],
]);
}
Expand Down
1 change: 0 additions & 1 deletion app/Http/Requests/UserRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public function rules()
return [
'first_name' => 'required|min:2|max:255',
'last_name' => 'required|min:2|max:255',
'email' => ['required','min:6','max:255'],
'email' => ['required','min:6','max:255', Rule::unique('users', 'email')->ignore(request()->route('id'))],
];
}
Expand Down
20 changes: 15 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@
"laravel"
],
"license": "MIT",
"repositories": [{
"type": "vcs",
"url": "https://github.com/yugen/surveys"
}],
"repositories": {
"backpack": {
"type": "composer",
"url": "https://repo.backpackforlaravel.com/"
},
"surveys": {
"type": "vcs",
"url": "https://github.com/yugen/surveys"
}
},
"require": {
"php": "^8.2",
"backpack/crud": "^6.0",
"backpack/editable-columns": "*",
"backpack/pro": "^2.0",
"backpack/theme-coreuiv2": "^1.2",
"barryvdh/laravel-elfinder": "^0.5.2",
"box/spout": "^3.1",
Expand Down Expand Up @@ -93,6 +101,8 @@
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"post-install-cmd": ["php artisan storage:link --quiet"]
"post-install-cmd": [
"php artisan storage:link --quiet"
]
}
}
Loading

0 comments on commit 0be314d

Please sign in to comment.