Skip to content

Conversation

JarrodMFlesch
Copy link
Contributor

@JarrodMFlesch JarrodMFlesch commented Jul 29, 2025

Allows user to override more of the tenant field config. Now you can override most of the field config with:

At the root level

/**
 * Field configuration for the field added to all tenant enabled collections
 */
tenantField?: RootTenantFieldConfigOverrides

At the collection level

Setting collection level overrides will replace the root level overrides shown above.

collections: {
  [key in CollectionSlug]?: {
    // ... rest of the types
    /**
     * Overrides for the tenant field, will override the entire tenantField configuration
     */
    tenantFieldOverrides?: CollectionTenantFieldConfigOverrides
  }
}

i18n improvements

⚠️ Marks tenantSelectorLabel as deprecated. You should instead use the i18n.translations object.
Exposes an i18n config property that allows you to easily replace all translation strings that the plugin uses.

multiTenantPlugin<ConfigType>({
  // ...rest of plugin configuration
  i18n: {
    translations: {
      en: {
        /**
         * @default 'Assigned Tenant'
         */
        'field-assignedTenant-label': 'Currently Assigned Site',
        /**
         * @default 'Tenant'
         */
        'nav-tenantSelector-label': 'Filter By Site',
        /**
         * `tenantLabel` defaults to the value of the `nav-tenantSelector-label` translation
         *
         * @default 'Confirm {{tenantLabel}} change'
         */
        'confirm-modal-tenant-switch--heading': 'Confirm {{tenantLabel}} Change',
        /**
         * @default 'You are about to change ownership from <0>{{fromTenant}}</0> to <0>{{toTenant}}</0>'
         */
        'confirm-modal-tenant-switch--body':
          'You are about to change ownership from <0>{{fromTenant}}</0> to <0>{{toTenant}}</0>.',
      },
    },
  },
})

Copy link
Contributor

github-actions bot commented Jul 29, 2025

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

@JarrodMFlesch JarrodMFlesch enabled auto-merge (squash) July 31, 2025 02:12
@JarrodMFlesch JarrodMFlesch changed the title feat(plugin-multi-tenant): allow tenant field overrides feat(plugin-multi-tenant): allow tenant field overrides, i18n exposure Aug 7, 2025
@JarrodMFlesch JarrodMFlesch changed the title feat(plugin-multi-tenant): allow tenant field overrides, i18n exposure feat(plugin-multi-tenant): tenant field overrides, exposes i18n translations Aug 7, 2025
@JarrodMFlesch JarrodMFlesch merged commit 995f96b into main Aug 12, 2025
247 of 249 checks passed
@JarrodMFlesch JarrodMFlesch deleted the feat/multi-tenant-field-overrides branch August 12, 2025 15:33
Copy link
Contributor

🚀 This is included in version v3.51.0

JarrodMFlesch added a commit that referenced this pull request Aug 21, 2025
The goal of this PR is to show the selected tenant on the document level
instead of using the global selector to sync the state to the document.


Should merge #13316 before
this one.

### Video of what this PR implements

**Would love feedback!**


https://github.com/user-attachments/assets/93ca3d2c-d479-4555-ab38-b77a5a9955e8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants