Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Add new bot account settings page. #2954

Merged
merged 7 commits into from
Jun 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add new bot account settings page.
  • Loading branch information
zkry committed Jun 12, 2019
commit 79d8e0342dc1b6dc73a2311e1b1eda420ade8489
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ exports[`components/AdminConsole should generate the routes 1`] = `
path="/integrations/integration_management"
render={[Function]}
/>
<Route
key="integrations/bot_accounts"
path="/integrations/bot_accounts"
render={[Function]}
/>
<Route
key="integrations/gif"
path="/integrations/gif"
Expand Down
40 changes: 31 additions & 9 deletions components/admin_console/admin_definition.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3397,15 +3397,6 @@ export default {
help_text_default: 'When true, webhooks, slash commands and other integrations, such as [Zapier](!https://docs.mattermost.com/integrations/zapier.html), will be allowed to change the profile picture they post with. Note: Combined with allowing integrations to override usernames, users may be able to perform phishing attacks by attempting to impersonate other users.',
help_text_markdown: true,
},
{
type: Constants.SettingsTypes.TYPE_BOOL,
key: 'ServiceSettings.EnableBotAccountCreation',
label: t('admin.service.enableBotTitle'),
label_default: 'Enable Bot Account Creation: ',
help_text: t('admin.service.enableBotAccountCreation'),
help_text_default: 'When true, users can create bot accounts for integrations in **Integrations > Bot Accounts**. Bot accounts are similar to user accounts except they cannot be used to log in. See [documentation](https://mattermost.com/pl/default-bot-accounts) to learn more.',
help_text_markdown: true,
},
{
type: Constants.SettingsTypes.TYPE_BOOL,
key: 'ServiceSettings.EnableUserAccessTokens',
Expand All @@ -3417,6 +3408,37 @@ export default {
},
],
},
},
bot_accounts: {
url: 'integrations/bot_accounts',
title: t('admin.integrations.botAccounts'),
title_default: 'Bot Accounts',
schema: {
id: "BotAccountSettings",
name: t('admin.integrations.botAccount.title'),
name_default: "Bot Accounts",
settings: [
{
type: Constants.SettingsTypes.TYPE_BOOL,
key: 'ServiceSettings.EnableBotAccountCreation',
label: t('admin.service.enableBotTitle'),
label_default: 'Enable Bot Account Creation: ',
help_text: t('admin.service.enableBotAccountCreation'),
help_text_default: 'When true, users can create bot accounts for integrations in **Integrations > Bot Accounts**. Bot accounts are similar to user accounts except they cannot be used to log in. See [documentation](https://mattermost.com/pl/default-bot-accounts) to learn more.',
help_text_markdown: true,
},
{
type: Constants.SettingsTypes.TYPE_BOOL,
key: 'ServiceSettings.DisableBotsWhenOwnerIsDeactivated',
label: t('admin.service.disableBotOwnerDeactivatedTitle'),
label_default: 'Disable bot accounts when owner is deactivated',
help_text: t('admin.service.disableBotWhenOwnerIsDeactivated'),
help_text_default: 'When a user is deactivated, disables all bot accounts managed by the user. To re-enable bot accounts, go to **Integrations > Bot Accounts**',
isDisabled: it.stateEquals('ServiceSettings.EnableBotAccountCreation', false),
help_text_markdown: true,
}
]
}
},
gif: {
url: 'integrations/gif',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,19 @@ exports[`components/AdminSidebar should match snapshot 1`] = `
/>
<AdminSidebarSection
key="5"
name="integrations/bot_accounts"
parentLink=""
subsection={false}
title={
<FormattedMessage
defaultMessage="Bot Accounts"
id="admin.integrations.botAccounts"
values={Object {}}
/>
}
/>
<AdminSidebarSection
key="6"
name="integrations/gif"
parentLink=""
subsection={false}
Expand All @@ -525,7 +538,7 @@ exports[`components/AdminSidebar should match snapshot 1`] = `
}
/>
<AdminSidebarSection
key="6"
key="7"
name="integrations/cors"
parentLink=""
subsection={false}
Expand Down Expand Up @@ -1077,6 +1090,19 @@ exports[`components/AdminSidebar should match snapshot, not prevent the console
/>
<AdminSidebarSection
key="5"
name="integrations/bot_accounts"
parentLink=""
subsection={false}
title={
<FormattedMessage
defaultMessage="Bot Accounts"
id="admin.integrations.botAccounts"
values={Object {}}
/>
}
/>
<AdminSidebarSection
key="6"
name="integrations/gif"
parentLink=""
subsection={false}
Expand All @@ -1089,7 +1115,7 @@ exports[`components/AdminSidebar should match snapshot, not prevent the console
}
/>
<AdminSidebarSection
key="6"
key="7"
name="integrations/cors"
parentLink=""
subsection={false}
Expand Down Expand Up @@ -1641,6 +1667,19 @@ exports[`components/AdminSidebar should match snapshot, not render the plugin in
/>
<AdminSidebarSection
key="5"
name="integrations/bot_accounts"
parentLink=""
subsection={false}
title={
<FormattedMessage
defaultMessage="Bot Accounts"
id="admin.integrations.botAccounts"
values={Object {}}
/>
}
/>
<AdminSidebarSection
key="6"
name="integrations/gif"
parentLink=""
subsection={false}
Expand All @@ -1653,7 +1692,7 @@ exports[`components/AdminSidebar should match snapshot, not render the plugin in
}
/>
<AdminSidebarSection
key="6"
key="7"
name="integrations/cors"
parentLink=""
subsection={false}
Expand Down Expand Up @@ -2336,6 +2375,19 @@ exports[`components/AdminSidebar should match snapshot, with license (with all f
/>
<AdminSidebarSection
key="5"
name="integrations/bot_accounts"
parentLink=""
subsection={false}
title={
<FormattedMessage
defaultMessage="Bot Accounts"
id="admin.integrations.botAccounts"
values={Object {}}
/>
}
/>
<AdminSidebarSection
key="6"
name="integrations/gif"
parentLink=""
subsection={false}
Expand All @@ -2348,7 +2400,7 @@ exports[`components/AdminSidebar should match snapshot, with license (with all f
}
/>
<AdminSidebarSection
key="6"
key="7"
name="integrations/cors"
parentLink=""
subsection={false}
Expand Down Expand Up @@ -3019,6 +3071,19 @@ exports[`components/AdminSidebar should match snapshot, with license (without an
/>
<AdminSidebarSection
key="5"
name="integrations/bot_accounts"
parentLink=""
subsection={false}
title={
<FormattedMessage
defaultMessage="Bot Accounts"
id="admin.integrations.botAccounts"
values={Object {}}
/>
}
/>
<AdminSidebarSection
key="6"
name="integrations/gif"
parentLink=""
subsection={false}
Expand All @@ -3031,7 +3096,7 @@ exports[`components/AdminSidebar should match snapshot, with license (without an
}
/>
<AdminSidebarSection
key="6"
key="7"
name="integrations/cors"
parentLink=""
subsection={false}
Expand Down
3 changes: 3 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@
"admin.image.storeDescription": "Storage system where files and image attachments are saved.\n \nSelecting \"Amazon S3\" enables fields to enter your Amazon credentials and bucket details.\n \nSelecting \"Local File System\" enables the field to specify a local file directory.",
"admin.image.storeLocal": "Local File System",
"admin.image.storeTitle": "File Storage System:",
"admin.integrations.botAccounts": "Bot Accounts",
"admin.integrations.cors": "CORS",
"admin.integrations.gif": "GIF (Beta)",
"admin.integrations.integrationManagement": "Integration Management",
Expand Down Expand Up @@ -1211,6 +1212,8 @@
"admin.service.corsTitle": "Enable cross-origin requests from:",
"admin.service.developerDesc": "When true, JavaScript errors are shown in a purple bar at the top of the user interface. Not recommended for use in production. ",
"admin.service.developerTitle": "Enable Developer Mode: ",
"admin.service.disableBotOwnerDeactivatedTitle": "Disable bot accounts when owner is deactivated",
zkry marked this conversation as resolved.
Show resolved Hide resolved
"admin.service.disableBotWhenOwnerIsDeactivated": "When a user is deactivated, disables all bot accounts managed by the user. To re-enable bot accounts, go to **Integrations > Bot Accounts**",
zkry marked this conversation as resolved.
Show resolved Hide resolved
"admin.service.enableBotAccountCreation": "When true, users can create bot accounts for integrations in **Integrations > Bot Accounts**. Bot accounts are similar to user accounts except they cannot be used to log in. See [documentation](https://mattermost.com/pl/default-bot-accounts) to learn more.",
"admin.service.enableBotTitle": "Enable Bot Account Creation: ",
"admin.service.enforceMfaDesc": "When true, [multi-factor authentication](!https://docs.mattermost.com/deployment/auth.html) is required for login. New users will be required to configure MFA on signup. Logged in users without MFA configured are redirected to the MFA setup page until configuration is complete.\n \nIf your system has users with login methods other than AD/LDAP and email, MFA must be enforced with the authentication provider outside of Mattermost.",
Expand Down