for default selected option(s), eg 5 or [\"1\", \"8\"]"
- },
- "subtype": {
- "type": "string",
- "nullable": true,
- "default": null,
- "enum": [
- "progress",
- "stars"
- ],
- "description": "Subtype for the new column"
- },
- "description": {
- "type": "string",
- "nullable": true,
- "default": null,
- "description": "Description"
- },
- "selectedViewIds": {
- "type": "array",
- "nullable": true,
- "default": [],
- "description": "View IDs where this columns should be added",
- "items": {
- "type": "integer",
- "format": "int64"
- }
- },
- "mandatory": {
- "type": "boolean",
- "default": false,
- "description": "Is mandatory"
- },
- "baseNodeType": {
- "type": "string",
- "default": "table",
- "enum": [
- "table",
- "view"
- ],
- "description": "Context type of the column creation"
- },
- "customSettings": {
- "type": "object",
- "default": {},
- "description": "Custom settings for the column",
- "additionalProperties": {
- "type": "object"
- }
- }
- }
- }
- }
- }
- },
- "parameters": [
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Column created",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "$ref": "#/components/schemas/Column"
- }
- }
- }
- }
- }
- }
- }
- },
- "403": {
- "description": "No permission",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "500": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- },
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Not found",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "401": {
- "description": "Current user is not logged in",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {}
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "/ocs/v2.php/apps/tables/api/2/columns/datetime": {
- "post": {
- "operationId": "api_columns-create-datetime-column",
- "summary": "[api v2] Create new datetime column",
- "description": "Specify a subtype to use any special datetime column",
- "tags": [
- "api_columns"
- ],
- "security": [
- {
- "bearer_auth": []
- },
- {
- "basic_auth": []
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "baseNodeId",
- "title"
- ],
- "properties": {
- "baseNodeId": {
- "type": "integer",
- "format": "int64",
- "description": "Context of the column creation"
- },
- "title": {
- "type": "string",
- "description": "Title"
- },
- "datetimeDefault": {
- "type": "string",
- "nullable": true,
- "enum": [
- "today",
- "now"
- ],
- "description": "For a subtype 'date' you can set 'today'. For a main type or subtype 'time' you can set to 'now'."
- },
- "subtype": {
- "type": "string",
- "nullable": true,
- "default": null,
- "enum": [
- "progress",
- "stars"
- ],
- "description": "Subtype for the new column"
- },
- "description": {
- "type": "string",
- "nullable": true,
- "default": null,
- "description": "Description"
- },
- "selectedViewIds": {
- "type": "array",
- "nullable": true,
- "default": [],
- "description": "View IDs where this columns should be added",
- "items": {
- "type": "integer",
- "format": "int64"
- }
- },
- "mandatory": {
- "type": "boolean",
- "default": false,
- "description": "Is mandatory"
- },
- "baseNodeType": {
- "type": "string",
- "default": "table",
- "enum": [
- "table",
- "view"
- ],
- "description": "Context type of the column creation"
- },
- "customSettings": {
- "type": "object",
- "default": {},
- "description": "Custom settings for the column",
- "additionalProperties": {
- "type": "object"
- }
- }
- }
- }
- }
- }
- },
- "parameters": [
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Column created",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "$ref": "#/components/schemas/Column"
- }
- }
- }
- }
- }
- }
- }
- },
- "403": {
- "description": "No permission",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "500": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- },
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Not found",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "401": {
- "description": "Current user is not logged in",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {}
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "/ocs/v2.php/apps/tables/api/2/columns/usergroup": {
- "post": {
- "operationId": "api_columns-create-usergroup-column",
- "summary": "[api v2] Create new usergroup column",
- "tags": [
- "api_columns"
- ],
- "security": [
- {
- "bearer_auth": []
- },
- {
- "basic_auth": []
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "baseNodeId",
- "title"
- ],
- "properties": {
- "baseNodeId": {
- "type": "integer",
- "format": "int64",
- "description": "Context of the column creation"
- },
- "title": {
- "type": "string",
- "description": "Title"
- },
- "usergroupDefault": {
- "type": "string",
- "nullable": true,
- "description": "Json array{id: string, type: int}, eg [{\"id\": \"admin\", \"type\": 0}, {\"id\": \"user1\", \"type\": 0}]"
- },
- "usergroupMultipleItems": {
- "type": "boolean",
- "default": null,
- "description": "Whether you can select multiple users or/and groups"
- },
- "usergroupSelectUsers": {
- "type": "boolean",
- "default": null,
- "description": "Whether you can select users"
- },
- "usergroupSelectGroups": {
- "type": "boolean",
- "default": null,
- "description": "Whether you can select groups"
- },
- "usergroupSelectTeams": {
- "type": "boolean",
- "default": null,
- "description": "Whether you can select teams"
- },
- "showUserStatus": {
- "type": "boolean",
- "default": null,
- "description": "Whether to show the user's status"
- },
- "description": {
- "type": "string",
- "nullable": true,
- "default": null,
- "description": "Description"
- },
- "selectedViewIds": {
- "type": "array",
- "nullable": true,
- "default": [],
- "description": "View IDs where this columns should be added",
- "items": {
- "type": "integer",
- "format": "int64"
- }
- },
- "mandatory": {
- "type": "boolean",
- "default": false,
- "description": "Is mandatory"
- },
- "baseNodeType": {
- "type": "string",
- "default": "table",
- "enum": [
- "table",
- "view"
- ],
- "description": "Context type of the column creation"
- },
- "customSettings": {
- "type": "object",
- "default": {},
- "description": "Custom settings for the column",
- "additionalProperties": {
- "type": "object"
- }
- }
- }
- }
- }
- }
- },
- "parameters": [
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Column created",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "$ref": "#/components/schemas/Column"
- }
- }
- }
- }
- }
- }
- }
- },
- "403": {
- "description": "No permission",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "500": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- },
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Not found",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "401": {
- "description": "Current user is not logged in",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {}
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "/ocs/v2.php/apps/tables/api/2/favorites/{nodeType}/{nodeId}": {
- "post": {
- "operationId": "api_favorite-create",
- "summary": "[api v2] Add a node (table or view) to user favorites",
- "tags": [
- "api_favorite"
- ],
- "security": [
- {
- "bearer_auth": []
- },
- {
- "basic_auth": []
- }
- ],
- "parameters": [
- {
- "name": "nodeType",
- "in": "path",
- "description": "any Application::NODE_TYPE_* constant",
- "required": true,
- "schema": {
- "type": "integer",
- "format": "int64"
- }
- },
- {
- "name": "nodeId",
- "in": "path",
- "description": "identifier of the node",
- "required": true,
- "schema": {
- "type": "integer",
- "format": "int64"
- }
- },
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Tables returned",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object"
- }
- }
- }
- }
- }
- }
- }
- },
- "403": {
- "description": "No permissions",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "500": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "404": {
- "description": "Not found",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "401": {
- "description": "Current user is not logged in",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
"type": "object",
"required": [
- "meta",
- "data"
+ "id",
+ "type"
],
"properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
+ "id": {
+ "type": "integer",
+ "format": "int64"
},
- "data": {}
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "delete": {
- "operationId": "api_favorite-destroy",
- "summary": "[api v2] Remove a node (table or view) to from favorites",
- "tags": [
- "api_favorite"
- ],
- "security": [
- {
- "bearer_auth": []
- },
- {
- "basic_auth": []
+ "type": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "permissions": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
- ],
+ },
"parameters": [
- {
- "name": "nodeType",
- "in": "path",
- "description": "any Application::NODE_TYPE_* constant",
- "required": true,
- "schema": {
- "type": "integer",
- "format": "int64"
- }
- },
- {
- "name": "nodeId",
- "in": "path",
- "description": "identifier of the node",
- "required": true,
- "schema": {
- "type": "integer",
- "format": "int64"
- }
- },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -9905,7 +8573,7 @@
],
"responses": {
"200": {
- "description": "Deleted table returned",
+ "description": "returning the full context information",
"content": {
"application/json": {
"schema": {
@@ -9925,7 +8593,7 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "object"
+ "$ref": "#/components/schemas/Context"
}
}
}
@@ -9934,8 +8602,8 @@
}
}
},
- "403": {
- "description": "No permissions",
+ "500": {
+ "description": "",
"content": {
"application/json": {
"schema": {
@@ -9972,8 +8640,8 @@
}
}
},
- "500": {
- "description": "",
+ "400": {
+ "description": "invalid parameters were supplied",
"content": {
"application/json": {
"schema": {
@@ -10010,8 +8678,8 @@
}
}
},
- "404": {
- "description": "Not found",
+ "403": {
+ "description": "lacking permissions on a resource",
"content": {
"application/json": {
"schema": {
@@ -10079,11 +8747,10 @@
}
}
},
- "/ocs/v2.php/apps/tables/api/2/contexts": {
+ "/ocs/v2.php/apps/tables/api/2/contexts/{contextId}": {
"get": {
- "operationId": "context-index",
- "summary": "[api v2] Get all contexts available to the requesting person",
- "description": "Return an empty array if no contexts were found",
+ "operationId": "context-show",
+ "summary": "[api v2] Get information about the requests context",
"tags": [
"context"
],
@@ -10096,6 +8763,16 @@
}
],
"parameters": [
+ {
+ "name": "contextId",
+ "in": "path",
+ "description": "ID of the context",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -10109,7 +8786,7 @@
],
"responses": {
"200": {
- "description": "reporting in available contexts",
+ "description": "returning the full context information",
"content": {
"application/json": {
"schema": {
@@ -10129,10 +8806,7 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Context"
- }
+ "$ref": "#/components/schemas/Context"
}
}
}
@@ -10179,6 +8853,44 @@
}
}
},
+ "404": {
+ "description": "context not found or not available anymore",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"401": {
"description": "Current user is not logged in",
"content": {
@@ -10209,9 +8921,9 @@
}
}
},
- "post": {
- "operationId": "context-create",
- "summary": "[api v2] Create a new context and return it",
+ "put": {
+ "operationId": "context-update",
+ "summary": "[api v2] Update an existing context and return it",
"tags": [
"context"
],
@@ -10224,52 +8936,53 @@
}
],
"requestBody": {
- "required": true,
+ "required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
- "required": [
- "name",
- "iconName"
- ],
"properties": {
"name": {
"type": "string",
- "description": "Name of the context"
+ "nullable": true,
+ "description": "provide this parameter to set a new name"
},
"iconName": {
"type": "string",
- "description": "Material design icon name of the context"
+ "nullable": true,
+ "description": "provide this parameter to set a new icon"
},
"description": {
"type": "string",
- "default": "",
- "description": "Descriptive text of the context"
+ "nullable": true,
+ "description": "provide this parameter to set a new description"
},
"nodes": {
- "type": "array",
- "default": [],
- "description": "optional nodes to be connected to this context",
- "items": {
- "type": "object",
- "required": [
- "id",
- "type"
- ],
- "properties": {
- "id": {
- "type": "integer",
- "format": "int64"
- },
- "type": {
- "type": "integer",
- "format": "int64"
- },
- "permissions": {
- "type": "integer",
- "format": "int64"
- }
+ "type": "object",
+ "nullable": true,
+ "description": "provide this parameter to set a new list of nodes.",
+ "required": [
+ "id",
+ "type",
+ "permissions",
+ "order"
+ ],
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "type": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "permissions": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "order": {
+ "type": "integer",
+ "format": "int64"
}
}
}
@@ -10279,6 +8992,16 @@
}
},
"parameters": [
+ {
+ "name": "contextId",
+ "in": "path",
+ "description": "ID of the context",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -10359,8 +9082,8 @@
}
}
},
- "400": {
- "description": "invalid parameters were supplied",
+ "404": {
+ "description": "Not found",
"content": {
"application/json": {
"schema": {
@@ -10398,7 +9121,7 @@
}
},
"403": {
- "description": "lacking permissions on a resource",
+ "description": "No permissions",
"content": {
"application/json": {
"schema": {
@@ -10464,12 +9187,10 @@
}
}
}
- }
- },
- "/ocs/v2.php/apps/tables/api/2/contexts/{contextId}": {
- "get": {
- "operationId": "context-show",
- "summary": "[api v2] Get information about the requests context",
+ },
+ "delete": {
+ "operationId": "context-destroy",
+ "summary": "[api v2] Delete an existing context and return it",
"tags": [
"context"
],
@@ -10573,7 +9294,45 @@
}
},
"404": {
- "description": "context not found or not available anymore",
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "No permissions",
"content": {
"application/json": {
"schema": {
@@ -10639,10 +9398,12 @@
}
}
}
- },
+ }
+ },
+ "/ocs/v2.php/apps/tables/api/2/contexts/{contextId}/transfer": {
"put": {
- "operationId": "context-update",
- "summary": "[api v2] Update an existing context and return it",
+ "operationId": "context-transfer",
+ "summary": "[api v2] Transfer the ownership of a context and return it",
"tags": [
"context"
],
@@ -10655,55 +9416,26 @@
}
],
"requestBody": {
- "required": false,
+ "required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
+ "required": [
+ "newOwnerId"
+ ],
"properties": {
- "name": {
- "type": "string",
- "nullable": true,
- "description": "provide this parameter to set a new name"
- },
- "iconName": {
- "type": "string",
- "nullable": true,
- "description": "provide this parameter to set a new icon"
- },
- "description": {
+ "newOwnerId": {
"type": "string",
- "nullable": true,
- "description": "provide this parameter to set a new description"
+ "description": "ID of the new owner"
},
- "nodes": {
- "type": "object",
- "nullable": true,
- "description": "provide this parameter to set a new list of nodes.",
- "required": [
- "id",
- "type",
- "permissions",
- "order"
- ],
- "properties": {
- "id": {
- "type": "integer",
- "format": "int64"
- },
- "type": {
- "type": "integer",
- "format": "int64"
- },
- "permissions": {
- "type": "integer",
- "format": "int64"
- },
- "order": {
- "type": "integer",
- "format": "int64"
- }
- }
+ "newOwnerType": {
+ "type": "integer",
+ "format": "int64",
+ "default": 0,
+ "description": "any Application::OWNER_TYPE_* constant",
+ "minimum": 0,
+ "maximum": 0
}
}
}
@@ -10718,7 +9450,8 @@
"required": true,
"schema": {
"type": "integer",
- "format": "int64"
+ "format": "int64",
+ "minimum": 0
}
},
{
@@ -10734,7 +9467,7 @@
],
"responses": {
"200": {
- "description": "returning the full context information",
+ "description": "Ownership transferred",
"content": {
"application/json": {
"schema": {
@@ -10801,6 +9534,44 @@
}
}
},
+ "403": {
+ "description": "No permissions",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"404": {
"description": "Not found",
"content": {
@@ -10839,8 +9610,8 @@
}
}
},
- "403": {
- "description": "No permissions",
+ "400": {
+ "description": "Invalid request",
"content": {
"application/json": {
"schema": {
@@ -10906,10 +9677,12 @@
}
}
}
- },
- "delete": {
- "operationId": "context-destroy",
- "summary": "[api v2] Delete an existing context and return it",
+ }
+ },
+ "/ocs/v2.php/apps/tables/api/2/contexts/{contextId}/pages/{pageId}": {
+ "put": {
+ "operationId": "context-update-content-order",
+ "summary": "[api v2] Update the order on a page of a context",
"tags": [
"context"
],
@@ -10921,6 +9694,39 @@
"basic_auth": []
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "content": {
+ "type": "object",
+ "description": "content items with it and order values",
+ "required": [
+ "id",
+ "order"
+ ],
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "order": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"parameters": [
{
"name": "contextId",
@@ -10932,6 +9738,16 @@
"format": "int64"
}
},
+ {
+ "name": "pageId",
+ "in": "path",
+ "description": "ID of the page",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -10945,7 +9761,7 @@
],
"responses": {
"200": {
- "description": "returning the full context information",
+ "description": "content updated successfully",
"content": {
"application/json": {
"schema": {
@@ -11088,6 +9904,44 @@
}
}
},
+ "400": {
+ "description": "Invalid request",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"401": {
"description": "Current user is not logged in",
"content": {
@@ -11119,12 +9973,12 @@
}
}
},
- "/ocs/v2.php/apps/tables/api/2/contexts/{contextId}/transfer": {
- "put": {
- "operationId": "context-transfer",
- "summary": "[api v2] Transfer the ownership of a context and return it",
+ "/ocs/v2.php/apps/tables/api/2/{nodeCollection}/{nodeId}/rows": {
+ "post": {
+ "operationId": "rowocs-create-row",
+ "summary": "[api v2] Create a new row in a table or a view",
"tags": [
- "context"
+ "rowocs"
],
"security": [
{
@@ -11141,20 +9995,22 @@
"schema": {
"type": "object",
"required": [
- "newOwnerId"
+ "data"
],
"properties": {
- "newOwnerId": {
- "type": "string",
- "description": "ID of the new owner"
- },
- "newOwnerType": {
- "type": "integer",
- "format": "int64",
- "default": 0,
- "description": "any Application::OWNER_TYPE_* constant",
- "minimum": 0,
- "maximum": 0
+ "data": {
+ "description": "An array containing the column identifiers and their values",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
+ }
+ ]
}
}
}
@@ -11163,14 +10019,27 @@
},
"parameters": [
{
- "name": "contextId",
+ "name": "nodeCollection",
"in": "path",
- "description": "ID of the context",
+ "description": "Indicates whether to create a row on a table or view",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "enum": [
+ "tables",
+ "views"
+ ],
+ "pattern": "^(tables|views)$"
+ }
+ },
+ {
+ "name": "nodeId",
+ "in": "path",
+ "description": "The identifier of the targeted table or view",
"required": true,
"schema": {
"type": "integer",
- "format": "int64",
- "minimum": 0
+ "format": "int64"
}
},
{
@@ -11186,7 +10055,7 @@
],
"responses": {
"200": {
- "description": "Ownership transferred",
+ "description": "Row returned",
"content": {
"application/json": {
"schema": {
@@ -11206,7 +10075,7 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "$ref": "#/components/schemas/Context"
+ "$ref": "#/components/schemas/Row"
}
}
}
@@ -11215,8 +10084,8 @@
}
}
},
- "500": {
- "description": "",
+ "403": {
+ "description": "No permissions",
"content": {
"application/json": {
"schema": {
@@ -11253,8 +10122,8 @@
}
}
},
- "403": {
- "description": "No permissions",
+ "400": {
+ "description": "Invalid request parameters",
"content": {
"application/json": {
"schema": {
@@ -11329,8 +10198,8 @@
}
}
},
- "400": {
- "description": "Invalid request",
+ "500": {
+ "description": "Internal error",
"content": {
"application/json": {
"schema": {
@@ -11398,14 +10267,16 @@
}
}
},
- "/ocs/v2.php/apps/tables/api/2/contexts/{contextId}/pages/{pageId}": {
- "put": {
- "operationId": "context-update-content-order",
- "summary": "[api v2] Update the order on a page of a context",
+ "/ocs/v2.php/apps/tables/api/2/public/{token}/columns": {
+ "get": {
+ "operationId": "api_public_columns-index-by-public-link",
+ "summary": "[api v2] Get all columns for a table or a view shared by link",
+ "description": "Return an empty array if no columns were found",
"tags": [
- "context"
+ "api_public_columns"
],
"security": [
+ {},
{
"bearer_auth": []
},
@@ -11413,58 +10284,161 @@
"basic_auth": []
}
],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "content"
- ],
- "properties": {
- "content": {
- "type": "object",
- "description": "content items with it and order values",
- "required": [
- "id",
- "order"
- ],
- "properties": {
- "id": {
- "type": "integer",
- "format": "int64"
- },
- "order": {
- "type": "integer",
- "format": "int64"
- }
+ "parameters": [
+ {
+ "name": "token",
+ "in": "path",
+ "description": "The share token",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
+ "schema": {
+ "type": "boolean",
+ "default": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Columns are returned",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/PublicColumn"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "No permissions",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid request parameters",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
}
}
}
}
}
}
- },
+ }
+ }
+ },
+ "/ocs/v2.php/apps/tables/api/2/public/{token}/rows": {
+ "get": {
+ "operationId": "public_rowocs-get-rows",
+ "summary": "[api v2] Fetch all rows from a link share",
+ "tags": [
+ "public_rowocs"
+ ],
+ "security": [
+ {},
+ {
+ "bearer_auth": []
+ },
+ {
+ "basic_auth": []
+ }
+ ],
"parameters": [
{
- "name": "contextId",
+ "name": "token",
"in": "path",
- "description": "ID of the context",
+ "description": "The share token",
"required": true,
+ "schema": {
+ "type": "string",
+ "pattern": "^[a-zA-Z0-9]{16}$"
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "description": "Optional: maximum number of results, capped at 500",
"schema": {
"type": "integer",
- "format": "int64"
+ "format": "int64",
+ "nullable": true
}
},
{
- "name": "pageId",
- "in": "path",
- "description": "ID of the page",
- "required": true,
+ "name": "offset",
+ "in": "query",
+ "description": "Optional: the offset for this operation",
"schema": {
"type": "integer",
- "format": "int64"
+ "format": "int64",
+ "nullable": true
}
},
{
@@ -11480,7 +10454,7 @@
],
"responses": {
"200": {
- "description": "content updated successfully",
+ "description": "Rows are returned",
"content": {
"application/json": {
"schema": {
@@ -11500,7 +10474,10 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "$ref": "#/components/schemas/Context"
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/PublicRow"
+ }
}
}
}
@@ -11509,8 +10486,8 @@
}
}
},
- "500": {
- "description": "",
+ "403": {
+ "description": "No permissions",
"content": {
"application/json": {
"schema": {
@@ -11547,8 +10524,8 @@
}
}
},
- "404": {
- "description": "Not found",
+ "400": {
+ "description": "Invalid request parameters",
"content": {
"application/json": {
"schema": {
@@ -11585,8 +10562,8 @@
}
}
},
- "403": {
- "description": "No permissions",
+ "404": {
+ "description": "Not found",
"content": {
"application/json": {
"schema": {
@@ -11623,8 +10600,8 @@
}
}
},
- "400": {
- "description": "Invalid request",
+ "500": {
+ "description": "Internal error",
"content": {
"application/json": {
"schema": {
@@ -11660,44 +10637,16 @@
}
}
}
- },
- "401": {
- "description": "Current user is not logged in",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {}
- }
- }
- }
- }
- }
- }
}
}
}
},
- "/ocs/v2.php/apps/tables/api/2/{nodeCollection}/{nodeId}/rows": {
+ "/ocs/v2.php/apps/tables/api/2/{nodeCollection}/{nodeId}/share": {
"post": {
- "operationId": "rowocs-create-row",
- "summary": "[api v2] Create a new row in a table or a view",
+ "operationId": "shareocs-create-link-share",
+ "summary": "[api v2] Create a new link share of a table or view",
"tags": [
- "rowocs"
+ "shareocs"
],
"security": [
{
@@ -11708,28 +10657,17 @@
}
],
"requestBody": {
- "required": true,
+ "required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
- "required": [
- "data"
- ],
"properties": {
- "data": {
- "description": "An array containing the column identifiers and their values",
- "oneOf": [
- {
- "type": "string"
- },
- {
- "type": "object",
- "additionalProperties": {
- "type": "object"
- }
- }
- ]
+ "password": {
+ "type": "string",
+ "nullable": true,
+ "default": null,
+ "description": "(Optional) A password to protect the link share with"
}
}
}
@@ -11747,8 +10685,7 @@
"enum": [
"tables",
"views"
- ],
- "pattern": "^(tables|views)$"
+ ]
}
},
{
@@ -11774,7 +10711,7 @@
],
"responses": {
"200": {
- "description": "Row returned",
+ "description": "Link share created",
"content": {
"application/json": {
"schema": {
@@ -11794,7 +10731,7 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "$ref": "#/components/schemas/Row"
+ "$ref": "#/components/schemas/LinkShare"
}
}
}
diff --git a/src/App.vue b/src/App.vue
index 28da579124..09465b68a0 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -4,19 +4,21 @@
-->
-
+
-
+
+
-
+
diff --git a/src/modules/main/sections/Dashboard.vue b/src/modules/main/sections/Dashboard.vue
index a063ec2a6c..0fa9e3d936 100644
--- a/src/modules/main/sections/Dashboard.vue
+++ b/src/modules/main/sections/Dashboard.vue
@@ -129,6 +129,7 @@ import { NcActionButton, NcActions, NcAvatar, NcButton, NcLoadingIcon } from '@n
import PlaylistEditIcon from 'vue-material-design-icons/PlaylistEdit.vue'
import { emit } from '@nextcloud/event-bus'
import { showError, showSuccess } from '@nextcloud/dialogs'
+import { isPublicLinkShare } from '../../../shared/utils/shareUtils.js'
export default {
components: {
@@ -263,7 +264,8 @@ export default {
async loadShares() {
// load shares for table
this.loadingTableShares = true
- this.tableShares = await this.getSharesForTableFromBE(this.table.id)
+ const allTableShares = await this.getSharesForTableFromBE(this.table.id)
+ this.tableShares = allTableShares.filter(s => !isPublicLinkShare(s))
this.loadingTableShares = false
// load shares for all views
@@ -271,10 +273,10 @@ export default {
for (const index in this.table.views) {
const view = this.table.views[index]
if (view.hasShares) {
- this.viewShares[view.id] = await this.getSharesForViewFromBE(view.id)
+ const allViewShares = await this.getSharesForViewFromBE(view.id)
+ this.viewShares[view.id] = allViewShares.filter(s => !isPublicLinkShare(s))
}
}
- this.tableShares = await this.getSharesForTableFromBE(this.table.id)
this.loadingViewShares = false
},
},
diff --git a/src/modules/main/sections/PublicElement.vue b/src/modules/main/sections/PublicElement.vue
new file mode 100644
index 0000000000..9b797ea891
--- /dev/null
+++ b/src/modules/main/sections/PublicElement.vue
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('tables', 'Export as CSV') }}
+
+
+
+
+
+
+
+
+
diff --git a/src/modules/main/sections/PublicMainWrapper.vue b/src/modules/main/sections/PublicMainWrapper.vue
new file mode 100644
index 0000000000..cbc5bbd2a1
--- /dev/null
+++ b/src/modules/main/sections/PublicMainWrapper.vue
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
diff --git a/src/modules/navigation/partials/NavigationTableItem.vue b/src/modules/navigation/partials/NavigationTableItem.vue
index ade3c3909e..9d01cf4f93 100644
--- a/src/modules/navigation/partials/NavigationTableItem.vue
+++ b/src/modules/navigation/partials/NavigationTableItem.vue
@@ -3,15 +3,9 @@
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
-
+
{{ table.emoji }}
@@ -26,7 +20,8 @@
{{ table.rowsCount }}
-
+
@@ -34,8 +29,7 @@
-
@@ -44,9 +38,7 @@
-
+
@@ -54,16 +46,13 @@
-
{{ t('tables', 'Share') }}
-
{{ t('tables', 'Import') }}
@@ -73,15 +62,13 @@
- {{ t('tables','Export') }}
+ {{ t('tables', 'Export') }}
-
+
{{ t('tables', 'Integration') }}
@@ -89,8 +76,7 @@
-
{{ t('tables', 'Activity') }}
@@ -99,8 +85,7 @@
-
{{ t('tables', 'Add to favorites') }}
@@ -109,9 +94,7 @@
-
+
{{ t('tables', 'Remove from favorites') }}
@@ -120,8 +103,7 @@
+ :close-after-click="true" @click="toggleArchiveTable(true)">
{{ t('tables', 'Archive table') }}
@@ -129,8 +111,7 @@
-
{{ t('tables', 'Unarchive table') }}
@@ -139,9 +120,7 @@
-
+
{{ t('tables', 'Delete table') }}
@@ -149,9 +128,7 @@
@@ -329,9 +306,8 @@ export default {
}
diff --git a/src/modules/sidebar/mixins/shareAPI.js b/src/modules/sidebar/mixins/shareAPI.js
index e06a7f62be..00f39045ed 100644
--- a/src/modules/sidebar/mixins/shareAPI.js
+++ b/src/modules/sidebar/mixins/shareAPI.js
@@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import axios from '@nextcloud/axios'
-import { generateUrl } from '@nextcloud/router'
+import { generateUrl, generateOcsUrl } from '@nextcloud/router'
import '@nextcloud/dialogs/style.css'
import displayError from '../../../shared/utils/displayError.js'
import ShareTypes from '../../../shared/mixins/shareTypesMixin.js'
@@ -15,6 +15,10 @@ export default {
data() {
return {
tablesStore: useTablesStore(),
+ SHARE_TYPE_USER: 0,
+ SHARE_TYPE_GROUP: 1,
+ SHARE_TYPE_LINK: 3,
+ SHARE_TYPE_CIRCLE: 7,
}
},
@@ -78,6 +82,36 @@ export default {
return true
},
+ async createLinkShare(password = null) {
+ const nodeId = this.activeElement.id
+ const collection = this.isView ? 'views' : 'tables'
+
+ const data = {}
+ if (password) {
+ data.password = password
+ }
+
+ try {
+ await axios.post(generateOcsUrl(`/apps/tables/api/2/${collection}/${nodeId}/share`), data)
+ } catch (e) {
+ displayError(e, t('tables', 'Could not create public link.'))
+ return false
+ }
+
+ if (this.isView) {
+ await this.setViewHasShares({
+ viewId: this.activeElement.id,
+ hasShares: true,
+ })
+ } else {
+ await this.setTableHasShares({
+ tableId: this.isView ? this.activeElement.tableId : this.activeElement.id,
+ hasShares: true,
+ })
+ }
+ return true
+ },
+
async removeShareFromBE(shareId) {
try {
await axios.delete(generateUrl('/apps/tables/share/' + shareId))
@@ -95,12 +129,10 @@ export default {
},
isValidShareType(shareType) {
- if (shareType === this.SHARE_TYPES.SHARE_TYPE_CIRCLE && !this.isCirclesEnabled) {
- return false
- }
return [
this.SHARE_TYPES.SHARE_TYPE_USER,
this.SHARE_TYPES.SHARE_TYPE_GROUP,
+ this.SHARE_TYPES.SHARE_TYPE_LINK,
...(this.isCirclesEnabled ? [this.SHARE_TYPES.SHARE_TYPE_CIRCLE] : []),
].includes(shareType)
},
diff --git a/src/modules/sidebar/partials/SharingEntryLink.vue b/src/modules/sidebar/partials/SharingEntryLink.vue
new file mode 100644
index 0000000000..dfa30ad62d
--- /dev/null
+++ b/src/modules/sidebar/partials/SharingEntryLink.vue
@@ -0,0 +1,357 @@
+
+
+
+
+
+
+
+
+
+ {{ t('tables', 'Create public link') }}
+
+
+
+
+
+
+
+
+
+ {{ t('tables', 'Set password') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('tables', 'Create') }}
+
+
+ {{ t('tables', 'Cancel') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('tables', 'Share link') }}
+
+
+ {{ t('tables', 'View only') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('tables', 'Delete link') }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/modules/sidebar/partials/SharingLinkList.vue b/src/modules/sidebar/partials/SharingLinkList.vue
new file mode 100644
index 0000000000..b8ae5573f6
--- /dev/null
+++ b/src/modules/sidebar/partials/SharingLinkList.vue
@@ -0,0 +1,83 @@
+
+
+
+
{{ t('tables', 'Public links') }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/modules/sidebar/sections/SidebarSharing.vue b/src/modules/sidebar/sections/SidebarSharing.vue
index e7a4eb268e..45140e2f86 100644
--- a/src/modules/sidebar/sections/SidebarSharing.vue
+++ b/src/modules/sidebar/sections/SidebarSharing.vue
@@ -8,6 +8,11 @@
+
@@ -19,15 +24,18 @@ import shareAPI from '../mixins/shareAPI.js'
import ShareForm from '../partials/ShareForm.vue'
import ShareList from '../partials/ShareList.vue'
import ShareInternalLink from '../partials/ShareInternalLink.vue'
+import SharingLinkList from '../partials/SharingLinkList.vue'
import { getCurrentUser } from '@nextcloud/auth'
import { generateUrl } from '@nextcloud/router'
import permissionsMixin from '../../../shared/components/ncTable/mixins/permissionsMixin.js'
+import { isPublicLinkShare } from '../../../shared/utils/shareUtils.js'
export default {
components: {
ShareForm,
ShareList,
ShareInternalLink,
+ SharingLinkList,
},
mixins: [shareAPI, permissionsMixin],
@@ -37,6 +45,7 @@ export default {
// shared with
shares: [],
+ linkShares: [],
}
},
@@ -74,19 +83,32 @@ export default {
getCurrentUser,
async loadSharesFromBE() {
this.loading = true
- this.shares = await this.getSharedWithFromBE()
+ const allShares = await this.getSharedWithFromBE()
+
+ this.shares = allShares.filter(share => !isPublicLinkShare(share))
+ this.linkShares = allShares.filter(share => isPublicLinkShare(share))
+
this.loading = false
},
async removeShare(share) {
await this.removeShareFromBE(share.id)
await this.loadSharesFromBE()
// If no share is left, remove shared indication
- if (this.isView) {
- if (this.shares.find(share => ((share.nodeType === 'view' && share.nodeId === this.activeElement.id) || (share.nodeType === 'table' && share.nodeId === this.activeElement.tableId))) === undefined) {
+ const hasStandardShares = this.shares.some(share =>
+ (this.isView
+ ? (share.nodeType === 'view' && share.nodeId === this.activeElement.id)
+ : (share.nodeType === 'table' && share.nodeId === this.activeElement.id)),
+ )
+ const hasLinkShares = this.linkShares.some(share =>
+ (this.isView
+ ? (share.nodeType === 'view' && share.nodeId === this.activeElement.id)
+ : (share.nodeType === 'table' && share.nodeId === this.activeElement.id)),
+ )
+
+ if (!hasStandardShares && !hasLinkShares) {
+ if (this.isView) {
await this.setViewHasShares({ viewId: this.activeElement.id, hasShares: false })
- }
- } else {
- if (this.shares.find(share => (share.nodeType === 'table' && share.nodeId === this.activeElement.id)) === undefined) {
+ } else {
await this.setTableHasShares({ tableId: this.activeElement.id, hasShares: false })
}
}
@@ -101,6 +123,12 @@ export default {
await this.updateShareToBE(shareId, data)
await this.loadSharesFromBE()
},
+ async onCreateLinkShare(password) {
+ const success = await this.createLinkShare(password)
+ if (success) {
+ await this.loadSharesFromBE()
+ }
+ },
},
}
diff --git a/src/pages/PublicTableView.vue b/src/pages/PublicTableView.vue
new file mode 100644
index 0000000000..6d6e07316e
--- /dev/null
+++ b/src/pages/PublicTableView.vue
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
diff --git a/src/router.js b/src/router.js
index 45ce7bd4c7..170921feba 100644
--- a/src/router.js
+++ b/src/router.js
@@ -9,6 +9,7 @@ import MainViewWrapper from './pages/View.vue'
import MainDashboardWrapper from './pages/Table.vue'
import Startpage from './pages/Startpage.vue'
import Context from './pages/Context.vue'
+import PublicTableView from './pages/PublicTableView.vue'
Vue.use(Router)
@@ -60,5 +61,10 @@ export default new Router({
component: MainViewWrapper,
name: 'viewRow',
},
+ {
+ path: '/s/:token',
+ component: PublicTableView,
+ name: 'publicShare',
+ },
],
})
diff --git a/src/shared/components/ncTable/mixins/cellEditMixin.js b/src/shared/components/ncTable/mixins/cellEditMixin.js
index b34b445fe9..01380479c7 100644
--- a/src/shared/components/ncTable/mixins/cellEditMixin.js
+++ b/src/shared/components/ncTable/mixins/cellEditMixin.js
@@ -28,6 +28,10 @@ export default {
type: Boolean,
default: true,
},
+ canEdit: {
+ type: Boolean,
+ default: true,
+ },
},
data() {
@@ -42,6 +46,11 @@ export default {
...mapActions(useDataStore, ['updateRow']),
canEditCell() {
+ // Prevent editing if row editing is globally disabled
+ if (!this.canEdit) {
+ return false
+ }
+
// Prevent editing for meta columns
if (this.column.id < 0) {
return false
diff --git a/src/shared/components/ncTable/partials/TableRow.vue b/src/shared/components/ncTable/partials/TableRow.vue
index f654616137..1412f92b93 100644
--- a/src/shared/components/ncTable/partials/TableRow.vue
+++ b/src/shared/components/ncTable/partials/TableRow.vue
@@ -20,7 +20,8 @@
:row-id="row.id"
:value="getCellValue(col)"
:element-id="elementId"
- :is-view="isView" />
+ :is-view="isView"
+ :can-edit="config.canEditRows" />
diff --git a/src/shared/components/ncTable/sections/Options.vue b/src/shared/components/ncTable/sections/Options.vue
index 1e4ca0a513..8550c52468 100644
--- a/src/shared/components/ncTable/sections/Options.vue
+++ b/src/shared/components/ncTable/sections/Options.vue
@@ -4,34 +4,25 @@
-->
|