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

specify views instead of QueryProjections

ulferts37381c8f2f34
diff --git a/docs/api/apiv3/components/examples/query.yml b/docs/api/apiv3/components/examples/query.yml
index 8cf3640a501..1af325be060 100644
--- a/docs/api/apiv3/components/examples/query.yml
+++ b/docs/api/apiv3/components/examples/query.yml
@@ -35,6 +35,7 @@ value:
public: false
sums: false
starred: false
+ hidden: false
projections:
- _type: QueryProjection::Table
showHierarchies: true
diff --git a/docs/api/apiv3/components/examples/view_bcf.yml b/docs/api/apiv3/components/examples/view_bcf.yml
new file mode 100644
index 00000000000..44a7fca4428
--- /dev/null
+++ b/docs/api/apiv3/components/examples/view_bcf.yml
@@ -0,0 +1,15 @@
+# Example: ViewBcf
+---
+value:
+ _type: Views::BCF
+ name: Bcfs
+ id: 8
+ _links:
+ self:
+ href: "/api/v3/views/8"
+ query:
+ href: "/api/v3/queries/18"
+ title: A query
+ project:
+ href: "/api/v3/project/89"
+ title: The project
diff --git a/docs/api/apiv3/components/examples/view_table.yml b/docs/api/apiv3/components/examples/view_table.yml
new file mode 100644
index 00000000000..c0a5b222199
--- /dev/null
+++ b/docs/api/apiv3/components/examples/view_table.yml
@@ -0,0 +1,31 @@
+# Example: ViewTable
+---
+value:
+ _type: Views::Table
+ name: Current work packages
+ timelineVisible: true
+ id: 9
+ _links:
+ self:
+ href: "/api/v3/views/9"
+ query:
+ href: "/api/v3/queries/18"
+ title: A query
+ columns:
+ - href: "/api/v3/users/id"
+ title: ID
+ - href: "/api/v3/users/subject"
+ title: Subject
+ - href: "/api/v3/users/type"
+ title: Type
+ - href: "/api/v3/users/status"
+ title: Status
+ - href: "/api/v3/users/priority"
+ title: Priority
+ - href: "/api/v3/users/assignee"
+ title: Assignee
+ - href: "/api/v3/users/updated_at"
+ title: Updated on
+ project:
+ href: "/api/v3/project/89"
+ title: The project
diff --git a/docs/api/apiv3/components/examples/query_projection_table_schema.yml b/docs/api/apiv3/components/examples/view_table_schema.yml
similarity index 70%
rename from docs/api/apiv3/components/examples/query_projection_table_schema.yml
rename to docs/api/apiv3/components/examples/view_table_schema.yml
index 6d086d675aa..d92c91de5ed 100644
--- a/docs/api/apiv3/components/examples/query_projection_table_schema.yml
+++ b/docs/api/apiv3/components/examples/view_table_schema.yml
@@ -1,11 +1,11 @@
-# Example: QueryProjection::TableSchema
+# Example: Views::TableSchema
---
value:
_dependencies: []
_embedded:
_links:
self:
- href: "/api/v3/queries/projection_schemas/table"
+ href: "/api/v3/views/schemas/table"
_type: Schema
columns:
_links: {}
diff --git a/docs/api/apiv3/components/examples/views.yml b/docs/api/apiv3/components/examples/views.yml
new file mode 100644
index 00000000000..e0b22b90c6f
--- /dev/null
+++ b/docs/api/apiv3/components/examples/views.yml
@@ -0,0 +1,45 @@
+# Example: Views
+---
+value:
+ _links:
+ self:
+ href: "/api/v3/views"
+ changeSize:
+ href: "/api/v3/views?pageSize={size}"
+ templated: true
+ jumpTo:
+ href: "/api/v3/views?offset={offset}"
+ templated: true
+ total: 1
+ count: 1
+ _type: Collection
+ _embedded:
+ elements:
+ - _type: Views::Table
+ name: Current work packages
+ timelineVisible: true
+ id: 9
+ _links:
+ self:
+ href: "/api/v3/views/9"
+ query:
+ href: "/api/v3/queries/18"
+ title: A query
+ columns:
+ - href: "/api/v3/users/id"
+ title: ID
+ - href: "/api/v3/users/subject"
+ title: Subject
+ - href: "/api/v3/users/type"
+ title: Type
+ - href: "/api/v3/users/status"
+ title: Status
+ - href: "/api/v3/users/priority"
+ title: Priority
+ - href: "/api/v3/users/assignee"
+ title: Assignee
+ - href: "/api/v3/users/updated_at"
+ title: Updated on
+ project:
+ href: "/api/v3/project/89"
+ title: The project
diff --git a/docs/api/apiv3/openapi-spec.yml b/docs/api/apiv3/openapi-spec.yml
index 9d088c11eee..17c6bd4b64b 100644
--- a/docs/api/apiv3/openapi-spec.yml
+++ b/docs/api/apiv3/openapi-spec.yml
@@ -191,8 +191,8 @@ paths:
"$ref": "./paths/memberships_available_projects.yml"
"/api/v3/memberships/form":
"$ref": "./paths/memberships_form.yml"
- "/api/v3/memberships/schemas":
- "$ref": "./paths/memberships_schemas.yml"
+ "/api/v3/memberships/schema":
+ "$ref": "./paths/memberships_schema.yml"
"/api/v3/memberships/{id}":
"$ref": "./paths/membership.yml"
"/api/v3/memberships/{id}/form":
@@ -225,8 +225,8 @@ paths:
"$ref": "./paths/projects_available_parent_projects.yml"
"/api/v3/projects/form":
"$ref": "./paths/projects_form.yml"
- "/api/v3/projects/schemas":
- "$ref": "./paths/projects_schemas.yml"
+ "/api/v3/projects/schema":
+ "$ref": "./paths/projects_schema.yml"
"/api/v3/projects/{id}":
"$ref": "./paths/project.yml"
"/api/v3/projects/{id}/budgets":
@@ -241,8 +241,6 @@ paths:
"$ref": "./paths/project_queries_default.yml"
"/api/v3/projects/{id}/queries/filter_instance_schemas":
"$ref": "./paths/project_queries_filter_instance_schemas.yml"
- "/api/v3/projects/{id}/queries/projection_schemas":
- "$ref": "./paths/project_queries_projection_schemas.yml"
"/api/v3/projects/{id}/queries/schema":
"$ref": "./paths/project_queries_schema.yml"
"/api/v3/projects/{id}/work_packages":
@@ -277,10 +275,6 @@ paths:
"$ref": "./paths/queries_form.yml"
"/api/v3/queries/operators/{id}":
"$ref": "./paths/queries_operator.yml"
- "/api/v3/queries/projection_schemas":
- "$ref": "./paths/queries_projection_schemas.yml"
- "/api/v3/queries/projection_schemas/table":
- "$ref": "./paths/queries_projection_table_schema.yml"
"/api/v3/queries/schema":
"$ref": "./paths/queries_schema.yml"
"/api/v3/queries/sort_bys/{id}":
@@ -335,8 +329,8 @@ paths:
"$ref": "./paths/type.yml"
"/api/v3/users":
"$ref": "./paths/users.yml"
- "/api/v3/users/schemas":
- "$ref": "./paths/users_schemas.yml"
+ "/api/v3/users/schema":
+ "$ref": "./paths/users_schema.yml"
"/api/v3/users/{id}":
"$ref": "./paths/user.yml"
"/api/v3/users/{id}/form":
@@ -349,14 +343,22 @@ paths:
"$ref": "./paths/versions_available_projects.yml"
"/api/v3/versions/form":
"$ref": "./paths/versions_form.yml"
- "/api/v3/versions/schemas":
- "$ref": "./paths/versions_schemas.yml"
+ "/api/v3/versions/schema":
+ "$ref": "./paths/versions_schema.yml"
"/api/v3/versions/{id}":
"$ref": "./paths/version.yml"
"/api/v3/versions/{id}/form":
"$ref": "./paths/version_form.yml"
"/api/v3/versions/{id}/projects":
"$ref": "./paths/version_projects.yml"
+ "/api/v3/views":
+ "$ref": "./paths/views.yml"
+ "/api/v3/views/schemas":
+ "$ref": "./paths/views_schemas.yml"
+ "/api/v3/views/schemas/{identifier}":
+ "$ref": "./paths/views_schemas_{identifier}.yml"
+ "/api/v3/views/{id}":
+ "$ref": "./paths/view.yml"
"/api/v3/wiki_pages/{id}":
"$ref": "./paths/wiki_page.yml"
"/api/v3/wiki_pages/{id}/attachments":
@@ -401,10 +403,16 @@ components:
"$ref": "./components/examples/query.yml"
QueryProjectionSchemas:
"$ref": "./components/examples/query_projection_schemas.yml"
- QueryProjectionTableSchema:
- "$ref": "./components/examples/query_projection_table_schema.yml"
QuerySchemaModel:
"$ref": "./components/examples/query_schema.yml"
+ Views:
+ "$ref": "./components/examples/views.yml"
+ ViewBCF:
+ "$ref": "./components/examples/view_bcf.yml"
+ ViewTable:
+ "$ref": "./components/examples/view_table.yml"
+ ViewTableSchema:
+ "$ref": "./components/examples/view_table_schema.yml"
schemas:
ActivityModel:
"$ref": "./components/schemas/activity_model.yml"
@@ -790,6 +798,7 @@ tags:
- "$ref": "./tags/userpreferences.yml"
- "$ref": "./tags/users.yml"
- "$ref": "./tags/versions.yml"
+- "$ref": "./tags/views.yml"
- "$ref": "./tags/wiki_pages.yml"
- "$ref": "./tags/work_packages.yml"
security:
diff --git a/docs/api/apiv3/paths/memberships_schemas.yml b/docs/api/apiv3/paths/memberships_schema.yml
similarity index 98%
rename from docs/api/apiv3/paths/memberships_schemas.yml
rename to docs/api/apiv3/paths/memberships_schema.yml
index 7496aaf3672..e6c1aa379bc 100644
--- a/docs/api/apiv3/paths/memberships_schemas.yml
+++ b/docs/api/apiv3/paths/memberships_schema.yml
@@ -1,4 +1,4 @@
-# /api/v3/memberships/schemas
+# /api/v3/memberships/schema
---
get:
responses:
diff --git a/docs/api/apiv3/paths/projects_schemas.yml b/docs/api/apiv3/paths/projects_schema.yml
similarity index 100%
rename from docs/api/apiv3/paths/projects_schemas.yml
rename to docs/api/apiv3/paths/projects_schema.yml
diff --git a/docs/api/apiv3/paths/queries_projection_schemas.yml b/docs/api/apiv3/paths/queries_projection_schemas.yml
deleted file mode 100644
index 0b7a008f466..00000000000
--- a/docs/api/apiv3/paths/queries_projection_schemas.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-# /api/v3/queries/projection_schemas
----
-get:
- responses:
- '200':
- content:
- application/hal+json:
- examples:
- ProjectQueryProjectionSchemas:
- "$ref": "../components/examples/project_query_projection_schemas.yml"
- description: OK
- headers: {}
- '403':
- content:
- application/hal+json:
- examples:
- response:
- value:
- _type: Error
- errorIdentifier: urn:openproject-org:api:v3:errors:Unauthenticated
- message: You are not authorized to access this resource.
- description: |-
- Returned if the client does not have sufficient permissions to see it.
-
- **Required permission:** view work package in any project
- headers: {}
- tags:
- - Query Projection Schema
- description: Returns the list of QueryProjection schemas defined for a global
- query, which is a query not assigned to a project.
- operationId: List_Query_Projection_Schemas
- summary: List Query Projection Schemas
diff --git a/docs/api/apiv3/paths/queries_projection_table_schema.yml b/docs/api/apiv3/paths/queries_projection_table_schema.yml
deleted file mode 100644
index fd4ed48a11c..00000000000
--- a/docs/api/apiv3/paths/queries_projection_table_schema.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-# /api/v3/queries/projection_schemas/table
----
-get:
- responses:
- '200':
- content:
- application/hal+json:
- examples:
- QueryProjectionTableSchema:
- "$ref": "../components/examples/query_projection_table_schema.yml"
- description: OK
- headers: {}
- '403':
- content:
- application/hal+json:
- examples:
- response:
- value:
- _type: Error
- errorIdentifier: urn:openproject-org:api:v3:errors:Unauthenticated
- message: You are not authorized to access this resource.
- description: |-
- Returned if the client does not have sufficient permissions to see it.
-
- **Required permission:** view work package in any project
- headers: {}
- tags:
- - Query Projection Schema
- description: Returns the schema for a `QueryProjection::Table`.
- operationId: View_Query_Projection_Table_Schema
- summary: View 'QueryProjection::Table' Schema
diff --git a/docs/api/apiv3/paths/users_schemas.yml b/docs/api/apiv3/paths/users_schema.yml
similarity index 100%
rename from docs/api/apiv3/paths/users_schemas.yml
rename to docs/api/apiv3/paths/users_schema.yml
diff --git a/docs/api/apiv3/paths/versions_schemas.yml b/docs/api/apiv3/paths/versions_schema.yml
similarity index 100%
rename from docs/api/apiv3/paths/versions_schemas.yml
rename to docs/api/apiv3/paths/versions_schema.yml
diff --git a/docs/api/apiv3/paths/view.yml b/docs/api/apiv3/paths/view.yml
new file mode 100644
index 00000000000..a30b033ea54
--- /dev/null
+++ b/docs/api/apiv3/paths/view.yml
@@ -0,0 +1,201 @@
+# /api/v3/views/{id}
+---
+get:
+ parameters:
+ - description: View id
+ example: '1'
+ in: path
+ name: id
+ required: true
+ schema:
+ type: integer
+ responses:
+ '200':
+ content:
+ application/hal+json:
+ examples:
+ ViewTable:
+ "$ref": "../components/examples/view_table.yml"
+ ViewBcf:
+ "$ref": "../components/examples/view_bcf.yml"
+ '400':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:InvalidRequestBody
+ message: The request body was not a single JSON object.
+ description: Occurs when the client did not send a valid JSON object in the
+ request body.
+ headers: {}
+ '403':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission
+ message: You are not authorized to access this resource.
+ description: |-
+ Returned if the client does not have sufficient permissions.
+
+ **Required permission:** The required permission depends on the type of the view.
+ headers: {}
+ '404':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:NotFound
+ message: The requested resource could not be found.
+ description: |-
+ Returned if the resource can not be found.
+
+ *Note: A client without sufficient permissions shall not be able to test for the existence of
+ a view. That's why a 404 is returned here, even if a 403 might be more appropriate.*
+ headers: {}
+ tags:
+ - Views
+ description: ''
+ operationId: View_view
+ summary: View view
+delete:
+ parameters:
+ - description: View id
+ example: '1'
+ in: path
+ name: id
+ required: true
+ schema:
+ type: integer
+ responses:
+ '204':
+ description: Returned if the view was successfully deleted.
+ headers: {}
+ '403':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission
+ message: You are not authorized to access this resource.
+ description: |-
+ Returned if the client does not have sufficient permissions.
+
+ **Required permission:** The permissions depend on the view.
+ headers: {}
+ '404':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:NotFound
+ message: The requested resource could not be found.
+ description: |-
+ Returned if the view does not exist or the client does not have sufficient permissions
+ to see it.
+
+ **Required permission:** The permissions depend on the view.
+
+ *Note: A client without sufficient permissions shall not be able to test for the existence of
+ a version. That's why a 404 is returned here, even if a 403 might be more appropriate.*
+ headers: {}
+ tags:
+ - Views
+ description: Deletes the view.
+ operationId: Delete_view
+ summary: Delete view
+patch:
+ parameters:
+ - description: View id
+ example: '1'
+ in: path
+ name: id
+ required: true
+ schema:
+ type: integer
+ responses:
+ '200':
+ content:
+ application/hal+json:
+ examples:
+ ViewTable:
+ "$ref": "../components/examples/view_table.yml"
+ description: OK
+ headers: {}
+ '400':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:InvalidRequestBody
+ message: The request body was not a single JSON object.
+ description: Occurs when the client did not send a valid JSON object in the
+ request body.
+ headers: {}
+ '403':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:MissingPermission
+ message: You are not authorized to access this resource.
+ description: |-
+ Returned if the client does not have sufficient permissions.
+
+ **Required permission:** The permissions depend on the view.
+ headers: {}
+ '404':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:NotFound
+ message: The requested resource could not be found.
+ description: |-
+ Returned if the view does not exist or the client does not have sufficient permissions
+ to see it.
+
+ **Required permission:** The permissions depend on the view.
+
+ *Note: A client without sufficient permissions shall not be able to test for the existence of
+ a version. That's why a 404 is returned here, even if a 403 might be more appropriate.*
+ headers: {}
+ '422':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _embedded:
+ details:
+ attribute: query
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:PropertyConstraintViolation
+ message: The query does not exist.
+ description: |-
+ Returned if:
+
+ * a constraint for a property was violated (`PropertyConstraintViolation`)
+ headers: {}
+ tags:
+ - Views
+ description: |-
+ Updates the given View by applying the attributes provided in the body.
+ operationId: Update_view
+ summary: Update view
diff --git a/docs/api/apiv3/paths/views.yml b/docs/api/apiv3/paths/views.yml
new file mode 100644
index 00000000000..f28320a0d89
--- /dev/null
+++ b/docs/api/apiv3/paths/views.yml
@@ -0,0 +1,86 @@
+# /api/v3/views
+---
+get:
+ parameters:
+ - description: |-
+ JSON specifying filter conditions.
+ Currently supported filters are:
+
+ + project: filters views by the project their associated query is assigned to. If the project filter is passed with the `!*` (not any) operator, global views are returned.
+
+ + id: filters views based on their id
+
+ + type: filters views based on their type
+ example: '[{ "project_id": { "operator": "!*", "values": null }" }]'
+ in: query
+ name: filters
+ required: false
+ schema:
+ type: string
+ responses:
+ '200':
+ content:
+ application/hal+json:
+ examples:
+ Queries:
+ "$ref": "../components/examples/views.yml"
+ description: OK
+ headers: {}
+ tags:
+ - Views
+ description: Returns a collection of Views. The collection can be filtered via
+ query parameters similar to how work packages are filtered.
+ operationId: List_views
+ summary: List views
+post:
+ responses:
+ '201':
+ content:
+ application/hal+json:
+ examples:
+ Query:
+ "$ref": "../components/examples/view_table.yml"
+ description: Created
+ headers: {}
+ '400':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:InvalidRequestBody
+ message: The request body was not a single JSON object.
+ description: Occurs when the client did not send a valid JSON object in the
+ request body.
+ headers: {}
+ '422':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _embedded:
+ details:
+ attribute: query
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:PropertyConstraintViolation
+ message: Query not found
+ description: |-
+ Returned if:
+
+ * the client tries to modify a read-only property (`PropertyIsReadOnly`)
+
+ * a constraint for a property was violated (`PropertyConstraintViolation`)
+
+ * the client provides a link to an invalid resource (`ResourceTypeMismatch`),
+ e.g. a query not found
+ headers: {}
+ tags:
+ - Views
+ description: |-
+ When calling this endpoint the client provides a single object, containing at least the properties and links that are required, in the body.
+ The required fields of a View can be found in its schema, which is embedded in the respective form.
+ Note that it is only allowed to provide properties or links supporting the write operation.
+ operationId: Create_views
+ summary: Create view
diff --git a/docs/api/apiv3/paths/views_schemas.yml b/docs/api/apiv3/paths/views_schemas.yml
new file mode 100644
index 00000000000..90a5ce6f3d5
--- /dev/null
+++ b/docs/api/apiv3/paths/views_schemas.yml
@@ -0,0 +1,27 @@
+# /api/v3/views/schemas
+---
+get:
+ parameters:
+ - description: |-
+ JSON specifying filter conditions.
+ Currently supported filters are:
+
+ + project: filters schemas by the project a view is specifyable in which depends on the users's permissions
+ and on the modules active within a project.
+ If the project filter is passed with the `!*` (not any) operator, global view schemas are returned.
+ example: '[{ "project_id": { "operator": "!*", "values": null }" }]'
+ in: query
+ name: filters
+ required: false
+ schema:
+ type: string
+ responses:
+ '200':
+ description: OK
+ headers: {}
+ tags:
+ - Views
+ description: |-
+ List views schemas. The response will contain all views that can be created by the user given the permissions granted and the modules active within projects visible to the user.
+ operationId: List_Views_Schemas
+ summary: List views schemas
diff --git a/docs/api/apiv3/paths/views_schemas_{identifier}.yml b/docs/api/apiv3/paths/views_schemas_{identifier}.yml
new file mode 100644
index 00000000000..6735ede5a38
--- /dev/null
+++ b/docs/api/apiv3/paths/views_schemas_{identifier}.yml
@@ -0,0 +1,43 @@
+# /api/v3/views/schemas/{identifier}
+---
+get:
+ parameters:
+ - description: Identifier of the schema
+ example: list
+ in: path
+ name: identifier
+ required: true
+ schema:
+ type: string
+ responses:
+ '200':
+ description: OK
+ headers: {}
+ content:
+ application/hal+json:
+ examples:
+ TableSchema:
+ "$refs": '../components/examples/view_table_schema.yml'
+ '404':
+ content:
+ application/hal+json:
+ examples:
+ response:
+ value:
+ _type: Error
+ errorIdentifier: urn:openproject-org:api:v3:errors:NotFound
+ message: The specified schema does not exist.
+ description: |-
+ Returned if the schema does not exist or the client does not have sufficient permissions
+ to see it.
+
+ **Required permission:** depending on the identifier.
+
+ *Note: A client without sufficient permissions shall not be able to test for the existence of a project.
+ That's why a 404 is returned here, even if a 403 might be more appropriate.*
+ headers: {}
+ tags:
+ - Views
+ description: ''
+ operationId: View_View_Schema
+ summary: View view schema
diff --git a/docs/api/apiv3/tags/queries.yml b/docs/api/apiv3/tags/queries.yml
index 113ce17c6b0..5256bd5a890 100644
--- a/docs/api/apiv3/tags/queries.yml
+++ b/docs/api/apiv3/tags/queries.yml
@@ -119,10 +119,5 @@ description: |
}
```
-
- ## QueryProjection
-
- A QueryProjection represents a projection that is to be applied to the filtered work packages. A projection might be a graph, a table, a calendar or basically every other representation.
- Each projection requires its own set of configurations. E.g. for a table, specifying the columns of the table is usefull, whereas it does not make sense for a graph. Because of this,
- the property and link set will differ heavily between each type of projection.
+
name: Queries
diff --git a/docs/api/apiv3/tags/views.yml b/docs/api/apiv3/tags/views.yml
new file mode 100644
index 00000000000..341bd30e653
--- /dev/null
+++ b/docs/api/apiv3/tags/views.yml
@@ -0,0 +1,33 @@
+---
+description: |-
+ A View is a representation of some information. That information might be a query (currently it always is).
+ The view will store the configuration on how to display the information but not the information itself.
+
+ A View might then be a graph, a table, a gantt chart or something completely different.
+ The client will have to choose how to represenent in the view.
+
+ A View instance will always be of a subtype of `View`, e.g. `View::List`. The properties between each `View` type might differ a lot.
+
+ **The View is a new concept so it is prone to change.**
+
+ ## Linked Properties
+
+ | Link | Description | Type | Constraints | Supported operations |
+ | :-------------------: | ---------------------------------------- | ------------- | -------- | -------------------- |
+ | self | This view | View (a subtype of it) | not null | READ |
+ | query | This query from which to fetch the data | Query | not null | READ/WRITE |
+ | project | This project the view is defined in. If no project is specified, the View is considered global. Currently, the project will always be derived from the query. | Project | | READ |
+
+ ## Local Properties
+
+ | Property | Description | Type | Constraints | Supported operations |
+ | :--------------: | ------------------------------------------------------| ----------- | ------------------------------------ | -------------------- |
+ | _type | The subtype chosen | String | Can only be one for which a schema exists | READ/WRITE (write only on creation) |
+ | id | View id | Integer | x > 0 | READ |
+ | name | View name | String | | READ/WRITE |
+ | public | Can users besides the owner see the view? | Boolean | | READ/WRITE |
+ | starred | Should the view be highlighted to the user? | Boolean | | READ |
+ | createdAt | Time of creation | DateTime | not null | READ |
+ | updatedAt | Time of the most recent change to the view | DateTime | not null | READ |
+
+name: Views