chore(experemantal_features): Remove activity center settings and enable by default

Closes: #5922
This commit is contained in:
Boris Melnik 2022-06-01 11:13:53 +03:00 committed by Iuri Matias
parent d6cc1ed1ab
commit 7cacadd9be
7 changed files with 3 additions and 59 deletions

View File

@ -12,8 +12,6 @@ const LSS_KEY_NODE_MANAGEMENT_ENABLED* = "nodeManagementEnabled"
const DEFAULT_NODE_MANAGEMENT_ENABLED = false
const LSS_KEY_IS_BROWSER_ENABLED* = "isExperimentalBrowserEnabled"
const DEFAULT_IS_BROWSER_ENABLED = false
const LSS_KEY_IS_ACTIVITY_CENTER_ENABLED* = "isActivityCenterEnabled"
const DEFAULT_IS_ACTIVITY_CENTER_ENABLED = false
const LSS_KEY_SHOW_ONLINE_USERS* = "showOnlineUsers"
const DEFAULT_SHOW_ONLINE_USERS = true
const LSS_KEY_EXPAND_USERS_LIST* = "expandUsersList"
@ -231,20 +229,6 @@ QtObject:
write = setIsBrowserEnabled
notify = isBrowserEnabledChanged
proc isActivityCenterEnabledChanged*(self: LocalAccountSensitiveSettings) {.signal.}
proc getIsActivityCenterEnabled*(self: LocalAccountSensitiveSettings): bool {.slot.} =
getSettingsProp[bool](self, LSS_KEY_IS_ACTIVITY_CENTER_ENABLED, newQVariant(DEFAULT_IS_ACTIVITY_CENTER_ENABLED))
proc setIsActivityCenterEnabled*(self: LocalAccountSensitiveSettings, value: bool) {.slot.} =
setSettingsProp(self, LSS_KEY_IS_ACTIVITY_CENTER_ENABLED, newQVariant(value)):
self.isActivityCenterEnabledChanged()
QtProperty[bool] isActivityCenterEnabled:
read = getIsActivityCenterEnabled
write = setIsActivityCenterEnabled
notify = isActivityCenterEnabledChanged
proc showOnlineUsersChanged*(self: LocalAccountSensitiveSettings) {.signal.}
proc getShowOnlineUsers*(self: LocalAccountSensitiveSettings): bool {.slot.} =
getSettingsProp[bool](self, LSS_KEY_SHOW_ONLINE_USERS, newQVariant(DEFAULT_SHOW_ONLINE_USERS))
@ -772,7 +756,6 @@ QtObject:
of LSS_KEY_IS_WALLET_ENABLED: self.isWalletEnabledChanged()
of LSS_KEY_NODE_MANAGEMENT_ENABLED: self.nodeManagementEnabledChanged()
of LSS_KEY_IS_BROWSER_ENABLED: self.isBrowserEnabledChanged()
of LSS_KEY_IS_ACTIVITY_CENTER_ENABLED: self.isActivityCenterEnabledChanged()
of LSS_KEY_SHOW_ONLINE_USERS: self.showOnlineUsersChanged()
of LSS_KEY_EXPAND_USERS_LIST: self.expandUsersListChanged()
of LSS_KEY_IS_GIF_WIDGET_ENABLED: self.isGifWidgetEnabledChanged()

View File

@ -829,16 +829,16 @@ method onStatusUrlRequested*[T](self: Module[T], action: StatusUrlAction, commun
i.inc
self.resolveENS(id, "", STATUS_URL_ENS_RESOLVE_REASON & $StatusUrlAction.OpenOrCreateGroupChat)
elif(action == StatusUrlAction.RequestToJoinCommunity and singletonInstance.localAccountSensitiveSettings.getCommunitiesEnabled()):
elif(action == StatusUrlAction.RequestToJoinCommunity):
let item = self.view.model().getItemById(singletonInstance.userProfile.getPubKey())
self.setActiveSection(item)
self.communitiesModule.requestToJoinCommunity(communityId, singletonInstance.userProfile.getName())
elif(action == StatusUrlAction.OpenCommunity and singletonInstance.localAccountSensitiveSettings.getCommunitiesEnabled()):
elif(action == StatusUrlAction.OpenCommunity):
let item = self.view.model().getItemById(communityId)
self.setActiveSection(item)
elif(action == StatusUrlAction.OpenCommunityChannel and singletonInstance.localAccountSensitiveSettings.getCommunitiesEnabled()):
elif(action == StatusUrlAction.OpenCommunityChannel):
for cId, cModule in self.channelGroupModules.pairs:
if(cId == singletonInstance.userProfile.getPubKey()):
continue

View File

@ -35,10 +35,6 @@ proc delete*(self: Controller) =
discard
proc init*(self: Controller) =
self.events.on(TOGGLE_SECTION) do(e:Args):
let args = ToggleSectionArgs(e)
self.delegate.onToggleSection(args.sectionType)
self.events.on(SIGNAL_COMMUNITY_JOINED) do(e:Args):
let args = CommunityArgs(e)
if(args.error.len > 0):

View File

@ -28,9 +28,6 @@ method saveExemptions*(self: AccessInterface, itemId: string, muteAllMessages: b
globalMentions: string, allMessages: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onToggleSection*(self: AccessInterface, sectionType: SectionType) {.base.} =
raise newException(ValueError, "No implementation available")
method addCommunity*(self: AccessInterface, communityDto: CommunityDto) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -108,19 +108,6 @@ method saveExemptions*(self: Module, itemId: string, muteAllMessages: bool, pers
otherMessages: otherMessages)
if(self.controller.setNotifSettingExemptions(itemId, exemptions)):
self.view.exemptionsModel().updateExemptions(itemId, muteAllMessages, personalMentions, globalMentions, otherMessages)
method onToggleSection*(self: Module, sectionType: SectionType) =
if(sectionType != SectionType.Community):
return
let channelGroups = self.controller.getChannelGroups()
for cg in channelGroups:
if cg.channelGroupType == ChannelGroupType.Community:
let ind = self.view.exemptionsModel().findIndexForItemId(cg.id)
if(ind != -1):
continue
let item = self.createItem(cg.id, cg.name, cg.images.thumbnail, cg.color, joinedTimestamp = 0, item.Type.Community)
self.view.exemptionsModel().addItem(item)
method addCommunity*(self: Module, communityDto: CommunityDto) =
let ind = self.view.exemptionsModel().findIndexForItemId(communityDto.id)

View File

@ -180,7 +180,6 @@ ColumnLayout {
chatContentModule.chatDetails.isUsersListAvailable
}
membersButton.highlighted: localAccountSensitiveSettings.expandUsersList
notificationButton.visible: localAccountSensitiveSettings.isActivityCenterEnabled
notificationButton.tooltip.offset: localAccountSensitiveSettings.expandUsersList && membersButton.visible ? 0 : 14
notificationCount: activityCenter.unreadNotificationsCount

View File

@ -161,24 +161,6 @@ SettingsContentBase {
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
anchors.leftMargin: 0
anchors.rightMargin: 0
//% "Activity Center"
text: qsTrId("activity-center")
isSwitch: true
switchChecked: localAccountSensitiveSettings.isActivityCenterEnabled
onClicked: {
if (!localAccountSensitiveSettings.isActivityCenterEnabled) {
confirmationPopup.experimentalFeature = root.advancedStore.experimentalFeatures.activityCenter
confirmationPopup.open()
} else {
root.advancedStore.toggleExperimentalFeature(root.advancedStore.experimentalFeatures.activityCenter)
}
}
}
// TODO: replace with StatusQ component
StatusSettingsLineButton {
anchors.leftMargin: 0