1
0
Fork 0

Compare commits

...

4 Commits

Author SHA1 Message Date
Daniel Herrmann 4b72a28f04 tests: split test to check public team discovery in two runs 2024-03-10 14:03:33 +01:00
Daniel Herrmann 25f0c0480c fix: add more details to pubic team flag in UI 2024-03-10 13:59:46 +01:00
Daniel Herrmann 76a7f1ae96 remove console.log 2024-03-10 13:56:55 +01:00
Daniel Herrmann 7114847807 fix(config): fix whitespace in comment for enablepublicteams 2024-03-10 13:17:23 +01:00
4 changed files with 14 additions and 8 deletions

View File

@ -63,7 +63,7 @@ service:
# Allow using a custom logo via external URL.
customlogourl: ''
# Enables the public team feature. If enabled, it is possible to configure teams to be public, which makes them
# discoverable when sharing a project, therefore not only showing teams the user is member of.
# discoverable when sharing a project, therefore not only showing teams the user is member of.
enablepublicteams: false
sentry:

View File

@ -922,7 +922,7 @@
"admin": "Admin",
"member": "Member",
"isPublic": "Visibility",
"isPublicDescription": "Make team publicly discoverable"
"isPublicDescription": "Make the team publicly discoverable. When enabled, anyone can share projects with this team even when not being a direct member."
}
},
"keyboardShortcuts": {

View File

@ -329,8 +329,6 @@ async function save() {
}
showErrorTeamnameRequired.value = false
console.log('team.value', team.value)
team.value = await teamService.value.update(team.value)
success({message: t('team.edit.success')})
}

View File

@ -149,7 +149,7 @@ func TestTeam_ReadAll(t *testing.T) {
assert.Len(t, ts, 1)
assert.Equal(t, int64(2), ts[0].ID)
})
t.Run("public", func(t *testing.T) {
t.Run("public discovery disabled", func(t *testing.T) {
s := db.NewSession()
defer s.Close()
@ -173,16 +173,24 @@ func TestTeam_ReadAll(t *testing.T) {
assert.Equal(t, reflect.Slice, reflect.TypeOf(teams).Kind())
ts = teams.([]*Team)
assert.Len(t, ts, 5)
})
t.Run("public discovery enabled", func(t *testing.T) {
s := db.NewSession()
defer s.Close()
team := &Team{}
// Enable ServiceEnablePublicTeams feature
config.ServiceEnablePublicTeams.Set(true)
// Fetch without public flag should still be the same
// Fetch without public flag should be the same as before
team.IncludePublic = false
teams, _, _, err = team.ReadAll(s, doer, "", 1, 50)
teams, _, _, err := team.ReadAll(s, doer, "", 1, 50)
require.NoError(t, err)
assert.Equal(t, reflect.Slice, reflect.TypeOf(teams).Kind())
ts = teams.([]*Team)
ts := teams.([]*Team)
assert.Len(t, ts, 5)
// Fetch with public flag should return more teams