Group role (#2993)

* feat: app/dataset support group (#2898)

* pref: member-group (#2862)

* feat: group list ordered by updateTime

* fix: transfer ownership of group when deleting member

* fix: i18n fix

* feat: can not set member as admin/owner when user is not active

* fix: GroupInfoModal hover input do not change color

* fix(fe): searchinput do not scroll

* feat: app collaborator with group, remove default permission

* feat: dataset collaborator with group, remove default permission

* chore(test): pref mock

* chore: remove useless code

* chore: adjust

* fix: add self as collaborator when creating folder

* fix(fe): folder manage menu do not show when user has write permission
only

* fix: dataset folder create

* feat: Add code comment

* Pref: app move (#2952)

* perf: app schema

* doc

---------

Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
This commit is contained in:
Archer
2024-10-25 19:39:11 +08:00
committed by GitHub
parent 74d58d562b
commit f89452acdd
60 changed files with 1142 additions and 1094 deletions

View File

@@ -1,12 +1,12 @@
import { getTestRequest } from '@/test/utils';
import '../../__mocks__/base';
import { getTestRequest } from '@/test/utils';
import handler, { OutLinkUpdateBody, OutLinkUpdateQuery } from './update';
import { root } from '../../__mocks__/db/init';
import { MongoOutLink } from '@fastgpt/service/support/outLink/schema';
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
import { root } from '../../__mocks__/db/init';
test('Update Outlink', async () => {
const outlink = await MongoOutLink.create({
beforeAll(async () => {
await MongoOutLink.create({
shareId: 'aaa',
appId: root.appId,
tmbId: root.tmbId,
@@ -14,8 +14,13 @@ test('Update Outlink', async () => {
type: 'share',
name: 'aaa'
});
});
await outlink.save();
test('Update Outlink', async () => {
const outlink = await MongoOutLink.findOne({ name: 'aaa' }).lean();
if (!outlink) {
throw new Error('Outlink not found');
}
const res = (await handler(
...getTestRequest<OutLinkUpdateQuery, OutLinkUpdateBody>({
@@ -27,6 +32,7 @@ test('Update Outlink', async () => {
})
)) as any;
console.log(res);
expect(res.code).toBe(200);
const link = await MongoOutLink.findById(outlink._id).lean();