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

Added file location information to storage API spec

Andreas Pfohlfadcd42ba859
diff --git a/docs/api/apiv3/components/schemas/file_collection_model.yml b/docs/api/apiv3/components/schemas/file_collection_model.yml
index 4f34338c48b..934a01fe35b 100644
--- a/docs/api/apiv3/components/schemas/file_collection_model.yml
+++ b/docs/api/apiv3/components/schemas/file_collection_model.yml
@@ -14,11 +14,11 @@ allOf:
properties:
self:
allOf:
- - $ref: "./link.yml"
+ - $ref: './link.yml'
- description: |-
- This file links collection
+ This file collection
- **Resource**: FileLinkCollectionReadModel
+ **Resource**: FileCollectionModel
_embedded:
type: object
required:
@@ -27,7 +27,7 @@ allOf:
elements:
type: array
items:
- $ref: './file_link_origin_data_model.yml'
+ $ref: './storage_file_model.yml'
example:
_type: Collection
@@ -39,6 +39,7 @@ example:
_embedded:
elements:
- id: 1337
+ location: '/data/logo.png'
name: logo.png
mimeType: image/png
size: 16042
@@ -47,6 +48,7 @@ example:
createdByName: Luke Skywalker
lastModifiedByName: Anakin Skywalker
- id: 1338
+ location: '1338'
name: README.md
mimeType: text/markdown
size: 3742
diff --git a/docs/api/apiv3/components/schemas/storage_file_location_model.yml b/docs/api/apiv3/components/schemas/storage_file_location_model.yml
new file mode 100644
index 00000000000..3bfe1122a45
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/storage_file_location_model.yml
@@ -0,0 +1,9 @@
+# Schema: StorageFileLocationModel
+---
+type: object
+required:
+ - location
+properties:
+ location:
+ type: string
+ description: Location identification for file in storage
diff --git a/docs/api/apiv3/components/schemas/storage_file_model.yml b/docs/api/apiv3/components/schemas/storage_file_model.yml
new file mode 100644
index 00000000000..2fca7a6ea3e
--- /dev/null
+++ b/docs/api/apiv3/components/schemas/storage_file_model.yml
@@ -0,0 +1,5 @@
+# Schema: StorageFileModel
+---
+allOf:
+ - $ref: './file_link_origin_data_model.yml'
+ - $ref: './storage_file_location_model.yml'
diff --git a/docs/api/apiv3/openapi-spec.yml b/docs/api/apiv3/openapi-spec.yml
index e965f46d215..d126b94a7e0 100644
--- a/docs/api/apiv3/openapi-spec.yml
+++ b/docs/api/apiv3/openapi-spec.yml
@@ -712,6 +712,10 @@ components:
"$ref": "./components/schemas/statuses_model.yml"
StorageModel:
"$ref": "./components/schemas/storage_model.yml"
+ StorageFileModel:
+ "$ref": "./components/schemas/storage_file_model.yml"
+ StorageFileLocationModel:
+ "$ref": "./components/schemas/storage_file_location_model.yml"
Time_EntryModel:
"$ref": "./components/schemas/time_entry_model.yml"
Time_Entry_ActivityModel:
diff --git a/docs/api/apiv3/paths/storage_files.yml b/docs/api/apiv3/paths/storage_files.yml
index 3ea0882d0cf..24fae906cb2 100644
--- a/docs/api/apiv3/paths/storage_files.yml
+++ b/docs/api/apiv3/paths/storage_files.yml
@@ -6,12 +6,12 @@ get:
tags:
- File links
description: |-
- Gets a collection of file data from a storage.
+ Gets a collection of files from a storage.
- If no `root` context was given, the result is the content of the document root. With `root` context given, the
- result contains the collections of file data from without the given root file id.
+ If no `root` context is given, the result is the content of the document root. With `root` context given, the
+ result contains the collections of files from within the given root file id.
- If given `root` context is no directory, but a file, the collection contains this file data as a single element.
+ If given `root` context is no directory, but a file, the collection contains this file as a single element.
parameters:
- name: id
description: Storage id
@@ -21,12 +21,12 @@ get:
type: integer
example: 1337
- name: root
- description: Root file id
+ description: Root file identification
in: query
required: false
schema:
type: string
- example: 53
+ example: '/my/data'
responses:
'200':
description: OK
@@ -38,7 +38,7 @@ get:
content:
application/hal+json:
schema:
- $ref: "../components/schemas/error_response.yml"
+ $ref: '../components/schemas/error_response.yml'
example:
_type: Error
errorIdentifier: urn:openproject-org:api:v3:errors:NotFound
@@ -48,4 +48,4 @@ get:
- if the storage does not exist or the client does not have sufficient permissions to see it
**Required permission:** view file links
- - if the document root file id do not exist on the storage
+ - if the document root file identification does not exist on the storage
diff --git a/frontend/src/app/core/state/storage-files/storage-file.model.ts b/frontend/src/app/core/state/storage-files/storage-file.model.ts
index d9b4387f097..935b78c378d 100644
--- a/frontend/src/app/core/state/storage-files/storage-file.model.ts
+++ b/frontend/src/app/core/state/storage-files/storage-file.model.ts
@@ -32,4 +32,5 @@ import { IFileLinkOriginData } from 'core-app/core/state/file-links/file-link.mo
export interface IStorageFile extends IFileLinkOriginData {
id:ID;
+
}