diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/components/FilesListVirtual.vue | 7 | ||||
-rw-r--r-- | apps/files_versions/src/components/Version.vue | 12 | ||||
-rw-r--r-- | apps/provisioning_api/appinfo/routes.php | 1 | ||||
-rw-r--r-- | apps/provisioning_api/lib/Controller/UsersController.php | 15 | ||||
-rw-r--r-- | apps/provisioning_api/openapi-full.json | 72 | ||||
-rw-r--r-- | apps/provisioning_api/openapi.json | 72 | ||||
-rw-r--r-- | apps/provisioning_api/tests/Controller/UsersControllerTest.php | 7 | ||||
-rw-r--r-- | apps/theming/lib/Capabilities.php | 2 | ||||
-rw-r--r-- | apps/theming/openapi.json | 4 | ||||
-rw-r--r-- | apps/theming/tests/CapabilitiesTest.php | 7 |
10 files changed, 196 insertions, 3 deletions
diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue index 8fdc87b154c..feb4b61c53e 100644 --- a/apps/files/src/components/FilesListVirtual.vue +++ b/apps/files/src/components/FilesListVirtual.vue @@ -21,7 +21,9 @@ </template> <template v-if="!isNoneSelected" #header-overlay> - <span class="files-list__selected">{{ t('files', '{count} selected', { count: selectedNodes.length }) }}</span> + <span class="files-list__selected"> + {{ n('files', '{count} selected', '{count} selected', selectedNodes.length, { count: selectedNodes.length }) }} + </span> <FilesListTableHeaderActions :current-view="currentView" :selected-nodes="selectedNodes" /> </template> @@ -68,7 +70,7 @@ import type { Location } from 'vue-router' import { Folder, Permission, View, getFileActions, FileType } from '@nextcloud/files' import { showError } from '@nextcloud/dialogs' import { subscribe, unsubscribe } from '@nextcloud/event-bus' -import { translate as t } from '@nextcloud/l10n' +import { n, t } from '@nextcloud/l10n' import { useHotKey } from '@nextcloud/vue/composables/useHotKey' import { defineComponent } from 'vue' @@ -140,6 +142,7 @@ export default defineComponent({ selectionStore, userConfigStore, + n, t, } }, diff --git a/apps/files_versions/src/components/Version.vue b/apps/files_versions/src/components/Version.vue index 8ea16e215c6..275f1d0ddbf 100644 --- a/apps/files_versions/src/components/Version.vue +++ b/apps/files_versions/src/components/Version.vue @@ -45,7 +45,10 @@ disable-menu disable-tooltip :show-user-status="false" /> - <div>{{ versionAuthor }}</div> + <div class="version__info__author_name" + :title="versionAuthor"> + {{ versionAuthor }} + </div> </div> </div> </template> @@ -349,12 +352,19 @@ export default defineComponent({ gap: 0.5rem; color: var(--color-main-text); font-weight: 500; + overflow: hidden; &__label { font-weight: 700; // Fix overflow on narrow screens overflow: hidden; text-overflow: ellipsis; + min-width: 110px; + } + + &__author_name { + overflow: hidden; + text-overflow: ellipsis; } &__date { diff --git a/apps/provisioning_api/appinfo/routes.php b/apps/provisioning_api/appinfo/routes.php index 66d1fb699a9..df4f806fa08 100644 --- a/apps/provisioning_api/appinfo/routes.php +++ b/apps/provisioning_api/appinfo/routes.php @@ -35,6 +35,7 @@ return [ ['root' => '/cloud', 'name' => 'Users#getCurrentUser', 'url' => '/user', 'verb' => 'GET'], ['root' => '/cloud', 'name' => 'Users#getEditableFields', 'url' => '/user/fields', 'verb' => 'GET'], ['root' => '/cloud', 'name' => 'Users#getEditableFieldsForUser', 'url' => '/user/fields/{userId}', 'verb' => 'GET'], + ['root' => '/cloud', 'name' => 'Users#getEnabledApps', 'url' => '/user/apps', 'verb' => 'GET'], ['root' => '/cloud', 'name' => 'Users#editUser', 'url' => '/users/{userId}', 'verb' => 'PUT'], ['root' => '/cloud', 'name' => 'Users#editUserMultiValue', 'url' => '/users/{userId}/{collectionName}', 'verb' => 'PUT', 'requirements' => ['collectionName' => '^(?!enable$|disable$)[a-zA-Z0-9_]*$']], ['root' => '/cloud', 'name' => 'Users#wipeUserDevices', 'url' => '/users/{userId}/wipe', 'verb' => 'POST'], diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 4b3db45f518..3dfa8f1fe5a 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -21,6 +21,7 @@ use OCA\Settings\Settings\Admin\Users; use OCP\Accounts\IAccountManager; use OCP\Accounts\IAccountProperty; use OCP\Accounts\PropertyDoesNotExistException; +use OCP\App\IAppManager; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\AuthorizedAdminSetting; use OCP\AppFramework\Http\Attribute\NoAdminRequired; @@ -79,6 +80,7 @@ class UsersController extends AUserDataOCSController { private KnownUserService $knownUserService, private IEventDispatcher $eventDispatcher, private IPhoneNumberUtil $phoneNumberUtil, + private IAppManager $appManager, ) { parent::__construct( $appName, @@ -710,6 +712,19 @@ class UsersController extends AUserDataOCSController { } /** + * Get a list of enabled apps for the current user + * + * @return DataResponse<Http::STATUS_OK, array{apps: list<string>}, array{}> + * + * 200: Enabled apps returned + */ + #[NoAdminRequired] + public function getEnabledApps(): DataResponse { + $currentLoggedInUser = $this->userSession->getUser(); + return new DataResponse(['apps' => $this->appManager->getEnabledAppsForUser($currentLoggedInUser)]); + } + + /** * @NoSubAdminRequired * * Get a list of fields that are editable for a user diff --git a/apps/provisioning_api/openapi-full.json b/apps/provisioning_api/openapi-full.json index 734c588be6b..cde7eeaa557 100644 --- a/apps/provisioning_api/openapi-full.json +++ b/apps/provisioning_api/openapi-full.json @@ -3573,6 +3573,78 @@ } } }, + "/ocs/v2.php/cloud/user/apps": { + "get": { + "operationId": "users-get-enabled-apps", + "summary": "Get a list of enabled apps for the current user", + "tags": [ + "users" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "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": "Enabled apps 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", + "required": [ + "apps" + ], + "properties": { + "apps": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, "/ocs/v2.php/cloud/users/{userId}/{collectionName}": { "put": { "operationId": "users-edit-user-multi-value", diff --git a/apps/provisioning_api/openapi.json b/apps/provisioning_api/openapi.json index d2fd2378488..29272f34956 100644 --- a/apps/provisioning_api/openapi.json +++ b/apps/provisioning_api/openapi.json @@ -2003,6 +2003,78 @@ } } }, + "/ocs/v2.php/cloud/user/apps": { + "get": { + "operationId": "users-get-enabled-apps", + "summary": "Get a list of enabled apps for the current user", + "tags": [ + "users" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "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": "Enabled apps 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", + "required": [ + "apps" + ], + "properties": { + "apps": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + }, "/ocs/v2.php/cloud/users/{userId}/{collectionName}": { "put": { "operationId": "users-edit-user-multi-value", diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php index 80d6d0f6152..3f8c1566b5d 100644 --- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php +++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php @@ -20,6 +20,7 @@ use OCP\Accounts\IAccount; use OCP\Accounts\IAccountManager; use OCP\Accounts\IAccountProperty; use OCP\Accounts\IAccountPropertyCollection; +use OCP\App\IAppManager; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCS\OCSException; use OCP\EventDispatcher\IEventDispatcher; @@ -64,6 +65,7 @@ class UsersControllerTest extends TestCase { private IEventDispatcher&MockObject $eventDispatcher; private IRootFolder $rootFolder; private IPhoneNumberUtil $phoneNumberUtil; + private IAppManager $appManager; protected function setUp(): void { parent::setUp(); @@ -84,6 +86,7 @@ class UsersControllerTest extends TestCase { $this->knownUserService = $this->createMock(KnownUserService::class); $this->eventDispatcher = $this->createMock(IEventDispatcher::class); $this->phoneNumberUtil = new PhoneNumberUtil(); + $this->appManager = $this->createMock(IAppManager::class); $this->rootFolder = $this->createMock(IRootFolder::class); $l10n = $this->createMock(IL10N::class); @@ -110,6 +113,7 @@ class UsersControllerTest extends TestCase { $this->knownUserService, $this->eventDispatcher, $this->phoneNumberUtil, + $this->appManager, ]) ->onlyMethods(['fillStorageInfo']) ->getMock(); @@ -501,6 +505,7 @@ class UsersControllerTest extends TestCase { $this->knownUserService, $this->eventDispatcher, $this->phoneNumberUtil, + $this->appManager, ]) ->onlyMethods(['editUser']) ->getMock(); @@ -3796,6 +3801,7 @@ class UsersControllerTest extends TestCase { $this->knownUserService, $this->eventDispatcher, $this->phoneNumberUtil, + $this->appManager, ]) ->onlyMethods(['getUserData']) ->getMock(); @@ -3887,6 +3893,7 @@ class UsersControllerTest extends TestCase { $this->knownUserService, $this->eventDispatcher, $this->phoneNumberUtil, + $this->appManager, ]) ->onlyMethods(['getUserData']) ->getMock(); diff --git a/apps/theming/lib/Capabilities.php b/apps/theming/lib/Capabilities.php index b6145298d95..c9bc98036f5 100644 --- a/apps/theming/lib/Capabilities.php +++ b/apps/theming/lib/Capabilities.php @@ -41,6 +41,7 @@ class Capabilities implements IPublicCapability { * @return array{ * theming: array{ * name: string, + * productName: string, * url: string, * slogan: string, * color: string, @@ -94,6 +95,7 @@ class Capabilities implements IPublicCapability { return [ 'theming' => [ 'name' => $this->theming->getName(), + 'productName' => $this->theming->getProductName(), 'url' => $this->theming->getBaseUrl(), 'slogan' => $this->theming->getSlogan(), 'color' => $color, diff --git a/apps/theming/openapi.json b/apps/theming/openapi.json index 26f5e7b8120..66ee05413b3 100644 --- a/apps/theming/openapi.json +++ b/apps/theming/openapi.json @@ -79,6 +79,7 @@ "type": "object", "required": [ "name", + "productName", "url", "slogan", "color", @@ -98,6 +99,9 @@ "name": { "type": "string" }, + "productName": { + "type": "string" + }, "url": { "type": "string" }, diff --git a/apps/theming/tests/CapabilitiesTest.php b/apps/theming/tests/CapabilitiesTest.php index f5230d4d6d0..16cc6d51ba9 100644 --- a/apps/theming/tests/CapabilitiesTest.php +++ b/apps/theming/tests/CapabilitiesTest.php @@ -54,6 +54,7 @@ class CapabilitiesTest extends TestCase { return [ ['name', 'url', 'slogan', '#FFFFFF', '#000000', 'logo', 'background', '#fff', '#000', 'http://absolute/', true, [ 'name' => 'name', + 'productName' => 'name', 'url' => 'url', 'slogan' => 'slogan', 'color' => '#FFFFFF', @@ -71,6 +72,7 @@ class CapabilitiesTest extends TestCase { ]], ['name1', 'url2', 'slogan3', '#01e4a0', '#ffffff', 'logo5', 'background6', '#fff', '#000', 'http://localhost/', false, [ 'name' => 'name1', + 'productName' => 'name1', 'url' => 'url2', 'slogan' => 'slogan3', 'color' => '#01e4a0', @@ -88,6 +90,7 @@ class CapabilitiesTest extends TestCase { ]], ['name1', 'url2', 'slogan3', '#000000', '#ffffff', 'logo5', 'backgroundColor', '#000000', '#ffffff', 'http://localhost/', true, [ 'name' => 'name1', + 'productName' => 'name1', 'url' => 'url2', 'slogan' => 'slogan3', 'color' => '#000000', @@ -105,6 +108,7 @@ class CapabilitiesTest extends TestCase { ]], ['name1', 'url2', 'slogan3', '#000000', '#ffffff', 'logo5', 'backgroundColor', '#000000', '#ffffff', 'http://localhost/', false, [ 'name' => 'name1', + 'productName' => 'name1', 'url' => 'url2', 'slogan' => 'slogan3', 'color' => '#000000', @@ -135,6 +139,9 @@ class CapabilitiesTest extends TestCase { ->method('getName') ->willReturn($name); $this->theming->expects($this->once()) + ->method('getProductName') + ->willReturn($name); + $this->theming->expects($this->once()) ->method('getBaseUrl') ->willReturn($url); $this->theming->expects($this->once()) |