Merge pull request #5492 from ToolJet/merge-back/2.1.2

Merge back hotfix 2.1.2
pull/5494/head
Sherfin Shamsudeen 2023-02-07 12:35:42 +05:30 zatwierdzone przez GitHub
commit a63a4639bf
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 23 dodań i 14 usunięć

Wyświetl plik

@ -1 +1 @@
2.1.1
2.1.2

Wyświetl plik

@ -12,9 +12,10 @@ const Slack = ({ optionchanged, createDataSource, options, isSaving, selectedDat
const provider = 'slack';
setAuthStatus('waiting_for_url');
let scope = 'chat:write,users:read,channels:read,channels:history';
let scope =
'users:read,channels:read,groups:read,im:read,mpim:read,channels:history,groups:history,im:history,mpim:history';
if (options.access_type === 'chat:write') {
scope = `${scope},chat:write:bot,chat:write:user`;
scope = `${scope},chat:write`;
}
datasourceService.fetchOauth2BaseUrl(provider).then((data) => {

Wyświetl plik

@ -65,19 +65,26 @@ export default class SlackQueryService implements QueryService {
break;
case 'send_message': {
const body = {
channel: queryOptions.channel,
text: queryOptions.message,
as_user: queryOptions.sendAsUser,
};
if (sourceOptions.access_type === 'chat:write') {
const body = {
channel: queryOptions.channel,
text: queryOptions.message,
as_user: queryOptions.sendAsUser,
};
response = await got('https://slack.com/api/chat.postMessage', {
method: 'post',
json: body,
headers: this.authHeader(accessToken),
});
response = await got('https://slack.com/api/chat.postMessage', {
method: 'post',
json: body,
headers: this.authHeader(accessToken),
});
result = JSON.parse(response.body);
result = JSON.parse(response.body);
} else {
result = {
ok: false,
error: 'You do not have the required permissions to perform this operation',
};
}
break;
}

Wyświetl plik

@ -1,5 +1,6 @@
export type SourceOptions = {
access_token: string;
access_type: 'chat:write' | 'read';
};
export type QueryOptions = {
operation: string;