Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

update preferences api specification

ulferts8ae523353e7f
diff --git a/docs/api/apiv3/components/schemas/user_preference_model.yml b/docs/api/apiv3/components/schemas/user_preference_model.yml
index 6f562563967..babb938b2bb 100644
--- a/docs/api/apiv3/components/schemas/user_preference_model.yml
+++ b/docs/api/apiv3/components/schemas/user_preference_model.yml
@@ -2,9 +2,18 @@
---
type: object
properties:
+ autoHidePopups:
+ type: boolean
+ description: Whether to hide popups (e.g. success messages) after 5 seconds
hideMail:
type: boolean
description: Hide mail address from other users
+ notifications:
+ type: NotificationSetting
+ description: The settings for the notifications to be received by the user
+ selfNotified:
+ type: boolean
+ description: Whether the user wants to be notfified of changes done by the user her/himself
timeZone:
type: string
description: Current selected time zone
@@ -14,9 +23,6 @@ properties:
warnOnLeavingUnsaved:
type: boolean
description: Issue warning when leaving a page with unsaved text
- accessibilityMode:
- type: boolean
- description: Enable accessibility mode
_links:
type: object
required:
diff --git a/docs/api/apiv3/components/schemas/user_preferences_model.yml b/docs/api/apiv3/components/schemas/user_preferences_model.yml
index cfe00b76f9f..52781433048 100644
--- a/docs/api/apiv3/components/schemas/user_preferences_model.yml
+++ b/docs/api/apiv3/components/schemas/user_preferences_model.yml
@@ -2,15 +2,45 @@
---
type: object
example:
- _type: UserPreferences
_links:
self:
href: "/api/v3/my_preferences"
user:
href: "/api/v3/users/1"
title: John Sheppard
- hideMail: false
- timeZone: Europe/Berlin
+ updateImmediately:
+ href: "/api/v3/users/3/preferences"
+ method: "patch"
+ _type: UserPreferences
commentSortDescending: true
+ hideMail: false
+ timeZone: "Europe/Berlin"
warnOnLeavingUnsaved: true
- accessibilityMode: false
+ notifications:
+ - channel: "mail"
+ watched: false
+ involved: true
+ mentioned: false
+ all: false
+ workPackageCommented: false
+ _links:
+ project:
+ href: null
+ - channel: "in_app"
+ watched: true
+ involved: true
+ mentioned: true
+ all: false
+ workPackageCommented: false
+ _links:
+ project:
+ href: null
+ - channel: "mail_digest"
+ watched: true
+ involved: true
+ mentioned: true
+ all: true,
+ workPackageCommented: true
+ _links:
+ project:
+ href: null
diff --git a/docs/api/apiv3/paths/my_preferences.yml b/docs/api/apiv3/paths/my_preferences.yml
index 605ca35bcc4..98ac0dccd7f 100644
--- a/docs/api/apiv3/paths/my_preferences.yml
+++ b/docs/api/apiv3/paths/my_preferences.yml
@@ -13,13 +13,43 @@ get:
href: "/api/v3/my_preferences"
user:
href: "/api/v3/users/1"
- title: John Sheppard
- _type: UserPreferences
- accessibilityMode: false
+ title: "John Sheppard"
+ updateImmediately:
+ href: "/api/v3/users/3/preferences"
+ method: "patch"
+ _type: "UserPreferences"
commentSortDescending: true
hideMail: false
- timeZone: Europe/Berlin
+ timeZone: "Europe/Berlin"
warnOnLeavingUnsaved: true
+ notifications:
+ - channel: "mail"
+ watched: false
+ involved: true
+ mentioned: false
+ all: false
+ workPackageCommented: false
+ _links:
+ project:
+ href: null
+ - channel: "in_app"
+ watched: true
+ involved: true
+ mentioned: true
+ all: false
+ workPackageCommented: false
+ _links:
+ project:
+ href: null
+ - channel: "mail_digest"
+ watched: true
+ involved: true
+ mentioned: true
+ all: true,
+ workPackageCommented: true
+ _links:
+ project:
+ href: null
schema:
"$ref": "../components/schemas/user_preferences_model.yml"
description: OK
@@ -54,12 +84,42 @@ patch:
user:
href: "/api/v3/users/1"
title: John Sheppard
+ updateImmediately:
+ href: "/api/v3/users/3/preferences"
+ method: "patch"
_type: UserPreferences
- accessibilityMode: false
commentSortDescending: true
hideMail: false
timeZone: Europe/Berlin
warnOnLeavingUnsaved: true
+ notifications:
+ - channel: "mail"
+ watched: false
+ involved: true
+ mentioned: false
+ all: false
+ workPackageCommented: false
+ _links:
+ project:
+ href: null
+ - channel: "in_app"
+ watched: true
+ involved: true
+ mentioned: true
+ all: false
+ workPackageCommented: false
+ _links:
+ project:
+ href: null
+ - channel: "mail_digest"
+ watched: true
+ involved: true
+ mentioned: true
+ all: true,
+ workPackageCommented: true
+ _links:
+ project:
+ href: null
schema:
"$ref": "../components/schemas/user_preferences_model.yml"
description: OK
@@ -114,12 +174,12 @@ patch:
application/json:
schema:
example:
- accessibilityMode: true
+ autoHidePopups: true
timeZone: Europe/Paris
properties:
- accessibilityMode:
+ autoHidePopups:
type: boolean
timeZone:
type: string
type: object
- summary: Update UserPreferences
+ summary: Update my preferences
diff --git a/docs/api/apiv3/tags/userpreferences.yml b/docs/api/apiv3/tags/userpreferences.yml
index 3a07d315f3e..776217d5b84 100644
--- a/docs/api/apiv3/tags/userpreferences.yml
+++ b/docs/api/apiv3/tags/userpreferences.yml
@@ -9,11 +9,13 @@ description: |-
## Local Properties
- | Property | Description | Type | Constraints | Supported operations |
- |:----------------------:| -----------------------------------------------------------| ---------- | ----------- | -------------------- |
- | hideMail | Hide mail address from other users | Boolean | | READ / WRITE |
- | timeZone | Current selected time zone | String | | READ / WRITE |
- | commentSortDescending | Sort comments in descending order | Boolean | | READ / WRITE |
- | warnOnLeavingUnsaved | Issue warning when leaving a page with unsaved text | Boolean | | READ / WRITE |
- | accessibilityMode | Enable accessibility mode | Boolean | | READ / WRITE |
+ | Property | Description | Type | Constraints | Supported operations |
+ |:----------------------:| ----------------------------------------------------------- | ---------- | ----------- | -------------------- |
+ | autoHidePopups | Whether to hide popups (e.g. success messages) after 5 seconds | Boolean | | READ / WRITE |
+ | hideMail | Hide mail address from other users | Boolean | | READ / WRITE |
+ | notifications | The settings for the notifications to be received by the user | NotificationSetting | | READ / WRITE |
+ | selfNotified | Whether the user wants to be notfified of changes done by the user her/himself | Boolean | | READ / WRITE |
+ | timeZone | Current selected time zone | String | | READ / WRITE |
+ | commentSortDescending | Sort comments in descending order | Boolean | | READ / WRITE |
+ | warnOnLeavingUnsaved | Issue warning when leaving a page with unsaved text | Boolean | | READ / WRITE |
name: UserPreferences
diff --git a/lib/api/open_api.rb b/lib/api/open_api.rb
index 279282603e5..965759dbc45 100644
--- a/lib/api/open_api.rb
+++ b/lib/api/open_api.rb
@@ -9,7 +9,7 @@ module API
if spec_path.exist?
assemble_spec spec_path
else
- raise "Could not find openapi-spec.yml uner #{spec_path}"
+ raise "Could not find openapi-spec.yml under #{spec_path}"
end
end
diff --git a/script/api/spec b/script/api/spec
index 347a0c3ab4c..dc1e8089520 100755
--- a/script/api/spec
+++ b/script/api/spec
@@ -3,7 +3,7 @@
if ARGV.join(" ") =~ /((-h)|(--help))/
puts "Prints the self-contained OpenAPI 3.0 specification of OpenProject's APIv3"
puts
- puts "usage: ./scripts/api/spec [--format JSON|yaml]"
+ puts "usage: ./script/api/spec [--format JSON|yaml]"
return
end