FriendsOfFlarum / terms

Ask your users to accept TOS and Privacy Policy
https://discuss.flarum.org/d/11714
MIT License
14 stars 9 forks source link

Feat/add optional policies #51

Open AngryDragonite opened 3 months ago

AngryDragonite commented 3 months ago

Resolves #33

Changes proposed in this pull request:

First of all, I added migrations that create columns: optional (boolean) and additional_info (JSON) inside fof_terms_policies table. Table fof-terms-policy-user has been enriched with is_accepted (boolean) column.

Modifications inside extend.php:

Modifications inside Policy.php, UserPolicyData.php, PolicyStoreController.php, PolicyRepository.php, RegisterPolicyValidator.php:

Modifications inside RegisterMiddleware.php:

New backend files:

Now lets take a look at what changed in the frontend.

Modifications inside Policy.js:

Modifications inside PolicyEdit.js:

Modifications inside AcceptPoliciesModal.js:

Modifications inside `forum/index.js':

Modifications inside admin/components/index.js:

New frontend files:

Other changes:

Reviewers should focus on:

I would definitely want to know, if my instructions on how to use ExtensionData in README.md are specific, exact and free of ambiguities. Every feedback on what in my code can be fixed, rewritten so it is easier to read, or is simply better is greatly welcomed :)

Screenshot

image             admin panel - select policy as optional \ \ image             user settings - opt in/out of consents

Confirmed

Required changes:

AngryDragonite commented 1 month ago

All requested changes committed.

imorland commented 1 month ago

Thank you @AngryDragonite - however there are now more files in js/dist. Please remove the dist folder from your commits to resolve the conflicts

AngryDragonite commented 1 month ago

@imorland Sorry for confusion, I followed steps that you advised, but somehow it got worse, possibly because I messed up something. I'm trying to fix it now

imorland commented 1 month ago

@AngryDragonite thanks for your efforts, unfortunately you're now deleting the dist folder contents, rather than simply omitting any changes to them. This should help you ;)

rafaucau commented 1 month ago

@imorland There are changes to the dist folder on the master branch since this PR. Perhaps this is causing the issues? https://github.com/FriendsOfFlarum/terms/commits/master/js/dist?since=2024-04-28&until=2024-06-16

I tried to help @AngryDragonite, but still the files are in this Pull Request.

rafaucau commented 1 week ago

ping @imorland @DavideIadeluca