-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added 'optional' field to fof-terms-policies table 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: accept policies really accepted by user instead of all * feat: added 'additionalInfo' model attribute feat: added 'ExtensionData' component * feat: changes in policy consents in profile settings now save automatically feat: changed 'ExtensionData' component, so it allows other extensions to sync with fof/terms fix: synced new model field name to its DB column * refactor: minor changes in 'ExtensionData' and 'PolicyEdit' feat: started writing guide on how to integrate fof/terms with other extensions in README.md * refactor: simplified addManagePoliciesOption code 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 * Apply fixes from StyleCI * refactor: changed additionalInfo column name into additional_info * fix: fixed bug that caused inappropriate behaviour when deleting policies. * style: formatted README.md * fix: optional policies that were not accepted during registration are now saved properly. * chore: added phpstan ignore to User::$fofTermsPoliciesState. * Update resources/locale/en.yml Co-authored-by: Davide Iadeluca <[email protected]> * Update resources/locale/en.yml Co-authored-by: Davide Iadeluca <[email protected]> * chore: minor changes in addManagePoliciesOption.js * chore: renamed migration files * chore: revert file permissions * chore: reverted file permissions chore: removed accidently added files * chore: fixed migration files' names * chore: reset js/dist folder changes * Delete js/dist/forum.js.map * Delete js/dist/admin.js * Delete js/dist/forum.js * Delete js/dist/admin.js.map * chore: sync fork and reset dist and package.json files * style: reformat addManagePoliciesOption.js * remove var_dump * style: one array access method * Apply fixes from StyleCI * style: use link component * fix: replace JSON column with longText for compatibility * refactor: simplify migrations * Apply fixes from StyleCI * fix: mark existing policies as accepted for all users, then set the default value to false for new users * Apply fixes from StyleCI * chore: resolve merge conflict --------- Co-authored-by: Rafał Całka <[email protected]> Co-authored-by: rafaucau <[email protected]> Co-authored-by: Davide Iadeluca <[email protected]> Co-authored-by: flarum-bot <[email protected]>
- Loading branch information
1 parent
156bea9
commit aa2f624
Showing
22 changed files
with
523 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Component from 'flarum/common/Component'; | ||
|
||
export default class ExtensionData extends Component { | ||
oninit(vnode) { | ||
super.oninit(vnode); | ||
this.keyattr = vnode.attrs.keyattr; | ||
this.policy = vnode.attrs.policy; | ||
this.setDirty = vnode.attrs.setDirty; | ||
this.children = vnode.children; | ||
|
||
this.updateAttribute = this.updateAttribute.bind(this); // Bind this to updateAttribute | ||
} | ||
|
||
view() { | ||
let children = | ||
typeof this.children[0] === 'function' | ||
? this.children[0]({ keyattr: this.keyattr, policy: this.policy, updateAttribute: this.updateAttribute }) | ||
: this.children; | ||
|
||
return <div class={'Form-group'}>{children}</div>; | ||
} | ||
|
||
updateAttribute(value) { | ||
let attributes = this.policy.additional_info(); | ||
attributes[this.keyattr] = value; | ||
this.policy.pushAttributes({ | ||
['additional_info']: attributes, | ||
}); | ||
|
||
this.setDirty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import PolicyEdit from './PolicyEdit'; | ||
import PolicyList from './PolicyList'; | ||
import TermsSettingsPage from './TermsSettingsPage'; | ||
import ExtensionData from './ExtensionData'; | ||
|
||
export const components = { | ||
PolicyEdit, | ||
PolicyList, | ||
TermsSettingsPage, | ||
ExtensionData, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.