change group views to add new parameters - #687

This commit is contained in:
Laurent GAY
2025-11-12 13:12:56 +01:00
committed by setop
parent 3cdfc76aff
commit 7b6c06d233
9 changed files with 86 additions and 11 deletions

View File

@@ -60,6 +60,7 @@ export const GROUP_VERY_BASIC_FIELDS_FRAGMENTS = gql`
visibility visibility
openness openness
manuallyApprovesFollowers manuallyApprovesFollowers
allowSeeParticipants
physicalAddress { physicalAddress {
description description
street street
@@ -104,6 +105,7 @@ export const GROUP_BASIC_FIELDS_FRAGMENTS = gql`
visibility visibility
openness openness
manuallyApprovesFollowers manuallyApprovesFollowers
allowSeeParticipants
physicalAddress { physicalAddress {
description description
street street
@@ -301,6 +303,7 @@ export const CREATE_GROUP = gql`
$visibility: GroupVisibility $visibility: GroupVisibility
$openness: Openness $openness: Openness
$manuallyApprovesFollowers: Boolean $manuallyApprovesFollowers: Boolean
$allowSeeParticipants: Boolean
) { ) {
createGroup( createGroup(
preferredUsername: $preferredUsername preferredUsername: $preferredUsername
@@ -312,6 +315,7 @@ export const CREATE_GROUP = gql`
visibility: $visibility visibility: $visibility
openness: $openness openness: $openness
manuallyApprovesFollowers: $manuallyApprovesFollowers manuallyApprovesFollowers: $manuallyApprovesFollowers
allowSeeParticipants: $allowSeeParticipants
) { ) {
...ActorFragment ...ActorFragment
banner { banner {
@@ -334,6 +338,7 @@ export const UPDATE_GROUP = gql`
$openness: Openness $openness: Openness
$physicalAddress: AddressInput $physicalAddress: AddressInput
$manuallyApprovesFollowers: Boolean $manuallyApprovesFollowers: Boolean
$allowSeeParticipants: Boolean
) { ) {
updateGroup( updateGroup(
id: $id id: $id
@@ -345,6 +350,7 @@ export const UPDATE_GROUP = gql`
openness: $openness openness: $openness
physicalAddress: $physicalAddress physicalAddress: $physicalAddress
manuallyApprovesFollowers: $manuallyApprovesFollowers manuallyApprovesFollowers: $manuallyApprovesFollowers
allowSeeParticipants: $allowSeeParticipants
) { ) {
...GroupVeryBasicFields ...GroupVeryBasicFields
} }

View File

@@ -176,6 +176,9 @@
"Back to profile list": "Back to profile list", "Back to profile list": "Back to profile list",
"Back to top": "Back to top", "Back to top": "Back to top",
"Back to user list": "Back to user list", "Back to user list": "Back to user list",
"Ban": "Ban",
"Ban the account": "Ban the account",
"Ban the account?": "Ban the account?",
"Banner": "Banner", "Banner": "Banner",
"Become part of the community and start organizing events": "Become part of the community and start organizing events", "Become part of the community and start organizing events": "Become part of the community and start organizing events",
"Before you can login, you need to click on the link inside it to validate your account.": "Before you can login, you need to click on the link inside it to validate your account.", "Before you can login, you need to click on the link inside it to validate your account.": "Before you can login, you need to click on the link inside it to validate your account.",
@@ -370,8 +373,8 @@
"Do not receive any mail": "Do not receive any mail", "Do not receive any mail": "Do not receive any mail",
"Do you really want to ban the account \u00ab\u00a0{emailAccount}\u00a0\u00bb\u00a0?": "Do you really want to ban the account \u00ab\u00a0{emailAccount}\u00a0\u00bb\u00a0?", "Do you really want to ban the account \u00ab\u00a0{emailAccount}\u00a0\u00bb\u00a0?": "Do you really want to ban the account \u00ab\u00a0{emailAccount}\u00a0\u00bb\u00a0?",
"Do you really want to ban this account? All of the user's profiles will be deleted.": "Do you really want to ban this account? All of the user's profiles will be deleted.", "Do you really want to ban this account? All of the user's profiles will be deleted.": "Do you really want to ban this account? All of the user's profiles will be deleted.",
"Do you really want to unban this account? The user will be able to log-in again.":"Do you really want to unban this account? The user will be able to log-in again.",
"Do you really want to suspend this profile? All of the profiles content will be deleted.": "Do you really want to suspend this profile? All of the profiles content will be deleted.", "Do you really want to suspend this profile? All of the profiles content will be deleted.": "Do you really want to suspend this profile? All of the profiles content will be deleted.",
"Do you really want to unban this account? The user will be able to log-in again.": "Do you really want to unban this account? The user will be able to log-in again.",
"Do you wish to {create_event} or {explore_events}?": "Do you wish to {create_event} or {explore_events}?", "Do you wish to {create_event} or {explore_events}?": "Do you wish to {create_event} or {explore_events}?",
"Do you wish to {create_group} or {explore_groups}?": "Do you wish to {create_group} or {explore_groups}?", "Do you wish to {create_group} or {explore_groups}?": "Do you wish to {create_group} or {explore_groups}?",
"Does the event needs to be confirmed later or is it cancelled?": "Does the event needs to be confirmed later or is it cancelled?", "Does the event needs to be confirmed later or is it cancelled?": "Does the event needs to be confirmed later or is it cancelled?",
@@ -692,6 +695,7 @@
"Maybe the content was removed by the author or a moderator": "Maybe the content was removed by the author or a moderator", "Maybe the content was removed by the author or a moderator": "Maybe the content was removed by the author or a moderator",
"Member": "Member", "Member": "Member",
"Members": "Members", "Members": "Members",
"Members can see events' participants": "Members can see events' participants",
"Members will also access private sections like discussions, resources and restricted posts.": "Members will also access private sections like discussions, resources and restricted posts.", "Members will also access private sections like discussions, resources and restricted posts.": "Members will also access private sections like discussions, resources and restricted posts.",
"Members-only post": "Members-only post", "Members-only post": "Members-only post",
"Membership requests will be approved by a group moderator": "Membership requests will be approved by a group moderator", "Membership requests will be approved by a group moderator": "Membership requests will be approved by a group moderator",
@@ -847,13 +851,13 @@
"Only group moderators can create, edit and delete posts.": "Only group moderators can create, edit and delete posts.", "Only group moderators can create, edit and delete posts.": "Only group moderators can create, edit and delete posts.",
"Only instances with an application actor can be followed": "Only instances with an application actor can be followed", "Only instances with an application actor can be followed": "Only instances with an application actor can be followed",
"Only registered users may fetch remote events from their URL.": "Only registered users may fetch remote events from their URL.", "Only registered users may fetch remote events from their URL.": "Only registered users may fetch remote events from their URL.",
"Open": "Open",
"Open a topic on our forum": "Open a topic on our forum", "Open a topic on our forum": "Open a topic on our forum",
"Open an issue on our bug tracker (advanced users)": "Open an issue on our bug tracker (advanced users)", "Open an issue on our bug tracker (advanced users)": "Open an issue on our bug tracker (advanced users)",
"Open conversations": "Open conversations", "Open conversations": "Open conversations",
"Open main menu": "Open main menu", "Open main menu": "Open main menu",
"Open user menu": "Open user menu", "Open user menu": "Open user menu",
"Opened reports": "Opened reports", "Opened reports": "Opened reports",
"Open": "Open",
"Options": "Options", "Options": "Options",
"Or": "Or", "Or": "Or",
"Ordered list": "Ordered list", "Ordered list": "Ordered list",
@@ -890,20 +894,21 @@
"Participation without account": "Participation without account", "Participation without account": "Participation without account",
"Participations": "Participations", "Participations": "Participations",
"Password": "Password", "Password": "Password",
"Password and confirmation password must be identical.":"Password and confirmation password must be identical.",
"Password (confirmation)": "Password (confirmation)", "Password (confirmation)": "Password (confirmation)",
"Password and confirmation password must be identical.": "Password and confirmation password must be identical.",
"Password reset": "Password reset", "Password reset": "Password reset",
"Past activities": "Passed activities", "Past activities": "Passed activities",
"Past events": "Passed events", "Past events": "Passed events",
"PeerTube live": "PeerTube live", "PeerTube live": "PeerTube live",
"PeerTube replay": "PeerTube replay", "PeerTube replay": "PeerTube replay",
"Pending": "Pending", "Pending": "Pending",
"Permission": "Permission",
"Personal feeds": "Personal feeds", "Personal feeds": "Personal feeds",
"Photo by {author} on {source}": "Photo by {author} on {source}", "Photo by {author} on {source}": "Photo by {author} on {source}",
"Pick": "Pick",
"Pick a profile or a group": "Pick a profile or a group",
"Pick an identity": "Pick an identity", "Pick an identity": "Pick an identity",
"Pick an instance": "Pick an instance", "Pick an instance": "Pick an instance",
"Pick a profile or a group": "Pick a profile or a group",
"Pick": "Pick",
"Pictures": "Pictures", "Pictures": "Pictures",
"Please add as many details as possible to help identify the problem.": "Please add as many details as possible to help identify the problem.", "Please add as many details as possible to help identify the problem.": "Please add as many details as possible to help identify the problem.",
"Please check your spam folder if you didn't receive the email.": "Please check your spam folder if you didn't receive the email.", "Please check your spam folder if you didn't receive the email.": "Please check your spam folder if you didn't receive the email.",
@@ -1113,10 +1118,7 @@
"Subtitles": "Subtitles", "Subtitles": "Subtitles",
"Suggestions:": "Suggestions:", "Suggestions:": "Suggestions:",
"Suspend": "Suspend", "Suspend": "Suspend",
"Ban": "Ban",
"Suspend group": "Suspend group", "Suspend group": "Suspend group",
"Ban the account": "Ban the account",
"Ban the account?": "Ban the account?",
"Suspend the profile": "Suspend the profile", "Suspend the profile": "Suspend the profile",
"Suspend the profile?": "Suspend the profile?", "Suspend the profile?": "Suspend the profile?",
"Suspended": "Suspended", "Suspended": "Suspended",
@@ -1575,7 +1577,7 @@
"Your participation still has to be approved by the organisers.": "Your participation still has to be approved by the organisers.", "Your participation still has to be approved by the organisers.": "Your participation still has to be approved by the organisers.",
"Your participation will be validated once you click the confirmation link into the email, and after the organizer manually validates your participation.": "Your participation will be validated once you click the confirmation link into the email, and after the organizer manually validates your participation.", "Your participation will be validated once you click the confirmation link into the email, and after the organizer manually validates your participation.": "Your participation will be validated once you click the confirmation link into the email, and after the organizer manually validates your participation.",
"Your participation will be validated once you click the confirmation link into the email.": "Your participation will be validated once you click the confirmation link into the email.", "Your participation will be validated once you click the confirmation link into the email.": "Your participation will be validated once you click the confirmation link into the email.",
"Your password has been successfully changed. You now need to logged-in with your new password.":"Your password has been successfully changed. You now need to logged-in with your new password.", "Your password has been successfully changed. You now need to logged-in with your new password.": "Your password has been successfully changed. You now need to logged-in with your new password.",
"Your position was not available.": "Your position was not available.", "Your position was not available.": "Your position was not available.",
"Your profile will be shown as contact.": "Your profile will be shown as contact.", "Your profile will be shown as contact.": "Your profile will be shown as contact.",
"Your timezone is currently set to {timezone}.": "Your timezone is currently set to {timezone}.", "Your timezone is currently set to {timezone}.": "Your timezone is currently set to {timezone}.",

View File

@@ -695,6 +695,7 @@
"Maybe the content was removed by the author or a moderator": "Peut-\u00eatre que le contenu a \u00e9t\u00e9 supprim\u00e9 par l'auteur\u00b7ice ou un\u00b7e mod\u00e9rateur\u00b7ice", "Maybe the content was removed by the author or a moderator": "Peut-\u00eatre que le contenu a \u00e9t\u00e9 supprim\u00e9 par l'auteur\u00b7ice ou un\u00b7e mod\u00e9rateur\u00b7ice",
"Member": "Membre", "Member": "Membre",
"Members": "Membres", "Members": "Membres",
"Members can see events' participants": "Les membres peuvent voir les participants des événements",
"Members will also access private sections like discussions, resources and restricted posts.": "Les membres auront \u00e9galement acc\u00e8s aux section priv\u00e9es comme les discussions, les ressources et les billets restreints.", "Members will also access private sections like discussions, resources and restricted posts.": "Les membres auront \u00e9galement acc\u00e8s aux section priv\u00e9es comme les discussions, les ressources et les billets restreints.",
"Members-only post": "Billet reserv\u00e9 aux membres", "Members-only post": "Billet reserv\u00e9 aux membres",
"Membership requests will be approved by a group moderator": "Les demandes d'adh\u00e9sion seront approuv\u00e9es par un\u00b7e mod\u00e9rateur\u00b7ice du groupe", "Membership requests will be approved by a group moderator": "Les demandes d'adh\u00e9sion seront approuv\u00e9es par un\u00b7e mod\u00e9rateur\u00b7ice du groupe",
@@ -900,6 +901,7 @@
"PeerTube live": "Direct sur PeerTube", "PeerTube live": "Direct sur PeerTube",
"PeerTube replay": "Replay sur PeerTube", "PeerTube replay": "Replay sur PeerTube",
"Pending": "En attente", "Pending": "En attente",
"Permission": "Permission",
"Personal feeds": "Flux personnels", "Personal feeds": "Flux personnels",
"Photo by {author} on {source}": "Photo par {author} sur {source}", "Photo by {author} on {source}": "Photo par {author} sur {source}",
"Pick an identity": "Choisissez une identit\u00e9", "Pick an identity": "Choisissez une identit\u00e9",

View File

@@ -23,6 +23,7 @@ export interface IGroup extends IActor {
openness: Openness; openness: Openness;
visibility: GroupVisibility; visibility: GroupVisibility;
manuallyApprovesFollowers: boolean; manuallyApprovesFollowers: boolean;
allowSeeParticipants: boolean;
activity: Paginate<IActivity>; activity: Paginate<IActivity>;
followers: Paginate<IFollower>; followers: Paginate<IFollower>;
membersCount?: number; membersCount?: number;
@@ -58,6 +59,8 @@ export class Group extends Actor implements IGroup {
manuallyApprovesFollowers = false; manuallyApprovesFollowers = false;
allowSeeParticipants = true;
patch(hash: IGroup | Record<string, unknown>): void { patch(hash: IGroup | Record<string, unknown>): void {
Object.assign(this, hash); Object.assign(this, hash);
} }

View File

@@ -198,6 +198,16 @@
{{ t("Manually approve new followers") }} {{ t("Manually approve new followers") }}
</o-checkbox> </o-checkbox>
</fieldset> </fieldset>
<fieldset>
<legend class="mt-2">
<span class="field-label !mb-0">
{{ t("Permission") }}
</span>
</legend>
<o-checkbox v-model="group.allowSeeParticipants">
{{ t("Members can see events' participants") }}
</o-checkbox>
</fieldset>
<o-button <o-button
variant="primary" variant="primary"
@@ -297,6 +307,7 @@ const buildVariables = computed(() => {
visibility: group.value.visibility, visibility: group.value.visibility,
openness: group.value.openness, openness: group.value.openness,
manuallyApprovesFollowers: group.value.manuallyApprovesFollowers, manuallyApprovesFollowers: group.value.manuallyApprovesFollowers,
allowSeeParticipants: group.value.allowSeeParticipants,
}; };
if (cloneGroup.physicalAddress?.id || cloneGroup.physicalAddress?.geom) { if (cloneGroup.physicalAddress?.id || cloneGroup.physicalAddress?.geom) {

View File

@@ -157,6 +157,12 @@
</o-checkbox> </o-checkbox>
</o-field> </o-field>
<o-field :label="t('Permission')">
<o-checkbox v-model="editableGroup.allowSeeParticipants">
{{ t("Members can see events' participants") }}
</o-checkbox>
</o-field>
<full-address-auto-complete <full-address-auto-complete
:label="t('Group address')" :label="t('Group address')"
v-model="currentAddress" v-model="currentAddress"
@@ -340,6 +346,7 @@ const buildVariables = computed(() => {
visibility: editableGroup.value?.visibility, visibility: editableGroup.value?.visibility,
openness: editableGroup.value?.openness, openness: editableGroup.value?.openness,
manuallyApprovesFollowers: editableGroup.value?.manuallyApprovesFollowers, manuallyApprovesFollowers: editableGroup.value?.manuallyApprovesFollowers,
allowSeeParticipants: editableGroup.value?.allowSeeParticipants,
physicalAddress, physicalAddress,
...avatarObj, ...avatarObj,
...bannerObj, ...bannerObj,

View File

@@ -24,8 +24,48 @@ beforeEach(async () => {
// await router.isReady(); // await router.isReady();
}); });
const mock_group = {
data: {
group: {
__typename: "Group",
avatar: null,
banner: null,
domain: null,
id: "123",
manuallyApprovesFollowers: true,
allowSeeParticipants: false,
members: {
__typename: "PaginatedMemberList",
total: 1,
},
name: "ssss",
openness: "MODERATED",
organizedEvents: {
__typename: "PaginatedEventList",
elements: [],
total: 0,
},
physicalAddress: null,
posts: {
__typename: "PaginatedPostList",
elements: [],
total: 0,
},
preferredUsername: "example",
summary: null,
suspended: false,
type: "GROUP",
url: "https://mobilizon.test/@example",
visibility: "PUBLIC",
},
},
};
const generateWrapper = () => { const generateWrapper = () => {
const global_data = getMockClient([FETCH_GROUP_PUBLIC, DELETE_GROUP]); const global_data = getMockClient([
[FETCH_GROUP_PUBLIC, mock_group],
DELETE_GROUP,
]);
global_data.provide.dateFnsLocale = enUS; global_data.provide.dateFnsLocale = enUS;
global_data.plugins = [router]; global_data.plugins = [router];
return mount(GroupSettings, { return mount(GroupSettings, {

View File

@@ -110,6 +110,10 @@ exports[`CreateView > Show simple 1`] = `
<fieldset> <fieldset>
<legend class="mt-2"><span class="field-label !mb-0">Followers</span><span>Followers will receive new public events and posts.</span></legend> <legend class="mt-2"><span class="field-label !mb-0">Followers</span><span>Followers will receive new public events and posts.</span></legend>
<div data-oruga="checkbox" class="o-checkbox"><input id="v-0-19" type="checkbox" data-oruga-input="checkbox" class="o-checkbox__input" true-value="true" false-value="false" autocomplete="off" aria-checked="false" aria-labelledby="v-0-20"><label id="v-0-20" for="v-0-19" class="o-checkbox__label">Manually approve new followers</label></div> <div data-oruga="checkbox" class="o-checkbox"><input id="v-0-19" type="checkbox" data-oruga-input="checkbox" class="o-checkbox__input" true-value="true" false-value="false" autocomplete="off" aria-checked="false" aria-labelledby="v-0-20"><label id="v-0-20" for="v-0-19" class="o-checkbox__label">Manually approve new followers</label></div>
</fieldset>
<fieldset>
<legend class="mt-2"><span class="field-label !mb-0">Permission</span></legend>
<div data-oruga="checkbox" class="o-checkbox o-checkbox--checked"><input id="v-0-21" type="checkbox" data-oruga-input="checkbox" class="o-checkbox__input" true-value="true" false-value="false" autocomplete="off" aria-checked="true" aria-labelledby="v-0-22"><label id="v-0-22" for="v-0-21" class="o-checkbox__label">Members can see events' participants</label></div>
</fieldset><button data-oruga="button" type="submit" role="button" tabindex="0" class="o-button o-button--primary mt-3"><span class="o-button__wrapper"><!----><span class="o-button__label">Create my group</span> </fieldset><button data-oruga="button" type="submit" role="button" tabindex="0" class="o-button o-button--primary mt-3"><span class="o-button__wrapper"><!----><span class="o-button__label">Create my group</span>
<!----></span> <!----></span>
</button> </button>

View File

@@ -2,7 +2,7 @@
exports[`GroupSettings > Show simple 1`] = ` exports[`GroupSettings > Show simple 1`] = `
"<div> "<div>
<!--v-if--> <breadcrumbs-nav links="[object Object],[object Object],[object Object]"></breadcrumbs-nav>
<transition-stub name="fade" appear="false" persisted="false" css="true"> <transition-stub name="fade" appear="false" persisted="false" css="true">
<!----> <!---->
</transition-stub> </transition-stub>