Discourse 동적 그룹

:information_source: 요약 그룹 멤버십을 자동으로 관리
:hammer_and_wrench: 레포지토리 링크 https://github.com/communiteq/discourse-dynamic-groups
:open_book: 설치 가이드 Discourse에서 플러그인 설치하는 방법

기능

Discourse 커뮤니티는 배지 소유 여부나 기존 그룹 멤버십과 같은 조건에 기반하여 그룹 멤버십을 자동화할 필요가 있습니다.

일반적인 사용 사례에는 다음이 포함됩니다:

  • ‘구독자(subscribers)’ 그룹에 속하지 않은 사용자

  • #marketplace에서 게시가 금지된 사용자가 아닌 사용자

  • TL0 또는 TL1이지만 TL2는 아닌 사용자

  • 신규 사용자 튜토리얼을 완료했거나 1년 이상 회원인 사용자

  • client_1, client_2 또는 client_3에 속해 있으면서 인턴이 아닌 사용자

이전에는 이러한 문제를 해결하기 위해 그룹을 주기적으로 동기화하는 사용자 정의 스크립트가 필요했습니다. Dynamic Groups 플러그인은 이러한 필요성을 제거합니다.

이 플러그인은 그룹 설정에 부울 표현식 필드를 도입하여 관리자가 그룹 멤버십을 동적으로 결정하는 규칙을 정의할 수 있게 합니다.

예시:

  • ‘구독자(subscribers)’ 그룹에 속하지 않은 사용자
    trust_level_0 AND NOT subscribers

  • #marketplace에서 게시가 금지된 사용자가 아닌 사용자
    trust_level_2 AND NOT banned_users

  • TL0 또는 TL1이지만 TL2는 아닌 사용자
    trust_level_0 AND NOT trust_level_2

  • 신규 사용자 튜토리얼을 완료했거나 1년 이상 회원인 사용자
    badge:certified OR badge:anniversary

  • client 1, 2 또는 3에 속해 있으면서 인턴이 아닌 사용자
    (client_1 OR client_2 OR client_3) AND NOT interns

구성

플러그인이 설치되고 활성화되면 그룹 관리 인터페이스에 새로운 탭이 나타납니다:

부울 표현식을 입력하거나 업데이트하면, 시스템이 몇 초간 해당 조건에 맞는 사용자로 그룹을 채우는 데 시간이 걸립니다. 그 시점부터는 사용자 상태가 변경될 때마다 그룹 멤버십이 자동으로 업데이트됩니다.

중요:
규칙이 정의되면 그룹은 **자동(automatic)**으로 표시되며 수동 멤버 변경이 비활성화됩니다. 그룹을 수동 관리로 되돌리려면 단순히 표현식 필드를 지우면 됩니다. 기존 멤버는 유지되며 수동 제어 권한을 다시 얻게 됩니다.

28개의 좋아요

Wow! Awesome work, Richard!

This fills a large gap in group management within Discourse. Totally delighted, and looking forward to giving it a good run.

I’ll be primarily using it to enable functional subgroups.

4개의 좋아요

Definitely a welcome addition to Discourse’s features!

2개의 좋아요

7 posts were merged into an existing topic: Only the first entry working with Multiselect fields when User first logged in Trigger used

Hi, thank you for developing this super useful plugin!

I’m currently using Discourse Dynamic Groups to automatically add all non-anonymous users to a special group. My boolean expression is:

NOT anonymous_users
Expected behavior:
When a new user registers (who does not belong to the anonymous_users group), they should be automatically added to this group, without any manual intervention.

Actual behavior:
Newly registered users are not immediately added to the group. They only get added after I manually re-save the boolean expression in the group settings.
This means the group is not updated automatically as users join, unless I trigger a manual sync.

2개의 좋아요

Hmm… good catch. And I do agree that this should be expected behavior.

From a technical POV, the plugin will only reevaluate group membership on two different conditions:

  1. When the boolean expression in the group settings is saved
  2. If a user is added or removed for a group mentioned in the boolean expression.

When a new user registers, neither is the case.

Can you try to change the expression to trust_level_0 AND NOT anonymous_users and report back if that resolves the issue?

3개의 좋아요

Hi,

When I try to use the expression

trust_level_0 AND NOT anonymous_users

I get the error:
Unknown keyword, group or badge: 'anonymous_users'

If I change the group name to my actual group, for example:

trust_level_0 AND NOT interns

I still get:
Unknown keyword, group or badge: 'interns'

I have double-checked and I am copying the group’s unique name directly from the group admin page, so there are no typos.
Is there anything I might be missing, or is there something else I need to configure for custom groups to be recognized in the expression?

4개의 좋아요

Thank you for reporting this.

While trying to reproduce, I have identified two bugs and one of them probably hit you.
Can you please update the plugin to the latest version 59640f1 and see if that resolves the issue.

The plugin still does not deal with renaming groups very well. If you rename a group you should save the rules from all groups that depend on it (just enter a space after the boolean expression and remove it again to enable the Save button). This will be addressed in a later version.

3개의 좋아요

Is this using your Category restrictor plugin or thi functions independently from it?

awesome plugin to fill in gaps.

It functions independently.

2개의 좋아요

Hi,

I am using the Dynamic Groups plugin and set my criteria as:

trust_level_0 AND NOT anon_group

However, I have noticed that users with trust_level_1 who are not in the anon_group are also being added to this dynamic group.

Could you please confirm if this is the expected behavior, or if this is a bug?

Users with trust level 1 are also members of the trust level 0 group. So the behavior is expected. You could exclude the trust level 1 group to only get TL0 users. Similar to the example from the first post

2개의 좋아요

Thank you for the clarification

저는 이 플러그인을 정말 :heart: 합니다 — 여러 사용 사례에서 정말 유용합니다. 공유하고 유지 관리해 주신 Communiteq 팀에게 다시 한번 감사드립니다!

UX 관련 질문 - Membership 탭 전체를 숨기는 것보다 키 필드만 숨기는 것이 더 나은가요?

Group 페이지의 Membership 탭을 숨긴다는 점을 알아차렸습니다. 말씀하시는 것은 이 탭입니다:

왜 그렇게 하는지는 이해할 수 있지만, Default title, Flair, Effect를 수정하고 싶을 때 몇 가지 문제가 발생합니다.

이것은 브라우저 콘솔에서 탭을 표시하거나 Dynamic Groups 탭의 표현식을 제거하고, 새로고침한 뒤 변경 사항을 적용한 후 다시 붙여넣고, 다시 새로고침하는 방식으로 우회할 수 있습니다.

하지만 전체 탭을 숨기는 것보다 도움이 되지 않는 필드만 숨기는 것이 더 나을 수도 있다고 생각합니다. 아래 이미지와 같은 방식이 더 좋을 것 같습니다:

1개의 좋아요

제안에 동의하지만…

이것은 핵심 기능입니다.
동적 그룹은 "자동"으로 표시된 후 멤버십 탭이 사라집니다.

그렇게는 작동하지 않습니다. Discourse 코어가 아예 탭을 출력하지 않기 때문입니다. 숨겨진 것이 아니라, 단순히 존재하지 않는 것입니다.

1개의 좋아요

아, 네가 답장하기 전에 그 사이에 알아냈어요!! 이걸로 코어 기능에 직접 연결된다는 걸 전에 깨닫지 못했네요. 아주 깔끔하게 잘 만들었네요.

잘못된 제안을 취소했습니다.

그러면 제가 앞서 설명한 다른 우회 방법이 괜찮을 것 같네요.

그런데 또 다른 문제가 하나 더 있는데, 이건 제가 몰랐어요 - 자동 그룹은 비스태프 사용자에게 표시되지 않습니다. 그리고 이건 깊게 코딩되어 있어요. 아니라고!

1개의 좋아요

저도 그 사실을 몰랐습니다!

다음 한 달 이내에 모든 플러그인에 대해 유지보수를 진행할 예정인데, ‘자동’ 플래그를 다시 검토할 필요가 있을 것 같습니다. 제 기억이 맞다면, 그것은 단순히 멤버 추가/제거 기능을 비활성화하기 위한 임시 조치였을 뿐입니다. 다른 모든 것들은 원치 않는 부작용일 가능성이 큽니다.

4개의 좋아요

이 부분에 대해 결론이 났나요?

1개의 좋아요

현재 이 플러그인에는 몇 가지 비추천(deprecation) 통지가 있습니다:

image

image

3개의 좋아요

해결했습니다. 이 문제를 보고해 주셔서 감사합니다! :+1:

3개의 좋아요