1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-07 14:25:37 +00:00

Resolve "Charge for user source users: display the count in the application settings user sources panel."

This commit is contained in:
Peter Evans 2024-12-10 15:53:07 +00:00
parent a1b7ee4790
commit c1940ad656
5 changed files with 39 additions and 22 deletions
changelog/entries/unreleased/feature
enterprise/web-frontend/modules/baserow_enterprise/integrations
web-frontend/modules
builder/locales
core/locales

View file

@ -0,0 +1,7 @@
{
"type": "feature",
"message": "[Builder] Display a count of user source users in the application settings panel.",
"issue_number": 3251,
"bullet_points": [],
"created_at": "2024-12-10"
}

View file

@ -107,12 +107,6 @@ export default {
this.handleError(error)
}
},
watch: {
'$v.$anyDirty'() {
// Force validity refresh on child touch
this.checkValidity()
},
},
computed: {
...mapGetters({ domains: 'domain/getDomains' }),
config() {
@ -134,6 +128,12 @@ export default {
return [...preview, ...others]
},
},
watch: {
'$v.$anyDirty'() {
// Force validity refresh on child touch
this.checkValidity()
},
},
methods: {
...mapActions({
actionFetchDomains: 'domain/fetch',

View file

@ -2,6 +2,7 @@ import { UserSourceType } from '@baserow/modules/core/userSourceTypes'
import { LocalBaserowIntegrationType } from '@baserow/modules/integrations/integrationTypes'
import LocalBaserowUserSourceForm from '@baserow_enterprise/integrations/localBaserow/components/userSources/LocalBaserowUserSourceForm'
import localBaserowIntegration from '@baserow/modules/integrations/localBaserow/assets/images/localBaserowIntegration.svg'
import moment from '@baserow/modules/core/moment'
import {
FormulaFieldType,
@ -86,27 +87,33 @@ export class LocalBaserowUserSourceType extends UserSourceType {
return this.app.i18n.t('localBaserowUserSourceType.notConfigured')
}
if (!userSource.table_id) {
const databases = integration.context_data?.databases
const tableSelected = databases
.map((database) => database.tables)
.flat()
.find(({ id }) => id === userSource.table_id)
if (!tableSelected) {
return `${integration.name} - ${this.app.i18n.t(
'localBaserowUserSourceType.notConfigured'
)}`
}
for (const database of integration.context_data.databases) {
for (const table of database.tables) {
if (table.id === userSource.table_id) {
const summaryParts = [integration.name, table.name]
if (!userSource.email_field_id || !userSource.name_field_id) {
summaryParts.push(
this.app.i18n.t('localBaserowUserSourceType.notConfigured')
)
}
return summaryParts.join(' - ')
}
}
const summaryParts = [integration.name, tableSelected.name]
if (!userSource.email_field_id || !userSource.name_field_id) {
summaryParts.push(
this.app.i18n.t('localBaserowUserSourceType.notConfigured')
)
} else if (userSource.user_count_updated_at !== null) {
summaryParts.push(
this.app.i18n.t('userSourceType.userCountSummary', {
count: userSource.user_count,
lastUpdated: moment.utc(userSource.user_count_updated_at).fromNow(),
})
)
}
return ''
return summaryParts.join(' - ')
}
get formComponent() {

View file

@ -257,7 +257,7 @@
"userSourceSettings": {
"titleAddUserSource": "New user source",
"titleUpdateUserSource": "Edit user source",
"noUserSourceMessage": "You have not yet add a user source to this application. You must add a user source if you want users being able to authenticate your application.",
"noUserSourceMessage": "You have not yet added a user source to this application. You must add a user source if you want users being able to authenticate your application.",
"titleOverview": "User sources",
"addUserSource": "Add user source"
},

View file

@ -806,5 +806,8 @@
"formGroup": {
"protectedField": "This field is protected. Click to change.",
"cancelProtectedField": "Cancel change"
},
"userSourceType": {
"userCountSummary": "{count} users ({lastUpdated})"
}
}