feat(communities): re-enabled open membership communities

Closes #3410.

Re-enables open membership communities, with necessary changes in the Inivitation Bubble for one-on-one chats.

fix: add/edit communities components not appearing
On add/edit community popup load, some components below the thumbnail image picker were not appearing until the app window was resized. Removing the height of the ScrollView fixed the issue (on mac).

NOTE: this may require windows and linux users to test.
This commit is contained in:
Eric Mastro 2021-09-14 16:01:43 +10:00 committed by Iuri Matias
parent 9854a49a44
commit e42b1d249e
3 changed files with 33 additions and 31 deletions

View File

@ -132,7 +132,9 @@ Item {
}, },
State { State {
name: "joined" name: "joined"
when: invitedCommunity.joined && invitedCommunity.isMember when: (invitedCommunity.joined && invitedCommunity.isMember) ||
(invitedCommunity.access === Constants.communityChatPublicAccess &&
invitedCommunity.joined)
PropertyChanges { PropertyChanges {
target: joinBtn target: joinBtn
//% "View" //% "View"
@ -153,8 +155,10 @@ Item {
}, },
State { State {
name: "unjoined" name: "unjoined"
when: invitedCommunity.access === Constants.communityChatOnRequestAccess && when: (invitedCommunity.access === Constants.communityChatOnRequestAccess &&
invitedCommunity.isMember invitedCommunity.isMember) ||
(invitedCommunity.access === Constants.communityChatPublicAccess &&
!invitedCommunity.joined)
PropertyChanges { PropertyChanges {
target: joinBtn target: joinBtn
//% "Join" //% "Join"

View File

@ -23,6 +23,7 @@ StatusModal {
| Utils.Validate.TextHexColor | Utils.Validate.TextHexColor
id: popup id: popup
height: 509
onOpened: { onOpened: {
if (isEdit) { if (isEdit) {
@ -65,7 +66,6 @@ StatusModal {
contentHeight: content.height contentHeight: content.height
bottomPadding: 8 bottomPadding: 8
height: Math.min(content.height, 432)
width: popup.width width: popup.width
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
@ -79,6 +79,7 @@ StatusModal {
Column { Column {
id: content id: content
width: popup.width width: popup.width
spacing: 8
Item { Item {
height: 8 height: 8
@ -87,6 +88,7 @@ StatusModal {
StatusInput { StatusInput {
id: nameInput id: nameInput
label: qsTr("Name your community")
charLimit: maxCommunityNameLength charLimit: maxCommunityNameLength
input.placeholderText: qsTr("A catchy name") input.placeholderText: qsTr("A catchy name")
validators: [StatusMinLengthValidator { validators: [StatusMinLengthValidator {
@ -292,8 +294,6 @@ StatusModal {
visible: !isEdit visible: !isEdit
//% "Membership requirement" //% "Membership requirement"
title: qsTrId("membership-title") title: qsTrId("membership-title")
// TODO: remove 'isEnabled: false' when we no longer need to force "request access" membership
enabled: false
label: { label: {
switch (membershipRequirementSettingPopup.checkedMembership) { switch (membershipRequirementSettingPopup.checkedMembership) {
//% "Require invite from another member" //% "Require invite from another member"
@ -315,8 +315,7 @@ StatusModal {
} }
StatusBaseText { StatusBaseText {
// TODO: remove 'false' when we no longer need to force "request access" membership visible: !isEdit
visible: false && !isEdit
height: visible ? implicitHeight : 0 height: visible ? implicitHeight : 0
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.pixelSize: 13 font.pixelSize: 13
@ -455,9 +454,6 @@ StatusModal {
MembershipRequirementPopup { MembershipRequirementPopup {
anchors.centerIn: parent anchors.centerIn: parent
id: membershipRequirementSettingPopup id: membershipRequirementSettingPopup
// TODO: remove the 'checkedMemership' setting when we no longer need
// to force "require approval" membership
checkedMembership: Constants.communityChatOnRequestAccess
} }
} }

View File

@ -60,24 +60,26 @@ StatusModal {
anchors.leftMargin: 32 anchors.leftMargin: 32
} }
StatusListItem { // TODO: uncomment this when we want to re-enable requiring invite from another member
anchors.horizontalCenter: parent.horizontalCenter // for community creation
//% "Require invite from another member" // StatusListItem {
title: qsTrId("membership-invite") // anchors.horizontalCenter: parent.horizontalCenter
sensor.onClicked: inviteOnlyRadio.checked = true // //% "Require invite from another member"
components: [ // title: qsTrId("membership-invite")
StatusRadioButton { // sensor.onClicked: inviteOnlyRadio.checked = true
id: inviteOnlyRadio // components: [
checked: popup.checkedMembership === Constants.communityChatInvitationOnlyAccess // StatusRadioButton {
ButtonGroup.group: membershipRequirementGroup // id: inviteOnlyRadio
onCheckedChanged: { // checked: popup.checkedMembership === Constants.communityChatInvitationOnlyAccess
if (checked) { // ButtonGroup.group: membershipRequirementGroup
popup.checkedMembership = Constants.communityChatInvitationOnlyAccess // onCheckedChanged: {
} // if (checked) {
} // popup.checkedMembership = Constants.communityChatInvitationOnlyAccess
} // }
] // }
} // }
// ]
// }
StatusBaseText { StatusBaseText {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap