Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the word Capture to Snippet on the Slack response (only) #296

Merged
merged 2 commits into from
Nov 14, 2023
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
5 changes: 5 additions & 0 deletions .changeset/cold-dancers-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gitbook/integration-slack': patch
---

Update term used in Save
10 changes: 5 additions & 5 deletions integrations/slack/src/actions/saveThread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const RUNTIME_TIME_LIMIT = 30000;
const APP_ORG_URL = 'https://app.gitbook.com/o/';

/**
* Save thread in GitBook as a summary (capture)
* Save thread in GitBook as a summary (snippet)
*/
export async function saveThread(
{
Expand All @@ -28,7 +28,7 @@ export async function saveThread(
// acknowledge the request to the user
notifySavingThread({ channel: channelId, thread_ts, userId }, context, accessToken);

const capturesURL = `${APP_ORG_URL}${installation.target.organization}/captures`;
const snippetsURL = `${APP_ORG_URL}${installation.target.organization}/snippets`;
// In some cases, the runtime limit is reached before the capture is finished (e.g large threads)
// we notify the user before the runtime limit is reached that the capture
const timeoutId = registerNotifyBeforeRuntimeLimit(
Expand All @@ -37,7 +37,7 @@ export async function saveThread(
thread_ts,
userId,
},
capturesURL,
snippetsURL,
context,
accessToken
);
Expand Down Expand Up @@ -267,7 +267,7 @@ function registerNotifyBeforeRuntimeLimit(
thread_ts: string;
userId: string;
},
capturesUrl: string,
snippetsUrl: string,
context: SlackRuntimeContext,
accessToken: string
) {
Expand All @@ -285,7 +285,7 @@ function registerNotifyBeforeRuntimeLimit(
type: 'section',
text: {
type: 'mrkdwn',
text: `Thread is being saved. You'll find the capture in <${capturesUrl}|GitBook> shortly.`,
text: `Thread is being saved. You'll find the snippet in <${snippetsUrl}|GitBook> shortly.`,
},
},
],
Expand Down
4 changes: 2 additions & 2 deletions integrations/slack/src/ui/blocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ export function PagesBlock(params: {
];
}

export function ConversationSavedBlock(captureUrl: string) {
export function ConversationSavedBlock(snippetsUrl: string) {
return [
{
type: 'section',
text: {
type: 'mrkdwn',
text: `:white_check_mark: Conversation saved in <${captureUrl}|GitBook>`,
text: `:white_check_mark: Conversation saved in <${snippetsUrl}|GitBook>`,
},
},
];
Expand Down