Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .env.local-dev.example
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ SYNC_TEMPLATES_ON_STARTUP=false
MIGRATE_ON_STARTUP=false

# =============================================================================
# Optional: Email (use console backend for local dev)
# Email (mailhog via Docker - intercepts all emails)
# =============================================================================
# EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend
# Mailhog web UI: http://localhost:8025
EMAIL_HOST=localhost
EMAIL_PORT=1025

# =============================================================================
# Optional: Celery
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ typings/

# nuxt.js build output
.nuxt
.nuxtrc

# Nuxt generate
dist
Expand Down
5 changes: 3 additions & 2 deletions backend/src/baserow/config/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@

CELERY_EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_USE_TLS = False
EMAIL_HOST = "mailhog"
EMAIL_PORT = 1025
# Use localhost for local dev (just dev up), mailhog for docker dev (just dc-dev up)
EMAIL_HOST = os.getenv("EMAIL_HOST", "mailhog")
EMAIL_PORT = int(os.getenv("EMAIL_PORT", "1025"))

BASEROW_MAX_ROW_REPORT_ERROR_COUNT = 10 # To trigger this exception easily

Expand Down
4 changes: 4 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ services:
caddy:
volumes:
- $PWD/Caddyfile.dev:/etc/caddy/Caddyfile
# For local development, mount the local backend/media folder so Caddy can
# serve files uploaded by the native backend process.
- $PWD/backend/media:/baserow/media

backend:
image: baserow_backend:dev
Expand Down Expand Up @@ -192,6 +195,7 @@ services:
logging:
driver: "none" # disable saving logs
ports:
- "${HOST_PUBLISH_IP:-127.0.0.1}:1025:1025" # smtp
- "8025:8025" # web ui
networks:
local:
Expand Down
31 changes: 10 additions & 21 deletions enterprise/web-frontend/modules/baserow_enterprise/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,7 @@ import {
extendPages,
} from 'nuxt/kit'
import { routes, rootChildRoutes } from './routes'

import en from './locales/en.json'
import fr from './locales/fr.json'
import nl from './locales/nl.json'
import de from './locales/de.json'
import es from './locales/es.json'
import it from './locales/it.json'
import pl from './locales/pl.json'
import ko from './locales/ko.json'

const locales = [
{ code: 'en', name: 'English', file: 'en.json' },
{ code: 'fr', name: 'Français', file: 'fr.json' },
{ code: 'nl', name: 'Nederlands', file: 'nl.json' },
{ code: 'de', name: 'Deutsch', file: 'de.json' },
{ code: 'es', name: 'Español', file: 'es.json' },
{ code: 'it', name: 'Italiano', file: 'it.json' },
{ code: 'pl', name: 'Polski (Beta)', file: 'pl.json' },
]
import { locales } from '../../../../web-frontend/config/locales.js'

export default defineNuxtModule({
meta: {
Expand Down Expand Up @@ -65,8 +47,15 @@ export default defineNuxtModule({
}
})

// Add top-level routes (login pages, etc.)
pages.push(...routes)
// Add login pages as children of login-pages (inherit login layout)
const loginPagesRoute = pages.find((route) => route.name === 'login-pages')
if (loginPagesRoute) {
routes.forEach((route) => {
if (!loginPagesRoute.children.find(({ name }) => name === route.name)) {
loginPagesRoute.children.push(route)
}
})
}
})

nuxt.hook('i18n:registerModule', (register) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,30 @@
</div>
</template>

<script>
export default {
<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import { useI18n } from 'vue-i18n'

definePageMeta({
layout: 'login',
asyncData({ route, i18n }) {
const { error } = route.query
const errorMessageI18nKey = `loginError.${error}`
let errorMessage = i18n.t('loginError.defaultErrorMessage')
if (i18n.te(errorMessageI18nKey)) {
errorMessage = i18n.t(`loginError.${error}`)
}
return {
errorMessage,
}
},
head() {
return {
title: this.$t('loginError.title'),
}
},
}
})

const route = useRoute()
const { t, te } = useI18n()

// Compute error message based on query param
const errorMessage = computed(() => {
const { error } = route.query
const errorMessageI18nKey = `loginError.${error}`
if (te(errorMessageI18nKey)) {
return t(errorMessageI18nKey)
}
return t('loginError.defaultErrorMessage')
})

// Head
useHead({
title: t('loginError.title'),
})
</script>
Loading
Loading