feat(teams): add public flags to teams to allow easier sharing with other teams #2179

Merged
konrad merged 16 commits from waza-ari/vikunja:2173-teams-public-flag into main 2024-03-10 14:04:35 +00:00
Contributor

Implements #2173

Implements #2173
waza-ari requested review from konrad 2024-03-09 20:31:24 +00:00
waza-ari force-pushed 2173-teams-public-flag from 1dfaeaa413 to 93672cae09 2024-03-09 20:31:36 +00:00 Compare
waza-ari changed title from 2173-teams-public-flag to feat(teams): add public flags to teams to allow easier sharing with other teams 2024-03-09 20:35:20 +00:00
waza-ari added 1 commit 2024-03-09 20:52:31 +00:00
fix: default value for migration should be boolean
Some checks failed
continuous-integration/drone/pr Build is failing
1b25245a2d
waza-ari added 1 commit 2024-03-09 21:10:35 +00:00
fix my stupidity and hope that commits will be squashed during pr...
All checks were successful
continuous-integration/drone/pr Build is passing
5975bfd501
Member

Hi waza-ari!

Thank you for creating a PR!

I've deployed the frontend changes of this PR on a preview environment under this URL: https://2179-2173-teams-public-flag--vikunja-frontend-preview.netlify.app

You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somewhere. The easiest to use is https://try.vikunja.io/.

This preview does not contain any changes made to the api, only the frontend.

Have a nice day!

Beep boop, I'm a bot.

Hi waza-ari! Thank you for creating a PR! I've deployed the frontend changes of this PR on a preview environment under this URL: https://2179-2173-teams-public-flag--vikunja-frontend-preview.netlify.app You can use this url to view the changes live and test them out. You will need to manually connect this to an api running somewhere. The easiest to use is https://try.vikunja.io/. This preview does not contain any changes made to the api, only the frontend. Have a nice day! > Beep boop, I'm a bot.
waza-ari added 1 commit 2024-03-09 21:39:07 +00:00
test: add test to compare getting teams with and without public team feature flag enabled
All checks were successful
continuous-integration/drone/pr Build is passing
8cefe76af5
Author
Contributor

Question: right now (even before this PR), empty groups (no team members) are not returned, as INNER JOIN is used and therefore those are filtered out. Now I'm struggling to think about any scenario where this would be possible, as regular teams cannot be left when there's only a single team member is left and OIDC teams should be auto deleted. So its probably just an issue that could happen with bogus fixture data, just want to confirm that's not an issue?

Question: right now (even before this PR), empty groups (no team members) are not returned, as `INNER JOIN` is used and therefore those are filtered out. Now I'm struggling to think about any scenario where this would be possible, as regular teams cannot be left when there's only a single team member is left and OIDC teams should be auto deleted. So its probably just an issue that could happen with bogus fixture data, just want to confirm that's not an issue?
konrad reviewed 2024-03-10 11:51:59 +00:00
@ -63,2 +63,4 @@
# 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.
Owner

Can you fix the indentation here? That should also fix the generated description in the markdown.

Can you fix the indentation here? That should also fix the generated description in the markdown.
waza-ari marked this conversation as resolved
@ -364,0 +368,4 @@
results = await searchService.getAll({}, {s: query, includePublic: true})
} else {
results = await searchService.getAll({}, {s: query})
}
Owner

Nitpick, but please refactor to something like this:

const includePublic = props.shareType === 'team' && configStore.publicTeamsEnabled
const results = await searchService.getAll({}, {s: query, includePublic})
Nitpick, but please refactor to something like this: ```js const includePublic = props.shareType === 'team' && configStore.publicTeamsEnabled const results = await searchService.getAll({}, {s: query, includePublic}) ```
Author
Contributor

I was thinking about that as well, but the entire point of having the abstract searchService is that it can be used both for searching teams and users. While the team search service understands the includePublic parameter, the user search service doesn't.

I was thinking about that as well, but the entire point of having the abstract `searchService` is that it can be used both for searching teams and users. While the team search service understands the `includePublic` parameter, the user search service doesn't.
Owner

Gotcha, that makes sense. I stumbled upon this because I forgot the service can be different things.

Gotcha, that makes sense. I stumbled upon this because I forgot the service can be different things.
konrad marked this conversation as resolved
@ -923,1 +923,3 @@
"member": "Member"
"member": "Member",
"isPublic": "Visibility",
"isPublicDescription": "Make team publicly discoverable"
Owner

We should describe what this implies.

We should describe what this implies.
waza-ari marked this conversation as resolved
@ -305,6 +329,8 @@ async function save() {
}
showErrorTeamnameRequired.value = false
console.log('team.value', team.value)
Owner

Please remove the console.log

Please remove the console.log
waza-ari marked this conversation as resolved
@ -126,6 +149,50 @@ 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) {
Owner

Please split this up in different test cases (with t.Run)

Please split this up in different test cases (with `t.Run`)
waza-ari marked this conversation as resolved
Owner

Question: right now (even before this PR), empty groups (no team members) are not returned, as INNER JOIN is used and therefore those are filtered out. Now I'm struggling to think about any scenario where this would be possible, as regular teams cannot be left when there's only a single team member is left and OIDC teams should be auto deleted. So its probably just an issue that could happen with bogus fixture data, just want to confirm that's not an issue?

I can't think of any scenario either, a team with no members does not really have a use-case IMHO.

> Question: right now (even before this PR), empty groups (no team members) are not returned, as `INNER JOIN` is used and therefore those are filtered out. Now I'm struggling to think about any scenario where this would be possible, as regular teams cannot be left when there's only a single team member is left and OIDC teams should be auto deleted. So its probably just an issue that could happen with bogus fixture data, just want to confirm that's not an issue? I can't think of any scenario either, a team with no members does not really have a use-case IMHO.
waza-ari added 4 commits 2024-03-10 13:03:41 +00:00
Author
Contributor

Hm, I'm uncertain if my changes could cause CI to fail, not sure if anything else was changed?

Hm, I'm uncertain if my changes could cause CI to fail, not sure if anything else was changed?
Owner

The desktop build is sometimes flaky, no worries. I've restarted that CI build.

The desktop build is sometimes flaky, no worries. I've restarted that CI build.
konrad reviewed 2024-03-10 13:45:16 +00:00
@ -922,2 +922,3 @@
"admin": "Admin",
"member": "Member"
"member": "Member",
"isPublic": "Visibility",
Owner

This should be called "Public Team" or something similar, calling it "Visibility" does not really say what it does. In combination with the explanation "Public Team" makes more sense.

This should be called "Public Team" or something similar, calling it "Visibility" does not really say what it does. In combination with the explanation "Public Team" makes more sense.
konrad marked this conversation as resolved
waza-ari added 1 commit 2024-03-10 13:46:45 +00:00
fix(i18n): rename label for public team checkbox
All checks were successful
continuous-integration/drone/pr Build is passing
8d2f31af02
konrad approved these changes 2024-03-10 13:49:02 +00:00
konrad left a comment
Owner

LGTM. Thanks!

LGTM. Thanks!
konrad scheduled this pull request to auto merge when all checks succeed 2024-03-10 13:49:19 +00:00
konrad merged commit ffa82556e0 into main 2024-03-10 14:04:35 +00:00
Sign in to join this conversation.
No Reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vikunja/vikunja#2179
No description provided.