Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | 5x 42x 420x | import React from "react";
import { Accordion, Table } from "react-bootstrap";
// The content here should be kept in sync with the section
// "Setting up the Slack app" in docs/slack.md
// One scope per row
const slackScopes = [
{ capability: "List members", scope: "users:read" },
{ capability: "List members' emails", scope: "users:read.email" },
{
capability: "Create public channels and invite users to them",
scope: "channels:manage",
},
{
capability: "Create private channels and invite users to them",
scope: "groups:write",
},
{ capability: "List public channel memberships", scope: "channels:read" },
{ capability: "List private channel memberships", scope: "groups:read" },
{ capability: "Send messages", scope: "chat:write" },
{
capability: "Send messages to public channels the bot has not joined",
scope: "chat:write.public",
},
{ capability: "Read public channel history", scope: "channels:history" },
{
capability:
"Join public channels (the bot must be a member of a channel to read its history)",
scope: "channels:join",
},
];
export default function SlackSetupInstructions({
testIdPrefix = "SlackSetupInstructions",
}) {
return (
<Accordion className="mb-3" data-testid={`${testIdPrefix}-instructions`}>
<Accordion.Item eventKey="instructions">
<Accordion.Header>
Instructions: Setting up the Slack app
</Accordion.Header>
<Accordion.Body>
<ol>
<li>
Create an app at{" "}
<a
href="https://api.slack.com/apps"
target="_blank"
rel="noopener noreferrer"
>
https://api.slack.com/apps
</a>{" "}
(choose "from scratch"), tied to the target workspace.
</li>
<li>
Under <strong>OAuth & Permissions → Bot Token Scopes</strong>,
add the scopes for the capabilities Frontiers uses (one scope per
row):
<Table
bordered
size="sm"
className="mt-2"
data-testid={`${testIdPrefix}-scopes`}
>
<thead>
<tr>
<th>Capability</th>
<th>Scope</th>
</tr>
</thead>
<tbody>
{slackScopes.map(({ capability, scope }) => (
<tr key={scope}>
<td>{capability}</td>
<td>
<code>{scope}</code>
</td>
</tr>
))}
</tbody>
</Table>
</li>
<li>
Install the app to the workspace (the button is on the same page).
</li>
<li>
Copy the <strong>Bot User OAuth Token</strong> (it starts with{" "}
<code>xoxb-</code>). That is what goes into the Frontiers course
settings.
</li>
<li>
Allow the app to remove people from public channels. By default
only Workspace Owners and Admins may, and then the section and
team channel jobs cannot remove anyone (their log shows{" "}
<code>restricted_action</code>). A Workspace Owner opens{" "}
<strong>Workspace settings → Roles & permissions</strong> (on
older workspaces,{" "}
<strong>Permissions → Channel Management</strong>) and sets{" "}
<strong>
People who can remove members from public channels
</strong>{" "}
to <strong>Everyone, except guests</strong>.
</li>
</ol>
</Accordion.Body>
</Accordion.Item>
</Accordion>
);
}
|