From f95456d7822073536e8e1c98833e56b0cd00238f Mon Sep 17 00:00:00 2001 From: IanM <16573496+imorland@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:58:39 +0000 Subject: [PATCH] chore: prep for flarum/gdpr (#102) * chore: prep for flarum/gdpr * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot --- composer.json | 4 ++-- extend.php | 4 ++-- resources/locale/en.yml | 7 +++++++ src/Data/Drafts.php | 12 +----------- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 67fc188..b78dfd6 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,7 @@ }, "optional-dependencies": [ "fof/byobu", - "blomstra/gdpr" + "flarum/gdpr" ] }, "flagrow": { @@ -58,7 +58,7 @@ } }, "require-dev": { - "blomstra/gdpr": "@beta", + "flarum/gdpr": "dev-main", "flarum/phpstan": "*" }, "scripts": { diff --git a/extend.php b/extend.php index 119e8e9..78a25fa 100644 --- a/extend.php +++ b/extend.php @@ -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; @@ -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), ]), diff --git a/resources/locale/en.yml b/resources/locale/en.yml index b4c3453..faca0a3 100644 --- a/resources/locale/en.yml +++ b/resources/locale/en.yml @@ -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." diff --git a/src/Data/Drafts.php b/src/Data/Drafts.php index c8e362b..2b6de20 100644 --- a/src/Data/Drafts.php +++ b/src/Data/Drafts.php @@ -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 = []; @@ -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()