diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 324ec0447adafcb17825b11fbd4fee8fabc0e56a..67b99e8fc488514d6c558b597a8619940caf37c8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -28,6 +28,7 @@ Added * Notification drawer in top nav bar * GraphQL queries and mutations for core data management * [Dev] Introduce new mechanism to register classes over all apps. +* Data template for `room` model used for haystack search indexing moved to core. Changed ~~~~~~~ @@ -50,6 +51,7 @@ Changed Fixed ~~~~~ +* The error page displayed when an ObjectOverview component is not able to get the required data was incomplete. * The permission check for the dashboard edit page failed when the user had no person assigned. * In some cases, the IFrame for legacy pages was not properly sized for its content. * When accessing the person overview page without a person ID, the avatar image was not displayed properly. diff --git a/aleksis/core/frontend/app/i18n.js b/aleksis/core/frontend/app/i18n.js index ed50743eddf2d7fe306b9fe1116ef17fc914911d..a345a13c457ca979a1a2cee7319d82f46cb67ca2 100644 --- a/aleksis/core/frontend/app/i18n.js +++ b/aleksis/core/frontend/app/i18n.js @@ -5,7 +5,6 @@ import dateTimeFormats from "./dateTimeFormats.js"; const i18nOpts = { - locale: "en", fallbackLocale: "en", messages: {}, dateTimeFormats, diff --git a/aleksis/core/frontend/components/app/App.vue b/aleksis/core/frontend/components/app/App.vue index da681615b320f70c3ac3c494bc12f1d70cd1d7f9..8896f20785f8992c81e5cecf4488536b9d29caf8 100644 --- a/aleksis/core/frontend/components/app/App.vue +++ b/aleksis/core/frontend/components/app/App.vue @@ -244,8 +244,6 @@ export default { }, watch: { systemProperties: function (newProperties) { - this.$i18n.locale = newProperties.currentLanguage; - this.$vuetify.lang.current = newProperties.currentLanguage; this.$vuetify.theme.themes.light.primary = newProperties.sitePreferences.themePrimary; this.$vuetify.theme.themes.light.secondary = diff --git a/aleksis/core/frontend/components/app/systemProperties.graphql b/aleksis/core/frontend/components/app/systemProperties.graphql index e599cf04694c79a0bd7d1a38dd7f9bb0bd80a4ae..35dc824fd3ec64f090615ebc4a484cf9c3a70911 100644 --- a/aleksis/core/frontend/components/app/systemProperties.graphql +++ b/aleksis/core/frontend/components/app/systemProperties.graphql @@ -5,7 +5,6 @@ nameTranslated cookie } - currentLanguage sitePreferences { themePrimary themeSecondary diff --git a/aleksis/core/frontend/components/generic/ObjectOverview.vue b/aleksis/core/frontend/components/generic/ObjectOverview.vue index d962243e988167f266cf003fd81b01c6e41a0454..4839b3b8a8a3413ffa11ac2478a5c571c9378522 100644 --- a/aleksis/core/frontend/components/generic/ObjectOverview.vue +++ b/aleksis/core/frontend/components/generic/ObjectOverview.vue @@ -6,6 +6,9 @@ v-else :short-error-message-key="shortErrorMessageKey" :long-error-message-key="longErrorMessageKey" + :redirect-button-text-key="redirectButtonTextKey" + :redirect-route-name="redirectRouteName" + :redirect-button-icon="redirectButtonIcon" /> </div> </template> @@ -32,6 +35,21 @@ export default { required: false, default: "network_errors.page_not_found", }, + redirectButtonTextKey: { + type: String, + required: false, + default: "network_errors.back_to_start", + }, + redirectRouteName: { + type: String, + required: false, + default: "dashboard", + }, + redirectButtonIcon: { + type: String, + required: false, + default: "mdi-home-outline", + }, }, methods: { getTitleAttr(obj) { diff --git a/aleksis/core/frontend/index.js b/aleksis/core/frontend/index.js index ef66ecf6576ed1d7d4581639a65b5607c7a75dc5..25df11b343a0708bbb6a1a378cfa1b17ab154749 100644 --- a/aleksis/core/frontend/index.js +++ b/aleksis/core/frontend/index.js @@ -9,6 +9,7 @@ import Vuetify from "@/vuetify"; import VueI18n from "@/vue-i18n"; import VueRouter from "@/vue-router"; import VueApollo from "@/vue-apollo"; +import VueCookies from "@/vue-cookies"; import AleksisVue from "./plugins/aleksis.js"; @@ -26,6 +27,7 @@ Vue.use(Vuetify); Vue.use(VueI18n); Vue.use(VueRouter); Vue.use(VueApollo); +Vue.use(VueCookies); // All of these imports yield config objects to be passed to the plugin constructors import vuetifyOpts from "./app/vuetify.js"; @@ -33,8 +35,20 @@ import i18nOpts from "./app/i18n.js"; import routerOpts from "./app/router.js"; import apolloOpts from "./app/apollo.js"; -const i18n = new VueI18n(i18nOpts); -const vuetify = new Vuetify(vuetifyOpts); +const i18n = new VueI18n({ + locale: Vue.$cookies.get("django_language") + ? Vue.$cookies.get("django_language") + : "en", + ...i18nOpts, +}); +const vuetify = new Vuetify({ + lang: { + current: Vue.$cookies.get("django_language") + ? Vue.$cookies.get("django_language") + : "en", + }, + ...vuetifyOpts, +}); const router = new VueRouter(routerOpts); const apolloProvider = new VueApollo(apolloOpts); diff --git a/aleksis/core/settings.py b/aleksis/core/settings.py index 67d841caf03bee034a02072c95d9b8130d8fcc9a..c8c81525bc32b3ff91c3301328c7002b04fc12ed 100644 --- a/aleksis/core/settings.py +++ b/aleksis/core/settings.py @@ -588,6 +588,7 @@ YARN_INSTALLED_APPS = [ "vue-apollo@^3.1.0", "vuetify@^2.6.7", "vue-router@^3.5.2", + "vue-cookies@^1.8.2", "vite@^4.0.1", "vite-plugin-pwa@^0.14.1", "vite-plugin-top-level-await@^1.2.2", diff --git a/aleksis/core/templates/search/indexes/core/room_text.txt b/aleksis/core/templates/search/indexes/core/room_text.txt new file mode 100644 index 0000000000000000000000000000000000000000..165c30e8c240ddecc872520626cccb598a6ad7a0 --- /dev/null +++ b/aleksis/core/templates/search/indexes/core/room_text.txt @@ -0,0 +1,2 @@ +{{ object.name }} +{{ object.short_name }}