Skip to content

Commit 562acd3

Browse files
authored
CustomField - add is_gdpr_data (#106)
Add is_gdpr_data to CustomField, so sensitive GDPR data can be identified
1 parent b26f937 commit 562acd3

9 files changed

+2190
-2404
lines changed

composer.lock

Lines changed: 2152 additions & 2403 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('custom_fields', function (Blueprint $table) {
17+
$table->boolean('is_gdpr_data')->default(false);
18+
});
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*
24+
* @return void
25+
*/
26+
public function down()
27+
{
28+
Schema::table('custom_fields', function (Blueprint $table) {
29+
$table->dropColumn('is_gdpr_data');
30+
});
31+
}
32+
};

src/App/Http/Requests/CustomFieldCreateRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function rules()
4949
'group' => 'nullable|string',
5050
'order' => 'nullable|integer',
5151
'renderer' => 'nullable|string',
52+
'is_gdpr_data' => 'nullable|boolean',
5253
];
5354
}
5455

src/App/Http/Requests/CustomFieldUpdateRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function rules()
5252
'group' => 'nullable|string',
5353
'order' => 'nullable|integer',
5454
'renderer' => 'nullable|string',
55+
'is_gdpr_data' => 'nullable|boolean',
5556
];
5657

5758
return Arr::except($rules, self::LOCKED_FOR_EDITING);

src/App/Http/Requests/PlainCustomFieldRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function rules()
4545
'group' => 'nullable|string',
4646
'order' => 'nullable|integer',
4747
'renderer' => 'nullable|string',
48+
'is_gdpr_data' => 'nullable|boolean',
4849
];
4950
}
5051

src/App/Http/Requests/RemoteCustomFieldRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function rules()
4545
'group' => 'nullable|string',
4646
'order' => 'nullable|integer',
4747
'renderer' => 'nullable|string',
48+
'is_gdpr_data' => 'nullable|boolean',
4849
'remote' => 'required|array',
4950
'remote.url' => 'required|url',
5051
'remote.method' => 'required|in:GET,POST,PUT',

src/App/Http/Requests/SelectionCustomFieldRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function rules()
4545
'group' => 'nullable|string',
4646
'order' => 'nullable|integer',
4747
'renderer' => 'nullable|string',
48+
'is_gdpr_data' => 'nullable|boolean',
4849
'selection' => 'array',
4950
'selection.multiselect' => 'boolean',
5051
'values' => 'array',

src/App/Models/CustomField.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
* @property bool $required
3838
* @property bool $hidden
3939
* @property bool $is_searchable
40+
* @property bool $is_gdpr_data
4041
* @property string $group
4142
* @property int $order
4243
* @property string $renderer

tests/Feature/Http/Controllers/SelectionCustomFieldControllerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ public function creates_selection_custom_field_with_values()
9898
$this
9999
->postJson(route('custom-field.selection.store', 'string'), $request)
100100
->assertJsonFragment([
101-
'id' => 1,
102101
'name' => $request['name'],
103102
]);
104103

0 commit comments

Comments
 (0)