Skip to content

Commit 4a225b9

Browse files
committed
2533: Fixed merge
2 parents 8c380bf + 6b6e07a commit 4a225b9

35 files changed

+1549
-88
lines changed

.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,8 @@ CALENDAR_API_FEED_SOURCE_DATE_FORMAT=
103103
CALENDAR_API_FEED_SOURCE_DATE_TIMEZONE=
104104
CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_SECONDS=300
105105
###< Calendar Api Feed Source ###
106+
107+
EVENTDATABASE_API_V2_CACHE_EXPIRE_SECONDS=300
108+
109+
TRACK_SCREEN_INFO=false
110+
TRACK_SCREEN_INFO_UPDATE_INTERVAL_SECONDS=300

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,32 @@ All notable changes to this project will be documented in this file.
66

77
- [#226](https://github.com/os2display/display-api-service/pull/226)
88
- Added Colibo feed type.
9+
10+
## [2.4.0] - 2025-03-31
11+
12+
- [#238](https://github.com/os2display/display-api-service/pull/238)
13+
- Added screen status to infrastructure.
14+
- [#232](https://github.com/os2display/display-api-service/pull/232)
15+
- Updated user emails in readme.
16+
- [#227](https://github.com/os2display/display-api-service/pull/227)
17+
- Added screen status to cache and endpoint for exposing screen status.
18+
19+
## [2.3.0] - 2025-03-24
20+
21+
- [#235](https://github.com/os2display/display-api-service/pull/234)
22+
- Fixed Eventdatabasen v2 subscription data order by using occurrences endpoint.
23+
- [#236](https://github.com/os2display/display-api-service/pull/236)
24+
- Fixed bug where no media url made Notified feed crash.
25+
- [#231](https://github.com/os2display/display-api-service/pull/231)
26+
- Adds new feed source: Eventdatabasen v2.
27+
- [#233](https://github.com/os2display/display-api-service/pull/233)
28+
- Added calendar api feed source tests for modifiers.
29+
- Changed to use PCRE pattern instead of custom pattern building and fixed modifier bugs for calendar api feed source.
30+
31+
## [2.2.0] - 2025-03-17
32+
33+
- [#229](https://github.com/os2display/display-api-service/pull/229)
34+
- Adds options to set paths to component and admin files from path to the json config file.
935
- [#225](https://github.com/os2display/display-api-service/pull/225)
1036
- Added ADRs.
1137
- [#215](https://github.com/os2display/display-api-service/pull/215)
@@ -18,6 +44,11 @@ All notable changes to this project will be documented in this file.
1844
- Adds create, update, delete operations to feed-source endpoint.
1945
- Adds data validation for feed source.
2046

47+
## [2.1.4] - 2025-01-14
48+
49+
- [#230](https://github.com/os2display/display-api-service/pull/230)
50+
- Adds options to set paths to component and admin files from path to the json config file.
51+
2152
## [2.1.3] - 2024-10-25
2253

2354
- [#220](https://github.com/os2display/display-api-service/pull/220)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ docker compose exec phpfpm bin/console doctrine:migrations:migrate
104104
docker compose exec phpfpm bin/console hautelook:fixtures:load --no-interaction
105105
```
106106

107-
The fixtures have an admin user: <john@example.com> with the password: apassword
108-
The fixtures have an editor user: <hans@editor.com> with the password: apassword
107+
The fixtures have an admin user: <admin@example.com> with the password: apassword
108+
The fixtures have an editor user: <editor@example.com> with the password: apassword
109109
The fixtures have the image-text template, and two screen layouts:
110110
full screen and "two boxes".
111111

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
"bin/console doctrine:schema:validate",
132132
"@coding-standards-apply",
133133
"vendor/bin/rector",
134-
"vendor/bin/psalm",
134+
"vendor/bin/psalm --no-cache",
135135
"@test-setup",
136136
"@test"
137137
],

config/api_platform/screen.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ resources:
7070
ApiPlatform\Metadata\GetCollection:
7171
filters:
7272
- 'App\Filter\MultipleSearchFilter'
73+
- 'screen.screen_user_exists_filter'
74+
- 'screen.screen_user_latest_request_filter'
7375
- 'entity.blameable_filter'
7476
- 'entity.order_filter'
7577
- 'created.at.order_filter'
@@ -100,7 +102,6 @@ resources:
100102
content:
101103
application/ld+json:
102104
examples:
103-
104105
headers: {}
105106

106107
ApiPlatform\Metadata\Post:

config/packages/cache.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ framework:
1717
# Default expire set to 5 minutes
1818
default_lifetime: 300
1919

20+
feed.without.expire.cache:
21+
adapter: cache.adapter.redis
22+
2023
# Creates a "calendar.api.cache" service
2124
calendar.api.cache:
2225
adapter: cache.adapter.redis
@@ -27,6 +30,12 @@ framework:
2730
# Default expire set to 1 day
2831
default_lifetime: 86400
2932

33+
# Creates a "screen.status.cache" service ($screenStatusCache)
34+
screen.status.cache:
35+
adapter: cache.adapter.redis
36+
# Default expire set to infinity
37+
default_lifetime: 0
38+
3039
# Creates an "interactive_slide.cache" service
3140
interactive_slide.cache:
3241
adapter: cache.adapter.redis

config/packages/test/cache.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ framework:
77
auth.screen.cache:
88
adapter: cache.adapter.filesystem
99
default_lifetime: 3600
10+
screen.status.cache:
11+
adapter: cache.adapter.filesystem
12+
default_lifetime: 0

config/services.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ services:
1717
# @see https://api-platform.com/docs/core/state-processors/#hooking-into-the-built-in-state-processors
1818
$persistProcessor: '@api_platform.doctrine.orm.state.persist_processor'
1919
$removeProcessor: '@api_platform.doctrine.orm.state.remove_processor'
20+
$trackScreenInfo: '%env(bool:TRACK_SCREEN_INFO)%'
21+
$trackScreenInfoUpdateIntervalSeconds: '%env(TRACK_SCREEN_INFO_UPDATE_INTERVAL_SECONDS)%'
2022

2123
_instanceof:
2224
App\Feed\FeedTypeInterface:
@@ -51,6 +53,10 @@ services:
5153
Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface: '@Lexik\Bundle\JWTAuthenticationBundle\Security\Http\Authentication\AuthenticationFailureHandler'
5254
Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface: '@Lexik\Bundle\JWTAuthenticationBundle\Security\Http\Authentication\AuthenticationSuccessHandler'
5355

56+
App\Feed\EventDatabaseApiV2FeedType:
57+
arguments:
58+
$cacheExpire: '%env(int:EVENTDATABASE_API_V2_CACHE_EXPIRE_SECONDS)%'
59+
5460
App\Feed\CalendarApiFeedType:
5561
arguments:
5662
$locationEndpoint: '%env(string:CALENDAR_API_FEED_SOURCE_LOCATION_ENDPOINT)%'
@@ -295,6 +301,16 @@ services:
295301
tags: ['api_platform.filter']
296302
arguments: [ { fullName: 'partial', email: 'partial' } ]
297303

304+
screen.screen_user_exists_filter:
305+
parent: 'api_platform.doctrine.orm.exists_filter'
306+
tags: ['api_platform.filter']
307+
arguments: [ { screenUser: ~ } ]
308+
309+
screen.screen_user_latest_request_filter:
310+
parent: 'api_platform.doctrine.orm.date_filter'
311+
tags: ['api_platform.filter']
312+
arguments: [ { screenUser.latestRequest: ~ } ]
313+
298314
# App filters for Api Platform
299315
App\Filter\PublishedFilter:
300316
tags: ['api_platform.filter']

docs/feed/calender-api-feed.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,19 @@ Modifiers can be set up to modify the output of the feed.
136136

137137
Two types of modifiers are available:
138138

139-
* EXCLUDE_IF_TITLE_NOT_CONTAINS: Removes entries from the feed if the title not contain the trigger word.
140-
* REPLACE_TITLE_IF_CONTAINS: Changes the title if it contains the trigger word.
139+
* EXCLUDE_IF_TITLE_NOT_CONTAINS: Removes entries from the feed if the title does not contain the pattern.
140+
* REPLACE_TITLE_IF_CONTAINS: Changes the title if it contains the pattern.
141141

142142
Parameters:
143143

144144
* type: EXCLUDE_IF_TITLE_NOT_CONTAINS or REPLACE_TITLE_IF_CONTAINS
145145
* id: Unique identifier for the modifier.
146146
* title: Display name when showing the modifier in the admin.
147-
* description: Help text for the modifier.
147+
* description: Description of the modifier.
148148
* activateInFeed: Should this filter be optional? If false the rule will always apply.
149-
* trigger: The string that should trigger the modifier.
150-
* replacement: The string to replace the title with.
151149
* removeTrigger: Should the trigger word be filtered from the title?
152-
* caseSensitive: Should the trigger word be case-sensitive?
150+
* pattern: The PCRE regular expression. See <https://www.php.net/manual/en/reference.pcre.pattern.syntax.php>.
151+
* replacement: The string to replace the title with. See <https://www.php.net/manual/en/function.preg-replace.php>.
153152

154153
Examples of modifiers:
155154

@@ -161,29 +160,26 @@ Examples of modifiers:
161160
"title": "Vis kun begivenheder med (liste) i titlen.",
162161
"description": "Denne mulighed fjerner begivenheder, der IKKE har (liste) i titlen. Den fjerner også (liste) fra titlen.",
163162
"activateInFeed": true,
164-
"trigger": "(liste)",
165-
"removeTrigger": true,
166-
"caseSensitive": false
163+
"pattern": "\/\\(liste\\)\/i",
164+
"removeTrigger": true
167165
},
168166
{
169167
"type": "REPLACE_TITLE_IF_CONTAINS",
170-
"id": "replaceIfContainsOptaget",
171168
"activateInFeed": false,
172-
"trigger": "(optaget)",
169+
"id": "replaceIfContainsOptaget",
170+
"pattern": "\/\\(optaget\\)\/i",
173171
"replacement": "Optaget",
174-
"removeTrigger": true,
175-
"caseSensitive": false
172+
"removeTrigger": true
176173
},
177174
{
178175
"type": "REPLACE_TITLE_IF_CONTAINS",
179-
"id": "onlyShowAsOptaget",
180176
"activateInFeed": true,
177+
"id": "onlyShowAsOptaget",
181178
"title": "Overskriv alle titler med Optaget",
182179
"description": "Denne mulighed viser alle titler som Optaget.",
183-
"trigger": "",
180+
"pattern": "\/\/",
184181
"replacement": "Optaget",
185-
"removeTrigger": false,
186-
"caseSensitive": false
182+
"removeTrigger": false
187183
}
188184
]
189185
```

infrastructure/itkdev/display-api-service/etc/confd/templates/env.local.tmpl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,10 @@ CALENDAR_API_FEED_SOURCE_CUSTOM_MAPPINGS={{ getenv "APP_CALENDAR_API_FEED_SOURCE
6060
CALENDAR_API_FEED_SOURCE_EVENT_MODIFIERS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_EVENT_MODIFIERS" "'{}'" }}
6161
CALENDAR_API_FEED_SOURCE_DATE_FORMAT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_DATE_FORMAT" "" }}
6262
CALENDAR_API_FEED_SOURCE_DATE_TIMEZONE={{ getenv "APP_CALENDAR_API_FEED_SOURCE_DATE_TIMEZONE" "" }}
63-
CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_SECONDS={{ getenv "CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_SECONDS" "300" }}
63+
CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_SECONDS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_SECONDS" "300" }}
6464
###< Calendar Api Feed Source ###
65+
66+
EVENTDATABASE_API_V2_CACHE_EXPIRE_SECONDS={{ getenv "APP_EVENTDATABASE_API_V2_CACHE_EXPIRE_SECONDS" "300" }}
67+
68+
TRACK_SCREEN_INFO={{ getenv "APP_TRACK_SCREEN_INFO" "false" }}
69+
TRACK_SCREEN_INFO_UPDATE_INTERVAL_SECONDS={{ getenv "APP_TRACK_SCREEN_INFO_UPDATE_INTERVAL_SECONDS" "300" }}

0 commit comments

Comments
 (0)