mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-25 05:49:04 +00:00
feat(settings): add team appearance setting to hide agent features (#411)
* feat(settings): add team appearance setting to hide agent features Add an Appearance subpage under Team Settings allowing team owners to toggle appearance.hideAgent for the team. Return appearance.hideAgent in the user-metadata API, and conditionally hide the AGENTS.md button, agent chatbot sidebar, and chatbot trigger button in the WebUI. * refactor(settings): add strongly typed TeamSettingsResponse to remove explicit any Introduce TeamSettingsResponse and TeamAppearanceSettings in @shumai/dtos, type TeamService.getSettings and updateSettings, and eliminate the explicit any cast in AppearanceSettings.tsx.
This commit is contained in:
@@ -260,6 +260,21 @@ describe('team api', () => {
|
||||
expect(mockUpdateSettings).toHaveBeenCalledWith('t1', 'transcode.hardwareAcceleration', 'auto')
|
||||
})
|
||||
|
||||
it('PATCH /teams/:teamId/settings updates appearance.hideAgent', async () => {
|
||||
mockUpdateSettings.mockResolvedValue({ appearance: { hideAgent: true } })
|
||||
|
||||
const res = await app.request('/teams/t1/settings', {
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ key: 'appearance.hideAgent', value: true }),
|
||||
})
|
||||
|
||||
expect(res.status).toBe(200)
|
||||
const data = await res.json()
|
||||
expect(data.appearance.hideAgent).toBe(true)
|
||||
expect(mockUpdateSettings).toHaveBeenCalledWith('t1', 'appearance.hideAgent', true)
|
||||
})
|
||||
|
||||
it('GET /teams/:teamId/user-metadata returns all metadata for the user in the team', async () => {
|
||||
mockListUserMetadata.mockResolvedValue([
|
||||
{ key: 'key1', value: 'value1' },
|
||||
|
||||
Reference in New Issue
Block a user