Skip to content

Commit

Permalink
chore: prep for flarum/gdpr (#102)
Browse files Browse the repository at this point in the history
* chore: prep for flarum/gdpr

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <[email protected]>
  • Loading branch information
imorland and StyleCIBot authored Nov 3, 2024
1 parent 78332c5 commit f95456d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"optional-dependencies": [
"fof/byobu",
"blomstra/gdpr"
"flarum/gdpr"
]
},
"flagrow": {
Expand All @@ -58,7 +58,7 @@
}
},
"require-dev": {
"blomstra/gdpr": "@beta",
"flarum/gdpr": "dev-main",
"flarum/phpstan": "*"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace FoF\Drafts;

use Blomstra\Gdpr\Extend\UserData;
use Flarum\Api\Serializer\CurrentUserSerializer;
use Flarum\Api\Serializer\ForumSerializer;
use Flarum\Extend;
use Flarum\Gdpr\Extend\UserData;
use Flarum\User\User;
use FoF\Drafts\Api\Controller;
use FoF\Drafts\Console\PublishDrafts;
Expand Down Expand Up @@ -71,7 +71,7 @@
->registerPreference('draftAutosaveInterval', 'intVal', 6),

(new Extend\Conditional())
->whenExtensionEnabled('blomstra-gdpr', fn () => [
->whenExtensionEnabled('flarum-gdpr', fn () => [
(new UserData())
->addType(Data\Drafts::class),
]),
Expand Down
7 changes: 7 additions & 0 deletions resources/locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ fof-drafts:
draft_autosave_interval_label: Autosave Interval (seconds)
draft_autosave_interval_button: Update Interval
draft_autosave_interval_invalid: The interval must be an integer greater than 4.

flarum-gdpr:
lib:
data:
drafts:
export_description: "All drafts created by the user."
anonymize_description: "Delete all drafts created by the user."
12 changes: 1 addition & 11 deletions src/Data/Drafts.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@

namespace FoF\Drafts\Data;

use Blomstra\Gdpr\Data\Type;
use Flarum\Gdpr\Data\Type;
use FoF\Drafts\Draft;
use Illuminate\Support\Arr;

class Drafts extends Type
{
public static function exportDescription(): string
{
return 'All drafts created by the user.';
}

public function export(): ?array
{
$dataExport = [];
Expand Down Expand Up @@ -53,11 +48,6 @@ public function anonymize(): void
$this->delete();
}

public static function deleteDescription(): string
{
return 'Delete all drafts created by the user.';
}

public function delete(): void
{
Draft::query()
Expand Down

0 comments on commit f95456d

Please sign in to comment.