Skip to content

Commit

Permalink
set default english if no configured
Browse files Browse the repository at this point in the history
  • Loading branch information
ScharfViktor committed May 9, 2023
1 parent 2febdb9 commit 2e60ec7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
7 changes: 4 additions & 3 deletions deployments/examples/ocis_traefik/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
restart: always

ocis:
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
image: owncloud/ocis:3.0.0-rc.3
networks:
ocis-net:
entrypoint:
Expand All @@ -63,17 +63,18 @@ services:
# INSECURE: needed if oCIS / Traefik is using self generated certificates
OCIS_INSECURE: "${INSECURE:-false}"
# basic auth (not recommended, but needed for eg. WebDav clients that do not support OpenID Connect)
PROXY_ENABLE_BASIC_AUTH: "${PROXY_ENABLE_BASIC_AUTH:-false}"
PROXY_ENABLE_BASIC_AUTH: "true"
# admin user password
IDM_ADMIN_PASSWORD: "${ADMIN_PASSWORD:-admin}" # this overrides the admin password from the configuration file
# demo users
IDM_CREATE_DEMO_USERS: "${DEMO_USERS:-false}"
IDM_CREATE_DEMO_USERS: "true"
# email server (in this case inbucket acts as mail catcher)
NOTIFICATIONS_SMTP_HOST: inbucket
NOTIFICATIONS_SMTP_PORT: 2500
NOTIFICATIONS_SMTP_SENDER: oCIS notifications <notifications@${OCIS_DOMAIN:-ocis.owncloud.test}>
NOTIFICATIONS_SMTP_USERNAME: notifications@${OCIS_DOMAIN:-ocis.owncloud.test}
NOTIFICATIONS_SMTP_INSECURE: "true" # the mail catcher uses self signed certificates
OCIS_DECOMPOSEDFS_METADATA_BACKEND: "messagepack"
volumes:
- ocis-config:/etc/ocis
- ocis-data:/var/lib/ocis
Expand Down
30 changes: 9 additions & 21 deletions tests/acceptance/features/bootstrap/SettingsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,38 +322,26 @@ public function sendRequestGetSettingsValuesList(string $user): void {

/**
* @param string $user
* @param string $valueName
*
* @return array
* @return string
*
* @throws GuzzleException
* @throws Exception
*/
public function getSettingsValues(string $user, string $valueName): array {
public function getSettingLanguageValue(string $user): string {
$this->sendRequestGetSettingsValuesList($user);
$body = json_decode((string)$this->featureContext->getResponse()->getBody(), true, 512, JSON_THROW_ON_ERROR);

// if no language is set, the request body is empty return English as the default language
if (empty($body)) {
return "en";
}
foreach ($body["values"] as $value) {
if ($value["identifier"]["setting"] === $valueName) {
return $value["value"];
if ($value["identifier"]["setting"] === "language") {
return $value["value"]["listValue"]["values"][0]["stringValue"];
break;
}
}
return [];
}

/**
* @param string $user
*
* @return string
*
* @throws GuzzleException
* @throws Exception
*/
public function getSettingLanguageValue(string $user): string {
$languageValue = $this->getSettingsValues($user, "language");
Assert::assertNotEmpty($languageValue, "settings values are empty");

return $languageValue["listValue"]["values"][0]["stringValue"];
}

/**
Expand Down

0 comments on commit 2e60ec7

Please sign in to comment.