From 36666b3fc387ef7888f477f019ffc8546c76501a Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 11 Oct 2017 15:04:52 +0100 Subject: [PATCH 1/7] Add warm fuzzy dialog for inviting users to a group --- src/GroupAddressPicker.js | 7 +++++++ src/i18n/strings/en_EN.json | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/GroupAddressPicker.js b/src/GroupAddressPicker.js index cfd2590780..ca495de16d 100644 --- a/src/GroupAddressPicker.js +++ b/src/GroupAddressPicker.js @@ -76,6 +76,13 @@ function _onGroupInviteFinished(groupId, addrs) { title: _t("Failed to invite the following users to %(groupId)s:", {groupId: groupId}), description: errorList.join(", "), }); + } else { + const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); + Modal.createTrackedDialog('Group invitations sent', '', QuestionDialog, { + title: _t("Invites sent"), + description: _t("Your group invitations have been sent."), + hasCancelButton: false, + }); } }).catch((err) => { const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 6acaba9fae..aaabea1011 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -906,5 +906,7 @@ "Related Groups": "Related Groups", "Related groups for this room:": "Related groups for this room:", "This room has no related groups": "This room has no related groups", - "New group ID (e.g. +foo:%(localDomain)s)": "New group ID (e.g. +foo:%(localDomain)s)" + "New group ID (e.g. +foo:%(localDomain)s)": "New group ID (e.g. +foo:%(localDomain)s)", + "Invites sent": "Invites sent", + "Your group invitations have been sent.": "Your group invitations have been sent." } From 710c952428fff4682dfb51174d643695c46c6432 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 12 Oct 2017 18:45:04 +0100 Subject: [PATCH 2/7] Make features disabled by default So we can then put them in labs on /develop & others can enable them as desired. --- src/UserSettingsStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index 050e28e5b7..1071448b5b 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -193,7 +193,7 @@ export default { isFeatureEnabled: function(featureId: string): boolean { const featuresConfig = SdkConfig.get()['features']; - let sdkConfigValue = 'labs'; + let sdkConfigValue = 'disable'; if (featuresConfig && featuresConfig[featureId] !== undefined) { sdkConfigValue = featuresConfig[featureId]; } From cd64c9bcbbd171c8cf0784d148e174d719837150 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 13 Oct 2017 11:48:44 +0100 Subject: [PATCH 3/7] Don't show labs features by default Previous PR disabled them but still showed the (broken) option --- src/UserSettingsStore.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index 1071448b5b..0acc6e5634 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -38,7 +38,8 @@ export default { return FEATURES.filter((f) => { const sdkConfigValue = featuresConfig[f.id]; - if (!['enable', 'disable'].includes(sdkConfigValue)) { + + if (sdkConfigValue === 'labs') { return true; } }).map((f) => { From f94873bd5dad0eed04f7d70786b7bf265a9f57d2 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 13 Oct 2017 13:58:24 +0100 Subject: [PATCH 4/7] Honour the (now legacy) enableLabs flag --- src/UserSettingsStore.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index 1071448b5b..7bcef8b7be 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -36,9 +36,16 @@ export default { getLabsFeatures() { const featuresConfig = SdkConfig.get()['features'] || {}; + // The old flag: honourned for backwards compat + const enableLabs = SdkConfig.get()['enableLabs']; + return FEATURES.filter((f) => { + if (enableLabs) { + return true; + } + const sdkConfigValue = featuresConfig[f.id]; - if (!['enable', 'disable'].includes(sdkConfigValue)) { + if (sdkConfigValue === 'labs') { return true; } }).map((f) => { From 4e793d4f68ad5c02af02330cef16cedb210b82de Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 13 Oct 2017 14:11:21 +0100 Subject: [PATCH 5/7] skip unnecessary filter --- src/UserSettingsStore.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index 7bcef8b7be..0a992dfbad 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -39,16 +39,18 @@ export default { // The old flag: honourned for backwards compat const enableLabs = SdkConfig.get()['enableLabs']; - return FEATURES.filter((f) => { - if (enableLabs) { - return true; - } - - const sdkConfigValue = featuresConfig[f.id]; - if (sdkConfigValue === 'labs') { - return true; - } - }).map((f) => { + let labsFeatures; + if (enableLabs) { + labsFeatures = FEATURES; + } else { + labsFeatures.filter((f) => { + const sdkConfigValue = featuresConfig[f.id]; + if (sdkConfigValue === 'labs') { + return true; + } + }); + } + return labsFeatures.map((f) => { return f.id; }); }, From 5214a867db5902491f90cbb5e34d97447363e5ca Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 13 Oct 2017 14:43:26 +0100 Subject: [PATCH 6/7] Fix labs again --- src/UserSettingsStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index 0a992dfbad..d6b32fab5e 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -43,7 +43,7 @@ export default { if (enableLabs) { labsFeatures = FEATURES; } else { - labsFeatures.filter((f) => { + labsFeatures = FEATURES.filter((f) => { const sdkConfigValue = featuresConfig[f.id]; if (sdkConfigValue === 'labs') { return true; From d0759a537bfdde4095ba0955cee8d5d1a7824176 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 13 Oct 2017 16:06:17 +0100 Subject: [PATCH 7/7] Fix the enableLabs flag, again We were showing the options but ignoring them --- src/UserSettingsStore.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index d6b32fab5e..6f689735a7 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -202,7 +202,10 @@ export default { isFeatureEnabled: function(featureId: string): boolean { const featuresConfig = SdkConfig.get()['features']; - let sdkConfigValue = 'disable'; + // The old flag: honourned for backwards compat + const enableLabs = SdkConfig.get()['enableLabs']; + + let sdkConfigValue = enableLabs ? 'labs' : 'disable'; if (featuresConfig && featuresConfig[featureId] !== undefined) { sdkConfigValue = featuresConfig[featureId]; }