-
Notifications
You must be signed in to change notification settings - Fork 1
CLM: Reminders for potentially outdated content #330
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
Open
jnptk
wants to merge
112
commits into
main
Choose a base branch
from
content-review
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
112 commits
Select commit
Hold shift + click to select a range
707d106
Add content_review behavior
jnptk 0b36d0c
Add vocabularies
jnptk a991d9b
Fix fieldset not showing
jnptk c77642d
Wording & stuff
jnptk 848b12f
Add behavior to all default content types
jnptk 94e4902
Add upgrade step
jnptk d70117f
make format
jnptk 6d47850
Add content_review_default_interval setting to intranet controlpanel
jnptk 417568c
Directly access vocabularies without directives.widget
jnptk 1137d82
Add basic review endpoint
jnptk 8a5b166
Update service permission & allowed context
jnptk 7341f10
Add plone.app.registry to upgrade step
jnptk d382f08
Remove unused import
jnptk ca04888
Fix context & update error messages
jnptk 8d7dbb4
Remove unused import
jnptk 1ac5bb6
Add review_status and review_due_date indexes
jnptk 4d939ea
Update upgrade step
jnptk 4696fef
Add querystring criterion
jnptk c22de8b
Merge branch 'main' into content-review
jnptk d04b534
Fix upgrade step after merging main
jnptk e831fd1
Add import step for review_due_date indexer
jnptk bd7bf93
Add invariant & review_enabled, title & description in fields
jnptk cb4ab7f
Fix querystring thingie
jnptk 2df48b4
Merge branch 'main' into content-review
jnptk 4d84607
Fix querystring again
jnptk 636ff24
Add default review intervals
jnptk e615c82
Set default review intervals
jnptk 62fd42e
Implement "approve", "delegate" and "postpone" action in review endpo…
jnptk 18f51ae
First batch of tests
jnptk c9ee28f
Merge branch 'main' into content-review
jnptk 7cfd169
Set review_comment to readonly
jnptk 3a5ec4a
Require review_interval, set default & default to setting
jnptk 120b14d
Bind to behavior & get vocab from field
jnptk c2cdb6f
Fix fti test
jnptk 44a4f6a
Add test for content_review_intervals vocabulary
jnptk d7e99c5
How-To guide (wip)
jnptk 57a27e7
Merge branch 'main' into content-review
jnptk e574255
Fix upgrade step after merge
jnptk 92747f9
Fix profile version
jnptk 179da61
Combine upgrade steps & move calc_due_date to utils
jnptk 6dbdd79
Formatting
jnptk c5ea73c
Add script to send a mail if a content objects is due to review
jnptk 49b789a
Merge branch 'main' into content-review
jnptk 5aa11df
Fix version after merge
jnptk 95a9861
Fix upgrade step
jnptk 7da59e8
Send mail in review_reminder script
jnptk 30792fc
Set default review_due_date to today
jnptk 96837ec
Add changelog entries
jnptk e40467d
Fix [at]review endpoint tests
jnptk eedb6f2
Properly calculate review_due_date
jnptk 884c7e3
Fix [at]review endpoint to set values persistently
jnptk e0c31db
More test for [at]review endpoint
jnptk 67575b6
Merge remote-tracking branch 'origin/main' into content-review
davisagli 6287e39
Remove .python-version (duplicates requires-python in pyproject.toml)
davisagli ab526b9
fix bad merge of upgrade steps
davisagli 1bc3cf3
add review querystring criteria
jnptk 624e311
return record directly in default_review_interval
jnptk 7b2443d
off source reminder email for better testability
jnptk 5f84081
update default review intervals based of lo-fi design
jnptk 2df56db
shorten [at]review reply
jnptk bf140a6
remove content_review_users vocab test
jnptk b306b25
assert full vocab in test
jnptk 808c8f4
make format
jnptk 25c20c6
fixes for notify_reviewer
jnptk 881f23b
add path to warning if no user was found
jnptk 2741b54
test calc_due_date
jnptk 231d72b
remove context aware factory (no context needed = no factory needed)
jnptk d1a6400
fix defaultFactory
davisagli 58a3bd5
Hacky override to get the UI working, we can make it better later
davisagli f1fdfac
Merge remote-tracking branch 'origin/main' into content-review
davisagli 36bfd5f
Work around bug in plone.restapi that calls defaultFactory with a con…
davisagli 08df685
fix acceptance test
davisagli 2d9a4ba
Remove unneeded explicit commits, disable CSRF protection
davisagli 1d68403
rename doc in service test
jnptk b93b2c6
add docs for [at]review endpoint
jnptk c6d63a9
i18n
Tishasoumya-02 be24f80
Merge branch 'content-review' of github.com:kitconcept/kitconcept.int…
Tishasoumya-02 6da18b8
don't allow pastDates
Tishasoumya-02 01553e3
fix lint
Tishasoumya-02 8759f1b
fix scss lint
Tishasoumya-02 2bda500
replace semantic-ui with plone-components and other fixes
Tishasoumya-02 8c1cd21
fix lint
Tishasoumya-02 a21dcd1
make i18n
Tishasoumya-02 d99cc6b
lint
Tishasoumya-02 c76f880
update with main
Tishasoumya-02 ea751fe
fix styleint
Tishasoumya-02 a115359
Merge branch 'main' into content-review
Tishasoumya-02 1d1b3be
update with main
Tishasoumya-02 6d9acc4
update accordion export
Tishasoumya-02 42d58c8
update form customization to updated form code from volto with autosa…
Tishasoumya-02 ddd8604
merge with 'main' into content-review
Tishasoumya-02 7614b2b
update lockfile
Tishasoumya-02 12d6904
fix merge conflict in locales
Tishasoumya-02 4eafc8c
remove the customised components and add the styling
Tishasoumya-02 42d025d
fix lint and stylelint
Tishasoumya-02 0754d92
fix
Tishasoumya-02 405981a
fix
Tishasoumya-02 6873b9a
Merge branch 'main' into content-review
Tishasoumya-02 762f6eb
remove onClose prop from DocumentReview component
Tishasoumya-02 c2d5267
Merge branch 'content-review' of github.com:kitconcept/kitconcept.int…
Tishasoumya-02 c83a0b7
improve code
iFlameing 41f2f77
add feature flag to toggle the feature on and off
iFlameing 9ad860c
Merge branch 'main' into content-review
iFlameing 1b367f7
update pnpm-lock.yaml
jnptk b7d8924
integrate review_reminder script into docker using swarm-cronjob
jnptk 07d285c
Merge branch 'main' into content-review
Tishasoumya-02 6f23570
integrate review_reminder script in demo & persistent stacks
jnptk 9197d57
add docs for configuring the reminder script
jnptk d12a17e
Merge branch 'main' into content-review
iFlameing 9156591
remove swarm-cronjob from demo.yml
jnptk 9b7a8b4
make sure backend-cron-worker service connects to the same db as back…
jnptk 78bb36d
update docs
jnptk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
| Implemented content review & reminders features. @jntpk |
This file contains hidden or 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,10 @@ | ||
| from kitconcept.intranet.utils.review_due_notifier import nofity_reviewer | ||
| from plone import api | ||
| from zope.component.hooks import setSite | ||
|
|
||
|
|
||
| portal = app.Plone | ||
| setSite(portal) | ||
|
|
||
| with api.env.adopt_roles(["Manager"]): | ||
| nofity_reviewer(portal) |
This file contains hidden or 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
96 changes: 96 additions & 0 deletions
96
backend/src/kitconcept/intranet/behaviors/content_review.py
This file contains hidden or 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,96 @@ | ||
| from kitconcept.intranet import _ | ||
| from kitconcept.intranet.utils.calc_due_date import calc_due_date | ||
| from plone import api | ||
| from plone.autoform.interfaces import IFormFieldProvider | ||
| from plone.supermodel import model | ||
| from zope import schema | ||
| from zope.interface import Invalid | ||
| from zope.interface import invariant | ||
| from zope.interface import provider | ||
| from zope.schema.interfaces import IContextAwareDefaultFactory | ||
|
|
||
|
|
||
| @provider(IContextAwareDefaultFactory) | ||
| def default_review_interval(context) -> str: | ||
| return api.portal.get_registry_record( | ||
| "kitconcept.intranet.content_review_default_interval" | ||
| ) | ||
|
|
||
|
|
||
| @provider(IFormFieldProvider) | ||
| class IContentReview(model.Schema): | ||
| """Content Review behavior""" | ||
|
|
||
| model.fieldset( | ||
| "Content Review & Reminders", | ||
| label=_("label_review_fieldset", "Content Review & Reminders"), | ||
| fields=[ | ||
| "review_timeless", | ||
| "review_status", | ||
| "review_interval", | ||
| "review_assignee", | ||
| "review_due_date", | ||
| "review_completed_date", | ||
| ], | ||
| ) | ||
|
|
||
| review_timeless = schema.Bool( | ||
| title=_( | ||
| "label_review_timeless", | ||
| default="Timeless content - exclude from review reminders", | ||
| ), | ||
| required=False, | ||
| default=False, | ||
| ) | ||
|
|
||
| review_status = schema.Choice( | ||
| title=_("label_review_status", default="Status"), | ||
| values=("Up-to-date", "Due", "Changes requested"), | ||
| default="Up-to-date", | ||
| required=False, | ||
| readonly=True, | ||
| ) | ||
|
|
||
| review_interval = schema.Choice( | ||
| title=_("label_review_interval", default="Review Interval"), | ||
| vocabulary="kitconcept.intranet.vocabularies.content_review_intervals", | ||
| required=False, | ||
| defaultFactory=default_review_interval, | ||
| ) | ||
|
|
||
| review_assignee = schema.Choice( | ||
| title=_("label_review_assignee", default="Reviewer"), | ||
| description=_( | ||
| "help_review_assignee", | ||
| default="... will be notified as soon as the review is due. Unless otherwise specified, the content owner is considered the responsible person.", | ||
| ), | ||
| vocabulary="plone.app.vocabularies.Users", | ||
| required=False, | ||
| ) | ||
|
|
||
| review_due_date = schema.Date( | ||
| title=_("label_review_due_date", default="Next review on"), | ||
| required=False, | ||
| defaultFactory=calc_due_date, | ||
| ) | ||
|
|
||
| review_completed_date = schema.Date( | ||
| title=_("label_review_completed_date", default="Last review on"), | ||
| required=False, | ||
| readonly=True, | ||
| ) | ||
|
|
||
| review_comment = schema.Text( | ||
| title=_("label_review_comment", default="Comment"), | ||
| required=False, | ||
|
jnptk marked this conversation as resolved.
|
||
| readonly=True, | ||
| ) | ||
|
|
||
| @invariant | ||
| def validate_due_date_field(data): | ||
| is_timeless = getattr(data, "review_timeless", False) | ||
| has_due_date = getattr(data, "review_due_date", None) | ||
| if not is_timeless and not has_due_date: | ||
| raise Invalid("You have to set a due date if the content is not timeless") | ||
| elif is_timeless and has_due_date: | ||
| raise Invalid("Cannot set due date if content is timeless") | ||
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.