settins tests fix

This commit is contained in:
Viktor Scharf
2025-01-20 10:16:59 +01:00
parent 2d632b5e5b
commit 7a28e6f49d
5 changed files with 20 additions and 19 deletions

1
.gitignore vendored
View File

@@ -37,6 +37,7 @@ vendor-php
# API acceptance tests - auto-generated files
.php-cs-fixer.cache
suite-logs
# QA activity reports
tests/qa-activity-report/reports/

View File

@@ -15,18 +15,18 @@ As an example, user profile settings that can be changed in the Web UI must be p
The settings service persists the settings data via the `storage-system` service.
<!--- Note: The diagramm is outdate, leaving it here for a future rework
The diagram shows how the settings service integrates into oCIS:
The diagram shows how the settings service integrates into OpenCloud:
The diagram shows how the settings service integrates into oCIS:
The diagram shows how the settings service integrates into OpenCloud:
```mermaid
graph TD
ows ---|"listSettingsBundles(),<br>saveSettingsValue(value)"| os[ocis-settings]
ows ---|"listSettingsBundles(),<br>saveSettingsValue(value)"| os[opencloud-settings]
owc ---|"listSettingsValues()"| sdk[oC SDK]
sdk --- sdks{ocis-settings<br>available?}
sdk --- sdks{opencloud-settings<br>available?}
sdks ---|"yes"| os
sdks ---|"no"| defaults[Use set of<br>default values]
oa[oCIS services<br>e.g. ocis-accounts] ---|"saveSettingsBundle(bundle)"| os
oa[OpenCloud services<br>e.g. opencloud-accounts] ---|"saveSettingsBundle(bundle)"| os
```
-->
@@ -90,7 +90,7 @@ which is the source of the texts provided by the code.
The default language can be defined via the `OC_DEFAULT_LANGUAGE` environment variable. If this variable is not defined, English will be used as default. The value has the ISO 639-1 format ("de", "en", etc.) and is limited by the list supported languages. This setting can be used to set the default language for notification and invitation emails.
Important developer note: the list of supported languages is at the moment not easy defineable, as it is the minimum intersection of languages shown in the WebUI and languages defined in the ocis code for the use of notifications and userlog. Even more, not all languages where there are translations available on transifex, are available in the WebUI respectively for ocis notifications, and the translation rate for existing languages is partially not that high. You will see therefore quite often English default strings though a supported language may exist and was selected.
Important developer note: the list of supported languages is at the moment not easy defineable, as it is the minimum intersection of languages shown in the WebUI and languages defined in the OpenCloud code for the use of notifications and userlog. Even more, not all languages where there are translations available on transifex, are available in the WebUI respectively for OpenCloud notifications, and the translation rate for existing languages is partially not that high. You will see therefore quite often English default strings though a supported language may exist and was selected.
The `OC_DEFAULT_LANGUAGE` setting impacts the `notification` and `userlog` services and the WebUI. Note that translations must exist for all named components to be presented correctly.
@@ -104,7 +104,7 @@ The `OC_DEFAULT_LANGUAGE` setting impacts the `notification` and `userlog` servi
## Custom Roles
It is possible to replace the default ocis roles (`admin`, `user`) with custom roles that contain custom permissions. One can set `SETTINGS_BUNDLES_PATH` to the path of a `json` file containing the new roles.
It is possible to replace the default OpenCloud roles (`admin`, `user`) with custom roles that contain custom permissions. One can set `SETTINGS_BUNDLES_PATH` to the path of a `json` file containing the new roles.
Role Example:
```json
@@ -113,7 +113,7 @@ Role Example:
"id": "38071a68-456a-4553-846a-fa67bf5596cc", // ID of the role. Recommendation is to use a random uuidv4. But any unique string will do.
"name": "user-light", // Internal name of the role. This is used by the system to identify the role. Any string will do here, but it should be unique among the other roles.
"type": "TYPE_ROLE", // Always use `TYPE_ROLE`
"extension": "ocis-roles", // Always use `ocis-roles`
"extension": "opencloud-roles", // Always use `opencloud-roles`
"displayName": "User Light", // DisplayName of the role used in webui
"settings": [
], // Permissions attached to the role. See Details below.
@@ -128,7 +128,7 @@ To create custom roles:
* Copy the role example to a `json` file.
* Change `id`, `name`, and `displayName` to your liking.
* Copy the desired permissions from the `user-all-permissions` example below to the `settings` array of the role.
* Set the `SETTINGS_BUNDLE_PATH` envvar to the path of the json file and start ocis
* Set the `SETTINGS_BUNDLE_PATH` envvar to the path of the json file and start OpenCloud
Example File:
```json
@@ -137,7 +137,7 @@ Example File:
"id": "38071a68-456a-4553-846a-fa67bf5596cc",
"name": "user-1-permission",
"type": "TYPE_ROLE",
"extension": "ocis-roles",
"extension": "opencloud-roles",
"displayName": "User with one permission only",
"settings": [
{
@@ -162,7 +162,7 @@ Example File:
"id": "71881883-1768-46bd-a24d-a356a2afdf7f",
"name": "user-all-permissions",
"type": "TYPE_ROLE",
"extension": "ocis-roles",
"extension": "opencloud-roles",
"displayName": "User with all available permissions",
"settings": [
{

View File

@@ -71,7 +71,7 @@ func (s *defaultLanguageDecorator) ListValues(ctx context.Context, req *settings
func (s *defaultLanguageDecorator) withDefaultLanguageSetting(accountUUID string) *settingsmsg.ValueWithIdentifier {
return &settingsmsg.ValueWithIdentifier{
Identifier: &settingsmsg.Identifier{
Extension: "ocis-accounts",
Extension: "opencloud-accounts",
Bundle: "profile",
Setting: "language",
},

View File

@@ -69,7 +69,7 @@ func ServiceAccountBundle() *settingsmsg.Bundle {
Id: BundleUUIDServiceAccount,
Name: "service-account",
Type: settingsmsg.Bundle_TYPE_ROLE,
Extension: "ocis-roles",
Extension: "opencloud-roles",
DisplayName: "Service Account",
Resource: &settingsmsg.Resource{
Type: settingsmsg.Resource_TYPE_SYSTEM,
@@ -104,7 +104,7 @@ func generateBundleAdminRole() *settingsmsg.Bundle {
Id: BundleUUIDRoleAdmin,
Name: "admin",
Type: settingsmsg.Bundle_TYPE_ROLE,
Extension: "ocis-roles",
Extension: "opencloud-roles",
DisplayName: "Admin",
Resource: &settingsmsg.Resource{
Type: settingsmsg.Resource_TYPE_SYSTEM,
@@ -150,7 +150,7 @@ func generateBundleSpaceAdminRole() *settingsmsg.Bundle {
Id: BundleUUIDRoleSpaceAdmin,
Name: "spaceadmin",
Type: settingsmsg.Bundle_TYPE_ROLE,
Extension: "ocis-roles",
Extension: "opencloud-roles",
DisplayName: "Space Admin",
Resource: &settingsmsg.Resource{
Type: settingsmsg.Resource_TYPE_SYSTEM,
@@ -190,7 +190,7 @@ func generateBundleUserRole() *settingsmsg.Bundle {
Id: BundleUUIDRoleUser,
Name: "user",
Type: settingsmsg.Bundle_TYPE_ROLE,
Extension: "ocis-roles",
Extension: "opencloud-roles",
DisplayName: "User",
Resource: &settingsmsg.Resource{
Type: settingsmsg.Resource_TYPE_SYSTEM,
@@ -224,7 +224,7 @@ func generateBundleUserLightRole() *settingsmsg.Bundle {
Id: BundleUUIDRoleUserLight,
Name: "user-light",
Type: settingsmsg.Bundle_TYPE_ROLE,
Extension: "ocis-roles",
Extension: "opencloud-roles",
DisplayName: "User Light",
Resource: &settingsmsg.Resource{
Type: settingsmsg.Resource_TYPE_SYSTEM,
@@ -242,7 +242,7 @@ func generateBundleProfileRequest() *settingsmsg.Bundle {
return &settingsmsg.Bundle{
Id: BundleUUIDProfile,
Name: "profile",
Extension: "ocis-accounts",
Extension: "opencloud-accounts",
Type: settingsmsg.Bundle_TYPE_DEFAULT,
Resource: &settingsmsg.Resource{
Type: settingsmsg.Resource_TYPE_SYSTEM,

View File

@@ -101,7 +101,7 @@ class SharingHelper {
string $xRequestId = '',
?string $shareWith = null,
?bool $publicUpload = false,
string $sharePassword = null,
?string $sharePassword = null,
$permissions = null,
?string $linkName = null,
?string $expireDate = null,