This restores the temporary Meta incident safeguards with two independent runtime controls for Chatwoot Cloud. Super admins can now re-enable Instagram messaging first and keep new Meta inbox creation disabled until onboarding is stable. When messaging is disabled, Instagram conversations show the incident notice and remain in private-note mode. The separate inbox-creation control disables Facebook, Instagram, and WhatsApp Embedded Signup entry points. Self-hosted installations remain unchanged. Related: https://github.com/chatwoot/chatwoot/pull/15210 Related: https://status.chatwoot.com/incident/976975 ### Things to know - `DISABLE_META_MESSAGE_SENDING` affects Instagram messaging only. - `DISABLE_META_INBOX_CREATION` affects Facebook, Instagram, and WhatsApp Embedded Signup inbox creation. - Both controls default to `true` for the active incident and are editable from Super Admin installation configs. - The Cloud-only boundary is enforced by the dashboard configuration getters. ### How to test 1. Open Super Admin → Installation Configs and set `DISABLE_META_MESSAGE_SENDING` to `false`. 2. Reload an Instagram conversation and confirm the incident banner disappears and the runtime restriction no longer forces private-note mode. 3. Set the flag back to `true`, reload, and confirm the banner and restriction return. 4. Set `DISABLE_META_INBOX_CREATION` to `false`, reload the Facebook, Instagram, or WhatsApp Embedded Signup setup flow, and confirm connection is enabled. 5. Set the flag back to `true`, reload, and confirm the incident notice appears and connection is disabled. --------- Co-authored-by: Muhsin <12408980+muhsin-k@users.noreply.github.com>
79 lines
2.1 KiB
JavaScript
79 lines
2.1 KiB
JavaScript
import { computed } from 'vue';
|
|
import { useRoute } from 'vue-router';
|
|
import { useMapGetter, useStore } from './store';
|
|
|
|
/**
|
|
* Composable for account-related operations.
|
|
* @returns {Object} An object containing account-related properties and methods.
|
|
*/
|
|
export function useAccount() {
|
|
/**
|
|
* Computed property for the current account ID.
|
|
* @type {import('vue').ComputedRef<number>}
|
|
*/
|
|
const route = useRoute();
|
|
const store = useStore();
|
|
const getAccountFn = useMapGetter('accounts/getAccount');
|
|
const isOnChatwootCloud = useMapGetter('globalConfig/isOnChatwootCloud');
|
|
const isMetaInboxCreationDisabled = useMapGetter(
|
|
'globalConfig/isMetaInboxCreationDisabled'
|
|
);
|
|
const isMetaMessageSendingDisabled = useMapGetter(
|
|
'globalConfig/isMetaMessageSendingDisabled'
|
|
);
|
|
const isFeatureEnabledonAccount = useMapGetter(
|
|
'accounts/isFeatureEnabledonAccount'
|
|
);
|
|
|
|
const accountId = computed(() => {
|
|
return Number(route.params.accountId);
|
|
});
|
|
const currentAccount = computed(() => getAccountFn.value(accountId.value));
|
|
|
|
/**
|
|
* Generates an account-scoped URL.
|
|
* @param {string} url - The URL to be scoped to the account.
|
|
* @returns {string} The account-scoped URL.
|
|
*/
|
|
const accountScopedUrl = url => {
|
|
return `/app/accounts/${accountId.value}/${url}`;
|
|
};
|
|
|
|
const isCloudFeatureEnabled = feature => {
|
|
return isFeatureEnabledonAccount.value(currentAccount.value.id, feature);
|
|
};
|
|
|
|
const accountScopedRoute = (name, params, query) => {
|
|
return {
|
|
name,
|
|
params: { accountId: accountId.value, ...params },
|
|
query: { ...query },
|
|
};
|
|
};
|
|
|
|
const updateAccount = async (data, options) => {
|
|
await store.dispatch('accounts/update', {
|
|
...data,
|
|
options,
|
|
});
|
|
};
|
|
|
|
const finishOnboarding = async data => {
|
|
await store.dispatch('accounts/finishOnboarding', data);
|
|
};
|
|
|
|
return {
|
|
accountId,
|
|
route,
|
|
currentAccount,
|
|
accountScopedUrl,
|
|
accountScopedRoute,
|
|
isCloudFeatureEnabled,
|
|
isOnChatwootCloud,
|
|
isMetaInboxCreationDisabled,
|
|
isMetaMessageSendingDisabled,
|
|
updateAccount,
|
|
finishOnboarding,
|
|
};
|
|
}
|