Skip to content

Commit

Permalink
various minor slack updates + docs (#1163)
Browse files Browse the repository at this point in the history
  • Loading branch information
IrinaSouth authored Jul 11, 2024
1 parent fe872ef commit 267975c
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class SlackPanelWidgetState extends State<SlackPanelWidget> {
const FHExternalLinkWidget(
tooltipMessage: "View documentation",
link:
"https://docs.featurehub.io/featurehub/latest/slack.html",
"https://docs.featurehub.io/featurehub/latest/slack-integration.html",
icon: Icon(Icons.arrow_outward_outlined),
label: 'Slack Integration Documentation',
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ class TrackingEventListViewState
for (final item in _items) TrackEventItemWidget(event: item),
if (_error != null) const FHLoadingError(),
if (_error == null && !_isLastPage && !_isLoading)
_buttonRefresh('More items...'),
_buttonRefresh('More records'),
if (_error != null && !_isLastPage && !_isLoading)
_buttonRefresh('Retry...'),
_buttonRefresh('Retry'),
if ((_error != null || _items.isNotEmpty || _isLastPage) &&
_isLoading)
const FHLoadingIndicator(),
Expand All @@ -129,9 +129,7 @@ class TrackingEventListViewState
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
FHFlatButton(
onPressed: () => _fetchPage(_pageKey + 1),
title: 'More items...'),
FHFlatButton(onPressed: () => _fetchPage(_pageKey + 1), title: title),
],
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class _FinalSetupPageOverlayWidget extends StatelessWidget {
child: Text(
'Next step is to create your first application and add some features.'
' Your first environment called "Production" will be created by default.'
' Or you can follow the "Quick Setup" helper by clicking the "rocket" icon on the right of the app bar.',
' You can follow the "Quick Setup" helper by clicking the "rocket" icon on the right of the app bar to see your progress.',
style: Theme.of(context).textTheme.bodyLarge),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class SiteSystemConfigWidget extends StatefulWidget {
}
}

class SiteSystemConfigState extends State<SiteSystemConfigWidget> with SystemConfigMixin {
class SiteSystemConfigState extends State<SiteSystemConfigWidget>
with SystemConfigMixin {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();

@override
Expand Down Expand Up @@ -50,15 +51,17 @@ class SiteSystemConfigState extends State<SiteSystemConfigWidget> with SystemCon
decoration: const InputDecoration(
border: OutlineInputBorder(),
hintText:
'https://featurehub.yourorganisation.ai',
labelText: "The url of your organisation's Featurehub Website",
'https://featurehub.yourorganisation.ai',
labelText:
"The URL of your organisation's FeatureHub app",
),
validator: (val) {
if ((val == null || val.trim().isEmpty)) {
return 'You cannot specify an empty url';
}

if (val.startsWith('http://') || val.startsWith('https://')) {
if (val.startsWith('http://') ||
val.startsWith('https://')) {
return null;
}

Expand All @@ -74,7 +77,9 @@ class SiteSystemConfigState extends State<SiteSystemConfigWidget> with SystemCon
children: [
const Text('Allow search robots to index'),
Checkbox(
value: robotsEnabled.value == true ? true : false,
value: robotsEnabled.value == true
? true
: false,
onChanged: (val) {
setState(() {
robotsEnabled.value = val;
Expand All @@ -89,9 +94,12 @@ class SiteSystemConfigState extends State<SiteSystemConfigWidget> with SystemCon
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text('Redirect traffic with bad Hosts header'),
const Text(
'Redirect traffic with bad Hosts header'),
Checkbox(
value: defaultChannel.value == true ? true : false,
value: defaultChannel.value == true
? true
: false,
onChanged: (val) {
setState(() {
defaultChannel.value = val;
Expand Down Expand Up @@ -135,7 +143,3 @@ class SiteSystemConfigState extends State<SiteSystemConfigWidget> with SystemCon
@override
String get namedSection => 'Site';
}




Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class SlackSystemConfigState extends State<SlackSystemConfigWidget>
children: [
FHExternalLinkWidget(
tooltipMessage: "View documentation",
link: "https://docs.featurehub.io/featurehub/latest/slack.html",
link:
"https://docs.featurehub.io/featurehub/latest/slack-integration.html",
icon: Icon(Icons.arrow_outward_outlined),
label: 'Slack Integration Documentation',
)
Expand Down Expand Up @@ -72,7 +73,7 @@ class SlackSystemConfigState extends State<SlackSystemConfigWidget>
header,
if (bearer.value != null)
Padding(
padding: const EdgeInsets.only(left: 8.0),
padding: const EdgeInsets.only(left: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expand Down Expand Up @@ -172,7 +173,7 @@ class SlackSystemConfigState extends State<SlackSystemConfigWidget>
),
)),
Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.only(top: 16.0, left: 8.0, bottom: 16.0),
child: Row(
children: [
FilledButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ Summary of changes:
{{~#if deletedStrategies}}
>• Deleted strategies: {{#deletedStrategies}}*{{name}}*{{#unless @last}}, {{/unless}}
{{/deletedStrategies}}{{/if}}
{{~#lockUpdated~}}
{{~#lockUpdated}}
{{~#wasLocked}}
>• Feature set to `locked`{{/wasLocked}}
{{~^wasLocked}}
>• Feature set to `unlocked`{{/wasLocked}}{{~/lockUpdated~}}
>• Feature set to `unlocked`{{/wasLocked}}{{~/lockUpdated}}
{{~#retiredUpdated}}
>• {{~#if wasRetired}} Feature set to `retired`{{/if}}{{#unless wasRetired}} Feature set to `unretired`{{/unless}}{{/retiredUpdated}}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 16 additions & 4 deletions docs/modules/ROOT/pages/slack-integration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@ image::slack-message-example.png[Slack install to workspace, 800]
. Firstly, you will need to enable Slack Integration in the System Config page. This is a global Slack setup page, which will help you to connect FeatureHub organisation (or deployed instance of Open Source version) with Slack. This can be accessed by users with Super Admin permission.
+
image::slack-system-config.png[Slack system config, 1500]
+
NOTE: For Open Source version only, ensure you have provided correct website URL for your FeatureHub app in the Site Configuration section of the System Configuration page.
+
image::fh-website-url-config.png[FeatureHub system config website URL, 1500]

. Click "Connect FeatureHub to Slack" button, this will redirect you to Slack app installation in your workspace. Make sure you are logged in as your workspace Slack admin. Follow the instructions to add FeatureHub app to your workspace. For FeatureHub Open Source there will be one extra step to select the "Install to Workspace" option.

. Click "Connect FeatureHub to Slack" button, this will redirect you to Slack app installation in your workspace. Make sure you are logged in as your workspace Slack admin. Follow the instructions to add FeatureHub app to your workspace. For FeatureHub Open Source you will be asked to create the app from a manifest:
+
image::slack-install-manifest.png[Slack install from manifest, 800]

+
For Open Source version you will have to complete an extra step by selecting "Install to Workspace".
+
image::1-slack-install-to-workspace.png[Slack install to workspace, 1500]

Expand All @@ -26,15 +36,17 @@ and paste it into the field in the FeatureHub Slack Configuration form
+
image::slack-oauth-token.png[Slack access token, 1500]

. Provide Slack channel ID where you would like the notifications to go to. You can find and copy it from the Channel Details menu in your Slack workspace. This will be your default channel ID, but you can override it for each application/environment later. Once you set this up, don't forget to enable your global configuration by ticking the box "Enabled".
. Provide Slack channel ID where you would like the notifications to go to. You can find and copy it from the Channel Details menu in your Slack workspace. This will be your default channel ID, but you can override it for each application/environment later. Once you set this up, don't forget to enable your global configuration by ticking the box "Enabled" and by saving the form.
+
image::slack-channel-id.png[Slack channel ID, 1500]

. Go to the Integrations tab on the Application Settings page, then select an environment and "Integration type: Slack" from the drop-down. Here you can enable Slack message delivery and if required override the default channel ID set in the previous step. You should now be able to receive Slack updates. There is also a log with message delivery status to indicate any errors in case message delivery is not successful.
. Go to the Integrations tab on the Application Settings page, then select an environment and "Integration type: Slack" from the drop-down. Here you can enable Slack message delivery and if required override the default channel ID set in the previous step.
+
image::slack-env-settings.png[Slack per environment settings, 1500]

TIP: If you are sending Slack updates to a private channel, you may need to invite @FeatureHub bot first. To send an invitation, type @featurehub and press send.
IMPORTANT: If you are sending Slack updates to a private channel, you may need to invite @FeatureHub bot first. To send an invitation, type @featurehub and press send.

You should now be able to receive Slack updates. Message delivery status log is available to indicate any errors in the case of unsuccessful message delivery.

== Offloading Slack delivery to an external app (FeatureHub Open Source only)

Expand Down
17 changes: 17 additions & 0 deletions docs/modules/ROOT/pages/system-configuration.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
= System Configuration

System Configuration pages can be accessed by users with Super Admin permission. Those are site-wide global settings.

== Site Configuration (Open Source version only)

Site Configuration allows you to configure correct website URL for your FeatureHub app, for example this is a prerequisite for enabling Slack integration.
+
image::fh-website-url-config.png[FeatureHub system config website URL, 1500]

== Slack Configuration

This is a global Slack setup page, which will help you to connect FeatureHub organisation (or deployed instance of Open Source version) with Slack. See more details on link:slack-integration.adoc[Slack integration] page.

image::slack-system-config.png[Slack system config, 1500]


0 comments on commit 267975c

Please sign in to comment.