-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/add optional policies #51
Feat/add optional policies #51
Conversation
feat: added 'is_accepted' field to fof-terms-policy-user table feat: added settings to opt out of consents in user profile feat: added functionality that allows users to decline policies that were declared optional
feat: added 'ExtensionData' component
…ically feat: changed 'ExtensionData' component, so it allows other extensions to sync with fof/terms fix: synced new model field name to its DB column
feat: started writing guide on how to integrate fof/terms with other extensions in README.md
feat: added translations feat: improved ExtensionData component feat: added recipe for integrating fof/terms with other extensions in README fix: additionalInfo is now properly saved into DB chore: removed redundant imports and comments
… now saved properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @AngryDragonite for your contribution! Just some minor things to iron out :)
Co-authored-by: Davide Iadeluca <146922689+DavideIadeluca@users.noreply.github.com>
Co-authored-by: Davide Iadeluca <146922689+DavideIadeluca@users.noreply.github.com>
… feat/add-optional-policies
chore: removed accidently added files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @AngryDragonite for the changes. The migrations still need a look, otherwise this PR from my side is good for a merge
All requested changes committed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @AngryDragonite and sorry it's taken us so long to look at this.
Overall I think it's okay, but I'd like to give it a spin locally before merging. Please will you remove the committed dist
folder from the PR? This is not needed here as these files will be built automatically upon merge, and only cause merge conflicts at this stage.
You can do this easily: git reset HEAD js/dist
and then push that change :)
@AngryDragonite thanks for your efforts, unfortunately you're now deleting the |
@imorland There are changes to the dist folder on the master branch since this PR. Perhaps this is causing the issues? I tried to help @AngryDragonite, but still the files are in this Pull Request. |
} | ||
} | ||
|
||
return $handler->handle($request); | ||
return $response; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason why we're not continuing down the middleware stack here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now handled earlier above (line 64). We need to handle this to read response body. GitHub diff is messed
$response = $handler->handle($request); |
Github diff is messed in this file. Please review the entire file without viewing the diff.
…efault value to false for new users
ping @imorland @DavideIadeluca |
Maybe someone else from the FOF team could review this PR? Like, for example, @dsevillamartin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your patience. I had another look again and from my side this is good for a merge to master. Everything is working as expected locally.
About the merge conflicts, before we merge this to master I think the following should work to resolve the issue:
git fetch origin
git checkout origin/master -- js/dist/admin.js js/dist/admin.js.map js/dist/forum.js js/dist/forum.js.map
git commit -m "chore: resolve merge conflict"
git push origin feat/add-optional-policies
@DavideIadeluca merging issue resolved |
@DavideIadeluca So what about merge? |
Awaiting final approval from @imorland |
ping @imorland |
@imorland @DavideIadeluca is there any chance of getting this thing done in any near future? We've been waiting for 4 months. |
Resolves #33
Changes proposed in this pull request:
First of all, I added migrations that create columns:
optional
(boolean) andadditional_info
(JSON) insidefof_terms_policies
table. Tablefof-terms-policy-user
has been enriched withis_accepted
(boolean) column.Modifications inside
extend.php
:RegisterMiddleware.php
.Modifications inside
Policy.php
,UserPolicyData.php
,PolicyStoreController.php
,PolicyRepository.php
,RegisterPolicyValidator.php
:Modifications inside
RegisterMiddleware.php
:New backend files:
PolicyDeclineController.php
- as the name suggests. Basically, it is "1:1 copy" ofPolicyAcceptController.php
, however with opposite behaviourNow lets take a look at what changed in the frontend.
Modifications inside
Policy.js
:optional
andadditional_info
fields to the Policy model.Modifications inside
PolicyEdit.js
:initNewField
method withPolicy
model changes,deletePolicy
method - during developing I encountered a bug - when deleting aPolicy
, its field is, of course deleted, but alsosavePolicy
method is being called. It was happening possibly because when clicking Delete policy button,onsubmit
method is being called.Modifications inside
AcceptPoliciesModal.js
:Modifications inside `forum/index.js':
addManagePoliciesOption
component.Modifications inside
admin/components/index.js
:ExtensionData
component, so developers working on integrating fof/terms with other extensions could access this componentNew frontend files:
ExtensionData.js
- a component that allows developers to integrate fof/terms with other extensions by saving their data intofof-terms-policies
table. Recipe on how to use it is descriped inREADME.md
in For developers section.addManagePoliciesOption.js
- a component that allows users to opt in/out of consents in their profile settings.Other changes:
admin.less
& newforum.less
- added some styling for components,en.yml
- added translations.README.md
- added section For developers, explaining step-by-step how to useExtensionData
component, and therefore integratefof/terms
with other extensions.Reviewers should focus on:
I would definitely want to know, if my instructions on how to use
ExtensionData
inREADME.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
admin panel - select policy as optional
user settings - opt in/out of consents
Confirmed
composer test
).Required changes: