Skip to content

Commit

Permalink
chore: backport fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Feb 12, 2025
1 parent 5ea3661 commit c924a44
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
5 changes: 2 additions & 3 deletions lib/Folder/FolderManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@
use OCA\Circles\CirclesQueryHelper;
use OCA\Circles\Exceptions\CircleNotFoundException;
use OCA\Circles\Model\Circle;
use OCA\Circles\Model\Member;
use OCA\Circles\Model\Probes\CircleProbe;
use OCA\GroupFolders\ACL\UserMapping\IUserMapping;
use OCA\GroupFolders\ACL\UserMapping\IUserMappingManager;
use OCA\GroupFolders\ACL\UserMapping\UserMapping;
use OCA\GroupFolders\Mount\GroupMountPoint;
use OCA\GroupFolders\ResponseDefinitions;
use OCP\AutoloadNotAllowedException;
use OCP\Constants;
use OCP\DB\Exception;
Expand All @@ -42,6 +40,7 @@
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\IMimeTypeLoader;
use OCP\Files\IRootFolder;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\IGroupManager;
use OCP\IUser;
Expand Down Expand Up @@ -436,7 +435,7 @@ private function getGroups(int $id): array {

/**
* @throws Exception
* @return list<GroupFoldersCircle>
* @return list<array{displayname: string, sid: string}>
*/
private function getCircles(int $id): array {
$circles = $this->getAllApplicable()[$id] ?? [];
Expand Down
9 changes: 7 additions & 2 deletions src/settings/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export interface OCSGroup {
displayname: string;
}

export interface OSCCircle {
sid: string;
displayname: string;
}

export interface ManageRuleProps {
type: string;
id: string;
Expand Down Expand Up @@ -141,9 +146,9 @@ export class Api {
async aclMappingSearch(folderId: number, search: string): Promise<{
groups: ManageRuleProps[],
users: ManageRuleProps[],
circles: AclManage[],
circles: ManageRuleProps[],
}> {
const response = await axios.get<OCSResponse<{groups: OCSGroup[], users: OCSUser[], circles: Circle[]}>>(this.getUrl(`folders/${folderId}/search`), { params: { search } })
const response = await axios.get<OCSResponse<{groups: OCSGroup[], users: OCSUser[], circles: OSCCircle[]}>>(this.getUrl(`folders/${folderId}/search`), { params: { search } })
return {
groups: Object.values(response.data.ocs.data.groups).map((item) => {
return {
Expand Down
6 changes: 3 additions & 3 deletions src/settings/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import { Component, FormEvent } from 'react'

import { Api, Circle, Folder, Group, OCSGroup, OCSUser } from './Api'
import {Api, Circle, Folder, Group, ManageRuleProps, OCSGroup, OCSUser} from './Api'
import { FolderGroups } from './FolderGroups'
import { QuotaSelect } from './QuotaSelect'
import './App.scss'
Expand Down Expand Up @@ -371,7 +371,7 @@ export class App extends Component<{}, AppState> implements OC.Plugin<OC.Search.
interface ManageAclSelectProps {
folder: Folder;
onChange: (type: string, id: string, manageAcl: boolean) => void;
onSearch: (name: string) => Thenable<{ groups: OCSGroup[]; users: OCSUser[]; circles: AclManage[] }>;
onSearch: (name: string) => Thenable<{ groups: ManageRuleProps[]; users: ManageRuleProps[]; circles: ManageRuleProps[] }>;
}

/**
Expand All @@ -390,7 +390,7 @@ function ManageAclSelect({ onChange, onSearch, folder }: ManageAclSelectProps) {
})
}

const typeLabel = (item: AclManage) => {
const typeLabel = (item: ManageRuleProps) => {
switch (item.type) {
case "circle":
return t('groupfolders', 'Team');
Expand Down
1 change: 1 addition & 0 deletions tests/Folder/FolderManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use OCP\Constants;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\IMimeTypeLoader;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\IGroupManager;
use OCP\IUser;
Expand Down

0 comments on commit c924a44

Please sign in to comment.