Files
baserow/web-frontend/modules/core/plugin.js
Peter Evans 1e7ae9deb8 feat: list every invitation link of a workspace in the workspace settings modal (#6802)
* feat: list every invitation link of a workspace in the workspace settings modal

* fix: show the table of view invite links, keep the list steady while searching and wrap its header
2026-11-27 17:16:07 +04:00

512 lines
18 KiB
JavaScript

// plugins/baserow.js
import { defineNuxtPlugin } from '#app'
import { Registry } from '@baserow/modules/core/registry'
import { PasswordAuthProviderType } from '@baserow/modules/core/authProviderTypes'
import {
CreateSnapshotJobType,
CreateUserTemplateJobType,
DownloadUserTemplateJobType,
DuplicateApplicationJobType,
ExportApplicationsJobType,
ImportApplicationsJobType,
InstallTemplateJobType,
RestoreSnapshotJobType,
} from '@baserow/modules/core/jobTypes'
import {
AccountSettingsType,
PasswordSettingsType,
EmailSettingsType,
EmailNotificationsSettingsType,
MCPEndpointSettingsType,
DeleteAccountSettingsType,
TwoFactorAuthSettingsType,
} from '@baserow/modules/core/settingsTypes'
import {
GenerativeAIWorkspaceSettingsType,
SnapshotsWorkspaceSettingsType,
IntegrationsWorkspaceSettingsType,
InvitationLinksWorkspaceSettingsType,
} from '@baserow/modules/core/workspaceSettingsTypes'
import { SharedApplicationType } from '@baserow/modules/core/applicationTypes'
import {
OpenAIModelType,
OllamaModelType,
AnthropicModelType,
BedrockModelType,
MistralModelType,
OpenRouterModelType,
GoogleModelType,
GroqModelType,
XaiModelType,
ZaiModelType,
} from '@baserow/modules/core/generativeAIModelTypes'
import {
UploadFileUserFileUploadType,
UploadViaURLUserFileUploadType,
} from '@baserow/modules/core/userFileUploadTypes'
import {
AIProvidersAdminType,
DashboardAdminType,
UsersAdminType,
WorkspacesAdminType,
TemplatesAdminType,
HealthCheckAdminType,
SettingsAdminType,
} from '@baserow/modules/core/adminTypes'
import {
BasicPermissionManagerType,
CorePermissionManagerType,
StaffPermissionManagerType,
WorkspaceMemberPermissionManagerType,
StaffOnlySettingOperationPermissionManagerType,
AllowIfTemplateOperationPermissionManagerType,
} from '@baserow/modules/core/permissionManagerTypes'
import {
MembersWorkspaceSettingsPageType,
IdentitiesWorkspaceSettingsPageType,
} from '@baserow/modules/core/workspaceSettingsPageTypes'
import {
WorkspaceInvitationCreatedNotificationType,
WorkspaceInvitationAcceptedNotificationType,
WorkspaceInvitationRejectedNotificationType,
BaserowVersionUpgradeNotificationType,
AbuseReportCreatedNotificationType,
UserTemplateInReviewNotificationType,
BlockedUserTemplateChangedNotificationType,
UserTemplateApprovedNotificationType,
UserTemplateRejectedNotificationType,
UserTemplateChangeRejectedNotificationType,
UserTemplateUnlistedNotificationType,
UserTemplateBlockedNotificationType,
UserTemplateUnblockedNotificationType,
} from '@baserow/modules/core/notificationTypes'
import { MoreOnboardingType } from '@baserow/modules/core/onboardingTypes'
import { SidebarGuidedTourType } from '@baserow/modules/core/guidedTourTypes'
import { TOTPAuthType } from '@baserow/modules/core/twoFactorAuthTypes'
import { CloudflareTurnstileCaptchaProviderType } from '@baserow/modules/core/captchaProviderTypes'
import { DefaultErrorPageType } from '@baserow/modules/core/errorPageTypes'
import {
GeneralIdentitySettingsType,
McpServerIdentitySettingsType,
} from '@baserow/modules/core/identitySettingsTypes'
import {
AnonymousUserSubjectType,
UserSubjectType,
} from '@baserow/modules/core/subjectTypes.jsx'
import {
EmailInvitationRouteType,
LinkInvitationRouteType,
} from '@baserow/modules/core/invitationRouteTypes'
import { WorkspaceInvitationTargetType } from '@baserow/modules/core/invitationTargetTypes'
import {
RuntimeAdd,
RuntimeMinus,
RuntimeMultiply,
RuntimeDivide,
RuntimeGreaterThan,
RuntimeGreaterThanOrEqual,
RuntimeLessThan,
RuntimeLessThanOrEqual,
RuntimeConcat,
RuntimeGet,
RuntimeEqual,
RuntimeNotEqual,
RuntimeUpper,
RuntimeLower,
RuntimeCapitalize,
RuntimeRound,
RuntimeAbs,
RuntimeIsEven,
RuntimeIsOdd,
RuntimeDateTimeFormat,
RuntimeDay,
RuntimeMonth,
RuntimeYear,
RuntimeHour,
RuntimeMinute,
RuntimeSecond,
RuntimeNow,
RuntimeNull,
RuntimeNumberFormat,
RuntimeToDuration,
RuntimeDurationFormat,
RuntimeToday,
RuntimeGetProperty,
RuntimeRandomInt,
RuntimeRandomFloat,
RuntimeRandomBool,
RuntimeGenerateUUID,
RuntimeIf,
RuntimeAnd,
RuntimeOr,
RuntimeReplace,
RuntimeLength,
RuntimeContains,
RuntimeReverse,
RuntimeJoin,
RuntimeSplit,
RuntimeIsEmpty,
RuntimeStrip,
RuntimeEncodeUri,
RuntimeEncodeUriComponent,
RuntimeMarkdownToHtml,
RuntimeSum,
RuntimeAvg,
RuntimeAt,
RuntimeRange,
RuntimeToArray,
RuntimeToJson,
RuntimeFromJson,
RuntimeToDatetime,
} from '@baserow/modules/core/runtimeFormulaTypes'
import { AdminRoleType, MemberRoleType } from '@baserow/modules/core/roleTypes'
export default defineNuxtPlugin({
name: 'core',
dependsOn: ['priorityBus', 'registry', 'i18n'],
setup(nuxtApp) {
const registry = nuxtApp.$registry
registry.registerNamespace('plugin')
registry.registerNamespace('chatRunType')
registry.registerNamespace('toolPresentation')
registry.registerNamespace('permissionManager')
registry.registerNamespace('application')
registry.registerNamespace('authProvider')
registry.registerNamespace('job')
registry.registerNamespace('view')
registry.registerNamespace('lastViewedItem')
registry.registerNamespace('field')
registry.registerNamespace('settings')
registry.registerNamespace('workspaceSettings')
registry.registerNamespace('userFileUpload')
registry.registerNamespace('membersPagePlugins')
registry.registerNamespace('runtimeFormulaFunction')
registry.registerNamespace('notification')
registry.registerNamespace('workflowAction')
registry.registerNamespace('integration')
registry.registerNamespace('service')
registry.registerNamespace('userSource')
registry.registerNamespace('appAuthProvider')
registry.registerNamespace('roles')
registry.registerNamespace('generativeAIModel')
registry.registerNamespace('aiProviderModelFeature')
registry.registerNamespace('onboarding')
registry.registerNamespace('guidedTour')
registry.registerNamespace('admin')
registry.registerNamespace('workspaceSettingsPage')
registry.registerNamespace('identityExtension')
registry.registerNamespace('identitySettings')
registry.registerNamespace('subject')
registry.registerNamespace('errorPage')
registry.registerNamespace('twoFactorAuth')
registry.registerNamespace('captchaProvider')
registry.registerNamespace('invitationRoute')
registry.registerNamespace('invitationTarget')
registry.registerNamespace('invitationData')
const context = { app: nuxtApp }
registry.register('application', new SharedApplicationType(context))
registry.register('subject', new UserSubjectType(context))
registry.register('subject', new AnonymousUserSubjectType(context))
registry.register('invitationRoute', new EmailInvitationRouteType(context))
registry.register('invitationRoute', new LinkInvitationRouteType(context))
registry.register(
'invitationTarget',
new WorkspaceInvitationTargetType(context)
)
registry.register(
'identitySettings',
new GeneralIdentitySettingsType(context)
)
registry.register(
'identitySettings',
new McpServerIdentitySettingsType(context)
)
registry.register('settings', new AccountSettingsType(context))
registry.register('settings', new PasswordSettingsType(context))
registry.register('settings', new EmailSettingsType(context))
registry.register('settings', new EmailNotificationsSettingsType(context))
registry.register('settings', new MCPEndpointSettingsType(context))
registry.register('settings', new DeleteAccountSettingsType(context))
registry.register('settings', new TwoFactorAuthSettingsType(context))
registry.register(
'workspaceSettings',
new GenerativeAIWorkspaceSettingsType(context)
)
registry.register(
'workspaceSettings',
new SnapshotsWorkspaceSettingsType(context)
)
registry.register(
'workspaceSettings',
new IntegrationsWorkspaceSettingsType(context)
)
registry.register(
'workspaceSettings',
new InvitationLinksWorkspaceSettingsType(context)
)
registry.register('generativeAIModel', new OpenAIModelType(context))
registry.register('generativeAIModel', new AnthropicModelType(context))
registry.register('generativeAIModel', new BedrockModelType(context))
registry.register('generativeAIModel', new GoogleModelType(context))
registry.register('generativeAIModel', new GroqModelType(context))
registry.register('generativeAIModel', new XaiModelType(context))
registry.register('generativeAIModel', new ZaiModelType(context))
registry.register('generativeAIModel', new MistralModelType(context))
registry.register('generativeAIModel', new OllamaModelType(context))
registry.register('generativeAIModel', new OpenRouterModelType(context))
registry.register(
'permissionManager',
new CorePermissionManagerType(context)
)
registry.register(
'permissionManager',
new StaffPermissionManagerType(context)
)
registry.register(
'permissionManager',
new WorkspaceMemberPermissionManagerType(context)
)
registry.register(
'permissionManager',
new BasicPermissionManagerType(context)
)
registry.register(
'permissionManager',
new StaffOnlySettingOperationPermissionManagerType(context)
)
registry.register(
'permissionManager',
new AllowIfTemplateOperationPermissionManagerType(context)
)
registry.register(
'userFileUpload',
new UploadFileUserFileUploadType(context)
)
registry.register(
'userFileUpload',
new UploadViaURLUserFileUploadType(context)
)
registry.register('admin', new DashboardAdminType(context))
registry.register('admin', new UsersAdminType(context))
registry.register('admin', new WorkspacesAdminType(context))
registry.register('admin', new TemplatesAdminType(context))
registry.register('admin', new AIProvidersAdminType(context))
registry.register('admin', new SettingsAdminType(context))
registry.register('admin', new HealthCheckAdminType(context))
registry.register('authProvider', new PasswordAuthProviderType(context))
registry.register('job', new DuplicateApplicationJobType(context))
registry.register('job', new InstallTemplateJobType(context))
registry.register('job', new CreateUserTemplateJobType(context))
registry.register('job', new DownloadUserTemplateJobType(context))
registry.register('job', new CreateSnapshotJobType(context))
registry.register('job', new RestoreSnapshotJobType(context))
registry.register('job', new ExportApplicationsJobType(context))
registry.register('job', new ImportApplicationsJobType(context))
registry.register(
'workspaceSettingsPage',
new MembersWorkspaceSettingsPageType(context)
)
registry.register(
'workspaceSettingsPage',
new IdentitiesWorkspaceSettingsPageType(context)
)
registry.register('runtimeFormulaFunction', new RuntimeConcat(context))
registry.register('runtimeFormulaFunction', new RuntimeGet(context))
registry.register('runtimeFormulaFunction', new RuntimeAdd(context))
registry.register('runtimeFormulaFunction', new RuntimeMinus(context))
registry.register('runtimeFormulaFunction', new RuntimeMultiply(context))
registry.register('runtimeFormulaFunction', new RuntimeDivide(context))
registry.register('runtimeFormulaFunction', new RuntimeGreaterThan(context))
registry.register(
'runtimeFormulaFunction',
new RuntimeGreaterThanOrEqual(context)
)
registry.register('runtimeFormulaFunction', new RuntimeLessThan(context))
registry.register(
'runtimeFormulaFunction',
new RuntimeLessThanOrEqual(context)
)
registry.register('runtimeFormulaFunction', new RuntimeEqual(context))
registry.register('runtimeFormulaFunction', new RuntimeNotEqual(context))
registry.register('runtimeFormulaFunction', new RuntimeUpper(context))
registry.register('runtimeFormulaFunction', new RuntimeLower(context))
registry.register('runtimeFormulaFunction', new RuntimeCapitalize(context))
registry.register('runtimeFormulaFunction', new RuntimeRound(context))
registry.register('runtimeFormulaFunction', new RuntimeAbs(context))
registry.register('runtimeFormulaFunction', new RuntimeIsEven(context))
registry.register('runtimeFormulaFunction', new RuntimeIsOdd(context))
registry.register(
'runtimeFormulaFunction',
new RuntimeDateTimeFormat(context)
)
registry.register('runtimeFormulaFunction', new RuntimeDay(context))
registry.register('runtimeFormulaFunction', new RuntimeMonth(context))
registry.register('runtimeFormulaFunction', new RuntimeYear(context))
registry.register('runtimeFormulaFunction', new RuntimeHour(context))
registry.register('runtimeFormulaFunction', new RuntimeMinute(context))
registry.register('runtimeFormulaFunction', new RuntimeSecond(context))
registry.register('runtimeFormulaFunction', new RuntimeNow(context))
registry.register('runtimeFormulaFunction', new RuntimeToday(context))
registry.register('runtimeFormulaFunction', new RuntimeGetProperty(context))
registry.register('runtimeFormulaFunction', new RuntimeRandomInt(context))
registry.register('runtimeFormulaFunction', new RuntimeRandomFloat(context))
registry.register('runtimeFormulaFunction', new RuntimeRandomBool(context))
registry.register(
'runtimeFormulaFunction',
new RuntimeGenerateUUID(context)
)
registry.register('runtimeFormulaFunction', new RuntimeIf(context))
registry.register('runtimeFormulaFunction', new RuntimeAnd(context))
registry.register('runtimeFormulaFunction', new RuntimeOr(context))
registry.register('runtimeFormulaFunction', new RuntimeReplace(context))
registry.register('runtimeFormulaFunction', new RuntimeLength(context))
registry.register('runtimeFormulaFunction', new RuntimeContains(context))
registry.register('runtimeFormulaFunction', new RuntimeReverse(context))
registry.register('runtimeFormulaFunction', new RuntimeJoin(context))
registry.register('runtimeFormulaFunction', new RuntimeSplit(context))
registry.register('runtimeFormulaFunction', new RuntimeIsEmpty(context))
registry.register('runtimeFormulaFunction', new RuntimeStrip(context))
registry.register('runtimeFormulaFunction', new RuntimeEncodeUri(context))
registry.register(
'runtimeFormulaFunction',
new RuntimeEncodeUriComponent(context)
)
registry.register(
'runtimeFormulaFunction',
new RuntimeMarkdownToHtml(context)
)
registry.register('runtimeFormulaFunction', new RuntimeSum(context))
registry.register('runtimeFormulaFunction', new RuntimeAvg(context))
registry.register('runtimeFormulaFunction', new RuntimeAt(context))
registry.register('runtimeFormulaFunction', new RuntimeToArray(context))
registry.register('runtimeFormulaFunction', new RuntimeRange(context))
registry.register('runtimeFormulaFunction', new RuntimeToJson(context))
registry.register('runtimeFormulaFunction', new RuntimeFromJson(context))
registry.register('runtimeFormulaFunction', new RuntimeNull(context))
registry.register(
'runtimeFormulaFunction',
new RuntimeNumberFormat(context)
)
registry.register('runtimeFormulaFunction', new RuntimeToDuration(context))
registry.register(
'runtimeFormulaFunction',
new RuntimeDurationFormat(context)
)
registry.register('runtimeFormulaFunction', new RuntimeToDatetime(context))
registry.register('errorPage', new DefaultErrorPageType(context))
const fns = [
RuntimeConcat,
RuntimeGet,
RuntimeAdd,
RuntimeMinus,
RuntimeMultiply,
RuntimeDivide,
RuntimeGreaterThan,
RuntimeGreaterThanOrEqual,
RuntimeLessThan,
RuntimeLessThanOrEqual,
RuntimeEqual,
RuntimeNotEqual,
RuntimeUpper,
RuntimeLower,
RuntimeCapitalize,
RuntimeRound,
RuntimeIsEven,
RuntimeIsOdd,
RuntimeDateTimeFormat,
RuntimeDay,
RuntimeMonth,
RuntimeYear,
RuntimeHour,
RuntimeMinute,
RuntimeSecond,
RuntimeNow,
RuntimeToday,
RuntimeGetProperty,
RuntimeRandomInt,
RuntimeRandomFloat,
RuntimeRandomBool,
RuntimeGenerateUUID,
RuntimeIf,
RuntimeAnd,
RuntimeOr,
]
fns.forEach((Fn) =>
registry.register('runtimeFormulaFunction', new Fn(context))
)
registry.register('roles', new AdminRoleType(context))
registry.register('roles', new MemberRoleType(context))
registry.register(
'notification',
new WorkspaceInvitationCreatedNotificationType(context)
)
registry.register(
'notification',
new WorkspaceInvitationAcceptedNotificationType(context)
)
registry.register(
'notification',
new WorkspaceInvitationRejectedNotificationType(context)
)
registry.register(
'notification',
new BaserowVersionUpgradeNotificationType(context)
)
registry.register(
'notification',
new AbuseReportCreatedNotificationType(context)
)
const userTemplateNotificationTypes = [
UserTemplateInReviewNotificationType,
BlockedUserTemplateChangedNotificationType,
UserTemplateApprovedNotificationType,
UserTemplateRejectedNotificationType,
UserTemplateChangeRejectedNotificationType,
UserTemplateUnlistedNotificationType,
UserTemplateBlockedNotificationType,
UserTemplateUnblockedNotificationType,
]
userTemplateNotificationTypes.forEach((Type) =>
registry.register('notification', new Type(context))
)
registry.register('twoFactorAuth', new TOTPAuthType(context))
registry.register(
'captchaProvider',
new CloudflareTurnstileCaptchaProviderType(context)
)
registry.register('onboarding', new MoreOnboardingType(context))
registry.register('guidedTour', new SidebarGuidedTourType(context))
},
})