1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-09-16 17:48:19 +00:00
bramw_baserow/premium/web-frontend/modules/baserow_premium/viewOwnershipTypes.js

57 lines
1.3 KiB
JavaScript

import { ViewOwnershipType } from '@baserow/modules/database/viewOwnershipTypes'
import PremiumFeatures from '@baserow_premium/features'
import PremiumModal from '@baserow_premium/components/PremiumModal'
import ViewOwnershipMenuLink from '@baserow_premium/components/views/ViewOwnershipMenuLink'
export class PersonalViewOwnershipType extends ViewOwnershipType {
static getType() {
return 'personal'
}
getName() {
const { i18n } = this.app
return i18n.t('viewOwnershipType.personal')
}
getFeatureName() {
const { i18n } = this.app
return i18n.t('premiumFeatures.personalViews')
}
getIconClass() {
return 'iconoir-lock'
}
isDeactivated(workspaceId) {
return !this.app.$hasFeature(PremiumFeatures.PREMIUM, workspaceId)
}
getDeactivatedText() {
return this.app.i18n.t('premium.deactivated')
}
getDeactivatedModal() {
return PremiumModal
}
getListViewTypeSort() {
return 40
}
/**
* Returns the component that should be used in the menu for changing the
* ownership type for the view.
*/
getChangeOwnershipTypeMenuItemComponent() {
return ViewOwnershipMenuLink
}
userCanTryCreate(table, workspaceId) {
return this.app.$hasPermission(
'database.table.create_and_use_personal_view',
table,
workspaceId
)
}
}