Skip to content
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

IBX-6717: Recent activity #2161

Merged
merged 57 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3fd7e62
Recent activity: TOC and skeleton
Oct 6, 2023
19bc106
Recent activity: TOC and skeleton
Oct 6, 2023
0fbc3ae
Recent activity: TOC and skeleton
Oct 6, 2023
436d6f3
Recent activity: actual REST API doesn't offer to create entries.
Oct 9, 2023
cbe062d
(minor) Recent activity: Fix Ibexa.DomainTermCapitalization
Oct 10, 2023
82a0948
Recent activity: Draft intro; Add Configuration skeleton
Oct 10, 2023
3438dc0
recent_activity.md: Add product variant as logged
Oct 23, 2023
ea283de
recent_activity.md: truncate_after_days & ibexa:activity-log:truncate
Dec 1, 2023
efaf7f2
recent_activity.md: Simplify intro w/ link to user doc
Dec 4, 2023
db48042
recent_activity.md: More about grouping
Dec 11, 2023
a3626c6
Merge branch 'master' into activity-log_toc
Jan 29, 2024
a66bc84
recent_activity.md: activity_logs_limit is also about groups
Jan 30, 2024
5d01713
Recent activity's policy
Feb 6, 2024
7f8984a
recent_activity.md: Details "Activity Log / Read" policy mandatoriness.
Feb 7, 2024
2137d2c
Merge branch 'master' into activity-log_toc
Feb 8, 2024
2063ff4
policies.md & limitation_reference.md: + ActivityLogOwner
Feb 8, 2024
7f94717
recent_activity.md: Fix vale
Feb 8, 2024
46d58c2
recent_activity.md: Update REST API Ref anchor link
Feb 13, 2024
4120bb6
Update docs/administration/recent_activity/recent_activity.md
adriendupuis Feb 13, 2024
551a3fd
Merge branch 'master' into activity-log_toc
Feb 13, 2024
5a665ba
Merge branch 'master' into activity-log_toc
Feb 13, 2024
ac2aa44
IBX-6742: Recent activity PHP API (#2159)
adriendupuis Feb 15, 2024
3dcea6d
IBX-6737: Recent activity REST API Ref (#2157)
adriendupuis Feb 15, 2024
87c4bb9
Merge branch 'master' into activity-log_toc
Feb 15, 2024
58317f3
Apply suggestions from code review
adriendupuis Feb 15, 2024
0934ee3
Apply suggestions from code review
adriendupuis Feb 16, 2024
1eed4c5
recent_activity.md: Enhance menu items' format
adriendupuis Feb 23, 2024
869069f
Merge branch 'master' into activity-log_toc
adriendupuis Feb 26, 2024
317d66d
Edition badges
adriendupuis Feb 26, 2024
e45d7e7
Apply suggestions from code review
adriendupuis Feb 28, 2024
2f293ed
Apply suggestions from code review
adriendupuis Feb 28, 2024
039be05
Apply suggestions from code review
adriendupuis Feb 28, 2024
5759b6b
Update docs/administration/recent_activity/recent_activity.md
adriendupuis Feb 28, 2024
f5f09d5
Update docs/administration/recent_activity/recent_activity.md
adriendupuis Feb 28, 2024
e608d47
Update docs/administration/recent_activity/recent_activity.md
adriendupuis Feb 28, 2024
52da20e
Update docs/administration/recent_activity/recent_activity.md
adriendupuis Feb 28, 2024
7a34168
Apply suggestions from code review
adriendupuis Feb 28, 2024
ec2664d
Apply suggestions from code review
adriendupuis Apr 9, 2024
2dbab6e
recent_activity.md: Move from parameter to semantic conf
adriendupuis Apr 9, 2024
3186ec7
recent_activity.md: Illustrate context group folding
adriendupuis Apr 9, 2024
494fce9
MyFeaturePostActivityListLoadEventSubscriber: Fix class
adriendupuis Apr 9, 2024
4b4c5fa
recent_activity.md: Context group screenshot using example
adriendupuis Apr 9, 2024
f310269
PHP CS Fixes
adriendupuis Apr 9, 2024
ed6b24a
Update docs/search/activity_log_search_reference/logged_at_criterion.md
adriendupuis Apr 9, 2024
fae5306
…/activity_log_search_reference/: Remove link to private repo
adriendupuis Apr 9, 2024
dd6f60d
Apply suggestions from code review
adriendupuis Apr 9, 2024
6e9192e
Update docs/administration/recent_activity/recent_activity.md
adriendupuis Apr 9, 2024
c300b0f
Apply suggestions from code review
adriendupuis Apr 17, 2024
f4b25ab
Apply suggestions from code review
adriendupuis Apr 18, 2024
0727b5d
Format policies (suggestions from code review)
adriendupuis Apr 18, 2024
6f33bd8
Rename ez*.raml to ibexa*.raml (#2360)
adriendupuis Apr 18, 2024
da07318
Merge branch 'master' into activity-log_toc
adriendupuis Apr 18, 2024
d534f7b
Rebuild rest_api_reference.html
adriendupuis Apr 18, 2024
76b8b05
Fix activity_log_criteria.md table
adriendupuis Apr 18, 2024
600bc31
Merge branch 'master' into activity-log_toc
adriendupuis Apr 19, 2024
256d5e1
Update mkdocs.yml
adriendupuis Apr 19, 2024
1dd5e69
Apply suggestions from code review
adriendupuis Apr 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/administration/recent_activity/activity_log_search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---

Check warning on line 1 in docs/administration/recent_activity/activity_log_search.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/recent_activity/activity_log_search.md#L1

[Ibexa.ReadingLevel] The grade level is 15.50. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 15.50. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/administration/recent_activity/activity_log_search.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: Activity Log Search
page_type: reference
---

# Activity Log Search reference

Activity Log Search Criteria and Sort Clauses are used to build `Ibexa\Contracts\ActivityLog\Values\ActivityLog\Query` for `ActivityLogService::find`.

## Activity Log Search Criteria reference

TODO: List and describe criteria from Ibexa\Contracts\ActivityLog\Values\ActivityLog\Criterion\ namespace

### Value Criterion

### Logical Criterion

## Activity Log Search Sort Clauses reference

TODO: List and describe Sort Clauses from Ibexa\Contracts\ActivityLog\Values\ActivityLog\SortClause\ namespace
68 changes: 68 additions & 0 deletions docs/administration/recent_activity/recent_activity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---

Check warning on line 1 in docs/administration/recent_activity/recent_activity.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/administration/recent_activity/recent_activity.md#L1

[Ibexa.ReadingLevel] The grade level is 11.28. Aim for 8th grade or lower by using shorter sentences and words.
Raw output
{"message": "[Ibexa.ReadingLevel] The grade level is 11.28. Aim for 8th grade or lower by using shorter sentences and words.", "location": {"path": "docs/administration/recent_activity/recent_activity.md", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
description: Log and monitor activity through UI, PHP API and REST API.
---

# Recent activity
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

Recent activity log summaries last actions on the repository (whatever their origin, such as Back Office, REST, migration, CLI, or CRON).
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

To learn more about its Back Office usage and the actions logged by default, see [Recent activity in the User documentation]([[= user_doc =]]/recent_activity/recent_activity/).

## Configuration and cronjob

adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
* The parameter `ibexa.site_access.config.<scope>.activity_log.pagination.activity_logs_limit` set the number of log items shown per page in the Back Office (default: 25 items per page). (A log item is a group of entries, or an entry without group.)
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
* The configuration `ibexa.repositories.<repository>.activity_log.truncate_after_days` set the number of days a log entry is kept before being deleted by the `ibexa:activity-log:truncate` command (default: 30 days).
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

For example, the following set 20 log groups per page for the `admin` SiteAccess, and 15 days of life to the log entries on the `default` repository:
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

```yaml
parameters:
ibexa.site_access.config.admin.activity_log.pagination.activity_logs_limit: 20
ibexa:
repositories:
default:
activity_log:
truncate_after_days: 15
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
```

To automate a regular truncation, the command `ibexa:activity-log:truncate` must be added to a crontab.
To minimize the number of entries to delete, it's recommended to execute the command more than one time a day.

For every exact hour, the cronjob line is:
`0 * * * * cd [path-to-ibexa]; php bin/console ibexa:activity-log:truncate --quiet --env=prod`

## Permission and security

The "Activity Log / Read" policy ([`activity_log/read`](policies.md#activity-log)) gives a role the access to
the "Admin > Activity list", the dashboard's "Recent activity" block, and the user profile's "Recent activity".
It can be limited to "Only own log".

The "Activity Log / Read" policy should be given to every roles having access to the Back Office,
at least with the "Only own log" owner limitation,
to allow them to use the "Recent activity" block in the default dashboard or their custom dashboard.
This policy is also required by user having a profile to properly view their own.
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

!!! caution

Never give `activity_log/read` permission to Anonymous role, even with the owner limitation,
as this role is shared among all unauthenticated users.
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

## PHP API

The ActivityLogService PHP API can be used to browse activity logs and write new entries.

### Searching in the Activity Log entries

TODO: Quick example of …\ActivityLog\Query passed to ActivityLogService(Interface)::find and loop through the returned ActivityList(Interface)

See [Activity Log Search Criteria reference](activity_log_search.md) to discover query possibilities.

### Adding custom Activity Log entries

Your custom features could write into the activity log.

TODO: Illustrate the use of ActivityLogService(Interface)::build & ActivityLogService(Interface)::save

adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
## REST API

REST API can be used to browse activity logs, see in the [REST API reference](../../api/rest_api/rest_api_reference/rest_api_reference.html#monitoring-activity).
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions docs/permissions/limitation_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ Out of the box FunctionList uses it in the following way:
- {name: ibexa.permissions.limitation_type, alias: FunctionList}
```

## ActivityLogOwner Limitation

The `ActivityLogOwner` Limitation specifies if a user can see only own [recent activity](recent_activity.md) log entries, and not entries from other users.
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

| Value | UI value | Description |
|-------|-----------------|--------------------------------------------------------|
| `1` | "Only own logs" | Current user can only access own activity log entries. |
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

## CartOwner Limitation

The `CartOwner` Limitation specifies whether the user can modify a cart.
Expand Down
6 changes: 6 additions & 0 deletions docs/permissions/policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ which define, which parts of the application or website the user has access to.

### Administration and user management

#### Activity log

| Module | Function | Effect | Possible Limitations |
|------------------------------|--------------------|-------------------------|-------------------------------------------------------------------------|
| <nobr>`activity_log`</nobr> | <nobr>`read`</nobr> | access to activity list | [ActivityLogOwner](limitation_reference.md#activitylogowner-limitation) |
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

#### Customer groups

| Module | Function | Effect | Possible Limitations |
Expand Down
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ nav:
- Multi-file upload: administration/back_office/multifile_upload.md
- Sub-items list: administration/back_office/subitems_list.md
- Notifications: administration/back_office/notifications.md
- Recent activity:
- Recent activity: administration/recent_activity/recent_activity.md
- Activity Log search reference: administration/recent_activity/activity_log_search.md
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
- Content management:
- Content management: content_management/content_management.md
- Content management guide: content_management/content_management_guide.md
Expand Down