try(dashboard): slack integration window does not work (test 2)
This commit is contained in:
@@ -21,8 +21,11 @@ export function SlackIntegrationForm({
|
|||||||
}) {
|
}) {
|
||||||
const { organizationId } = useAppParams();
|
const { organizationId } = useAppParams();
|
||||||
useWS(`/live/integrations/slack?organizationId=${organizationId}`, (res) => {
|
useWS(`/live/integrations/slack?organizationId=${organizationId}`, (res) => {
|
||||||
|
// @ts-expect-error
|
||||||
|
console.log('3. slack integration done', window.slackPopup);
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
if (window.slackPopup && typeof window.slackPopup.close === 'function') {
|
if (window.slackPopup && typeof window.slackPopup.close === 'function') {
|
||||||
|
console.log('4. close popup');
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
window.slackPopup.close();
|
window.slackPopup.close();
|
||||||
}
|
}
|
||||||
@@ -38,11 +41,14 @@ export function SlackIntegrationForm({
|
|||||||
});
|
});
|
||||||
const mutation = api.integration.createOrUpdateSlack.useMutation({
|
const mutation = api.integration.createOrUpdateSlack.useMutation({
|
||||||
async onSuccess(res) {
|
async onSuccess(res) {
|
||||||
|
console.log('1. onSuccess', res);
|
||||||
|
|
||||||
const url = res.slackInstallUrl;
|
const url = res.slackInstallUrl;
|
||||||
const width = 600;
|
const width = 600;
|
||||||
const height = 800;
|
const height = 800;
|
||||||
const left = window.screenX + (window.outerWidth - width) / 2;
|
const left = window.screenX + (window.outerWidth - width) / 2;
|
||||||
const top = window.screenY + (window.outerHeight - height) / 2.5;
|
const top = window.screenY + (window.outerHeight - height) / 2.5;
|
||||||
|
console.log('2. open popup');
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
window.slackPopup = window.open(
|
window.slackPopup = window.open(
|
||||||
url,
|
url,
|
||||||
|
|||||||
Reference in New Issue
Block a user