Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion SystemSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Piwik\Piwik;
use Piwik\Settings\Setting;
use Piwik\Settings\FieldConfig;
use Piwik\Url;

class SystemSettings extends \Piwik\Settings\Plugin\SystemSettings
{
Expand All @@ -29,7 +30,8 @@ private function createSlackOauthTokenSetting()
return $this->makeSetting('slackOauthToken', $default = '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
$field->title = Piwik::translate('Slack_OauthTokenSettingTitle');
$field->uiControl = FieldConfig::UI_CONTROL_PASSWORD;
$field->description = Piwik::translate('Slack_OauthTokenSettingDescription');
$link = Url::addCampaignParametersToMatomoLink('https://matomo.org/?post_type=faq&p=87125&preview=true', null, null, 'App.SystemSettings.Slack') . '#step-1-get-a-slack-oauth-token';
$field->inlineHelp = Piwik::translate('Slack_OauthTokenSettingDescription', ['<a href="' . $link . '" target="_blank" rel="noreferrer noopener">', '</a>']);
$field->transform = function ($value) {
return trim($value);
};
Expand Down
10 changes: 5 additions & 5 deletions lang/en.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"Slack": {
"ChannelId": "Slack Channel ID",
"NoOauthTokenAdded": "Please add your Slack OauthToken %1$shere%2$s.",
"OauthTokenRequiredErrorMessage": "Please add your Slack Oauth token in General Settings under Slack section.",
"OauthTokenSettingTitle": "Slack Oauth Token",
"OauthTokenSettingDescription": "Enter your Slack Oauth Token",
"NoOauthTokenAdded": "Please add your Slack OAuth Token %1$shere%2$s.",
"OauthTokenRequiredErrorMessage": "To enable Slack, provide your Slack OAuth Token in General settings > Slack.",
"OauthTokenSettingTitle": "Slack OAuth Token",
"OauthTokenSettingDescription": "Enter your Slack OAuth Token generated from your Slack. %1$sLearn more%2$s.",
"PleaseFindYourReport": "Here is your %1$s report for %2$s",
"SlackChannelIdRequiredErrorMessage": "Slack Channel ID cannot be empty.",
"SlackChannel": "Slack Channel",
"SlackEnterYourSlackChannelIdHelpText": "Enter your Slack Channel ID"
"SlackEnterYourSlackChannelIdHelpText": "Enter the Slack Channel ID of the channel that will receive these reports. To find the ID, go to Slack and open the channel details > About tab. %1$sLearn more%2$s"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/UI/expected-ui-screenshots/Slack_empty_report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/UI/expected-ui-screenshots/Slack_new_scheduled_reports.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/UI/expected-ui-screenshots/Slack_send_via_slack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/UI/expected-ui-screenshots/Slack_send_via_slack_new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/UI/expected-ui-screenshots/Slack_slack_report_disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/UI/expected-ui-screenshots/Slack_slack_report_enabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/UI/expected-ui-screenshots/Slack_slack_report_error.png
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.
Binary file modified tests/UI/expected-ui-screenshots/Slack_slack_report_pdf_view.png
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.
19 changes: 11 additions & 8 deletions vue/dist/Slack.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vue/dist/Slack.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vue/dist/Slack.umd.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vue/dist/Slack.umd.min.js.map

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions vue/src/SelectSlackChannel/SelectSlackChannel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</span>
<span
v-else
v-text="translate('Slack_SlackEnterYourSlackChannelIdHelpText')"
v-html="$sanitize(getSlackChannelHelpText)"
>
</span>
</div>
Expand All @@ -37,7 +37,7 @@

<script lang="ts">
import { defineComponent } from 'vue';
import { MatomoUrl, translate } from 'CoreHome';
import { MatomoUrl, translate, externalLink } from 'CoreHome';
import { Field } from 'CorePluginsAdmin';

export default defineComponent({
Expand Down Expand Up @@ -70,6 +70,13 @@ export default defineComponent({
'</a>',
);
},
getSlackChannelHelpText() {
return translate(
'Slack_SlackEnterYourSlackChannelIdHelpText',
externalLink('https://matomo.org/?post_type=faq&p=87026&preview=true#step-2-set-up-slack-in-matomo'),
'</a>',
);
},
},
});
</script>